linux-2.6-microblaze.git
9 months agonet: ethernet: ibm: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:56 +0000 (22:41 +0200)]
net: ethernet: ibm: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these drivers from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: i825xx: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:55 +0000 (22:41 +0200)]
net: ethernet: i825xx: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: hisilicon: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:54 +0000 (22:41 +0200)]
net: ethernet: hisilicon: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these drivers from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: faraday: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:53 +0000 (22:41 +0200)]
net: ethernet: faraday: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these drivers from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: ethoc: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:52 +0000 (22:41 +0200)]
net: ethernet: ethoc: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: engleder: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:51 +0000 (22:41 +0200)]
net: ethernet: engleder: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: dnet: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:50 +0000 (22:41 +0200)]
net: ethernet: dnet: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: davicom: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:49 +0000 (22:41 +0200)]
net: ethernet: davicom: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: cortina: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:48 +0000 (22:41 +0200)]
net: ethernet: cortina: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: cirrus: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:47 +0000 (22:41 +0200)]
net: ethernet: cirrus: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these drivers from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: cavium: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:46 +0000 (22:41 +0200)]
net: ethernet: cavium: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: calxeda: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:45 +0000 (22:41 +0200)]
net: ethernet: calxeda: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: cadence: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:44 +0000 (22:41 +0200)]
net: ethernet: cadence: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: broadcom: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:43 +0000 (22:41 +0200)]
net: ethernet: broadcom: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these drivers from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: atheros: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:42 +0000 (22:41 +0200)]
net: ethernet: atheros: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: arc: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:41 +0000 (22:41 +0200)]
net: ethernet: arc: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these drivers from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: apple: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:40 +0000 (22:41 +0200)]
net: ethernet: apple: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: apm: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:39 +0000 (22:41 +0200)]
net: ethernet: apm: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: amd: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:38 +0000 (22:41 +0200)]
net: ethernet: amd: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these drivers from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: altera: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:37 +0000 (22:41 +0200)]
net: ethernet: altera: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: allwinner: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:36 +0000 (22:41 +0200)]
net: ethernet: allwinner: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: aeroflex: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:35 +0000 (22:41 +0200)]
net: ethernet: aeroflex: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: actions: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:34 +0000 (22:41 +0200)]
net: ethernet: actions: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: ethernet: 8390: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 18 Sep 2023 20:41:33 +0000 (22:41 +0200)]
net: ethernet: 8390: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert these drivers from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoMerge branch 'add-wed-support-for-mt7988-chipset'
Paolo Abeni [Tue, 19 Sep 2023 16:27:58 +0000 (18:27 +0200)]
Merge branch 'add-wed-support-for-mt7988-chipset'

Lorenzo Bianconi says:

====================
Add WED support for MT7988 chipset

Similar to MT7622 and MT7986, introduce Wireless Ethernet Dispatcher (WED)
support for MT7988 chipset in order to offload to the hw packet engine traffic
received from LAN/WAN device to WLAN nic (MT7996E).
Add WED RX support in order to offload traffic received by WLAN nic to the
wired interfaces (LAN/WAN).
====================

