]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 12:55:05 +0000 (13:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 12:55:05 +0000 (13:55 +0100)
added patches:
driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch
ravb-fix-failed-to-switch-device-to-config-mode-message-during-unbind.patch

queue-4.14/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch [new file with mode: 0644]
queue-4.14/ravb-fix-failed-to-switch-device-to-config-mode-message-during-unbind.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch b/queue-4.14/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch
new file mode 100644 (file)
index 0000000..65ee2d0
--- /dev/null
@@ -0,0 +1,48 @@
+From 27c0d217340e47ec995557f61423ef415afba987 Mon Sep 17 00:00:00 2001
+From: "Isaac J. Manjarres" <isaacmanjarres@google.com>
+Date: Tue, 20 Sep 2022 17:14:13 -0700
+Subject: driver core: Fix bus_type.match() error handling in __driver_attach()
+
+From: Isaac J. Manjarres <isaacmanjarres@google.com>
+
+commit 27c0d217340e47ec995557f61423ef415afba987 upstream.
+
+When a driver registers with a bus, it will attempt to match with every
+device on the bus through the __driver_attach() function. Currently, if
+the bus_type.match() function encounters an error that is not
+-EPROBE_DEFER, __driver_attach() will return a negative error code, which
+causes the driver registration logic to stop trying to match with the
+remaining devices on the bus.
+
+This behavior is not correct; a failure while matching a driver to a
+device does not mean that the driver won't be able to match and bind
+with other devices on the bus. Update the logic in __driver_attach()
+to reflect this.
+
+Fixes: 656b8035b0ee ("ARM: 8524/1: driver cohandle -EPROBE_DEFER from bus_type.match()")
+Cc: stable@vger.kernel.org
+Cc: Saravana Kannan <saravanak@google.com>
+Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
+Link: https://lore.kernel.org/r/20220921001414.4046492-1-isaacmanjarres@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/base/dd.c |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/base/dd.c
++++ b/drivers/base/dd.c
+@@ -785,8 +785,12 @@ static int __driver_attach(struct device
+                */
+               return 0;
+       } else if (ret < 0) {
+-              dev_dbg(dev, "Bus failed to match device: %d", ret);
+-              return ret;
++              dev_dbg(dev, "Bus failed to match device: %d\n", ret);
++              /*
++               * Driver could not match with device, but may match with
++               * another device on the bus.
++               */
++              return 0;
+       } /* ret > 0 means positive match */
+       if (dev->parent)        /* Needed for USB */
diff --git a/queue-4.14/ravb-fix-failed-to-switch-device-to-config-mode-message-during-unbind.patch b/queue-4.14/ravb-fix-failed-to-switch-device-to-config-mode-message-during-unbind.patch
new file mode 100644 (file)
index 0000000..2ebb86a
--- /dev/null
@@ -0,0 +1,63 @@
+From c72a7e42592b2e18d862cf120876070947000d7a Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das.jz@bp.renesas.com>
+Date: Wed, 14 Dec 2022 10:51:18 +0000
+Subject: ravb: Fix "failed to switch device to config mode" message during unbind
+
+From: Biju Das <biju.das.jz@bp.renesas.com>
+
+commit c72a7e42592b2e18d862cf120876070947000d7a upstream.
+
+This patch fixes the error "ravb 11c20000.ethernet eth0: failed to switch
+device to config mode" during unbind.
+
+We are doing register access after pm_runtime_put_sync().
+
+We usually do cleanup in reverse order of init. Currently in
+remove(), the "pm_runtime_put_sync" is not in reverse order.
+
+Probe
+       reset_control_deassert(rstc);
+       pm_runtime_enable(&pdev->dev);
+       pm_runtime_get_sync(&pdev->dev);
+
+remove
+       pm_runtime_put_sync(&pdev->dev);
+       unregister_netdev(ndev);
+       ..
+       ravb_mdio_release(priv);
+       pm_runtime_disable(&pdev->dev);
+
+Consider the call to unregister_netdev()
+unregister_netdev->unregister_netdevice_queue->rollback_registered_many
+that calls the below functions which access the registers after
+pm_runtime_put_sync()
+ 1) ravb_get_stats
+ 2) ravb_close
+
+Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
+Cc: stable@vger.kernel.org
+Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
+Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
+Link: https://lore.kernel.org/r/20221214105118.2495313-1-biju.das.jz@bp.renesas.com
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/renesas/ravb_main.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/renesas/ravb_main.c
++++ b/drivers/net/ethernet/renesas/ravb_main.c
+@@ -2195,11 +2195,11 @@ static int ravb_remove(struct platform_d
+                         priv->desc_bat_dma);
+       /* Set reset mode */
+       ravb_write(ndev, CCC_OPC_RESET, CCC);
+-      pm_runtime_put_sync(&pdev->dev);
+       unregister_netdev(ndev);
+       netif_napi_del(&priv->napi[RAVB_NC]);
+       netif_napi_del(&priv->napi[RAVB_BE]);
+       ravb_mdio_release(priv);
++      pm_runtime_put_sync(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
+       free_netdev(ndev);
+       platform_set_drvdata(pdev, NULL);
index 1713ec6b60aaf8d0b9fcad19f2cc76172f7dab28..b47a34fa51343f673913a2e12fb8d97d52a5feb0 100644 (file)
@@ -319,3 +319,5 @@ nfsd-fix-handling-of-readdir-in-v4root-vs.-mount-upcall-timeout.patch
 hfs-hfsplus-use-warn_on-for-sanity-check.patch
 hfs-hfsplus-avoid-warn_on-for-sanity-check-use-proper-error-handling.patch
 parisc-align-parisc-madv_xxx-constants-with-all-other-architectures.patch
+driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch
+ravb-fix-failed-to-switch-device-to-config-mode-message-during-unbind.patch