| To: | Andy Fleming <afleming@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: RFC: PHY Abstraction Layer II |
| From: | Stephen Hemminger <shemminger@xxxxxxxx> |
| Date: | Wed, 01 Jun 2005 14:19:15 -0700 |
| Cc: | Netdev <netdev@xxxxxxxxxxx>, Embedded PPC Linux list <linuxppc-embedded@xxxxxxxxxx>, Kumar Gala <kumar.gala@xxxxxxxxxxxxx> |
| In-reply-to: | <92F1428A-0B26-428B-8C06-35C7E5B9EEE3@freescale.com> |
| References: | <1107b64b01fb8e9a6c84359bb56881a6@freescale.com> <20050531105939.7486e071@dxpl.pdx.osdl.net> <92F1428A-0B26-428B-8C06-35C7E5B9EEE3@freescale.com> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) |
Andy Fleming wrote:
The problem is that sleeping is defined in the linux kernel as meaning waiting on a mutual exclusion primitive (like semaphore) that puts the current thread to sleep. It is not legal to sleep with a spinlock held. In the phy_read code you do: spin_lock_bh(&bus->mdio_lock); retval = bus->read(bus, phydev->addr, regnum); spin_unlock_bh(&bus->mdio_lock); If the bus->read function were to do something like start a request and wait on a semaphore, then you would be sleeping with a spin lock held. So bus->read can not sleep! (as sleep is defined in the linux kernel). |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH] ieee80211: Update generic definitions to latest specs., Gertjan van Wingerde |
|---|---|
| Next by Date: | Re: Locking model for NAPI drivers, Michael Chan |
| Previous by Thread: | Re: RFC: PHY Abstraction Layer II, Andy Fleming |
| Next by Thread: | Re: RFC: PHY Abstraction Layer II, Andy Fleming |
| Indexes: | [Date] [Thread] [Top] [All Lists] |