Link: https://lore.kernel.org/r/cover.1695032290.git.lorenzo@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: add wed 3.0 reset support
Sujuan Chen [Mon, 18 Sep 2023 10:29:19 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: add wed 3.0 reset support

Introduce support for resetting Wireless Ethernet Dispatcher 3.0
available on MT988 SoC.

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: debugfs: add WED 3.0 debugfs entries
Sujuan Chen [Mon, 18 Sep 2023 10:29:18 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: debugfs: add WED 3.0 debugfs entries

Introduce WED3.0 debugfs entries useful for debugging.

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: debugfs: move wed_v2 specific regs out of regs array
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:17 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: debugfs: move wed_v2 specific regs out of regs array

Move specific WED2.0 debugfs entries out of regs array. This is a
preliminary patch to introduce WED 3.0 debugfs info.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: introduce hw_rro support for MT7988
Sujuan Chen [Mon, 18 Sep 2023 10:29:16 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: introduce hw_rro support for MT7988

MT7988 SoC support 802.11 receive reordering offload in hw while
MT7986 SoC implements it through the firmware running on the mcu.

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: introduce partial AMSDU offload support for MT7988
Sujuan Chen [Mon, 18 Sep 2023 10:29:15 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: introduce partial AMSDU offload support for MT7988

Introduce partial AMSDU offload support for MT7988 SoC in order to merge
in hw packets belonging to the same AMSDU before passing them to the
WLAN nic.

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: refactor mtk_wed_check_wfdma_rx_fill routine
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:14 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: refactor mtk_wed_check_wfdma_rx_fill routine

Refactor mtk_wed_check_wfdma_rx_fill() in order to be reused adding HW
receive offload support for MT7988 SoC.

Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: introduce WED support for MT7988
Sujuan Chen [Mon, 18 Sep 2023 10:29:13 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: introduce WED support for MT7988

Similar to MT7986 and MT7622, enable Wireless Ethernet Ditpatcher for
MT7988 in order to offload traffic forwarded from LAN/WLAN to WLAN/LAN

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: add mtk_wed_soc_data structure
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:12 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: add mtk_wed_soc_data structure

Introduce mtk_wed_soc_data utility structure to contain per-SoC
definitions.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: fix EXT_INT_STATUS_RX_FBUF definitions for MT7986 SoC
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:11 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: fix EXT_INT_STATUS_RX_FBUF definitions for MT7986 SoC

Fix MTK_WED_EXT_INT_STATUS_RX_FBUF_LO_TH and
MTK_WED_EXT_INT_STATUS_RX_FBUF_HI_TH definitions for MT7986 (MT7986 is
the only SoC to use them).

Fixes: de84a090d99a ("net: ethernet: mtk_eth_wed: add wed support for mt7986 chipset")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: make memory region optional
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:10 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: make memory region optional

Make mtk_wed_wo_memory_region optionals.
This is a preliminary patch to introduce Wireless Ethernet Dispatcher
support for MT7988 SoC since MT7988 WED fw image will have a different
layout.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: move mem_region array out of mtk_wed_mcu_load_firmware
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:09 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: move mem_region array out of mtk_wed_mcu_load_firmware

Remove mtk_wed_wo_memory_region boot structure in mtk_wed_wo.
This is a preliminary patch to introduce WED support for MT7988 SoC.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: introduce mtk_wed_buf structure
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:08 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: introduce mtk_wed_buf structure

Introduce mtk_wed_buf structure to store both virtual and physical
addresses allocated in mtk_wed_tx_buffer_alloc() routine. This is a
preliminary patch to add WED support for MT7988 SoC since it relies on a
different dma descriptor layout not storing page dma addresses.

Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: rename mtk_rxbm_desc in mtk_wed_bm_desc
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:07 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: rename mtk_rxbm_desc in mtk_wed_bm_desc

Rename mtk_rxbm_desc structure in mtk_wed_bm_desc since it will be used
even on tx side by MT7988 SoC.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: do not configure rx offload if not supported
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:06 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: do not configure rx offload if not supported

Check if rx offload is supported running mtk_wed_get_rx_capa routine
before configuring it. This is a preliminary patch to introduce Wireless
Ethernet Dispatcher (WED) support for MT7988 SoC.

Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: ethernet: mtk_wed: introduce versioning utility routines
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:05 +0000 (12:29 +0200)]
net: ethernet: mtk_wed: introduce versioning utility routines

Similar to mtk_eth_soc, introduce the following wed versioning
utility routines:
- mtk_wed_is_v1
- mtk_wed_is_v2

This is a preliminary patch to introduce WED support for MT7988 SoC

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agodt-bindings: arm: mediatek: mt7622-wed: add WED binding for MT7988 SoC
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:04 +0000 (12:29 +0200)]
dt-bindings: arm: mediatek: mt7622-wed: add WED binding for MT7988 SoC

Introduce MT7988 SoC compatibility string in mtk_wed binding.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agodt-bindings: soc: mediatek: mt7986-wo-ccif: add binding for MT7988 SoC
Lorenzo Bianconi [Mon, 18 Sep 2023 10:29:03 +0000 (12:29 +0200)]
dt-bindings: soc: mediatek: mt7986-wo-ccif: add binding for MT7988 SoC

Introduce MT7988 SoC compatibility string in mt7986-wo-ccif binding.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agoipv6: lockless IPV6_ADDR_PREFERENCES implementation
Eric Dumazet [Mon, 18 Sep 2023 14:23:21 +0000 (14:23 +0000)]
ipv6: lockless IPV6_ADDR_PREFERENCES implementation

We have data-races while reading np->srcprefs

Switch the field to a plain byte, add READ_ONCE()
and WRITE_ONCE() annotations where needed,
and IPV6_ADDR_PREFERENCES setsockopt() can now be lockless.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20230918142321.1794107-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: phy: fix regression with AX88772A PHY driver
Russell King (Oracle) [Mon, 18 Sep 2023 13:25:36 +0000 (14:25 +0100)]
net: phy: fix regression with AX88772A PHY driver

Marek reports that a deadlock occurs with the AX88772A PHY used on the
ASIX USB network driver:

asix 1-1.4:1.0 (unnamed net_device) (uninitialized): PHY [usb-001:003:10] driver [Asix Electronics AX88772A] (irq=POLL)
Asix Electronics AX88772A usb-001:003:10: attached PHY driver(mii_bus:phy_addr=usb-001:003:10, irq=POLL)
asix 1-1.4:1.0 eth0: register 'asix' at usb-12110000.usb-1.4, ASIX AX88772 USB 2.0 Ethernet, a2:99:b6:cd:11:eb
asix 1-1.4:1.0 eth0: configuring for phy/internal link mode

============================================
WARNING: possible recursive locking detected
6.6.0-rc1-00239-g8da77df649c4-dirty #13949 Not tainted
--------------------------------------------
kworker/3:3/71 is trying to acquire lock:
c6c704cc (&dev->lock){+.+.}-{3:3}, at: phy_start_aneg+0x1c/0x38

but task is already holding lock:
c6c704cc (&dev->lock){+.+.}-{3:3}, at: phy_state_machine+0x100/0x2b8

This is because we now consistently call phy_process_state_change()
while holding phydev->lock, but the AX88772A PHY driver then goes on
to call phy_start_aneg() which tries to grab the same lock - causing
deadlock.

Fix this by exporting the unlocked version, and use this in the PHY
driver instead.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: ef113a60d0a9 ("net: phy: call phy_error_precise() while holding the lock")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/E1qiEFs-007g7b-Lq@rmk-PC.armlinux.org.uk
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agonet: dsa: microchip: Fix spelling mistake "unxpexted" -> "unexpected"
Colin Ian King [Mon, 18 Sep 2023 13:21:42 +0000 (14:21 +0100)]
net: dsa: microchip: Fix spelling mistake "unxpexted" -> "unexpected"

There is a spelling mistake in a dev_err message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20230918132142.199638-1-colin.i.king@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agoocteon_ep: restructured interrupt handlers
Shinas Rasheed [Mon, 18 Sep 2023 06:56:21 +0000 (23:56 -0700)]
octeon_ep: restructured interrupt handlers

Separated queue specific interrupts to register to individual msix-vectors
instead of using a single generic interrupt handler on a single
msix-vector.

Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Link: https://lore.kernel.org/r/20230918065621.2165449-1-srasheed@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
9 months agoMerge branch 'stmmac-devvm_stmmac_probe_config_dt-conversion'
David S. Miller [Mon, 18 Sep 2023 11:44:36 +0000 (12:44 +0100)]
Merge branch 'stmmac-devvm_stmmac_probe_config_dt-conversion'

Jisheng Zhang says:

====================
stmmac: convert to devm_stmmac_probe_config_dt

Russell pointed out there's a new devm_stmmac_probe_config_dt()
helper now when reviewing my starfive gmac error handling patch[1].
After greping the code, this nice helper was introduced by Bartosz in
[2], I think it's time to convert all dwmac users to this helper and
finally complete the TODO in [2] "but once all users of the old
stmmac_pltfr_remove() are converted to the devres helper, it will be
renamed back to stmmac_pltfr_remove() and the no_dt function removed."

Link: https://lore.kernel.org/netdev/ZOtWmedBsa6wQQ6+@shell.armlinux.org.uk/
Link: https://lore.kernel.org/all/20230623100417.93592-1-brgl@bgdev.pl/
Since v1:
 - rebase on new net-next
 - add make stmmac_{probe|remove}_config_dt static as suggested by Russell.
====================

Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: make stmmac_{probe|remove}_config_dt static
Jisheng Zhang [Sat, 16 Sep 2023 07:58:29 +0000 (15:58 +0800)]
net: stmmac: make stmmac_{probe|remove}_config_dt static

Now there's no external users of these two functions, make them static
so that there aren't any new usages of stmmac_probe_config_dt().

To avoid forward declaration, move stmmac_remove_config_dt() location.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Suggested-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove
Jisheng Zhang [Sat, 16 Sep 2023 07:58:28 +0000 (15:58 +0800)]
net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove

Now, all users of the old stmmac_pltfr_remove() are converted to the
devres helper, it's time to rename stmmac_pltfr_remove_no_dt() back to
stmmac_pltfr_remove() and remove the old stmmac_pltfr_remove().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-visconti: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:27 +0000 (15:58 +0800)]
net: stmmac: dwmac-visconti: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The calling of stmmac_pltfr_remove() now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-tegra: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:26 +0000 (15:58 +0800)]
net: stmmac: dwmac-tegra: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The calling of stmmac_pltfr_remove() now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-sunxi: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:25 +0000 (15:58 +0800)]
net: stmmac: dwmac-sunxi: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-sun8i: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:24 +0000 (15:58 +0800)]
net: stmmac: dwmac-sun8i: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The calling of stmmac_pltfr_remove() now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-stm32: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:23 +0000 (15:58 +0800)]
net: stmmac: dwmac-stm32: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-sti: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:22 +0000 (15:58 +0800)]
net: stmmac: dwmac-sti: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-starfive: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:21 +0000 (15:58 +0800)]
net: stmmac: dwmac-starfive: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-socfpga: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:20 +0000 (15:58 +0800)]
net: stmmac: dwmac-socfpga: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The calling of stmmac_pltfr_remove() now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-rk: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:19 +0000 (15:58 +0800)]
net: stmmac: dwmac-rk: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-meson8b: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:18 +0000 (15:58 +0800)]
net: stmmac: dwmac-meson8b: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-meson: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:17 +0000 (15:58 +0800)]
net: stmmac: dwmac-meson: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-mediatek: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:16 +0000 (15:58 +0800)]
net: stmmac: dwmac-mediatek: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The calling of stmmac_pltfr_remove() now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-lpc18xx: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:15 +0000 (15:58 +0800)]
net: stmmac: dwmac-lpc18xx: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-ipq806x: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:14 +0000 (15:58 +0800)]
net: stmmac: dwmac-ipq806x: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-intel-plat: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:13 +0000 (15:58 +0800)]
net: stmmac: dwmac-intel-plat: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The calling of stmmac_pltfr_remove() now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-ingenic: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:12 +0000 (15:58 +0800)]
net: stmmac: dwmac-ingenic: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-imx: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:11 +0000 (15:58 +0800)]
net: stmmac: dwmac-imx: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-generic: use devm_stmmac_pltfr_probe()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:10 +0000 (15:58 +0800)]
net: stmmac: dwmac-generic: use devm_stmmac_pltfr_probe()

