diff --git a/patches.suse/ibmvfc-fix-invalid-sub-CRQ-handles-after-hard-reset.patch b/patches.suse/ibmvfc-fix-invalid-sub-CRQ-handles-after-hard-reset.patch index fdb4fbc..8a4902c 100644 --- a/patches.suse/ibmvfc-fix-invalid-sub-CRQ-handles-after-hard-reset.patch +++ b/patches.suse/ibmvfc-fix-invalid-sub-CRQ-handles-after-hard-reset.patch @@ -1,10 +1,10 @@ -From cedd78cf13852882ab79b738c4025c74921374b2 Mon Sep 17 00:00:00 2001 +From 991c92f8b0bae8912992cf55c055e87be5576a74 Mon Sep 17 00:00:00 2001 From: Tyrel Datwyler -Date: Thu, 11 Feb 2021 12:57:40 -0600 -Subject: [PATCH 2/4] ibmvfc: fix invalid sub-CRQ handles after hard reset +Date: Thu, 25 Feb 2021 15:50:54 -0600 +Subject: [PATCH 2/5] ibmvfc: fix invalid sub-CRQ handles after hard reset References: bsc#1182632 ltc#191222 -Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=229197 +Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=231116 A hard reset results in a complete transport disconnect such that the CRQ connection with the partner VIOS is broken. This has the side effect @@ -20,14 +20,13 @@ CRQ is registered with the hypervisor. fixes: faacf8c5f1d5 ("ibmvfc: add alloc/dealloc routines for SCSI Sub-CRQ Channels") Signed-off-by: Tyrel Datwyler -Reviewed-by: Brian King Acked-by: Michal Suchanek --- drivers/scsi/ibmvscsi/ibmvfc.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c -index 7be437e9d805..5030e1e974e7 100644 +index 7be437e9d805..b8010d228710 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -158,6 +158,9 @@ static void ibmvfc_npiv_logout(struct ibmvfc_host *); @@ -68,16 +67,19 @@ index 7be437e9d805..5030e1e974e7 100644 /* And re-open it again */ rc = plpar_hcall_norets(H_REG_CRQ, vdev->unit_address, crq->msg_token, PAGE_SIZE); -@@ -966,6 +959,9 @@ static int ibmvfc_reset_crq(struct ibmvfc_host *vhost) +@@ -966,9 +959,12 @@ static int ibmvfc_reset_crq(struct ibmvfc_host *vhost) dev_warn(vhost->dev, "Partner adapter not ready\n"); else if (rc != 0) dev_warn(vhost->dev, "Couldn't register crq (rc=%d)\n", rc); + -+ ibmvfc_init_sub_crqs(vhost); -+ spin_unlock(vhost->crq.q_lock); spin_unlock_irqrestore(vhost->host->host_lock, flags); ++ ibmvfc_init_sub_crqs(vhost); ++ + return rc; + } + @@ -5694,6 +5690,7 @@ static void ibmvfc_deregister_scsi_channel(struct ibmvfc_host *vhost, int index) free_irq(scrq->irq, scrq); diff --git a/patches.suse/ibmvfc-reinitialize-sub-CRQs-and-perform-channel-enq.patch b/patches.suse/ibmvfc-reinitialize-sub-CRQs-and-perform-channel-enq.patch new file mode 100644 index 0000000..0640b76 --- /dev/null +++ b/patches.suse/ibmvfc-reinitialize-sub-CRQs-and-perform-channel-enq.patch @@ -0,0 +1,61 @@ +From c5b3a0cbc90aa619083b9c5652674755bb172aba Mon Sep 17 00:00:00 2001 +From: Tyrel Datwyler +Date: Thu, 25 Feb 2021 15:50:57 -0600 +Subject: [PATCH 5/5] ibmvfc: reinitialize sub-CRQs and perform channel enquiry + after LPM + +References: bsc#1182632 ltc#191222 +Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=231116 + +A live partition migration (LPM) results in a CRQ disconnect similar to +a hard reset. In this LPM case the hypervisor moslty perserves the CRQ +transport such that it simply needs to be reenabled. However, the +capabilities may have changed such as fewer channels, or no channels at +all. Further, its possible that there may be sub-CRQ support, but no +channel support. The CRQ reenable path currently doesn't take any of +this into consideration. + +For simpilicty release and reinitialize sub-CRQs during reenable, and +set do_enquiry and using_channels with the appropriate values to trigger +channel renegotiation. + +fixes: faacf8c5f1d5 ("ibmvfc: add alloc/dealloc routines for SCSI Sub-CRQ Channels") +Signed-off-by: Tyrel Datwyler +Acked-by: Michal Suchanek +--- + drivers/scsi/ibmvscsi/ibmvfc.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c +index 58da775e9b55..585c4ff8f804 100644 +--- a/drivers/scsi/ibmvscsi/ibmvfc.c ++++ b/drivers/scsi/ibmvscsi/ibmvfc.c +@@ -903,6 +903,9 @@ static int ibmvfc_reenable_crq_queue(struct ibmvfc_host *vhost) + { + int rc = 0; + struct vio_dev *vdev = to_vio_dev(vhost->dev); ++ unsigned long flags; ++ ++ ibmvfc_release_sub_crqs(vhost); + + /* Re-enable the CRQ */ + do { +@@ -914,6 +917,15 @@ static int ibmvfc_reenable_crq_queue(struct ibmvfc_host *vhost) + if (rc) + dev_err(vhost->dev, "Error enabling adapter (rc=%d)\n", rc); + ++ spin_lock_irqsave(vhost->host->host_lock, flags); ++ spin_lock(vhost->crq.q_lock); ++ vhost->do_enquiry = 1; ++ vhost->using_channels = 0; ++ spin_unlock(vhost->crq.q_lock); ++ spin_unlock_irqrestore(vhost->host->host_lock, flags); ++ ++ ibmvfc_init_sub_crqs(vhost); ++ + return rc; + } + +-- +2.26.2 + diff --git a/patches.suse/ibmvfc-simplify-handling-of-sub-CRQ-initialization.patch b/patches.suse/ibmvfc-simplify-handling-of-sub-CRQ-initialization.patch index 26238a1..972901b 100644 --- a/patches.suse/ibmvfc-simplify-handling-of-sub-CRQ-initialization.patch +++ b/patches.suse/ibmvfc-simplify-handling-of-sub-CRQ-initialization.patch @@ -1,10 +1,10 @@ -From 4a59ed8a077e0a4a6f52084c80c716b9936198ef Mon Sep 17 00:00:00 2001 +From 4978d0d48995d849b55b2e19634988ed632d80e8 Mon Sep 17 00:00:00 2001 From: Tyrel Datwyler -Date: Thu, 11 Feb 2021 12:57:39 -0600 -Subject: [PATCH 1/4] ibmvfc: simplify handling of sub-CRQ initialization +Date: Thu, 25 Feb 2021 15:50:53 -0600 +Subject: [PATCH 1/5] ibmvfc: simplify handling of sub-CRQ initialization References: bsc#1182632 ltc#191222 -Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=229197 +Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=231116 If ibmvfc_init_sub_crqs() fails ibmvfc_probe() simply parrots registration failure reported elsewhere, and futher @@ -20,7 +20,7 @@ that fixes a hard reset issue, by tying a sub-CRQ setup failure and do_enquiry logic into ibmvfc_init_sub_crqs(). Signed-off-by: Tyrel Datwyler -Reviewed-by: Brian King +Reviewed-by: Brian King Acked-by: Michal Suchanek --- drivers/scsi/ibmvscsi/ibmvfc.c | 21 ++++++++++----------- diff --git a/patches.suse/ibmvfc-store-return-code-of-H_FREE_SUB_CRQ-during-cl.patch b/patches.suse/ibmvfc-store-return-code-of-H_FREE_SUB_CRQ-during-cl.patch index 9f70430..0d3eda9 100644 --- a/patches.suse/ibmvfc-store-return-code-of-H_FREE_SUB_CRQ-during-cl.patch +++ b/patches.suse/ibmvfc-store-return-code-of-H_FREE_SUB_CRQ-during-cl.patch @@ -1,11 +1,11 @@ -From 3ccefdfd4f8e84cf164a61898a599a8f29755887 Mon Sep 17 00:00:00 2001 +From 626dd0d310153f7bdb2946f01c3cb16700382fcf Mon Sep 17 00:00:00 2001 From: Tyrel Datwyler -Date: Thu, 11 Feb 2021 12:57:42 -0600 -Subject: [PATCH 4/4] ibmvfc: store return code of H_FREE_SUB_CRQ during +Date: Thu, 25 Feb 2021 15:50:56 -0600 +Subject: [PATCH 4/5] ibmvfc: store return code of H_FREE_SUB_CRQ during cleanup References: bsc#1182632 ltc#191222 -Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=229197 +Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=231116 The H_FREE_SUB_CRQ hypercall can return a retry delay return code that indicates the call needs to be retried after a specific amount of time @@ -15,28 +15,41 @@ which will result in the delay loop being skipped in the case of a retry delay return code. Store the return code result of the H_FREE_SUB_CRQ call such that the -return code check in the delay loop evaluates a meaningful value. +return code check in the delay loop evaluates a meaningful value. Also, +use the rtas_busy_delay() to check the rc value and delay for the +appropriate amount of time. Fixes: 9288d35d70b5 ("ibmvfc: map/request irq and register Sub-CRQ interrupt handler") Signed-off-by: Tyrel Datwyler +Reviewed-by: Brian King Acked-by: Michal Suchanek --- - drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + drivers/scsi/ibmvscsi/ibmvfc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c -index 2e6f3524c6c6..b9a5a61f1cc1 100644 +index 775902246ed2..58da775e9b55 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c -@@ -5672,7 +5672,7 @@ static int ibmvfc_register_scsi_channel(struct ibmvfc_host *vhost, +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -5672,8 +5673,8 @@ static int ibmvfc_register_scsi_channel(struct ibmvfc_host *vhost, irq_failed: do { - plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cookie); +- } while (rc == H_BUSY || H_IS_LONG_BUSY(rc)); + rc = plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cookie); - } while (rc == H_BUSY || H_IS_LONG_BUSY(rc)); ++ } while (rtas_busy_delay(rc)); reg_failed: ibmvfc_free_queue(vhost, scrq); + LEAVE; -- 2.26.2 diff --git a/patches.suse/ibmvfc-treat-H_CLOSED-as-success-during-sub-CRQ-regi.patch b/patches.suse/ibmvfc-treat-H_CLOSED-as-success-during-sub-CRQ-regi.patch index 9a905bc..82c1ed9 100644 --- a/patches.suse/ibmvfc-treat-H_CLOSED-as-success-during-sub-CRQ-regi.patch +++ b/patches.suse/ibmvfc-treat-H_CLOSED-as-success-during-sub-CRQ-regi.patch @@ -1,11 +1,11 @@ -From d2df919c8fabebc86c2f8962e724fa0dc39a5368 Mon Sep 17 00:00:00 2001 +From c87f5d557464eb48c901bdf084b33b3a78381e87 Mon Sep 17 00:00:00 2001 From: Tyrel Datwyler -Date: Thu, 11 Feb 2021 12:57:41 -0600 -Subject: [PATCH 3/4] ibmvfc: treat H_CLOSED as success during sub-CRQ +Date: Thu, 25 Feb 2021 15:50:55 -0600 +Subject: [PATCH 3/5] ibmvfc: treat H_CLOSED as success during sub-CRQ registration References: bsc#1182632 ltc#191222 -Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=229197 +Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=231116 A non-zero return code for H_REG_SUB_CRQ is currently treated as a failure resulting in failing sub-CRQ setup. The case of H_CLOSED should @@ -20,14 +20,14 @@ so that sub-CRQs are successfully setup. Fixes: faacf8c5f1d5 ("ibmvfc: add alloc/dealloc routines for SCSI Sub-CRQ Channels") Signed-off-by: Tyrel Datwyler -Reviewed-by: Brian King +Reviewed-by: Brian King Acked-by: Michal Suchanek --- drivers/scsi/ibmvscsi/ibmvfc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c -index 5030e1e974e7..2e6f3524c6c6 100644 +index b8010d228710..775902246ed2 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -5638,7 +5638,8 @@ static int ibmvfc_register_scsi_channel(struct ibmvfc_host *vhost, diff --git a/patches.suse/ibmvnic-always-store-valid-MAC-address.patch b/patches.suse/ibmvnic-always-store-valid-MAC-address.patch new file mode 100644 index 0000000..1482591 --- /dev/null +++ b/patches.suse/ibmvnic-always-store-valid-MAC-address.patch @@ -0,0 +1,59 @@ +From 67eb211487f0c993d9f402d1c196ef159fd6a3b5 Mon Sep 17 00:00:00 2001 +From: Jiri Wiesner +Date: Thu, 4 Mar 2021 17:18:28 +0100 +Subject: [PATCH] ibmvnic: always store valid MAC address + +References: bsc#1182011 ltc#191844 +Patch-mainline: queued +Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git +Git-commit: 67eb211487f0c993d9f402d1c196ef159fd6a3b5 + +The last change to ibmvnic_set_mac(), 8fc3672a8ad3, meant to prevent +users from setting an invalid MAC address on an ibmvnic interface +that has not been brought up yet. The change also prevented the +requested MAC address from being stored by the adapter object for an +ibmvnic interface when the state of the ibmvnic interface is +VNIC_PROBED - that is after probing has finished but before the +ibmvnic interface is brought up. The MAC address stored by the +adapter object is used and sent to the hypervisor for checking when +an ibmvnic interface is brought up. + +The ibmvnic driver ignoring the requested MAC address when in +VNIC_PROBED state caused LACP bonds (bonds in 802.3ad mode) with more +than one slave to malfunction. The bonding code must be able to +change the MAC address of its slaves before they are brought up +during enslaving. The inability of kernels with 8fc3672a8ad3 to set +the MAC addresses of bonding slaves is observable in the output of +"ip address show". The MAC addresses of the slaves are the same as +the MAC address of the bond on a working system whereas the slaves +retain their original MAC addresses on a system with a malfunctioning +LACP bond. + +Fixes: 8fc3672a8ad3 ("ibmvnic: fix ibmvnic_set_mac") +Signed-off-by: Jiri Wiesner +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 3bad762083c5..b6102ccf9b90 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1906,10 +1906,9 @@ static int ibmvnic_set_mac(struct net_device *netdev, void *p) + if (!is_valid_ether_addr(addr->sa_data)) + return -EADDRNOTAVAIL; + +- if (adapter->state != VNIC_PROBED) { +- ether_addr_copy(adapter->mac_addr, addr->sa_data); ++ ether_addr_copy(adapter->mac_addr, addr->sa_data); ++ if (adapter->state != VNIC_PROBED) + rc = __ibmvnic_set_mac(netdev, addr->sa_data); +- } + + return rc; + } +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-fix-a-race-between-open-and-reset.patch b/patches.suse/ibmvnic-fix-a-race-between-open-and-reset.patch new file mode 100644 index 0000000..88e91a3 --- /dev/null +++ b/patches.suse/ibmvnic-fix-a-race-between-open-and-reset.patch @@ -0,0 +1,149 @@ +From 8f1c0fd2c84c8bf738b7139d09d4ea53027f47c3 Mon Sep 17 00:00:00 2001 +From: Sukadev Bhattiprolu +Date: Tue, 23 Feb 2021 21:02:29 -0800 +Subject: [PATCH] ibmvnic: fix a race between open and reset + +References: bsc#1176855 ltc#187293 +Patch-mainline: queued +Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git +Git-commit: 8f1c0fd2c84c8bf738b7139d09d4ea53027f47c3 + +__ibmvnic_reset() currently reads the adapter->state before getting the +rtnl and saves that state as the "target state" for the reset. If this +read occurs when adapter is in PROBED state, the target state would be +PROBED. + +Just after the target state is saved, and before the actual reset process +is started (i.e before rtnl is acquired) if we get an ibmvnic_open() call +we would move the adapter to OPEN state. + +But when the reset is processed (after ibmvnic_open()) drops the rtnl), +it will leave the adapter in PROBED state even though we already moved +it to OPEN. + +To fix this, use the RTNL to improve serialization when reading/updating +the adapter state. i.e determine the target state of a reset only after +getting the RTNL. And if a reset is in progress during an open, simply +set the target state of the adapter and let the reset code finish the +open (like we currently do if failover is pending). + +One twist to this serialization is if the adapter state changes when we +drop the RTNL to update the link state. Account for this by checking if +there was an intervening open and update the target state for the reset +accordingly (see new comments in the code). Note that only the reset +functions and ibmvnic_open() can set the adapter to OPEN state and this +must happen under rtnl. + +Fixes: 7d7195a026ba ("ibmvnic: Do not process device remove during device reset") +Signed-off-by: Sukadev Bhattiprolu +Reviewed-by: Dany Madden +Link: https://lore.kernel.org/r/20210224050229.1155468-1-sukadev@linux.ibm.com +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 63 ++++++++++++++++++++++++++---- + 1 file changed, 55 insertions(+), 8 deletions(-) + +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1202,12 +1202,25 @@ static int ibmvnic_open(struct net_devic + struct ibmvnic_adapter *adapter = netdev_priv(netdev); + int rc; + +- /* If device failover is pending, just set device state and return. +- * Device operation will be handled by reset routine. ++ ASSERT_RTNL(); ++ ++ /* If device failover is pending or we are about to reset, just set ++ * device state and return. Device operation will be handled by reset ++ * routine. ++ * ++ * It should be safe to overwrite the adapter->state here. Since ++ * we hold the rtnl, either the reset has not actually started or ++ * the rtnl got dropped during the set_link_state() in do_reset(). ++ * In the former case, no one else is changing the state (again we ++ * have the rtnl) and in the latter case, do_reset() will detect and ++ * honor our setting below. + */ +- if (adapter->failover_pending) { ++ if (adapter->failover_pending || (test_bit(0, &adapter->resetting))) { ++ netdev_dbg(netdev, "[S:%d FOP:%d] Resetting, deferring open\n", ++ adapter->state, adapter->failover_pending); + adapter->state = VNIC_OPEN; +- return 0; ++ rc = 0; ++ goto out; + } + + if (adapter->state != VNIC_CLOSED) { +@@ -1227,10 +1240,12 @@ static int ibmvnic_open(struct net_devic + + out: + /* +- * If open fails due to a pending failover, set device state and +- * return. Device operation will be handled by reset routine. ++ * If open failed and there is a pending failover or in-progress reset, ++ * set device state and return. Device operation will be handled by ++ * reset routine. See also comments above regarding rtnl. + */ +- if (rc && adapter->failover_pending) { ++ if (rc && ++ (adapter->failover_pending || (test_bit(0, &adapter->resetting)))) { + adapter->state = VNIC_OPEN; + rc = 0; + } +@@ -2043,6 +2058,14 @@ static int do_reset(struct ibmvnic_adapt + if (rwi->reset_reason == VNIC_RESET_FAILOVER) + adapter->failover_pending = false; + ++ /* read the state and check (again) after getting rtnl */ ++ reset_state = adapter->state; ++ ++ if (reset_state == VNIC_REMOVING || reset_state == VNIC_REMOVED) { ++ rc = -EBUSY; ++ goto out; ++ } ++ + netif_carrier_off(netdev); + adapter->reset_reason = rwi->reset_reason; + +@@ -2069,7 +2092,24 @@ static int do_reset(struct ibmvnic_adapt + if (rc) + goto out; + ++ if (adapter->state == VNIC_OPEN) { ++ /* When we dropped rtnl, ibmvnic_open() got ++ * it and noticed that we are resetting and ++ * set the adapter state to OPEN. Update our ++ * new "target" state, and resume the reset ++ * from VNIC_CLOSING state. ++ */ ++ netdev_dbg(netdev, ++ "Open changed state from %d, updating.\n", ++ reset_state); ++ reset_state = VNIC_OPEN; ++ adapter->state = VNIC_CLOSING; ++ } ++ + if (adapter->state != VNIC_CLOSING) { ++ /* If someone else changed the adapter state ++ * when we dropped the rtnl, fail the reset ++ */ + rc = -1; + goto out; + } +@@ -2205,6 +2245,14 @@ static int do_hard_reset(struct ibmvnic_ + netdev_dbg(adapter->netdev, "Hard resetting driver (%d)\n", + rwi->reset_reason); + ++ /* read the state and check (again) after getting rtnl */ ++ reset_state = adapter->state; ++ ++ if (reset_state == VNIC_REMOVING || reset_state == VNIC_REMOVED) { ++ rc = -EBUSY; ++ goto out; ++ } ++ + netif_carrier_off(netdev); + adapter->reset_reason = rwi->reset_reason; + diff --git a/patches.suse/ibmvnic-remove-excessive-irqsave.patch b/patches.suse/ibmvnic-remove-excessive-irqsave.patch new file mode 100644 index 0000000..6f553f7 --- /dev/null +++ b/patches.suse/ibmvnic-remove-excessive-irqsave.patch @@ -0,0 +1,53 @@ +From 69cdb7947adb816fc9325b4ec02a6dddd5070b82 Mon Sep 17 00:00:00 2001 +From: Junlin Yang +Date: Fri, 5 Mar 2021 16:48:39 +0800 +Subject: [PATCH] ibmvnic: remove excessive irqsave + +References: bsc#1182485 ltc#191591 +Patch-mainline: v5.12 or v5.12-rc3 (next release) +Git-commit: 69cdb7947adb816fc9325b4ec02a6dddd5070b82 + +ibmvnic_remove locks multiple spinlocks while disabling interrupts: +spin_lock_irqsave(&adapter->state_lock, flags); +spin_lock_irqsave(&adapter->rwi_lock, flags); + +As reported by coccinelle, the second _irqsave() overwrites the value +saved in 'flags' by the first _irqsave(), therefore when the second +_irqrestore() comes,the value in 'flags' is not valid,the value saved +by the first _irqsave() has been lost. +This likely leads to IRQs remaining disabled. So remove the second +_irqsave(): +spin_lock_irqsave(&adapter->state_lock, flags); +spin_lock(&adapter->rwi_lock); + +Generated by: ./scripts/coccinelle/locks/flags.cocci +./drivers/net/ethernet/ibm/ibmvnic.c:5413:1-18: +ERROR: nested lock+irqsave that reuses flags from line 5404. + +Fixes: 4a41c421f367 ("ibmvnic: serialize access to work queue on remove") +Signed-off-by: Junlin Yang +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index b6102ccf9b90..161fa95e8768 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -5408,9 +5408,9 @@ static int ibmvnic_remove(struct vio_dev *dev) + * after setting state, so __ibmvnic_reset() which is called + * from the flush_work() below, can make progress. + */ +- spin_lock_irqsave(&adapter->rwi_lock, flags); ++ spin_lock(&adapter->rwi_lock); + adapter->state = VNIC_REMOVING; +- spin_unlock_irqrestore(&adapter->rwi_lock, flags); ++ spin_unlock(&adapter->rwi_lock); + + spin_unlock_irqrestore(&adapter->state_lock, flags); + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-simplify-reset_long_term_buff-function.patch b/patches.suse/ibmvnic-simplify-reset_long_term_buff-function.patch new file mode 100644 index 0000000..d4a56b2 --- /dev/null +++ b/patches.suse/ibmvnic-simplify-reset_long_term_buff-function.patch @@ -0,0 +1,111 @@ +From 1c7d45e7b2c29080bf6c8cd0e213cc3cbb62a054 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 12 Feb 2021 20:36:10 -0600 +Subject: [PATCH] ibmvnic: simplify reset_long_term_buff function + +References: bsc#1183023 ltc#191791 +Patch-mainline: v5.12-rc1 +Git-commit: 1c7d45e7b2c29080bf6c8cd0e213cc3cbb62a054 + +The only thing reset_long_term_buff() should do is set +buffer to zero. After doing that, it is not necessary to +send_request_map again to VIOS since it actually does not +change the mapping. So, keep memset function and remove all +others. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 46 ++++++------------------------ + 1 file changed, 8 insertions(+), 38 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 1774fbaab146..7a5e589e7223 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -253,40 +253,12 @@ static void free_long_term_buff(struct ibmvnic_adapter *adapter, + dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr); + } + +-static int reset_long_term_buff(struct ibmvnic_adapter *adapter, +- struct ibmvnic_long_term_buff *ltb) ++static int reset_long_term_buff(struct ibmvnic_long_term_buff *ltb) + { +- struct device *dev = &adapter->vdev->dev; +- int rc; ++ if (!ltb->buff) ++ return -EINVAL; + + memset(ltb->buff, 0, ltb->size); +- +- mutex_lock(&adapter->fw_lock); +- adapter->fw_done_rc = 0; +- +- reinit_completion(&adapter->fw_done); +- rc = send_request_map(adapter, ltb->addr, ltb->size, ltb->map_id); +- if (rc) { +- mutex_unlock(&adapter->fw_lock); +- return rc; +- } +- +- rc = ibmvnic_wait_for_completion(adapter, &adapter->fw_done, 10000); +- if (rc) { +- dev_info(dev, +- "Reset failed, long term map request timed out or aborted\n"); +- mutex_unlock(&adapter->fw_lock); +- return rc; +- } +- +- if (adapter->fw_done_rc) { +- dev_info(dev, +- "Reset failed, attempting to free and reallocate buffer\n"); +- free_long_term_buff(adapter, ltb); +- mutex_unlock(&adapter->fw_lock); +- return alloc_long_term_buff(adapter, ltb, ltb->size); +- } +- mutex_unlock(&adapter->fw_lock); + return 0; + } + +@@ -508,8 +480,7 @@ static int reset_rx_pools(struct ibmvnic_adapter *adapter) + rx_pool->size * + rx_pool->buff_size); + } else { +- rc = reset_long_term_buff(adapter, +- &rx_pool->long_term_buff); ++ rc = reset_long_term_buff(&rx_pool->long_term_buff); + } + + if (rc) +@@ -632,12 +603,11 @@ static int init_rx_pools(struct net_device *netdev) + return 0; + } + +-static int reset_one_tx_pool(struct ibmvnic_adapter *adapter, +- struct ibmvnic_tx_pool *tx_pool) ++static int reset_one_tx_pool(struct ibmvnic_tx_pool *tx_pool) + { + int rc, i; + +- rc = reset_long_term_buff(adapter, &tx_pool->long_term_buff); ++ rc = reset_long_term_buff(&tx_pool->long_term_buff); + if (rc) + return rc; + +@@ -664,10 +634,10 @@ static int reset_tx_pools(struct ibmvnic_adapter *adapter) + + tx_scrqs = adapter->num_active_tx_pools; + for (i = 0; i < tx_scrqs; i++) { +- rc = reset_one_tx_pool(adapter, &adapter->tso_pool[i]); ++ rc = reset_one_tx_pool(&adapter->tso_pool[i]); + if (rc) + return rc; +- rc = reset_one_tx_pool(adapter, &adapter->tx_pool[i]); ++ rc = reset_one_tx_pool(&adapter->tx_pool[i]); + if (rc) + return rc; + } +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-substitute-mb-with-dma_wmb-for-send_-crq-fun.patch b/patches.suse/ibmvnic-substitute-mb-with-dma_wmb-for-send_-crq-fun.patch new file mode 100644 index 0000000..affcb21 --- /dev/null +++ b/patches.suse/ibmvnic-substitute-mb-with-dma_wmb-for-send_-crq-fun.patch @@ -0,0 +1,46 @@ +From 1a42156f52bd4de0e2442671bc24b7ffc7b01c52 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 12 Feb 2021 20:36:46 -0600 +Subject: [PATCH] ibmvnic: substitute mb() with dma_wmb() for send_*crq* + functions + +References: bsc#1183023 ltc#191791 +Patch-mainline: v5.12-rc1 +Git-commit: 1a42156f52bd4de0e2442671bc24b7ffc7b01c52 + +The CRQ and subCRQ descriptors are DMA mapped, so dma_wmb(), +though weaker, is good enough to protect the data structures. + +Signed-off-by: Lijun Pan +Acked-by: Thomas Falcon +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 7a5e589e7223..927d5f36d308 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3599,7 +3599,7 @@ static int send_subcrq_indirect(struct ibmvnic_adapter *adapter, + int rc; + + /* Make sure the hypervisor sees the complete request */ +- mb(); ++ dma_wmb(); + rc = plpar_hcall_norets(H_SEND_SUB_CRQ_INDIRECT, ua, + cpu_to_be64(remote_handle), + ioba, num_entries); +@@ -3629,7 +3629,7 @@ static int ibmvnic_send_crq(struct ibmvnic_adapter *adapter, + } + + /* Make sure the hypervisor sees the complete request */ +- mb(); ++ dma_wmb(); + + rc = plpar_hcall_norets(H_SEND_CRQ, ua, + cpu_to_be64(u64_crq[0]), +-- +2.26.2 + diff --git a/patches.suse/net-re-solve-some-conflicts-after-net-net-next-merge.patch b/patches.suse/net-re-solve-some-conflicts-after-net-net-next-merge.patch new file mode 100644 index 0000000..dbbf5f3 --- /dev/null +++ b/patches.suse/net-re-solve-some-conflicts-after-net-net-next-merge.patch @@ -0,0 +1,62 @@ +From b646acd5eb48ec49ef90404336d7e8ee502ecd05 Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Tue, 16 Feb 2021 22:58:44 -0800 +Subject: [PATCH] net: re-solve some conflicts after net -> net-next merge + +References: bsc#1176855 ltc#187293 +Patch-mainline: v5.12-rc1 +Git-commit: b646acd5eb48ec49ef90404336d7e8ee502ecd05 (ibmvnic only) + +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 5 ++-- + drivers/net/ethernet/ibm/ibmvnic.h | 10 +++++--- + .../net/ethernet/mellanox/mlx5/core/en_main.c | 5 ---- + drivers/net/ethernet/realtek/r8169_main.c | 25 ------------------- + .../selftests/net/forwarding/tc_flower.sh | 3 ++- + 5 files changed, 11 insertions(+), 37 deletions(-) + +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2400,8 +2400,7 @@ static int ibmvnic_reset(struct ibmvnic_ + + spin_lock_irqsave(&adapter->rwi_lock, flags); + +- /* +- * If failover is pending don't schedule any other reset. ++ /* If failover is pending don't schedule any other reset. + * Instead let the failover complete. If there is already a + * a failover reset scheduled, we will detect and drop the + * duplicate reset when walking the ->rwi_list below. +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -1080,10 +1080,16 @@ struct ibmvnic_adapter { + + struct tasklet_struct tasklet; + enum vnic_state state; ++ /* Used for serialization of state field. When taking both state ++ * and rwi locks, take state lock first. ++ */ ++ spinlock_t state_lock; ++ struct list_head rwi_list; + enum ibmvnic_reset_reason reset_reason; +- /* when taking both state and rwi locks, take state lock first */ ++ /* Used for serialization of state field. When taking both state ++ * and rwi locks, take state lock first. ++ */ + spinlock_t rwi_lock; +- struct list_head rwi_list; + struct work_struct ibmvnic_reset; + struct delayed_work ibmvnic_delayed_reset; + unsigned long resetting; +@@ -1097,9 +1103,4 @@ struct ibmvnic_adapter { + + struct ibmvnic_tunables desired; + struct ibmvnic_tunables fallback; +- +- /* Used for serialization of state field. When taking both state +- * and rwi locks, take state lock first. +- */ +- spinlock_t state_lock; + }; diff --git a/patches.suse/powerpc-numa-Fix-build-when-CONFIG_NUMA-n.patch b/patches.suse/powerpc-numa-Fix-build-when-CONFIG_NUMA-n.patch new file mode 100644 index 0000000..18b45d7 --- /dev/null +++ b/patches.suse/powerpc-numa-Fix-build-when-CONFIG_NUMA-n.patch @@ -0,0 +1,64 @@ +From 3fb4a8fa28b740709bdd3229b80279957f4d37ed Mon Sep 17 00:00:00 2001 +From: Scott Cheloha +Date: Thu, 5 Nov 2020 16:30:40 -0600 +Subject: [PATCH] powerpc/numa: Fix build when CONFIG_NUMA=n + +References: bsc#1132477 ltc#175530 +Patch-mainline: v5.10-rc3 +Git-commit: 3fb4a8fa28b740709bdd3229b80279957f4d37ed + +Add a non-NUMA definition for of_drconf_to_nid_single() to topology.h +so we have one even if powerpc/mm/numa.c is not compiled. On a +non-NUMA kernel the appropriate node id is always first_online_node. + +Fixes: 72cdd117c449 ("pseries/hotplug-memory: hot-add: skip redundant LMB lookup") +Reported-by: kernel test robot +Signed-off-by: Scott Cheloha +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201105223040.3612663-1-cheloha@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +index 8728590f514a..3beeb030cd78 100644 +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -6,6 +6,7 @@ + + struct device; + struct device_node; ++struct drmem_lmb; + + #ifdef CONFIG_NUMA + +@@ -61,6 +62,9 @@ static inline int early_cpu_to_node(int cpu) + */ + return (nid < 0) ? 0 : nid; + } ++ ++int of_drconf_to_nid_single(struct drmem_lmb *lmb); ++ + #else + + static inline int early_cpu_to_node(int cpu) { return 0; } +@@ -84,10 +88,12 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) + return 0; + } + +-#endif /* CONFIG_NUMA */ ++static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb) ++{ ++ return first_online_node; ++} + +-struct drmem_lmb; +-int of_drconf_to_nid_single(struct drmem_lmb *lmb); ++#endif /* CONFIG_NUMA */ + + #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) + extern int find_and_online_cpu_nid(int cpu); +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-Don-t-enforce-MSI-affinity-with-kdum.patch b/patches.suse/powerpc-pseries-Don-t-enforce-MSI-affinity-with-kdum.patch new file mode 100644 index 0000000..d58b884 --- /dev/null +++ b/patches.suse/powerpc-pseries-Don-t-enforce-MSI-affinity-with-kdum.patch @@ -0,0 +1,100 @@ +From f9619d5e5174867536b7e558683bc4408eab833f Mon Sep 17 00:00:00 2001 +From: Greg Kurz +Date: Mon, 15 Feb 2021 10:45:06 +0100 +Subject: [PATCH] powerpc/pseries: Don't enforce MSI affinity with kdump +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +References: bsc#1181655 ltc#190855 +Patch-mainline: v5.12 or v5.12-rc3 (next release) +Git-commit: f9619d5e5174867536b7e558683bc4408eab833f + +Depending on the number of online CPUs in the original kernel, it is +likely for CPU #0 to be offline in a kdump kernel. The associated IRQs +in the affinity mappings provided by irq_create_affinity_masks() are +thus not started by irq_startup(), as per-design with managed IRQs. + +This can be a problem with multi-queue block devices driven by blk-mq : +such a non-started IRQ is very likely paired with the single queue +enforced by blk-mq during kdump (see blk_mq_alloc_tag_set()). This +causes the device to remain silent and likely hangs the guest at +some point. + +This is a regression caused by commit 9ea69a55b3b9 ("powerpc/pseries: +Pass MSI affinity to irq_create_mapping()"). Note that this only happens +with the XIVE interrupt controller because XICS has a workaround to bypass +affinity, which is activated during kdump with the "noirqdistrib" kernel +parameter. + +The issue comes from a combination of factors: +- discrepancy between the number of queues detected by the multi-queue + block driver, that was used to create the MSI vectors, and the single + queue mode enforced later on by blk-mq because of kdump (i.e. keeping + all queues fixes the issue) +- CPU#0 offline (i.e. kdump always succeed with CPU#0) + +Given that I couldn't reproduce on x86, which seems to always have CPU#0 +online even during kdump, I'm not sure where this should be fixed. Hence +going for another approach : fine-grained affinity is for performance +and we don't really care about that during kdump. Simply revert to the +previous working behavior of ignoring affinity masks in this case only. + +Fixes: 9ea69a55b3b9 ("powerpc/pseries: Pass MSI affinity to irq_create_mapping()") +Cc: stable@vger.kernel.org # v5.10+ +Signed-off-by: Greg Kurz +Reviewed-by: Laurent Vivier +Reviewed-by: Cédric Le Goater +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20210215094506.1196119-1-groug@kaod.org +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/msi.c | 25 +++++++++++++++++++++++-- + 1 file changed, 23 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c +index b3ac2455faad..637300330507 100644 +--- a/arch/powerpc/platforms/pseries/msi.c ++++ b/arch/powerpc/platforms/pseries/msi.c +@@ -4,6 +4,7 @@ + * Copyright 2006-2007 Michael Ellerman, IBM Corp. + */ + ++#include + #include + #include + #include +@@ -458,8 +459,28 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type) + return hwirq; + } + +- virq = irq_create_mapping_affinity(NULL, hwirq, +- entry->affinity); ++ /* ++ * Depending on the number of online CPUs in the original ++ * kernel, it is likely for CPU #0 to be offline in a kdump ++ * kernel. The associated IRQs in the affinity mappings ++ * provided by irq_create_affinity_masks() are thus not ++ * started by irq_startup(), as per-design for managed IRQs. ++ * This can be a problem with multi-queue block devices driven ++ * by blk-mq : such a non-started IRQ is very likely paired ++ * with the single queue enforced by blk-mq during kdump (see ++ * blk_mq_alloc_tag_set()). This causes the device to remain ++ * silent and likely hangs the guest at some point. ++ * ++ * We don't really care for fine-grained affinity when doing ++ * kdump actually : simply ignore the pre-computed affinity ++ * masks in this case and let the default mask with all CPUs ++ * be used when creating the IRQ mappings. ++ */ ++ if (is_kdump_kernel()) ++ virq = irq_create_mapping(NULL, hwirq); ++ else ++ virq = irq_create_mapping_affinity(NULL, hwirq, ++ entry->affinity); + + if (!virq) { + pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-group-lmb-operation-and-memblock-s.patch b/patches.suse/powerpc-pseries-group-lmb-operation-and-memblock-s.patch index 16495e9..7415d3e 100644 --- a/patches.suse/powerpc-pseries-group-lmb-operation-and-memblock-s.patch +++ b/patches.suse/powerpc-pseries-group-lmb-operation-and-memblock-s.patch @@ -1,4 +1,4 @@ -From a235863387220d22de0b1b9e848ba6d872266a9d Mon Sep 17 00:00:00 2001 +From 17656bb8fabd7ae15c384c03a027a9177dbdfe6a Mon Sep 17 00:00:00 2001 From: Pingfan Liu Date: Tue, 11 Feb 2020 10:59:41 +0800 Subject: [PATCH 1/2] powerpc/pseries: group lmb operation and memblock's @@ -22,16 +22,16 @@ To: linuxppc-dev@lists.ozlabs.org Cc: kexec@lists.infradead.org Acked-by: Michal Suchanek --- - .../platforms/pseries/hotplug-memory.c | 26 ++++++++++++------- - 1 file changed, 17 insertions(+), 9 deletions(-) + .../platforms/pseries/hotplug-memory.c | 24 ++++++++++++------- + 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c -index a4d40a3ceea3..fbf14c8b28f8 100644 +index 8377f1f7c78e..6ddc9518c675 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c -@@ -377,7 +377,8 @@ static int dlpar_add_lmb(struct drmem_lmb *); - static int dlpar_remove_lmb(struct drmem_lmb *lmb) +@@ -369,7 +369,8 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb) { + struct memory_block *mem_block; unsigned long block_sz; - int rc; + phys_addr_t base_addr; @@ -39,21 +39,21 @@ index a4d40a3ceea3..fbf14c8b28f8 100644 if (!lmb_is_removable(lmb)) return -EINVAL; -@@ -386,17 +387,19 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb) - if (rc) +@@ -384,17 +385,20 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb) return rc; + } + base_addr = lmb->base_addr; -+ nid = lmb->nid; ++ nid = mem_block->nid; block_sz = pseries_memory_block_size(); -- __remove_memory(lmb->nid, lmb->base_addr, block_sz); -- +- __remove_memory(mem_block->nid, lmb->base_addr, block_sz); + put_device(&mem_block->dev); + - /* Update memory regions for memory remove */ - memblock_remove(lmb->base_addr, block_sz); - invalidate_lmb_associativity_index(lmb); - lmb_clear_nid(lmb); lmb->flags &= ~DRCONF_MEM_ASSIGNED; + __remove_memory(nid, base_addr, block_sz); @@ -64,25 +64,23 @@ index a4d40a3ceea3..fbf14c8b28f8 100644 return 0; } -@@ -663,6 +666,8 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) +@@ -622,6 +626,8 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) + return rc; } - lmb_set_nid(lmb); + lmb->flags |= DRCONF_MEM_ASSIGNED; + block_sz = memory_block_size_bytes(); - /* Add the memory */ -@@ -674,11 +679,14 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) + /* Find the node id for this LMB. Fake one if necessary. */ +@@ -638,10 +644,12 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) rc = dlpar_online_lmb(lmb); if (rc) { -- __remove_memory(lmb->nid, lmb->base_addr, block_sz); -+ int nid = lmb->nid; +- __remove_memory(nid, lmb->base_addr, block_sz); + phys_addr_t base_addr = lmb->base_addr; + invalidate_lmb_associativity_index(lmb); - lmb_clear_nid(lmb); - } else { - lmb->flags |= DRCONF_MEM_ASSIGNED; + lmb->flags &= ~DRCONF_MEM_ASSIGNED; @@ -92,5 +90,5 @@ index a4d40a3ceea3..fbf14c8b28f8 100644 return rc; -- -2.23.0 +2.26.2 diff --git a/patches.suse/powerpc-pseries-update-device-tree-before-ejecting-h.patch b/patches.suse/powerpc-pseries-update-device-tree-before-ejecting-h.patch index 096ec2a..4c6326b 100644 --- a/patches.suse/powerpc-pseries-update-device-tree-before-ejecting-h.patch +++ b/patches.suse/powerpc-pseries-update-device-tree-before-ejecting-h.patch @@ -1,4 +1,4 @@ -From 9ae86aa5d7e10e5587a13f6ff29dfe26f115d238 Mon Sep 17 00:00:00 2001 +From 3d87a8c65dd83b05a542925351e823d131cbc7b4 Mon Sep 17 00:00:00 2001 From: Pingfan Liu Date: Tue, 11 Feb 2020 10:59:42 +0800 Subject: [PATCH 2/2] powerpc/pseries: update device tree before ejecting @@ -54,37 +54,38 @@ Cc: kexec@lists.infradead.org Tested-by: Hari Bathini Acked-by: Michal Suchanek --- - arch/powerpc/platforms/pseries/hotplug-memory.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) + arch/powerpc/platforms/pseries/hotplug-memory.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c +index 6ddc9518c675..cce0409c6cda 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c -@@ -392,6 +392,7 @@ static int dlpar_remove_lmb(struct drmem +@@ -393,6 +393,7 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb) + invalidate_lmb_associativity_index(lmb); - lmb_clear_nid(lmb); lmb->flags &= ~DRCONF_MEM_ASSIGNED; + drmem_update_dt(); __remove_memory(nid, base_addr, block_sz); -@@ -627,6 +630,7 @@ static int dlpar_add_lmb(struct drmem_lm +@@ -627,6 +628,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) + } - lmb_set_nid(lmb); lmb->flags |= DRCONF_MEM_ASSIGNED; + drmem_update_dt(); block_sz = memory_block_size_bytes(); -@@ -645,6 +651,7 @@ static int dlpar_add_lmb(struct drmem_lm +@@ -648,6 +650,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) + invalidate_lmb_associativity_index(lmb); - lmb_clear_nid(lmb); lmb->flags &= ~DRCONF_MEM_ASSIGNED; + drmem_update_dt(); __remove_memory(nid, base_addr, block_sz); } -@@ -887,9 +896,6 @@ int dlpar_memory(struct pseries_hp_error +@@ -900,9 +903,6 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog) break; } @@ -95,5 +96,5 @@ diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/plat return rc; } -- -2.23.0 +2.26.2 diff --git a/patches.suse/powerpc-sstep-Fix-VSX-instruction-emulation.patch b/patches.suse/powerpc-sstep-Fix-VSX-instruction-emulation.patch new file mode 100644 index 0000000..a877e23 --- /dev/null +++ b/patches.suse/powerpc-sstep-Fix-VSX-instruction-emulation.patch @@ -0,0 +1,94 @@ +From 5c88a17e15795226b56d83f579cbb9b7a4864f79 Mon Sep 17 00:00:00 2001 +From: Jordan Niethe +Date: Thu, 25 Feb 2021 14:19:46 +1100 +Subject: [PATCH] powerpc/sstep: Fix VSX instruction emulation + +References: jsc#SLE-13847 bsc#1180581 ltc#190174 +Patch-mainline: v5.12 or v5.12-rc3 (next release) +Git-commit: 5c88a17e15795226b56d83f579cbb9b7a4864f79 + +Commit af99da74333b ("powerpc/sstep: Support VSX vector paired storage +access instructions") added loading and storing 32 word long data into +adjacent VSRs. However the calculation used to determine if two VSRs +needed to be loaded/stored inadvertently prevented the load/storing +taking place for instructions with a data length less than 16 words. + +This causes the emulation to not function correctly, which can be seen +by the alignment_handler selftest: + +$ ./alignment_handler +[snip] +test: test_alignment_handler_vsx_207 +tags: git_version:powerpc-5.12-1-0-g82d2c16b350f +VSX: 2.07B + Doing lxsspx: PASSED + Doing lxsiwax: FAILED: Wrong Data + Doing lxsiwzx: PASSED + Doing stxsspx: PASSED + Doing stxsiwx: PASSED +failure: test_alignment_handler_vsx_207 +test: test_alignment_handler_vsx_300 +tags: git_version:powerpc-5.12-1-0-g82d2c16b350f +VSX: 3.00B + Doing lxsd: PASSED + Doing lxsibzx: PASSED + Doing lxsihzx: PASSED + Doing lxssp: FAILED: Wrong Data + Doing lxv: PASSED + Doing lxvb16x: PASSED + Doing lxvh8x: PASSED + Doing lxvx: PASSED + Doing lxvwsx: FAILED: Wrong Data + Doing lxvl: PASSED + Doing lxvll: PASSED + Doing stxsd: PASSED + Doing stxsibx: PASSED + Doing stxsihx: PASSED + Doing stxssp: PASSED + Doing stxv: PASSED + Doing stxvb16x: PASSED + Doing stxvh8x: PASSED + Doing stxvx: PASSED + Doing stxvl: PASSED + Doing stxvll: PASSED +failure: test_alignment_handler_vsx_300 +[snip] + +Fix this by making sure all VSX instruction emulation correctly +load/store from the VSRs. + +Fixes: af99da74333b ("powerpc/sstep: Support VSX vector paired storage access instructions") +Signed-off-by: Jordan Niethe +Reviewed-by: Ravi Bangoria +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20210225031946.1458206-1-jniethe5@gmail.com +Acked-by: Michal Suchanek +--- + arch/powerpc/lib/sstep.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c +index bb5c20d4ca91..c6aebc149d14 100644 +--- a/arch/powerpc/lib/sstep.c ++++ b/arch/powerpc/lib/sstep.c +@@ -904,7 +904,7 @@ static nokprobe_inline int do_vsx_load(struct instruction_op *op, + if (!address_ok(regs, ea, size) || copy_mem_in(mem, ea, size, regs)) + return -EFAULT; + +- nr_vsx_regs = size / sizeof(__vector128); ++ nr_vsx_regs = max(1ul, size / sizeof(__vector128)); + emulate_vsx_load(op, buf, mem, cross_endian); + preempt_disable(); + if (reg < 32) { +@@ -951,7 +951,7 @@ static nokprobe_inline int do_vsx_store(struct instruction_op *op, + if (!address_ok(regs, ea, size)) + return -EFAULT; + +- nr_vsx_regs = size / sizeof(__vector128); ++ nr_vsx_regs = max(1ul, size / sizeof(__vector128)); + preempt_disable(); + if (reg < 32) { + /* FP regs + extensions */ +-- +2.26.2 + diff --git a/patches.suse/pseries-drmem-don-t-cache-node-id-in-drmem_lmb-struc.patch b/patches.suse/pseries-drmem-don-t-cache-node-id-in-drmem_lmb-struc.patch new file mode 100644 index 0000000..910ffb5 --- /dev/null +++ b/patches.suse/pseries-drmem-don-t-cache-node-id-in-drmem_lmb-struc.patch @@ -0,0 +1,210 @@ +From e5e179aa3a39c818db8fbc2dce8d2cd24adaf657 Mon Sep 17 00:00:00 2001 +From: Scott Cheloha +Date: Mon, 10 Aug 2020 20:51:15 -0500 +Subject: [PATCH] pseries/drmem: don't cache node id in drmem_lmb struct + +References: bsc#1132477 ltc#175530 +Patch-mainline: v5.10-rc1 +Git-commit: e5e179aa3a39c818db8fbc2dce8d2cd24adaf657 + +At memory hot-remove time we can retrieve an LMB's nid from its +corresponding memory_block. There is no need to store the nid +in multiple locations. + +Note that lmb_to_memblock() uses find_memory_block() to get the +corresponding memory_block. As find_memory_block() runs in sub-linear +time this approach is negligibly slower than what we do at present. + +In exchange for this lookup at hot-remove time we no longer need to +call memory_add_physaddr_to_nid() during drmem_init() for each LMB. +On powerpc, memory_add_physaddr_to_nid() is a linear search, so this +spares us an O(n^2) initialization during boot. + +On systems with many LMBs that initialization overhead is palpable and +disruptive. For example, on a box with 249854 LMBs we're seeing +drmem_init() take upwards of 30 seconds to complete: + +[ 53.721639] drmem: initializing drmem v2 +[ 80.604346] watchdog: BUG: soft lockup - CPU#65 stuck for 23s! [swapper/0:1] +[ 80.604377] Modules linked in: +[ 80.604389] CPU: 65 PID: 1 Comm: swapper/0 Not tainted 5.6.0-rc2+ #4 +[ 80.604397] NIP: c0000000000a4980 LR: c0000000000a4940 CTR: 0000000000000000 +[ 80.604407] REGS: c0002dbff8493830 TRAP: 0901 Not tainted (5.6.0-rc2+) +[ 80.604412] MSR: 8000000002009033 CR: 44000248 XER: 0000000d +[ 80.604431] CFAR: c0000000000a4a38 IRQMASK: 0 +[ 80.604431] GPR00: c0000000000a4940 c0002dbff8493ac0 c000000001904400 c0003cfffffede30 +[ 80.604431] GPR04: 0000000000000000 c000000000f4095a 000000000000002f 0000000010000000 +[ 80.604431] GPR08: c0000bf7ecdb7fb8 c0000bf7ecc2d3c8 0000000000000008 c00c0002fdfb2001 +[ 80.604431] GPR12: 0000000000000000 c00000001e8ec200 +[ 80.604477] NIP [c0000000000a4980] hot_add_scn_to_nid+0xa0/0x3e0 +[ 80.604486] LR [c0000000000a4940] hot_add_scn_to_nid+0x60/0x3e0 +[ 80.604492] Call Trace: +[ 80.604498] [c0002dbff8493ac0] [c0000000000a4940] hot_add_scn_to_nid+0x60/0x3e0 (unreliable) +[ 80.604509] [c0002dbff8493b20] [c000000000087c10] memory_add_physaddr_to_nid+0x20/0x60 +[ 80.604521] [c0002dbff8493b40] [c0000000010d4880] drmem_init+0x25c/0x2f0 +[ 80.604530] [c0002dbff8493c10] [c000000000010154] do_one_initcall+0x64/0x2c0 +[ 80.604540] [c0002dbff8493ce0] [c0000000010c4aa0] kernel_init_freeable+0x2d8/0x3a0 +[ 80.604550] [c0002dbff8493db0] [c000000000010824] kernel_init+0x2c/0x148 +[ 80.604560] [c0002dbff8493e20] [c00000000000b648] ret_from_kernel_thread+0x5c/0x74 +[ 80.604567] Instruction dump: +[ 80.604574] 392918e8 e9490000 e90a000a e92a0000 80ea000c 1d080018 3908ffe8 7d094214 +[ 80.604586] 7fa94040 419d00dc e9490010 714a0088 <2faa0008> 409e00ac e9490000 7fbe5040 +[ 89.047390] drmem: 249854 LMB(s) + +With a patched kernel on the same machine we're no longer seeing the +soft lockup. drmem_init() now completes in negligible time, even when +the LMB count is large. + +Fixes: b2d3b5ee66f2 ("powerpc/pseries: Track LMB nid instead of using device tree") +Signed-off-by: Scott Cheloha +Reviewed-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200811015115.63677-1-cheloha@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/drmem.h | 21 ---------------- + arch/powerpc/mm/drmem.c | 6 +---- + .../platforms/pseries/hotplug-memory.c | 24 ++++++++++++------- + 3 files changed, 17 insertions(+), 34 deletions(-) + +diff --git a/arch/powerpc/include/asm/drmem.h b/arch/powerpc/include/asm/drmem.h +index 6fb928605ed1..030a19d92213 100644 +--- a/arch/powerpc/include/asm/drmem.h ++++ b/arch/powerpc/include/asm/drmem.h +@@ -15,9 +15,6 @@ struct drmem_lmb { + u32 drc_index; + u32 aa_index; + u32 flags; +-#ifdef CONFIG_MEMORY_HOTPLUG +- int nid; +-#endif + }; + + struct drmem_lmb_info { +@@ -121,22 +118,4 @@ static inline void invalidate_lmb_associativity_index(struct drmem_lmb *lmb) + lmb->aa_index = 0xffffffff; + } + +-#ifdef CONFIG_MEMORY_HOTPLUG +-static inline void lmb_set_nid(struct drmem_lmb *lmb) +-{ +- lmb->nid = memory_add_physaddr_to_nid(lmb->base_addr); +-} +-static inline void lmb_clear_nid(struct drmem_lmb *lmb) +-{ +- lmb->nid = -1; +-} +-#else +-static inline void lmb_set_nid(struct drmem_lmb *lmb) +-{ +-} +-static inline void lmb_clear_nid(struct drmem_lmb *lmb) +-{ +-} +-#endif +- + #endif /* _ASM_POWERPC_LMB_H */ +diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c +index b2eeea39684c..9af3832c9d8d 100644 +--- a/arch/powerpc/mm/drmem.c ++++ b/arch/powerpc/mm/drmem.c +@@ -389,10 +389,8 @@ static void __init init_drmem_v1_lmbs(const __be32 *prop) + if (!drmem_info->lmbs) + return; + +- for_each_drmem_lmb(lmb) { ++ for_each_drmem_lmb(lmb) + read_drconf_v1_cell(lmb, &prop); +- lmb_set_nid(lmb); +- } + } + + static void __init init_drmem_v2_lmbs(const __be32 *prop) +@@ -437,8 +435,6 @@ static void __init init_drmem_v2_lmbs(const __be32 *prop) + + lmb->aa_index = dr_cell.aa_index; + lmb->flags = dr_cell.flags; +- +- lmb_set_nid(lmb); + } + } + } +diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c +index 5d545b78111f..0ea976d1cac4 100644 +--- a/arch/powerpc/platforms/pseries/hotplug-memory.c ++++ b/arch/powerpc/platforms/pseries/hotplug-memory.c +@@ -354,25 +354,32 @@ static int dlpar_add_lmb(struct drmem_lmb *); + + static int dlpar_remove_lmb(struct drmem_lmb *lmb) + { ++ struct memory_block *mem_block; + unsigned long block_sz; + int rc; + + if (!lmb_is_removable(lmb)) + return -EINVAL; + ++ mem_block = lmb_to_memblock(lmb); ++ if (mem_block == NULL) ++ return -EINVAL; ++ + rc = dlpar_offline_lmb(lmb); +- if (rc) ++ if (rc) { ++ put_device(&mem_block->dev); + return rc; ++ } + + block_sz = pseries_memory_block_size(); + +- __remove_memory(lmb->nid, lmb->base_addr, block_sz); ++ __remove_memory(mem_block->nid, lmb->base_addr, block_sz); ++ put_device(&mem_block->dev); + + /* Update memory regions for memory remove */ + memblock_remove(lmb->base_addr, block_sz); + + invalidate_lmb_associativity_index(lmb); +- lmb_clear_nid(lmb); + lmb->flags &= ~DRCONF_MEM_ASSIGNED; + + return 0; +@@ -591,7 +598,7 @@ static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index) + static int dlpar_add_lmb(struct drmem_lmb *lmb) + { + unsigned long block_sz; +- int rc; ++ int nid, rc; + + if (lmb->flags & DRCONF_MEM_ASSIGNED) + return -EINVAL; +@@ -602,11 +609,13 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) + return rc; + } + +- lmb_set_nid(lmb); + block_sz = memory_block_size_bytes(); + ++ /* Find the node id for this address. */ ++ nid = memory_add_physaddr_to_nid(lmb->base_addr); ++ + /* Add the memory */ +- rc = __add_memory(lmb->nid, lmb->base_addr, block_sz); ++ rc = __add_memory(nid, lmb->base_addr, block_sz); + if (rc) { + invalidate_lmb_associativity_index(lmb); + return rc; +@@ -614,9 +623,8 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) + + rc = dlpar_online_lmb(lmb); + if (rc) { +- __remove_memory(lmb->nid, lmb->base_addr, block_sz); ++ __remove_memory(nid, lmb->base_addr, block_sz); + invalidate_lmb_associativity_index(lmb); +- lmb_clear_nid(lmb); + } else { + lmb->flags |= DRCONF_MEM_ASSIGNED; + } +-- +2.26.2 + diff --git a/patches.suse/pseries-hotplug-memory-hot-add-skip-redundant-LMB-lo.patch b/patches.suse/pseries-hotplug-memory-hot-add-skip-redundant-LMB-lo.patch new file mode 100644 index 0000000..f746201 --- /dev/null +++ b/patches.suse/pseries-hotplug-memory-hot-add-skip-redundant-LMB-lo.patch @@ -0,0 +1,151 @@ +From 72cdd117c449896c707fc6cfe5b90978160697d0 Mon Sep 17 00:00:00 2001 +From: Scott Cheloha +Date: Wed, 16 Sep 2020 09:51:22 -0500 +Subject: [PATCH] pseries/hotplug-memory: hot-add: skip redundant LMB lookup + +References: bsc#1132477 ltc#175530 +Patch-mainline: v5.10-rc1 +Git-commit: 72cdd117c449896c707fc6cfe5b90978160697d0 + +During memory hot-add, dlpar_add_lmb() calls memory_add_physaddr_to_nid() +to determine which node id (nid) to use when later calling __add_memory(). + +This is wasteful. On pseries, memory_add_physaddr_to_nid() finds an +appropriate nid for a given address by looking up the LMB containing the +address and then passing that LMB to of_drconf_to_nid_single() to get the +nid. In dlpar_add_lmb() we get this address from the LMB itself. + +In short, we have a pointer to an LMB and then we are searching for +that LMB *again* in order to find its nid. + +If we call of_drconf_to_nid_single() directly from dlpar_add_lmb() we +can skip the redundant lookup. The only error handling we need to +duplicate from memory_add_physaddr_to_nid() is the fallback to the +default nid when drconf_to_nid_single() returns -1 (NUMA_NO_NODE) or +an invalid nid. + +Skipping the extra lookup makes hot-add operations faster, especially +on machines with many LMBs. + +Consider an LPAR with 126976 LMBs. In one test, hot-adding 126000 +LMBs on an upatched kernel took ~3.5 hours while a patched kernel +completed the same operation in ~2 hours: + +Unpatched (12450 seconds): +Sep 9 04:06:31 ltc-brazos1 drmgr[810169]: drmgr: -c mem -a -q 126000 +Sep 9 04:06:31 ltc-brazos1 kernel: pseries-hotplug-mem: Attempting to hot-add 126000 LMB(s) +[...] +Sep 9 07:34:01 ltc-brazos1 kernel: pseries-hotplug-mem: Memory at 20000000 (drc index 80000002) was hot-added + +Patched (7065 seconds): +Sep 8 21:49:57 ltc-brazos1 drmgr[877703]: drmgr: -c mem -a -q 126000 +Sep 8 21:49:57 ltc-brazos1 kernel: pseries-hotplug-mem: Attempting to hot-add 126000 LMB(s) +[...] +Sep 8 23:27:42 ltc-brazos1 kernel: pseries-hotplug-mem: Memory at 20000000 (drc index 80000002) was hot-added + +It should be noted that the speedup grows more substantial when +hot-adding LMBs at the end of the drconf range. This is because we +are skipping a linear LMB search. + +To see the distinction, consider smaller hot-add test on the same +LPAR. A perf-stat run with 10 iterations showed that hot-adding 4096 +LMBs completed less than 1 second faster on a patched kernel: + +Unpatched: + Performance counter stats for 'drmgr -c mem -a -q 4096' (10 runs): + + 104,753.42 msec task-clock # 0.992 CPUs utilized ( +- 0.55% ) + 4,708 context-switches # 0.045 K/sec ( +- 0.69% ) + 2,444 cpu-migrations # 0.023 K/sec ( +- 1.25% ) + 394 page-faults # 0.004 K/sec ( +- 0.22% ) + 445,902,503,057 cycles # 4.257 GHz ( +- 0.55% ) (66.67%) + 8,558,376,740 stalled-cycles-frontend # 1.92% frontend cycles idle ( +- 0.88% ) (49.99%) + 300,346,181,651 stalled-cycles-backend # 67.36% backend cycles idle ( +- 0.76% ) (50.01%) + 258,091,488,691 instructions # 0.58 insn per cycle + # 1.16 stalled cycles per insn ( +- 0.22% ) (66.67%) + 70,568,169,256 branches # 673.660 M/sec ( +- 0.17% ) (50.01%) + 3,100,725,426 branch-misses # 4.39% of all branches ( +- 0.20% ) (49.99%) + + 105.583 +- 0.589 seconds time elapsed ( +- 0.56% ) + +Patched: + Performance counter stats for 'drmgr -c mem -a -q 4096' (10 runs): + + 104,055.69 msec task-clock # 0.993 CPUs utilized ( +- 0.32% ) + 4,606 context-switches # 0.044 K/sec ( +- 0.20% ) + 2,463 cpu-migrations # 0.024 K/sec ( +- 0.93% ) + 394 page-faults # 0.004 K/sec ( +- 0.25% ) + 442,951,129,921 cycles # 4.257 GHz ( +- 0.32% ) (66.66%) + 8,710,413,329 stalled-cycles-frontend # 1.97% frontend cycles idle ( +- 0.47% ) (50.06%) + 299,656,905,836 stalled-cycles-backend # 67.65% backend cycles idle ( +- 0.39% ) (50.02%) + 252,731,168,193 instructions # 0.57 insn per cycle + # 1.19 stalled cycles per insn ( +- 0.20% ) (66.66%) + 68,902,851,121 branches # 662.173 M/sec ( +- 0.13% ) (49.94%) + 3,100,242,882 branch-misses # 4.50% of all branches ( +- 0.15% ) (49.98%) + + 104.829 +- 0.325 seconds time elapsed ( +- 0.31% ) + +This is consistent. An add-by-count hot-add operation adds LMBs +greedily, so LMBs near the start of the drconf range are considered +first. On an otherwise idle LPAR with so many LMBs we would expect to +find the LMBs we need near the start of the drconf range, hence the +smaller speedup. + +Signed-off-by: Scott Cheloha +Reviewed-by: Laurent Dufour +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200916145122.3408129-1-cheloha@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 3 +++ + arch/powerpc/mm/numa.c | 2 +- + arch/powerpc/platforms/pseries/hotplug-memory.c | 6 ++++-- + 3 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +index e45219f74be0..8728590f514a 100644 +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -86,6 +86,9 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) + + #endif /* CONFIG_NUMA */ + ++struct drmem_lmb; ++int of_drconf_to_nid_single(struct drmem_lmb *lmb); ++ + #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) + extern int find_and_online_cpu_nid(int cpu); + extern int cpu_to_coregroup_id(int cpu); +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index b725fb66e913..8335399b7509 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -430,7 +430,7 @@ static int of_get_assoc_arrays(struct assoc_arrays *aa) + * This is like of_node_to_nid_single() for memory represented in the + * ibm,dynamic-reconfiguration-memory node. + */ +-static int of_drconf_to_nid_single(struct drmem_lmb *lmb) ++int of_drconf_to_nid_single(struct drmem_lmb *lmb) + { + struct assoc_arrays aa = { .arrays = NULL }; + int default_nid = NUMA_NO_NODE; +diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c +index 0ea976d1cac4..9a533acf8ad0 100644 +--- a/arch/powerpc/platforms/pseries/hotplug-memory.c ++++ b/arch/powerpc/platforms/pseries/hotplug-memory.c +@@ -611,8 +611,10 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) + + block_sz = memory_block_size_bytes(); + +- /* Find the node id for this address. */ +- nid = memory_add_physaddr_to_nid(lmb->base_addr); ++ /* Find the node id for this LMB. Fake one if necessary. */ ++ nid = of_drconf_to_nid_single(lmb); ++ if (nid < 0 || !node_possible(nid)) ++ nid = first_online_node; + + /* Add the memory */ + rc = __add_memory(nid, lmb->base_addr, block_sz); +-- +2.26.2 + diff --git a/series.conf b/series.conf index 51163b7..a66a67e 100644 --- a/series.conf +++ b/series.conf @@ -44215,6 +44215,7 @@ patches.suse/powerpc-perf-consolidate-GPCI-hcall-structs-into-asm.patch patches.suse/powerpc-pseries-new-lparcfg-key-value-pair-partition.patch patches.suse/powerpc-pseries-explicitly-reschedule-during-drmem_l.patch + patches.suse/pseries-drmem-don-t-cache-node-id-in-drmem_lmb-struc.patch patches.suse/selftests-powerpc-Move-set_dscr-into-rfi_flush.c.patch patches.suse/selftests-powerpc-Skip-security-tests-on-older-CPUs.patch patches.suse/powerpc-Update-documentation-of-ISA-versions-for-Pow.patch @@ -44270,6 +44271,7 @@ patches.suse/powerpc-smp-Optimize-update_coregroup_mask.patch patches.suse/powerpc-perf-Exclude-pmc5-6-from-the-irrelevant-PMU-.patch patches.suse/powerpc-rtas-Restrict-RTAS-requests-from-userspace.patch + patches.suse/pseries-hotplug-memory-hot-add-skip-redundant-LMB-lo.patch patches.suse/powerpc-perf-hv-gpci-Fix-starting-index-value.patch patches.suse/Documentation-ABI-Add-ABI-documentation-for-hv-24x7-.patch patches.suse/Documentation-ABI-Add-ABI-documentation-for-hv-gpci-.patch @@ -44819,6 +44821,7 @@ patches.suse/nvme-rdma-avoid-repeated-request-completion.patch patches.suse/nvme-tcp-avoid-repeated-request-completion.patch patches.suse/powerpc-eeh_cache-Fix-a-possible-debugfs-deadlock.patch + patches.suse/powerpc-numa-Fix-build-when-CONFIG_NUMA-n.patch patches.suse/futex-Handle-transient-ownerless-rtmutex-state-corre.patch patches.suse/perf-core-fix-a-memory-leak-in-perf_event_parse_addr_filter.patch patches.suse/x86-speculation-allow-ibpb-to-be-conditionally-enabled-on-cpus-with-always-on-stibp.patch @@ -46784,6 +46787,8 @@ patches.suse/ath10k-Fix-lockdep-assertion-warning-in-ath10k_sta_s.patch patches.suse/ath9k-fix-data-bus-crash-when-setting-nf_override-vi.patch patches.suse/mac80211-fix-potential-overflow-when-multiplying-to-.patch + patches.suse/ibmvnic-simplify-reset_long_term_buff-function.patch + patches.suse/ibmvnic-substitute-mb-with-dma_wmb-for-send_-crq-fun.patch patches.suse/ibmvnic-Set-to-CLOSED-state-even-on-error.patch patches.suse/ibmvnic-change-IBMVNIC_MAX_IND_DESCS-to-16.patch patches.suse/b43-N-PHY-Fix-the-update-of-coef-for-the-PHY-revisio.patch @@ -46791,6 +46796,7 @@ patches.suse/ibmvnic-add-memory-barrier-to-protect-long-term-buff.patch patches.suse/ibmvnic-skip-send_request_unmap-for-timeout-reset.patch patches.suse/ibmvnic-serialize-access-to-work-queue-on-remove.patch + patches.suse/net-re-solve-some-conflicts-after-net-net-next-merge.patch patches.suse/reset-hisilicon-correct-vendor-prefix.patch patches.suse/memory-ti-aemif-Drop-child-node-when-jumping-out-loo.patch patches.suse/soc-aspeed-snoop-Add-clock-control-logic.patch @@ -47013,6 +47019,13 @@ patches.suse/scsi-iscsi-restrict-sessions-and-handles-to-admin-capabilities patches.suse/scsi-iscsi-ensure-sysfs-attributes-are-limited-to-page_size patches.suse/scsi-iscsi-verify-lengths-on-passthrough-pdus + patches.suse/powerpc-pseries-Don-t-enforce-MSI-affinity-with-kdum.patch + patches.suse/powerpc-sstep-Fix-VSX-instruction-emulation.patch + patches.suse/ibmvnic-remove-excessive-irqsave.patch + + # netdev/net + patches.suse/ibmvnic-fix-a-race-between-open-and-reset.patch + patches.suse/ibmvnic-always-store-valid-MAC-address.patch # out-of-tree patches patches.suse/perf-x86-intel-uncore-Store-the-logical-die-id-inste.patch @@ -47021,6 +47034,7 @@ patches.suse/ibmvfc-fix-invalid-sub-CRQ-handles-after-hard-reset.patch patches.suse/ibmvfc-treat-H_CLOSED-as-success-during-sub-CRQ-regi.patch patches.suse/ibmvfc-store-return-code-of-H_FREE_SUB_CRQ-during-cl.patch + patches.suse/ibmvfc-reinitialize-sub-CRQs-and-perform-channel-enq.patch ######################################################## # end of sorted patches