diff mbox series

net: dsa: b53: mmap: add phy ops

Message ID 20230323194841.1431878-1-noltari@gmail.com (mailing list archive)
State Accepted
Commit 45977e58ce65ed0459edc9a0466d9dfea09463f5
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: b53: mmap: add phy ops | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 26 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Álvaro Fernández Rojas March 23, 2023, 7:48 p.m. UTC
Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing
B53_PORT_MII_PAGE registers which hangs the device.
This access should be done through the MDIO Mux bus controller.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 drivers/net/dsa/b53/b53_mmap.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Jakub Kicinski March 25, 2023, 2:13 a.m. UTC | #1
On Thu, 23 Mar 2023 20:48:41 +0100 Álvaro Fernández Rojas wrote:
> Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing
> B53_PORT_MII_PAGE registers which hangs the device.
> This access should be done through the MDIO Mux bus controller.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

Hi Florian, ack? Would be good for the record..
Florian Fainelli March 25, 2023, 4:34 p.m. UTC | #2
On 3/23/2023 12:48 PM, Álvaro Fernández Rojas wrote:
> Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing
> B53_PORT_MII_PAGE registers which hangs the device.
> This access should be done through the MDIO Mux bus controller.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
patchwork-bot+netdevbpf@kernel.org March 27, 2023, 7:40 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 23 Mar 2023 20:48:41 +0100 you wrote:
> Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing
> B53_PORT_MII_PAGE registers which hangs the device.
> This access should be done through the MDIO Mux bus controller.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  drivers/net/dsa/b53/b53_mmap.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)

Here is the summary with links:
  - net: dsa: b53: mmap: add phy ops
    https://git.kernel.org/netdev/net/c/45977e58ce65

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
index e968322dfbf0..34f5804e449d 100644
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -216,6 +216,18 @@  static int b53_mmap_write64(struct b53_device *dev, u8 page, u8 reg,
 	return 0;
 }
 
+static int b53_mmap_phy_read16(struct b53_device *dev, int addr, int reg,
+			       u16 *value)
+{
+	return -EIO;
+}
+
+static int b53_mmap_phy_write16(struct b53_device *dev, int addr, int reg,
+				u16 value)
+{
+	return -EIO;
+}
+
 static const struct b53_io_ops b53_mmap_ops = {
 	.read8 = b53_mmap_read8,
 	.read16 = b53_mmap_read16,
@@ -227,6 +239,8 @@  static const struct b53_io_ops b53_mmap_ops = {
 	.write32 = b53_mmap_write32,
 	.write48 = b53_mmap_write48,
 	.write64 = b53_mmap_write64,
+	.phy_read16 = b53_mmap_phy_read16,
+	.phy_write16 = b53_mmap_phy_write16,
 };
 
 static int b53_mmap_probe_of(struct platform_device *pdev,