Use the devres variant of stmmac_pltfr_probe() and finally drop the
remove() hook.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-generic: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:09 +0000 (15:58 +0800)]
net: stmmac: dwmac-generic: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-dwc-qos-eth: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:08 +0000 (15:58 +0800)]
net: stmmac: dwmac-dwc-qos-eth: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: dwmac-anarion: use devm_stmmac_probe_config_dt()
Jisheng Zhang [Sat, 16 Sep 2023 07:58:07 +0000 (15:58 +0800)]
net: stmmac: dwmac-anarion: use devm_stmmac_probe_config_dt()

Simplify the driver's probe() function by using the devres
variant of stmmac_probe_config_dt().

The remove_new() callback now needs to be switched to
stmmac_pltfr_remove_no_dt().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoMerge branch 'stmmac-tx-coe'
David S. Miller [Mon, 18 Sep 2023 10:37:08 +0000 (11:37 +0100)]
Merge branch 'stmmac-tx-coe'

Rohan G Thomas says:

====================
net: stmmac: Tx coe sw fallback

DW xGMAC IP can be synthesized such that it can support tx checksum
offloading only for a few initial tx queues. Also as Serge pointed
out, for the DW QoS IP, tx coe can be individually configured for
each tx queue. This patchset adds support for tx coe sw fallback for
those queues that don't support tx coe. Also, add binding for
snps,coe-unsupported property.

