diff for duplicates of <20261023163715.695355017@linuxfoundation.org> diff --git a/a/1.txt b/N1/1.txt index ccecf6b..22e24b2 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,65 +1,52 @@ -6.18-stable review patch. If anyone has any objections, please let me know. +7.2-stable review patch. If anyone has any objections, please let me know. ------------------ -From: Peng Fan <peng.fan@nxp.com> +From: David Yang <mmyangfl@gmail.com> -[ Upstream commit 38d44f78f041ffe60c8e2443b99434a199e7541d ] +[ Upstream commit d71483f0716e7ae98578817bfdc8a5b822d250f8 ] -mxc_update_irq_chained_handler() is called before the IRQ domain, the -generic IRQ chip, and the port list entry are set up. If an interrupt -arrives in that window: +greth_of_probe() calls greth_mdio_init(), which connects the PHY, +before dev->netdev_ops is assigned. phy_attach_direct() -> +phy_link_topo_add_phy() reads dev->netdev_ops through +netdev_need_ops_lock() since the commit in question, so probing crashes +with a NULL pointer dereference when CONFIG_NET_SHAPER is enabled. - - mx3_gpio_irq_handler() calls generic_handle_domain_irq() with - port->domain still NULL. - - mx2_gpio_irq_handler() walks mxc_gpio_ports, but the port has not - been added to the list yet. +Assign netdev_ops before the PHY attach, as was done for emac in commit +7c9f391ec89c ("net: emac: move setting of netops to fix crash"). -Additionally, if any of the subsequent probe steps -(gpio_generic_chip_init(), devm_gpiochip_add_data(), -irq_domain_create_legacy(), or mxc_gpio_init_gc()) fail, the error -paths never unregister the chained handler, leaving a dangling handler -that points at freed memory. - -Move the handler installation after all its dependencies are ready and -after list_add_tail(), so the handler is never live while the data -structures it touches are incomplete, and is never installed if probe -fails. - -Fixes: 5f6d1998adeb ("gpio: mxc: release the parent IRQ in runtime suspend") -Assisted-by: LLM -Reviewed-by: Frank Li <Frank.Li@nxp.com> -Signed-off-by: Peng Fan <peng.fan@nxp.com> -Reviewed-by: Linus Walleij <linusw@kernel.org> -Reviewed-by: Andy Shevchenko <andy@kernel.org> -Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-1-c4d769587d3e@nxp.com -Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> +Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion") +Signed-off-by: David Yang <mmyangfl@gmail.com> +Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> +Acked-by: Andreas Larsson <andreas@gaisler.com> +Link: https://patch.msgid.link/20261008022656.3592191-9-mmyangfl@gmail.com +Reviewed-by: Jijie Shao <shaojijie@huawei.com> +Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org> --- - drivers/gpio/gpio-mxc.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c -index 12f11a6c96653..9c4db51489730 100644 ---- a/drivers/gpio/gpio-mxc.c -+++ b/drivers/gpio/gpio-mxc.c -@@ -474,8 +474,6 @@ static int mxc_gpio_probe(struct platform_device *pdev) - } else - port->mx_irq_handler = mx3_gpio_irq_handler; + drivers/net/ethernet/aeroflex/greth.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c +index a593adc16c78a..fccb67beebee1 100644 +--- a/drivers/net/ethernet/aeroflex/greth.c ++++ b/drivers/net/ethernet/aeroflex/greth.c +@@ -1421,6 +1421,8 @@ static int greth_of_probe(struct platform_device *ofdev) + /* Check if MAC can handle MDIO interrupts */ + greth->mdio_int_en = (tmp >> 26) & 1; -- mxc_update_irq_chained_handler(port, true); -- - config.dev = &pdev->dev; - config.sz = 4; - config.dat = port->base + GPIO_PSR; -@@ -525,6 +523,8 @@ static int mxc_gpio_probe(struct platform_device *pdev) - - list_add_tail(&port->node, &mxc_gpio_ports); - -+ mxc_update_irq_chained_handler(port, true); ++ dev->netdev_ops = &greth_netdev_ops; + - platform_set_drvdata(pdev, port); - pm_runtime_put_autosuspend(&pdev->dev); + err = greth_mdio_init(greth); + if (err) { + if (netif_msg_probe(greth)) +@@ -1498,7 +1500,6 @@ static int greth_of_probe(struct platform_device *ofdev) + dev->flags &= ~IFF_MULTICAST; + } + +- dev->netdev_ops = &greth_netdev_ops; + dev->ethtool_ops = &greth_ethtool_ops; + err = register_netdev(dev); -- 2.53.0 diff --git a/a/content_digest b/N1/content_digest index b148af4..ad3d494 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,82 +1,69 @@ - "ref\020261023163714.201276352@linuxfoundation.org\0" + "ref\020261023163713.816071858@linuxfoundation.org\0" "From\0Greg Kroah-Hartman <gregkh@linuxfoundation.org>\0" - "Subject\0[PATCH 6.18 063/193] gpio: mxc: fix race between chained IRQ handler install and probe completion\0" - "Date\0Fri, 23 Oct 2026 18:35:40 +0200\0" + "Subject\0[PATCH 7.2 081/242] net: ethernet: aeroflex: move setting of netops to fix crash\0" + "Date\0Fri, 23 Oct 2026 18:38:43 +0200\0" "To\0stable@vger.kernel.org\0" "Cc\0Greg Kroah-Hartman <gregkh@linuxfoundation.org>" patches@lists.linux.dev - Frank Li <Frank.Li@nxp.com> - Peng Fan <peng.fan@nxp.com> - Linus Walleij <linusw@kernel.org> - Andy Shevchenko <andy@kernel.org> - Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> + David Yang <mmyangfl@gmail.com> + Maxime Chevallier <maxime.chevallier@bootlin.com> + Andreas Larsson <andreas@gaisler.com> + Jijie Shao <shaojijie@huawei.com> + Paolo Abeni <pabeni@redhat.com> " Sasha Levin <sashal@kernel.org>\0" "\00:1\0" "b\0" - "6.18-stable review patch. If anyone has any objections, please let me know.\n" + "7.2-stable review patch. If anyone has any objections, please let me know.\n" "\n" "------------------\n" "\n" - "From: Peng Fan <peng.fan@nxp.com>\n" + "From: David Yang <mmyangfl@gmail.com>\n" "\n" - "[ Upstream commit 38d44f78f041ffe60c8e2443b99434a199e7541d ]\n" + "[ Upstream commit d71483f0716e7ae98578817bfdc8a5b822d250f8 ]\n" "\n" - "mxc_update_irq_chained_handler() is called before the IRQ domain, the\n" - "generic IRQ chip, and the port list entry are set up. If an interrupt\n" - "arrives in that window:\n" + "greth_of_probe() calls greth_mdio_init(), which connects the PHY,\n" + "before dev->netdev_ops is assigned. phy_attach_direct() ->\n" + "phy_link_topo_add_phy() reads dev->netdev_ops through\n" + "netdev_need_ops_lock() since the commit in question, so probing crashes\n" + "with a NULL pointer dereference when CONFIG_NET_SHAPER is enabled.\n" "\n" - " - mx3_gpio_irq_handler() calls generic_handle_domain_irq() with\n" - " port->domain still NULL.\n" - " - mx2_gpio_irq_handler() walks mxc_gpio_ports, but the port has not\n" - " been added to the list yet.\n" + "Assign netdev_ops before the PHY attach, as was done for emac in commit\n" + "7c9f391ec89c (\"net: emac: move setting of netops to fix crash\").\n" "\n" - "Additionally, if any of the subsequent probe steps\n" - "(gpio_generic_chip_init(), devm_gpiochip_add_data(),\n" - "irq_domain_create_legacy(), or mxc_gpio_init_gc()) fail, the error\n" - "paths never unregister the chained handler, leaving a dangling handler\n" - "that points at freed memory.\n" - "\n" - "Move the handler installation after all its dependencies are ready and\n" - "after list_add_tail(), so the handler is never live while the data\n" - "structures it touches are incomplete, and is never installed if probe\n" - "fails.\n" - "\n" - "Fixes: 5f6d1998adeb (\"gpio: mxc: release the parent IRQ in runtime suspend\")\n" - "Assisted-by: LLM\n" - "Reviewed-by: Frank Li <Frank.Li@nxp.com>\n" - "Signed-off-by: Peng Fan <peng.fan@nxp.com>\n" - "Reviewed-by: Linus Walleij <linusw@kernel.org>\n" - "Reviewed-by: Andy Shevchenko <andy@kernel.org>\n" - "Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-1-c4d769587d3e@nxp.com\n" - "Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>\n" + "Fixes: ded86da4bbb7 (\"net: ethtool: relax ethnl_req_get_phydev() locking assertion\")\n" + "Signed-off-by: David Yang <mmyangfl@gmail.com>\n" + "Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>\n" + "Acked-by: Andreas Larsson <andreas@gaisler.com>\n" + "Link: https://patch.msgid.link/20261008022656.3592191-9-mmyangfl@gmail.com\n" + "Reviewed-by: Jijie Shao <shaojijie@huawei.com>\n" + "Signed-off-by: Paolo Abeni <pabeni@redhat.com>\n" "Signed-off-by: Sasha Levin <sashal@kernel.org>\n" "---\n" - " drivers/gpio/gpio-mxc.c | 4 ++--\n" - " 1 file changed, 2 insertions(+), 2 deletions(-)\n" + " drivers/net/ethernet/aeroflex/greth.c | 3 ++-\n" + " 1 file changed, 2 insertions(+), 1 deletion(-)\n" "\n" - "diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c\n" - "index 12f11a6c96653..9c4db51489730 100644\n" - "--- a/drivers/gpio/gpio-mxc.c\n" - "+++ b/drivers/gpio/gpio-mxc.c\n" - "@@ -474,8 +474,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)\n" - " \t} else\n" - " \t\tport->mx_irq_handler = mx3_gpio_irq_handler;\n" - " \n" - "-\tmxc_update_irq_chained_handler(port, true);\n" - "-\n" - " \tconfig.dev = &pdev->dev;\n" - " \tconfig.sz = 4;\n" - " \tconfig.dat = port->base + GPIO_PSR;\n" - "@@ -525,6 +523,8 @@ static int mxc_gpio_probe(struct platform_device *pdev)\n" + "diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c\n" + "index a593adc16c78a..fccb67beebee1 100644\n" + "--- a/drivers/net/ethernet/aeroflex/greth.c\n" + "+++ b/drivers/net/ethernet/aeroflex/greth.c\n" + "@@ -1421,6 +1421,8 @@ static int greth_of_probe(struct platform_device *ofdev)\n" + " \t/* Check if MAC can handle MDIO interrupts */\n" + " \tgreth->mdio_int_en = (tmp >> 26) & 1;\n" " \n" - " \tlist_add_tail(&port->node, &mxc_gpio_ports);\n" - " \n" - "+\tmxc_update_irq_chained_handler(port, true);\n" + "+\tdev->netdev_ops = &greth_netdev_ops;\n" "+\n" - " \tplatform_set_drvdata(pdev, port);\n" - " \tpm_runtime_put_autosuspend(&pdev->dev);\n" + " \terr = greth_mdio_init(greth);\n" + " \tif (err) {\n" + " \t\tif (netif_msg_probe(greth))\n" + "@@ -1498,7 +1500,6 @@ static int greth_of_probe(struct platform_device *ofdev)\n" + " \t\tdev->flags &= ~IFF_MULTICAST;\n" + " \t}\n" + " \n" + "-\tdev->netdev_ops = &greth_netdev_ops;\n" + " \tdev->ethtool_ops = &greth_ethtool_ops;\n" " \n" + " \terr = register_netdev(dev);\n" "-- \n" 2.53.0 -0351285b7065ad2a774a06b1c1509392566b2a17219af5b946848aafc522ff79 +fe48f576d404af64bf7238638afb92bbe620c916022d0ffad2164e1930e883ed
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.