From: Subject: patch phy-rwsem-removal.patch added to gregkh-2.6 tree Date: Mon, 09 Apr 2007 16:03:47 -0700 Message-ID: <20070409230429.39A8DC6CC34@imap.suse.de> To: greg@kroah.com, gregkh@suse.de, netdev@vger.kernel.org Return-path: Received: from mail.suse.de ([195.135.220.2]:50445 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752490AbXDIXEc (ORCPT ); Mon, 9 Apr 2007 19:04:32 -0400 Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org This is a note to let you know that I've just added the patch titled Subject: PHY: remove rwsem use from phy core to my gregkh-2.6 tree. Its filename is phy-rwsem-removal.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From foo@baz Tue Apr 9 12:12:43 2002 Date: Mon, 9 Apr 2007 11:52:31 -0400 (EDT) To: Greg KH From: Greg Kroah-Hartman Subject: PHY: remove rwsem use from phy core The subsystem rwsem is not used by the driver core at all, so the use of it in the phy code doesn't make any sense. They might possibly want to use a local lock, but I am unsure about that. Cc: netdev Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/fixed.c | 6 ------ drivers/net/phy/phy_device.c | 9 +-------- 2 files changed, 1 insertion(+), 14 deletions(-) --- a/drivers/net/phy/fixed.c +++ b/drivers/net/phy/fixed.c @@ -276,21 +276,15 @@ static int fixed_mdio_register_device(in artificially, we are binding the driver here by hand; it will be the same for all the fixed phys anyway. */ - down_write(&phydev->dev.bus->subsys.rwsem); - phydev->dev.driver = &fixed_mdio_driver.driver; err = phydev->dev.driver->probe(&phydev->dev); if(err < 0) { printk(KERN_ERR "Phy %s: problems with fixed driver\n",phydev->dev.bus_id); - up_write(&phydev->dev.bus->subsys.rwsem); goto probe_fail; } err = device_bind_driver(&phydev->dev); - - up_write(&phydev->dev.bus->subsys.rwsem); - if (err) goto probe_fail; --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -208,16 +208,12 @@ struct phy_device *phy_attach(struct net * exist, and we should use the genphy driver. */ if (NULL == d->driver) { int err; - down_write(&d->bus->subsys.rwsem); d->driver = &genphy_driver.driver; err = d->driver->probe(d); - if (err >= 0) err = device_bind_driver(d); - up_write(&d->bus->subsys.rwsem); - if (err) return ERR_PTR(err); } @@ -258,11 +254,8 @@ void phy_detach(struct phy_device *phyde * was using the generic driver), we unbind the device * from the generic driver so that there's a chance a * real driver could be loaded */ - if (phydev->dev.driver == &genphy_driver.driver) { - down_write(&phydev->dev.bus->subsys.rwsem); + if (phydev->dev.driver == &genphy_driver.driver) device_release_driver(&phydev->dev); - up_write(&phydev->dev.bus->subsys.rwsem); - } } EXPORT_SYMBOL(phy_detach); Patches currently in gregkh-2.6 which might be from greg@kroah.com are