changelog v7:
* Updated commit message.
* Add blank lines around newly added dt binding.

changelog v6:
* Reworked patchset to cover DW QoS Ethernet IP also.

changelog v5:
* As rightly suggested by Serge, reworked redundant code.

changelog v4:
* Replaced tx_q_coe_lmt with bit flag.

changelog v3:
* Resend with complete email list.

changelog v2:
* Reformed binding description.
* Minor grammatical corrections in comments and commit messages.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: stmmac: Tx coe sw fallback
Rohan G Thomas [Sat, 16 Sep 2023 06:33:12 +0000 (14:33 +0800)]
net: stmmac: Tx coe sw fallback

Add sw fallback of tx checksum calculation for those tx queues that
don't support tx checksum offloading. DW xGMAC IP can be synthesized
such that it can support tx checksum offloading only for a few
initial tx queues. Also as Serge pointed out, for the DW QoS IP, tx
coe can be individually configured for each tx queue.

So when tx coe is enabled, for any tx queue that doesn't support
tx coe with 'coe-unsupported' flag set will have a sw fallback
happen in the driver for tx checksum calculation when any packets to
be transmitted on these tx queues.

Signed-off-by: Rohan G Thomas <rohan.g.thomas@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agodt-bindings: net: snps,dwmac: Tx coe unsupported
Rohan G Thomas [Sat, 16 Sep 2023 06:33:11 +0000 (14:33 +0800)]
dt-bindings: net: snps,dwmac: Tx coe unsupported

