[SRU][Bionic][PATCH 0/3] [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][Bionic][PATCH 0/3] [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg

Marcelo Henrique Cerri
BugLink: http://bugs.launchpad.net/bugs/1758378

That's intended to the regular bionic kernel (bionic/linux), since
some azure users are hitting the same issue when using bionic/linux or
xenial/linux-hwe-edge.

Some of the fixes were already included by the update to v4.15.18 and
the remaining patches are clean cherry picks from mainline only
touching "drivers/pci/host/pci-hyperv.c".

Dexuan Cui (3):
  PCI: hv: Fix a comment typo in _hv_pcifront_read_config()
  PCI: hv: Remove the bogus test in hv_eject_device_work()
  PCI: hv: Only queue new work items in hv_pci_devices_present() if
    necessary

 drivers/pci/host/pci-hyperv.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Bionic][PATCH 1/3] PCI: hv: Fix a comment typo in _hv_pcifront_read_config()

Marcelo Henrique Cerri
From: Dexuan Cui <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1758378

Comment in _hv_pcifront_read_config() contains a typo, fix it.

No functional change.

Signed-off-by: Dexuan Cui <[hidden email]>
[[hidden email]: changed commit log]
Signed-off-by: Lorenzo Pieralisi <[hidden email]>
Acked-by: Haiyang Zhang <[hidden email]>
Cc: Vitaly Kuznetsov <[hidden email]>
Cc: Stephen Hemminger <[hidden email]>
Cc: K. Y. Srinivasan <[hidden email]>
(cherry picked from commit df3f2159f4e4146d40b244725ce79ed921530b99)
Signed-off-by: Marcelo Henrique Cerri <[hidden email]>
---
 drivers/pci/host/pci-hyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index ebfd32f142cd..f5fe4c38aee2 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -666,7 +666,7 @@ static void _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where,
  break;
  }
  /*
- * Make sure the write was done before we release the spinlock
+ * Make sure the read was done before we release the spinlock
  * allowing consecutive reads/writes.
  */
  mb();
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Bionic][PATCH 2/3] PCI: hv: Remove the bogus test in hv_eject_device_work()

Marcelo Henrique Cerri
In reply to this post by Marcelo Henrique Cerri
From: Dexuan Cui <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1758378

When kernel is executing hv_eject_device_work(), hpdev->state value must
be hv_pcichild_ejecting; any other value would consist in a bug,
therefore replace the bogus check with an explicit WARN_ON() on the
condition failure detection.

Signed-off-by: Dexuan Cui <[hidden email]>
[[hidden email]: updated commit log]
Signed-off-by: Lorenzo Pieralisi <[hidden email]>
Reviewed-by: Michael Kelley <[hidden email]>
Acked-by: Haiyang Zhang <[hidden email]>
Cc: Vitaly Kuznetsov <[hidden email]>
Cc: Jack Morgenstein <[hidden email]>
Cc: Stephen Hemminger <[hidden email]>
Cc: K. Y. Srinivasan <[hidden email]>
(cherry picked from commit fca288c0153b2b97114b9081bc3c33c3735145b6)
Signed-off-by: Marcelo Henrique Cerri <[hidden email]>
---
 drivers/pci/host/pci-hyperv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index f5fe4c38aee2..5eb7954ee584 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1854,10 +1854,7 @@ static void hv_eject_device_work(struct work_struct *work)
 
  hpdev = container_of(work, struct hv_pci_dev, wrk);
 
