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>] [day] [month] [year] [list]
Date:	Tue, 14 Aug 2007 20:15:53 +0200
From:	Michael Buesch <mb@...sch.de>
To:	John Linville <linville@...driver.com>
Cc:	netdev@...r.kernel.org
Subject: [PATCH] b44-ssb: Powerup the bus before using the device.

We must turn on buspower before poking with the device

Signed-off-by: Michael Buesch <mb@...sch.de>

Index: wireless-dev-new/drivers/net/b44.c
===================================================================
--- wireless-dev-new.orig/drivers/net/b44.c	2007-08-11 00:45:55.000000000 +0200
+++ wireless-dev-new/drivers/net/b44.c	2007-08-12 22:18:34.000000000 +0200
@@ -2154,17 +2154,23 @@ static int __devinit b44_init_one(struct
 
 	netif_carrier_off(dev);
 
+	err = ssb_bus_powerup(sdev->bus, 0);
+	if (err) {
+		dev_err(sdev->dev,
+			"Failed to powerup the bus\n");
+		goto err_out_free_dev;
+	}
 	err = ssb_dma_set_mask(sdev, DMA_30BIT_MASK);
 	if (err) {
 		dev_err(sdev->dev,
 			"Required 30BIT DMA mask unsupported by the system.\n");
-		goto err_out_free_dev;
+		goto err_out_powerdown;
 	}
 	err = b44_get_invariants(bp);
 	if (err) {
 		dev_err(sdev->dev,
 			"Problem fetching invariants of chip, aborting.\n");
-		goto err_out_free_dev;
+		goto err_out_powerdown;
 	}
 
 	bp->mii_if.dev = dev;
@@ -2184,7 +2190,7 @@ static int __devinit b44_init_one(struct
 	err = register_netdev(dev);
 	if (err) {
 		dev_err(sdev->dev, "Cannot register net device, aborting.\n");
-		goto out;
+		goto err_out_powerdown;
 	}
 
 	ssb_set_drvdata(sdev, dev);
@@ -2201,6 +2207,9 @@ static int __devinit b44_init_one(struct
 
 	return 0;
 
+err_out_powerdown:
+	ssb_bus_may_powerdown(sdev->bus);
+
 err_out_free_dev:
 	free_netdev(dev);
 
@@ -2208,13 +2217,14 @@ out:
 	return err;
 }
 
-static void __devexit b44_remove_one(struct ssb_device *pdev)
+static void __devexit b44_remove_one(struct ssb_device *sdev)
 {
-	struct net_device *dev = ssb_get_drvdata(pdev);
+	struct net_device *dev = ssb_get_drvdata(sdev);
 
 	unregister_netdev(dev);
+	ssb_bus_may_powerdown(sdev->bus);
 	free_netdev(dev);
-	ssb_set_drvdata(pdev, NULL);
+	ssb_set_drvdata(sdev, NULL);
 }
 
 static int b44_suspend(struct ssb_device *sdev, pm_message_t state)
@@ -2251,6 +2261,13 @@ static int b44_resume(struct ssb_device 
 	struct b44 *bp = netdev_priv(dev);
 	int rc = 0;
 
+	rc = ssb_bus_powerup(sdev->bus, 0);
+	if (rc) {
+		dev_err(sdev->dev,
+			"Failed to powerup the bus\n");
+		return rc;
+	}
+
 	if (!netif_running(dev))
 		return 0;
 
-
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