Add dt-bindings for coe-unsupported property per tx queue. Some DWMAC
IPs support tx checksum offloading(coe) only for a few tx queues.

DW xGMAC IP can be synthesized such that it can support tx coe only
for a few initial tx queues. Also as Serge pointed out, for the DW
QoS IP tx coe can be individually configured for each tx queue. This
property is added to have sw fallback for checksum calculation if a
tx queue doesn't support tx coe.

Signed-off-by: Rohan G Thomas <rohan.g.thomas@intel.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoceph: Annotate struct ceph_monmap with __counted_by
Kees Cook [Fri, 15 Sep 2023 20:15:10 +0000 (13:15 -0700)]
ceph: Annotate struct ceph_monmap with __counted_by

Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct ceph_monmap.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Xiubo Li <xiubli@redhat.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: ceph-devel@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: spider_net: Use size_add() in call to struct_size()
Gustavo A. R. Silva [Fri, 15 Sep 2023 19:25:36 +0000 (13:25 -0600)]
net: spider_net: Use size_add() in call to struct_size()

If, for any reason, the open-coded arithmetic causes a wraparound,
the protection that `struct_size()` adds against potential integer
overflows is defeated. Fix this by hardening call to `struct_size()`
with `size_add()`.

Fixes: 3f1071ec39f7 ("net: spider_net: Use struct_size() helper")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agotipc: Use size_add() in calls to struct_size()
Gustavo A. R. Silva [Fri, 15 Sep 2023 19:16:26 +0000 (13:16 -0600)]
tipc: Use size_add() in calls to struct_size()

If, for any reason, the open-coded arithmetic causes a wraparound,
the protection that `struct_size()` adds against potential integer
overflows is defeated. Fix this by hardening call to `struct_size()`
with `size_add()`.

Fixes: e034c6d23bc4 ("tipc: Use struct_size() helper")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agotls: Use size_add() in call to struct_size()
Gustavo A. R. Silva [Fri, 15 Sep 2023 19:12:38 +0000 (13:12 -0600)]
tls: Use size_add() in call to struct_size()

