lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1450875402-20740-22-git-send-email-andrew@lunn.ch>
Date:	Wed, 23 Dec 2015 13:56:35 +0100
From:	Andrew Lunn <andrew@...n.ch>
To:	Florian Fainelli <f.fainelli@...il.com>, narmstrong@...libre.com,
	vivien.didelot@...oirfairelinux.com
Cc:	netdev <netdev@...r.kernel.org>, Andrew Lunn <andrew@...n.ch>
Subject: [PATCH RFC 21/28] net: dsa: Add some debug prints for error cases

Due to the complexity it can be hard to know why DSA fails to probe.
Add some debug prints for the common error cases.

Signed-off-by: Andrew Lunn <andrew@...n.ch>
---
 net/dsa/dsa.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 0658077f4e63..2c1f50561343 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -672,6 +672,7 @@ static int dsa_of_probe(struct device *dev, struct dsa_platform_data *pd)
 
 	ethernet = of_parse_phandle(np, "dsa,ethernet", 0);
 	if (!ethernet) {
+		dev_dbg(dev, "Missing mandatory dsa,ethernet property\n");
 		ret = -EINVAL;
 		goto out_put_mdio;
 	}
@@ -703,8 +704,10 @@ static int dsa_of_probe(struct device *dev, struct dsa_platform_data *pd)
 		if (chip) {
 			cd->of_chip = chip;
 		} else {
-			if (!mdio)
+			if (!mdio) {
+				dev_dbg(dev, "Missing required dsa,mii-bus property\n");
 				return -EINVAL;
+			}
 
 			mdio_bus = of_mdio_find_bus(mdio);
 			if (!mdio_bus)
@@ -1002,13 +1005,17 @@ int dsa_switch_register(struct dsa_switch_tree *dst, struct dsa_switch *ds,
 	struct dsa_platform_data *pd = dst->pd;
 	int index = dsa_find_chip_index(dst, np);
 
-	if (index < 0)
+	if (index < 0) {
+		netdev_dbg(dst->master_netdev, "Registration for unknown switch\n");
 		return index;
+	}
 
 	netdev_info(dst->master_netdev, "[%d]: detected a %s switch\n", index, name);
 
-	if (dst->ds[index])
+	if (dst->ds[index]) {
+		netdev_dbg(dst->master_netdev, "Device already registered\n");
 		return -EINVAL;
+	}
 
 	ds->index = index;
 	ds->pd = &pd->chip[index];
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