- if (hpdev->state != hv_pcichild_ejecting) {
- put_pcichild(hpdev, hv_pcidev_ref_pnp);
- return;
- }
+ WARN_ON(hpdev->state != hv_pcichild_ejecting);
 
  /*
  * Ejection can come before or after the PCI bus has been set up, so
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Bionic][PATCH 3/3] PCI: hv: Only queue new work items in hv_pci_devices_present() if necessary

Marcelo Henrique Cerri
In reply to this post by Marcelo Henrique Cerri
From: Dexuan Cui <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1758378

If there is pending work in hv_pci_devices_present() we just need to add
the new dr entry into the dr_list. Add a check to detect pending work
items and update the code to skip queuing work if pending work items
are detected.

Signed-off-by: Dexuan Cui <[hidden email]>
[[hidden email]: updated commit log]
Signed-off-by: Lorenzo Pieralisi <[hidden email]>
Reviewed-by: Michael Kelley <[hidden email]>
Acked-by: Haiyang Zhang <[hidden email]>
Cc: Vitaly Kuznetsov <[hidden email]>
Cc: Jack Morgenstein <[hidden email]>
Cc: Stephen Hemminger <[hidden email]>
Cc: K. Y. Srinivasan <[hidden email]>
(cherry picked from commit 948373b3ed1bcf05a237c24675b84804315aff14)
Signed-off-by: Marcelo Henrique Cerri <[hidden email]>
---
 drivers/pci/host/pci-hyperv.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 5eb7954ee584..f7d36c03486c 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1801,6 +1801,7 @@ static void hv_pci_devices_present(struct hv_pcibus_device *hbus,
  struct hv_dr_state *dr;
  struct hv_dr_work *dr_wrk;
  unsigned long flags;
+ bool pending_dr;
 
  dr_wrk = kzalloc(sizeof(*dr_wrk), GFP_NOWAIT);
  if (!dr_wrk)
@@ -1824,11 +1825,21 @@ static void hv_pci_devices_present(struct hv_pcibus_device *hbus,
  }
 
  spin_lock_irqsave(&hbus->device_list_lock, flags);
+ /*
+ * If pending_dr is true, we have already queued a work,
+ * which will see the new dr. Otherwise, we need to
+ * queue a new work.
+ */
+ pending_dr = !list_empty(&hbus->dr_list);
  list_add_tail(&dr->list_entry, &hbus->dr_list);
  spin_unlock_irqrestore(&hbus->device_list_lock, flags);
 
- get_hvpcibus(hbus);
- queue_work(hbus->wq, &dr_wrk->wrk);
+ if (pending_dr) {
+ kfree(dr_wrk);
+ } else {
+ get_hvpcibus(hbus);
+ queue_work(hbus->wq, &dr_wrk->wrk);
+ }
 }
 
 /**
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Bionic][PATCH 0/3] [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg

Colin Ian King-2
In reply to this post by Marcelo Henrique Cerri
On 08/06/18 19:39, Marcelo Henrique Cerri wrote:

> BugLink: http://bugs.launchpad.net/bugs/1758378
>
> That's intended to the regular bionic kernel (bionic/linux), since
> some azure users are hitting the same issue when using bionic/linux or
> xenial/linux-hwe-edge.
>
> Some of the fixes were already included by the update to v4.15.18 and
> the remaining patches are clean cherry picks from mainline only
> touching "drivers/pci/host/pci-hyperv.c".
>
> Dexuan Cui (3):
>   PCI: hv: Fix a comment typo in _hv_pcifront_read_config()
>   PCI: hv: Remove the bogus test in hv_eject_device_work()
>   PCI: hv: Only queue new work items in hv_pci_devices_present() if
>     necessary
>
>  drivers/pci/host/pci-hyperv.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
>
Clean cherry picks, looks sane to me.

Thanks Marcelo,

Acked-by: Colin Ian King <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Bionic][PATCH 0/3] [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg

Stefan Bader-2
In reply to this post by Marcelo Henrique Cerri
On 08.06.2018 11:39, Marcelo Henrique Cerri wrote:

> BugLink: http://bugs.launchpad.net/bugs/1758378
>
> That's intended to the regular bionic kernel (bionic/linux), since
> some azure users are hitting the same issue when using bionic/linux or
> xenial/linux-hwe-edge.
>
> Some of the fixes were already included by the update to v4.15.18 and
> the remaining patches are clean cherry picks from mainline only
> touching "drivers/pci/host/pci-hyperv.c".
>
> Dexuan Cui (3):
>   PCI: hv: Fix a comment typo in _hv_pcifront_read_config()
>   PCI: hv: Remove the bogus test in hv_eject_device_work()
>   PCI: hv: Only queue new work items in hv_pci_devices_present() if
>     necessary
>
>  drivers/pci/host/pci-hyperv.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
>
Acked-by: Stefan Bader <[hidden email]>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU][Bionic][PATCH 0/3] [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg

Khaled Elmously
In reply to this post by Marcelo Henrique Cerri
Applied to Bionic


On 2018-06-08 15:39:08 , Marcelo Henrique Cerri wrote:

> BugLink: http://bugs.launchpad.net/bugs/1758378
>
> That's intended to the regular bionic kernel (bionic/linux), since
> some azure users are hitting the same issue when using bionic/linux or
> xenial/linux-hwe-edge.
>
> Some of the fixes were already included by the update to v4.15.18 and
> the remaining patches are clean cherry picks from mainline only
> touching "drivers/pci/host/pci-hyperv.c".
>
> Dexuan Cui (3):
>   PCI: hv: Fix a comment typo in _hv_pcifront_read_config()
>   PCI: hv: Remove the bogus test in hv_eject_device_work()
>   PCI: hv: Only queue new work items in hv_pci_devices_present() if
>     necessary
>
>  drivers/pci/host/pci-hyperv.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
>
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team