If, for any reason, the open-coded arithmetic causes a wraparound,
the protection that `struct_size()` adds against potential integer
overflows is defeated. Fix this by hardening call to `struct_size()`
with `size_add()`.

Fixes: b89fec54fd61 ("tls: rx: wrap decrypt params in a struct")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agomlxsw: Use size_mul() in call to struct_size()
Gustavo A. R. Silva [Fri, 15 Sep 2023 19:01:23 +0000 (13:01 -0600)]
mlxsw: Use size_mul() in call to struct_size()

If, for any reason, the open-coded arithmetic causes a wraparound, the
protection that `struct_size()` adds against potential integer overflows
is defeated. Fix this by hardening call to `struct_size()` with `size_mul()`.

Fixes: 2285ec872d9d ("mlxsw: spectrum_acl_bloom_filter: use struct_size() in kzalloc()")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoMerge branch 'kselftest-rtnetlink'
David S. Miller [Mon, 18 Sep 2023 08:34:06 +0000 (09:34 +0100)]
Merge branch 'kselftest-rtnetlink'

Daniel Mendes says:

====================
kselftest: rtnetlink: add additional command line options

Many other tests implement options like verbose, pause, and pause
on failure. These patches just add these options to rtnetlink.sh.
The same conventions are used as the tests that already have this
functionality: eg verbose is 0 or 1 but PAUSE is "yes" or "no".
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agokselftest: rtnetlink: add pause and pause on fail flag
Daniel Mendes [Tue, 12 Sep 2023 14:28:36 +0000 (10:28 -0400)]
kselftest: rtnetlink: add pause and pause on fail flag

'Pause' prompts the user to press Enter to continue running tests
once one test has finished. Pause on fail on prompts the user to press
enter only when a test fails.

Modifications to kci_test_addrlft() and kci_test_ipsec_offload()
ensure that whenever end_test is called, [$ret -ne 0] indicates
failure. This allows end_test to really easily implement pause on fail
functionality.

Signed-off-by: Daniel Mendes <dmendes@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agokselftest: rtnetlink.sh: add verbose flag
Daniel Mendes [Tue, 12 Sep 2023 14:28:35 +0000 (10:28 -0400)]
kselftest: rtnetlink.sh: add verbose flag

Uses a run_cmd helper function similar to other selftests to add
verbose functionality i.e. print executed commands and their outputs

Many commands silence or redirect output. This can be removed since
the verbose helper function captures output anyway and only outputs it
if VERBOSE is true. Similarly, the helper command for pipes to grep
searches stderr and stdout. This makes output redirection unnecessary
in those cases.

Signed-off-by: Daniel Mendes <dmendes@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoMerge branch 'pds_core-pci-reset'
David S. Miller [Mon, 18 Sep 2023 08:28:22 +0000 (09:28 +0100)]
Merge branch 'pds_core-pci-reset'

Shannon Nelson says:

====================
pds_core: add PCI reset handling

Make sure pds_core can handle and recover from PCI function resets and
similar PCI bus issues: add detection and handlers for PCI problems.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agopds_core: add attempts to fix broken PCI
Shannon Nelson [Thu, 14 Sep 2023 22:32:00 +0000 (15:32 -0700)]
pds_core: add attempts to fix broken PCI

If we see a 0xff value from a PCI register read, we know that
the PCI connection is broken, possibly by a low level reset that
didn't go through the nice pci_error_handlers path.

Make use of the PCI cleanup code that we already have from the
reset handlers and add some detection and attempted recovery
from a broken PCI connection.

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agopds_core: implement pci reset handlers
Shannon Nelson [Thu, 14 Sep 2023 22:31:59 +0000 (15:31 -0700)]
pds_core: implement pci reset handlers

Implement the callbacks for a nice PCI reset.  These get called
when a user is nice enough to use the sysfs PCI reset entry, e.g.
    echo 1 > /sys/bus/pci/devices/0000:2b:00.0/reset

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agopds_core: keep viftypes table across reset
Shannon Nelson [Thu, 14 Sep 2023 22:31:58 +0000 (15:31 -0700)]
pds_core: keep viftypes table across reset

