[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200709184318.4192-1-cphealy@gmail.com>
Date: Thu, 9 Jul 2020 11:43:18 -0700
From: Chris Healy <cphealy@...il.com>
To: andrew@...n.ch, vivien.didelot@...il.com, f.fainelli@...il.com,
davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Chris Healy <cphealy@...il.com>
Subject: [PATCH net-next] net: dsa: mv88e6xxx: Add serdes read/write dynamic debug
Add deb_dbg print statements in both serdes_read and serdes_write
functions.
Signed-off-by: Chris Healy <cphealy@...il.com>
---
drivers/net/dsa/mv88e6xxx/serdes.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c
index 9c07b4f3d345..756b34343547 100644
--- a/drivers/net/dsa/mv88e6xxx/serdes.c
+++ b/drivers/net/dsa/mv88e6xxx/serdes.c
@@ -20,14 +20,25 @@
static int mv88e6352_serdes_read(struct mv88e6xxx_chip *chip, int reg,
u16 *val)
{
- return mv88e6xxx_phy_page_read(chip, MV88E6352_ADDR_SERDES,
+ int err;
+
+ err = mv88e6xxx_phy_page_read(chip, MV88E6352_ADDR_SERDES,
MV88E6352_SERDES_PAGE_FIBER,
reg, val);
+
+ if (err)
+ return err;
+
+ dev_dbg(chip->dev, "serdes <- reg: 0x%.2x val: 0x%.2x\n", reg, *val);
+
+ return 0;
}
static int mv88e6352_serdes_write(struct mv88e6xxx_chip *chip, int reg,
u16 val)
{
+ dev_dbg(chip->dev, "serdes -> reg: 0x%.2x val: 0x%.2x\n", reg, val);
+
return mv88e6xxx_phy_page_write(chip, MV88E6352_ADDR_SERDES,
MV88E6352_SERDES_PAGE_FIBER,
reg, val);
@@ -37,8 +48,17 @@ static int mv88e6390_serdes_read(struct mv88e6xxx_chip *chip,
int lane, int device, int reg, u16 *val)
{
int reg_c45 = MII_ADDR_C45 | device << 16 | reg;
+ int err;
+
+ err = mv88e6xxx_phy_read(chip, lane, reg_c45, val);
+ if (err)
+ return err;
+
+ dev_dbg(chip->dev, "serdes <- lane: %.2d device: 0x%.2x reg_c45: 0x%.4x val: 0x%.4x\n",
+ lane, device, reg_c45, *val);
+
+ return 0;
- return mv88e6xxx_phy_read(chip, lane, reg_c45, val);
}
static int mv88e6390_serdes_write(struct mv88e6xxx_chip *chip,
@@ -46,6 +66,9 @@ static int mv88e6390_serdes_write(struct mv88e6xxx_chip *chip,
{
int reg_c45 = MII_ADDR_C45 | device << 16 | reg;
+ dev_dbg(chip->dev, "serdes -> lane: %.2d device: 0x%.2x reg_c45: 0x%.4x val: 0x%.4x\n",
+ lane, device, reg_c45, val);
+
return mv88e6xxx_phy_write(chip, lane, reg_c45, val);
}
--
2.21.3
Powered by blists - more mailing lists