summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2018-05-24 23:52:14 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-25 16:46:29 -0400
commite52cde71709348c0d67bf0f213b438fa4d6cf9a9 (patch)
tree5c5e1dc5b23c715bc19d072b93bc984b6f14585f
parent910714f1fcf88f6873a1b33672b3f87207ed48a5 (diff)
net: dsa: dsa_loop: Make dynamic debugging helpful
Remove redundant debug prints from phy_read/write since we can trace those calls through trace events. Enhance dynamic debug prints to print arguments which helps figuring how what is going on at the driver level with higher level configuration interfaces. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/dsa_loop.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index 58f14af04639..816f34d64736 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -67,7 +67,7 @@ static struct phy_device *phydevs[PHY_MAX_ADDR];
67static enum dsa_tag_protocol dsa_loop_get_protocol(struct dsa_switch *ds, 67static enum dsa_tag_protocol dsa_loop_get_protocol(struct dsa_switch *ds,
68 int port) 68 int port)
69{ 69{
70 dev_dbg(ds->dev, "%s\n", __func__); 70 dev_dbg(ds->dev, "%s: port: %d\n", __func__, port);
71 71
72 return DSA_TAG_PROTO_NONE; 72 return DSA_TAG_PROTO_NONE;
73} 73}
@@ -124,8 +124,6 @@ static int dsa_loop_phy_read(struct dsa_switch *ds, int port, int regnum)
124 struct mii_bus *bus = ps->bus; 124 struct mii_bus *bus = ps->bus;
125 int ret; 125 int ret;
126 126
127 dev_dbg(ds->dev, "%s\n", __func__);
128
129 ret = mdiobus_read_nested(bus, ps->port_base + port, regnum); 127 ret = mdiobus_read_nested(bus, ps->port_base + port, regnum);
130 if (ret < 0) 128 if (ret < 0)
131 ps->ports[port].mib[DSA_LOOP_PHY_READ_ERR].val++; 129 ps->ports[port].mib[DSA_LOOP_PHY_READ_ERR].val++;
@@ -142,8 +140,6 @@ static int dsa_loop_phy_write(struct dsa_switch *ds, int port,
142 struct mii_bus *bus = ps->bus; 140 struct mii_bus *bus = ps->bus;
143 int ret; 141 int ret;
144 142
145 dev_dbg(ds->dev, "%s\n", __func__);
146
147 ret = mdiobus_write_nested(bus, ps->port_base + port, regnum, value); 143 ret = mdiobus_write_nested(bus, ps->port_base + port, regnum, value);
148 if (ret < 0) 144 if (ret < 0)
149 ps->ports[port].mib[DSA_LOOP_PHY_WRITE_ERR].val++; 145 ps->ports[port].mib[DSA_LOOP_PHY_WRITE_ERR].val++;
@@ -156,7 +152,8 @@ static int dsa_loop_phy_write(struct dsa_switch *ds, int port,
156static int dsa_loop_port_bridge_join(struct dsa_switch *ds, int port, 152static int dsa_loop_port_bridge_join(struct dsa_switch *ds, int port,
157 struct net_device *bridge) 153 struct net_device *bridge)
158{ 154{
159 dev_dbg(ds->dev, "%s\n", __func__); 155 dev_dbg(ds->dev, "%s: port: %d, bridge: %s\n",
156 __func__, port, bridge->name);
160 157
161 return 0; 158 return 0;
162} 159}
@@ -164,19 +161,22 @@ static int dsa_loop_port_bridge_join(struct dsa_switch *ds, int port,
164static void dsa_loop_port_bridge_leave(struct dsa_switch *ds, int port, 161static void dsa_loop_port_bridge_leave(struct dsa_switch *ds, int port,
165 struct net_device *bridge) 162 struct net_device *bridge)
166{ 163{
167 dev_dbg(ds->dev, "%s\n", __func__); 164 dev_dbg(ds->dev, "%s: port: %d, bridge: %s\n",
165 __func__, port, bridge->name);
168} 166}
169 167
170static void dsa_loop_port_stp_state_set(struct dsa_switch *ds, int port, 168static void dsa_loop_port_stp_state_set(struct dsa_switch *ds, int port,
171 u8 state) 169 u8 state)
172{ 170{
173 dev_dbg(ds->dev, "%s\n", __func__); 171 dev_dbg(ds->dev, "%s: port: %d, state: %d\n",
172 __func__, port, state);
174} 173}
175 174
176static int dsa_loop_port_vlan_filtering(struct dsa_switch *ds, int port, 175static int dsa_loop_port_vlan_filtering(struct dsa_switch *ds, int port,
177 bool vlan_filtering) 176 bool vlan_filtering)
178{ 177{
179 dev_dbg(ds->dev, "%s\n", __func__); 178 dev_dbg(ds->dev, "%s: port: %d, vlan_filtering: %d\n",
179 __func__, port, vlan_filtering);
180 180
181 return 0; 181 return 0;
182} 182}
@@ -188,7 +188,8 @@ dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,
188 struct dsa_loop_priv *ps = ds->priv; 188 struct dsa_loop_priv *ps = ds->priv;
189 struct mii_bus *bus = ps->bus; 189 struct mii_bus *bus = ps->bus;
190 190
191 dev_dbg(ds->dev, "%s\n", __func__); 191 dev_dbg(ds->dev, "%s: port: %d, vlan: %d-%d",
192 __func__, port, vlan->vid_begin, vlan->vid_end);
192 193
193 /* Just do a sleeping operation to make lockdep checks effective */ 194 /* Just do a sleeping operation to make lockdep checks effective */
194 mdiobus_read(bus, ps->port_base + port, MII_BMSR); 195 mdiobus_read(bus, ps->port_base + port, MII_BMSR);
@@ -209,8 +210,6 @@ static void dsa_loop_port_vlan_add(struct dsa_switch *ds, int port,
209 struct dsa_loop_vlan *vl; 210 struct dsa_loop_vlan *vl;
210 u16 vid; 211 u16 vid;
211 212
212 dev_dbg(ds->dev, "%s\n", __func__);
213
214 /* Just do a sleeping operation to make lockdep checks effective */ 213 /* Just do a sleeping operation to make lockdep checks effective */
215 mdiobus_read(bus, ps->port_base + port, MII_BMSR); 214 mdiobus_read(bus, ps->port_base + port, MII_BMSR);
216 215
@@ -222,6 +221,9 @@ static void dsa_loop_port_vlan_add(struct dsa_switch *ds, int port,
222 vl->untagged |= BIT(port); 221 vl->untagged |= BIT(port);
223 else 222 else
224 vl->untagged &= ~BIT(port); 223 vl->untagged &= ~BIT(port);
224
225 dev_dbg(ds->dev, "%s: port: %d vlan: %d, %stagged, pvid: %d\n",
226 __func__, port, vid, untagged ? "un" : "", pvid);
225 } 227 }
226 228
227 if (pvid) 229 if (pvid)
@@ -237,8 +239,6 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
237 struct dsa_loop_vlan *vl; 239 struct dsa_loop_vlan *vl;
238 u16 vid, pvid = ps->pvid; 240 u16 vid, pvid = ps->pvid;
239 241
240 dev_dbg(ds->dev, "%s\n", __func__);
241
242 /* Just do a sleeping operation to make lockdep checks effective */ 242 /* Just do a sleeping operation to make lockdep checks effective */
243 mdiobus_read(bus, ps->port_base + port, MII_BMSR); 243 mdiobus_read(bus, ps->port_base + port, MII_BMSR);
244 244
@@ -251,6 +251,9 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
251 251
252 if (pvid == vid) 252 if (pvid == vid)
253 pvid = 1; 253 pvid = 1;
254
255 dev_dbg(ds->dev, "%s: port: %d vlan: %d, %stagged, pvid: %d\n",
256 __func__, port, vid, untagged ? "un" : "", pvid);
254 } 257 }
255 ps->pvid = pvid; 258 ps->pvid = pvid;
256 259