Keep the viftypes and the current enable/disable states
across a recovery action.

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agopds_core: check health in devcmd wait
Shannon Nelson [Thu, 14 Sep 2023 22:31:57 +0000 (15:31 -0700)]
pds_core: check health in devcmd wait

Similar to what we do in the AdminQ, check for devcmd health
while waiting for an answer.

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoocteon_ep: support to fetch firmware info
Shinas Rasheed [Fri, 15 Sep 2023 08:16:07 +0000 (01:16 -0700)]
octeon_ep: support to fetch firmware info

Add support to fetch firmware info such as heartbeat miss count,
heartbeat interval. This shall be used for heartbeat monitor.

Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agogve: Use size_add() in call to struct_size()
Gustavo A. R. Silva [Fri, 15 Sep 2023 18:17:49 +0000 (12:17 -0600)]
gve: Use size_add() in call to struct_size()

If, for any reason, `tx_stats_num + rx_stats_num` wraps around, the
protection that struct_size() adds against potential integer overflows
is defeated. Fix this by hardening call to struct_size() with size_add().

Fixes: 691f4077d560 ("gve: Replace zero-length array with flexible-array member")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoMerge branch 'vsock-tests'
David S. Miller [Sun, 17 Sep 2023 16:42:37 +0000 (17:42 +0100)]
Merge branch 'vsock-tests'

Stefano Garzarella says:

====================
vsock/test: add recv_buf()/send_buf() utility functions and some improvements

We recently found that some tests were failing [1].

The problem was that we were not waiting for all the bytes correctly,
so we had a partial read. I had initially suggested using MSG_WAITALL,
but this could have timeout problems.

Since we already had send_byte() and recv_byte() that handled the timeout,
but also the expected return value, I moved that code to two new functions
that we can now use to send/receive generic buffers.

The last commit is just an improvement to a test I found difficult to
understand while using the new functions.

@Arseniy a review and some testing are really appreciated :-)

[1] https://lore.kernel.org/netdev/63xflnwiohdfo6m3vnrrxgv2ulplencpwug5qqacugqh7xxpu3@tsczkuqgwurb/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agovsock/test: track bytes in sk_buff merging test for SOCK_SEQPACKET
Stefano Garzarella [Fri, 15 Sep 2023 12:14:52 +0000 (14:14 +0200)]
vsock/test: track bytes in sk_buff merging test for SOCK_SEQPACKET

The test was a bit complicated to read.
Added variables to keep track of the bytes read and to be read
in each step. Also some comments.

The test is unchanged.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agovsock/test: use send_buf() in vsock_test.c
Stefano Garzarella [Fri, 15 Sep 2023 12:14:51 +0000 (14:14 +0200)]
vsock/test: use send_buf() in vsock_test.c

We have a very common pattern used in vsock_test that we can
now replace with the new send_buf().

This allows us to reuse the code we already had to check the
actual return value and wait for all the bytes to be sent with
an appropriate timeout.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agovsock/test: add send_buf() utility function
Stefano Garzarella [Fri, 15 Sep 2023 12:14:50 +0000 (14:14 +0200)]
vsock/test: add send_buf() utility function

Move the code of send_byte() out in a new utility function that
can be used to send a generic buffer.

This new function can be used when we need to send a custom
buffer and not just a single 'A' byte.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agovsock/test: use recv_buf() in vsock_test.c
Stefano Garzarella [Fri, 15 Sep 2023 12:14:49 +0000 (14:14 +0200)]
vsock/test: use recv_buf() in vsock_test.c

We have a very common pattern used in vsock_test that we can
now replace with the new recv_buf().

This allows us to reuse the code we already had to check the
actual return value and wait for all bytes to be received with
an appropriate timeout.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agovsock/test: add recv_buf() utility function
Stefano Garzarella [Fri, 15 Sep 2023 12:14:48 +0000 (14:14 +0200)]
vsock/test: add recv_buf() utility function

Move the code of recv_byte() out in a new utility function that
can be used to receive a generic buffer.

This new function can be used when we need to receive a custom
buffer and not just a single 'A' byte.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoMerge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
David S. Miller [Sun, 17 Sep 2023 14:12:06 +0000 (15:12 +0100)]
Merge https://git./linux/kernel/git/bpf/bpf-next

