Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1368783/?format=api
{ "id": 1368783, "url": "http://patchwork.ozlabs.org/api/patches/1368783/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20200922072931.2148-1-geert+renesas@glider.be/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20200922072931.2148-1-geert+renesas@glider.be>", "list_archive_url": null, "date": "2020-09-22T07:29:31", "name": "[net] Revert \"ravb: Fixed to be able to unload modules\"", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "7ae178bb31e21e53568dbfb8560e3a22648b651c", "submitter": { "id": 63808, "url": "http://patchwork.ozlabs.org/api/people/63808/?format=api", "name": "Geert Uytterhoeven", "email": "geert+renesas@glider.be" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20200922072931.2148-1-geert+renesas@glider.be/mbox/", "series": [ { "id": 203370, "url": "http://patchwork.ozlabs.org/api/series/203370/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=203370", "date": "2020-09-22T07:29:31", "name": "[net] Revert \"ravb: Fixed to be able to unload modules\"", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/203370/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1368783/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1368783/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming-netdev@ozlabs.org", "Delivered-To": "patchwork-incoming-netdev@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=23.128.96.18; helo=vger.kernel.org;\n envelope-from=netdev-owner@vger.kernel.org; receiver=<UNKNOWN>)", "ozlabs.org;\n dmarc=none (p=none dis=none) header.from=glider.be" ], "Received": [ "from vger.kernel.org (vger.kernel.org [23.128.96.18])\n\tby ozlabs.org (Postfix) with ESMTP id 4BwXxz73V6z9sTM\n\tfor <patchwork-incoming-netdev@ozlabs.org>;\n Tue, 22 Sep 2020 17:29:43 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n id S1730020AbgIVH3n (ORCPT\n <rfc822;patchwork-incoming-netdev@ozlabs.org>);\n Tue, 22 Sep 2020 03:29:43 -0400", "from lindbergh.monkeyblade.net ([23.128.96.19]:57330 \"EHLO\n lindbergh.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n with ESMTP id S1729762AbgIVH3m (ORCPT\n <rfc822;netdev@vger.kernel.org>); Tue, 22 Sep 2020 03:29:42 -0400", "from xavier.telenet-ops.be (xavier.telenet-ops.be\n [IPv6:2a02:1800:120:4::f00:14])\n by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4279EC0613CF\n for <netdev@vger.kernel.org>; Tue, 22 Sep 2020 00:29:42 -0700 (PDT)", "from ramsan ([84.195.186.194])\n by xavier.telenet-ops.be with bizsmtp\n id WvVc2300C4C55Sk01vVcpx; Tue, 22 Sep 2020 09:29:39 +0200", "from rox.of.borg ([192.168.97.57])\n by ramsan with esmtp (Exim 4.90_1)\n (envelope-from <geert@linux-m68k.org>)\n id 1kKck4-0005Uv-8l; Tue, 22 Sep 2020 09:29:36 +0200", "from geert by rox.of.borg with local (Exim 4.90_1)\n (envelope-from <geert@linux-m68k.org>)\n id 1kKck4-0000Zg-6j; Tue, 22 Sep 2020 09:29:36 +0200" ], "From": "Geert Uytterhoeven <geert+renesas@glider.be>", "To": "\"David S . Miller\" <davem@davemloft.net>,\n Jakub Kicinski <kuba@kernel.org>,\n Yuusuke Ashizuka <ashiduka@fujitsu.com>,\n Sergei Shtylyov <sergei.shtylyov@gmail.com>", "Cc": "Andrew Lunn <andrew@lunn.ch>,\n Heiner Kallweit <hkallweit1@gmail.com>,\n Russell King <linux@armlinux.org.uk>, netdev@vger.kernel.org,\n linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org,\n Geert Uytterhoeven <geert+renesas@glider.be>,\n stable@vger.kernel.org", "Subject": "[PATCH net] Revert \"ravb: Fixed to be able to unload modules\"", "Date": "Tue, 22 Sep 2020 09:29:31 +0200", "Message-Id": "<20200922072931.2148-1-geert+renesas@glider.be>", "X-Mailer": "git-send-email 2.17.1", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "This reverts commit 1838d6c62f57836639bd3d83e7855e0ee4f6defc.\n\nThis commit moved the ravb_mdio_init() call (and thus the\nof_mdiobus_register() call) from the ravb_probe() to the ravb_open()\ncall. This causes a regression during system resume (s2idle/s2ram), as\nnew PHY devices cannot be bound while suspended.\n\nDuring boot, the Micrel PHY is detected like this:\n\n Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=228)\n ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off\n\nDuring system suspend, (A) defer_all_probes is set to true, and (B)\nusermodehelper_disabled is set to UMH_DISABLED, to avoid drivers being\nprobed while suspended.\n\n A. If CONFIG_MODULES=n, phy_device_register() calling device_add()\n merely adds the device, but does not probe it yet, as\n really_probe() returns early due to defer_all_probes being set:\n\n dpm_resume+0x128/0x4f8\n\t device_resume+0xcc/0x1b0\n\t dpm_run_callback+0x74/0x340\n\t ravb_resume+0x190/0x1b8\n\t ravb_open+0x84/0x770\n\t\t of_mdiobus_register+0x1e0/0x468\n\t\t of_mdiobus_register_phy+0x1b8/0x250\n\t\t of_mdiobus_phy_device_register+0x178/0x1e8\n\t\t phy_device_register+0x114/0x1b8\n\t\t\t device_add+0x3d4/0x798\n\t\t\t bus_probe_device+0x98/0xa0\n\t\t\t device_initial_probe+0x10/0x18\n\t\t\t __device_attach+0xe4/0x140\n\t\t\t\t bus_for_each_drv+0x64/0xc8\n\t\t\t\t __device_attach_driver+0xb8/0xe0\n\t\t\t\t driver_probe_device.part.11+0xc4/0xd8\n\t\t\t\t really_probe+0x32c/0x3b8\n\n Later, phy_attach_direct() notices no PHY driver has been bound,\n and falls back to the Generic PHY, leading to degraded operation:\n\n Generic PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=POLL)\n ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off\n\n B. If CONFIG_MODULES=y, request_module() returns early with -EBUSY due\n to UMH_DISABLED, and MDIO initialization fails completely:\n\n mdio_bus e6800000.ethernet-ffffffff:00: error -16 loading PHY driver module for ID 0x00221622\n ravb e6800000.ethernet eth0: failed to initialize MDIO\n PM: dpm_run_callback(): ravb_resume+0x0/0x1b8 returns -16\n PM: Device e6800000.ethernet failed to resume: error -16\n\n Ignoring -EBUSY in phy_request_driver_module(), like was done for\n -ENOENT in commit 21e194425abd65b5 (\"net: phy: fix issue with loading\n PHY driver w/o initramfs\"), would makes it fall back to the Generic\n PHY, like in the CONFIG_MODULES=n case.\n\nSigned-off-by: Geert Uytterhoeven <geert+renesas@glider.be>\nCc: stable@vger.kernel.org\n---\nCommit 1838d6c62f578366 (\"ravb: Fixed to be able to unload modules\") was\nalready backported to stable v4.4, v4.9, v4.14, v4.19, v5.4, and v5.8),\nand thus needs to be reverted there, too.\n---\n drivers/net/ethernet/renesas/ravb_main.c | 110 +++++++++++------------\n 1 file changed, 55 insertions(+), 55 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c\nindex 5082c16bf9c060b2..9c4df4ede0111eae 100644\n--- a/drivers/net/ethernet/renesas/ravb_main.c\n+++ b/drivers/net/ethernet/renesas/ravb_main.c\n@@ -1339,51 +1339,6 @@ static inline int ravb_hook_irq(unsigned int irq, irq_handler_t handler,\n \treturn error;\n }\n \n-/* MDIO bus init function */\n-static int ravb_mdio_init(struct ravb_private *priv)\n-{\n-\tstruct platform_device *pdev = priv->pdev;\n-\tstruct device *dev = &pdev->dev;\n-\tint error;\n-\n-\t/* Bitbang init */\n-\tpriv->mdiobb.ops = &bb_ops;\n-\n-\t/* MII controller setting */\n-\tpriv->mii_bus = alloc_mdio_bitbang(&priv->mdiobb);\n-\tif (!priv->mii_bus)\n-\t\treturn -ENOMEM;\n-\n-\t/* Hook up MII support for ethtool */\n-\tpriv->mii_bus->name = \"ravb_mii\";\n-\tpriv->mii_bus->parent = dev;\n-\tsnprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, \"%s-%x\",\n-\t\t pdev->name, pdev->id);\n-\n-\t/* Register MDIO bus */\n-\terror = of_mdiobus_register(priv->mii_bus, dev->of_node);\n-\tif (error)\n-\t\tgoto out_free_bus;\n-\n-\treturn 0;\n-\n-out_free_bus:\n-\tfree_mdio_bitbang(priv->mii_bus);\n-\treturn error;\n-}\n-\n-/* MDIO bus release function */\n-static int ravb_mdio_release(struct ravb_private *priv)\n-{\n-\t/* Unregister mdio bus */\n-\tmdiobus_unregister(priv->mii_bus);\n-\n-\t/* Free bitbang info */\n-\tfree_mdio_bitbang(priv->mii_bus);\n-\n-\treturn 0;\n-}\n-\n /* Network device open function for Ethernet AVB */\n static int ravb_open(struct net_device *ndev)\n {\n@@ -1392,13 +1347,6 @@ static int ravb_open(struct net_device *ndev)\n \tstruct device *dev = &pdev->dev;\n \tint error;\n \n-\t/* MDIO bus init */\n-\terror = ravb_mdio_init(priv);\n-\tif (error) {\n-\t\tnetdev_err(ndev, \"failed to initialize MDIO\\n\");\n-\t\treturn error;\n-\t}\n-\n \tnapi_enable(&priv->napi[RAVB_BE]);\n \tnapi_enable(&priv->napi[RAVB_NC]);\n \n@@ -1476,7 +1424,6 @@ static int ravb_open(struct net_device *ndev)\n out_napi_off:\n \tnapi_disable(&priv->napi[RAVB_NC]);\n \tnapi_disable(&priv->napi[RAVB_BE]);\n-\travb_mdio_release(priv);\n \treturn error;\n }\n \n@@ -1786,8 +1733,6 @@ static int ravb_close(struct net_device *ndev)\n \travb_ring_free(ndev, RAVB_BE);\n \travb_ring_free(ndev, RAVB_NC);\n \n-\travb_mdio_release(priv);\n-\n \treturn 0;\n }\n \n@@ -1939,6 +1884,51 @@ static const struct net_device_ops ravb_netdev_ops = {\n \t.ndo_set_features\t= ravb_set_features,\n };\n \n+/* MDIO bus init function */\n+static int ravb_mdio_init(struct ravb_private *priv)\n+{\n+\tstruct platform_device *pdev = priv->pdev;\n+\tstruct device *dev = &pdev->dev;\n+\tint error;\n+\n+\t/* Bitbang init */\n+\tpriv->mdiobb.ops = &bb_ops;\n+\n+\t/* MII controller setting */\n+\tpriv->mii_bus = alloc_mdio_bitbang(&priv->mdiobb);\n+\tif (!priv->mii_bus)\n+\t\treturn -ENOMEM;\n+\n+\t/* Hook up MII support for ethtool */\n+\tpriv->mii_bus->name = \"ravb_mii\";\n+\tpriv->mii_bus->parent = dev;\n+\tsnprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, \"%s-%x\",\n+\t\t pdev->name, pdev->id);\n+\n+\t/* Register MDIO bus */\n+\terror = of_mdiobus_register(priv->mii_bus, dev->of_node);\n+\tif (error)\n+\t\tgoto out_free_bus;\n+\n+\treturn 0;\n+\n+out_free_bus:\n+\tfree_mdio_bitbang(priv->mii_bus);\n+\treturn error;\n+}\n+\n+/* MDIO bus release function */\n+static int ravb_mdio_release(struct ravb_private *priv)\n+{\n+\t/* Unregister mdio bus */\n+\tmdiobus_unregister(priv->mii_bus);\n+\n+\t/* Free bitbang info */\n+\tfree_mdio_bitbang(priv->mii_bus);\n+\n+\treturn 0;\n+}\n+\n static const struct of_device_id ravb_match_table[] = {\n \t{ .compatible = \"renesas,etheravb-r8a7790\", .data = (void *)RCAR_GEN2 },\n \t{ .compatible = \"renesas,etheravb-r8a7794\", .data = (void *)RCAR_GEN2 },\n@@ -2213,6 +2203,13 @@ static int ravb_probe(struct platform_device *pdev)\n \t\teth_hw_addr_random(ndev);\n \t}\n \n+\t/* MDIO bus init */\n+\terror = ravb_mdio_init(priv);\n+\tif (error) {\n+\t\tdev_err(&pdev->dev, \"failed to initialize MDIO\\n\");\n+\t\tgoto out_dma_free;\n+\t}\n+\n \tnetif_napi_add(ndev, &priv->napi[RAVB_BE], ravb_poll, 64);\n \tnetif_napi_add(ndev, &priv->napi[RAVB_NC], ravb_poll, 64);\n \n@@ -2234,6 +2231,8 @@ static int ravb_probe(struct platform_device *pdev)\n out_napi_del:\n \tnetif_napi_del(&priv->napi[RAVB_NC]);\n \tnetif_napi_del(&priv->napi[RAVB_BE]);\n+\travb_mdio_release(priv);\n+out_dma_free:\n \tdma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat,\n \t\t\t priv->desc_bat_dma);\n \n@@ -2265,6 +2264,7 @@ static int ravb_remove(struct platform_device *pdev)\n \tunregister_netdev(ndev);\n \tnetif_napi_del(&priv->napi[RAVB_NC]);\n \tnetif_napi_del(&priv->napi[RAVB_BE]);\n+\travb_mdio_release(priv);\n \tpm_runtime_disable(&pdev->dev);\n \tfree_netdev(ndev);\n \tplatform_set_drvdata(pdev, NULL);\n", "prefixes": [ "net" ] }