Alexei Starovoitov says:

====================
The following pull-request contains BPF updates for your *net-next* tree.

We've added 73 non-merge commits during the last 9 day(s) which contain
a total of 79 files changed, 5275 insertions(+), 600 deletions(-).

The main changes are:

1) Basic BTF validation in libbpf, from Andrii Nakryiko.

2) bpf_assert(), bpf_throw(), exceptions in bpf progs, from Kumar Kartikeya Dwivedi.

3) next_thread cleanups, from Oleg Nesterov.

4) Add mcpu=v4 support to arm32, from Puranjay Mohan.

5) Add support for __percpu pointers in bpf progs, from Yonghong Song.

6) Fix bpf tailcall interaction with bpf trampoline, from Leon Hwang.

7) Raise irq_work in bpf_mem_alloc while irqs are disabled to improve refill probabablity, from Hou Tao.

Please consider pulling these changes from:

  git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git

Thanks a lot!

Also thanks to reporters, reviewers and testers of commits in this pull-request:

Alan Maguire, Andrey Konovalov, Dave Marchevsky, "Eric W. Biederman",
Jiri Olsa, Maciej Fijalkowski, Quentin Monnet, Russell King (Oracle),
Song Liu, Stanislav Fomichev, Yonghong Song
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agoMerge branch 'phy-stopping-race'
David S. Miller [Sun, 17 Sep 2023 13:31:24 +0000 (14:31 +0100)]
Merge branch 'phy-stopping-race'

Russell King says:

====================
net: phy: avoid race when erroring stopping PHY

This series addresses a problem reported by Jijie Shao where the PHY
state machine can race with phy_stop() leading to an incorrect state.

The issue centres around phy_state_machine() dropping the phydev->lock
mutex briefly, which allows phy_stop() to get in half-way through the
state machine, and when the state machine resumes, it overwrites
phydev->state with a value incompatible with a stopped PHY. This causes
a subsequent phy_start() to issue a warning.

We address this firstly by using versions of functions that do not take
tne lock, moving them into the locked region. The only function that
this can't be done with is phy_suspend() which needs to call into the
driver without taking the lock.

For phy_suspend(), we split the state machine into two parts - the
initial part which runs under the phydev->lock, and the second part
which runs without the lock.

We finish off by using the split state machine in phy_stop() which
removes another unnecessary unlock-lock sequence from phylib.

Changes from RFC:
- Added Jijie Shao's tested-by
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: phy: convert phy_stop() to use split state machine
Russell King (Oracle) [Thu, 14 Sep 2023 15:36:02 +0000 (16:36 +0100)]
net: phy: convert phy_stop() to use split state machine

Convert phy_stop() to use the new locked-section and unlocked-section
parts of the PHY state machine.

Tested-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: phy: split locked and unlocked section of phy_state_machine()
Russell King (Oracle) [Thu, 14 Sep 2023 15:35:57 +0000 (16:35 +0100)]
net: phy: split locked and unlocked section of phy_state_machine()

Split out the locked and unlocked sections of phy_state_machine() into
two separate functions which can be called inside the phydev lock and
outside the phydev lock as appropriate, thus allowing us to combine
the locked regions in the caller of phy_state_machine() with the
locked region inside phy_state_machine().

This avoids unnecessarily dropping the phydev lock which may allow
races to occur.

Tested-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: phy: move phy_state_machine()
Russell King (Oracle) [Thu, 14 Sep 2023 15:35:52 +0000 (16:35 +0100)]
net: phy: move phy_state_machine()

Move phy_state_machine() before phy_stop() to avoid subsequent patches
introducing forward references.

Tested-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 months agonet: phy: move phy_suspend() to end of phy_state_machine()
Russell King (Oracle) [Thu, 14 Sep 2023 15:35:47 +0000 (16:35 +0100)]
net: phy: move phy_suspend() to end of phy_state_machine()

Move the call to phy_suspend() to the end of phy_state_machine() after
we release the lock so that we can combine the locked areas.
phy_suspend() can not be called while holding phydev->lock as it has
caused deadlocks in the past.

Tested-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>