* mv643xx_eth: Delay required in reading the PHY registers. [not found] <bb58ac4d0905010108n77ca98c8t59409952150c3a11@mail.gmail.com> @ 2009-05-06 5:38 ` Upakul Barkakaty 2009-05-06 12:18 ` Lennert Buytenhek 0 siblings, 1 reply; 3+ messages in thread From: Upakul Barkakaty @ 2009-05-06 5:38 UTC (permalink / raw) To: netdev Hi all, I am using the Marvell ethernet driver[mv643xx_eth]. The function eth_port_read_smi_reg(), uses a delay in order to wait for the SMI register to become available. Does anyone have any clue how much time it actually takes for the SMI register to become available? Actually I am using an older version of the driver which does not use the udelay functions in the loops. It rather has a "for" loop for putting a timeout. Now the gcc-4.3.1 compiler optimizes out the "for" loop. So I need to replace the "for" loop with a delay function. Now the question is "how much delay would be appropriate". Any replies in this regard would be appreciated. -- Regards, Upakul Barkakaty ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: mv643xx_eth: Delay required in reading the PHY registers. 2009-05-06 5:38 ` mv643xx_eth: Delay required in reading the PHY registers Upakul Barkakaty @ 2009-05-06 12:18 ` Lennert Buytenhek 2009-05-06 12:26 ` Upakul Barkakaty 0 siblings, 1 reply; 3+ messages in thread From: Lennert Buytenhek @ 2009-05-06 12:18 UTC (permalink / raw) To: Upakul Barkakaty; +Cc: netdev On Wed, May 06, 2009 at 11:08:07AM +0530, Upakul Barkakaty wrote: > I am using the Marvell ethernet driver[mv643xx_eth]. The function > eth_port_read_smi_reg(), uses a delay in order to wait for the SMI > register to become available. > > Does anyone have any clue how much time it actually takes for the SMI > register to become available? Actually I am using an older version of > the driver which does not use the udelay functions in the loops. It > rather has a "for" loop for putting a timeout. Now the gcc-4.3.1 > compiler optimizes out the "for" loop. So I need to replace the "for" > loop with a delay function. Now the question is "how much delay would > be appropriate". > > Any replies in this regard would be appreciated. You sent me the same question in private mail -- I wonder how many other people you've sent this question to. As I told you in private mail as well, any recent version of the driver will wait for SMI completion by waiting for the appropriate interrupt. If you really cannot use that option, then even though the transaction is on the order of tens of microseconds, I would still try to go to sleep at least for a little bit (say, msleep(10)) as SMI accesses aren't in a critical path and not busy-waiting while sucking up CPU is more important than getting the access done as quick as you can. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: mv643xx_eth: Delay required in reading the PHY registers. 2009-05-06 12:18 ` Lennert Buytenhek @ 2009-05-06 12:26 ` Upakul Barkakaty 0 siblings, 0 replies; 3+ messages in thread From: Upakul Barkakaty @ 2009-05-06 12:26 UTC (permalink / raw) To: Lennert Buytenhek; +Cc: netdev Thanks Lennert for the reply. Appreciate it. On Wed, May 6, 2009 at 5:48 PM, Lennert Buytenhek <buytenh@wantstofly.org> wrote: > On Wed, May 06, 2009 at 11:08:07AM +0530, Upakul Barkakaty wrote: > >> I am using the Marvell ethernet driver[mv643xx_eth]. The function >> eth_port_read_smi_reg(), uses a delay in order to wait for the SMI >> register to become available. >> >> Does anyone have any clue how much time it actually takes for the SMI >> register to become available? Actually I am using an older version of >> the driver which does not use the udelay functions in the loops. It >> rather has a "for" loop for putting a timeout. Now the gcc-4.3.1 >> compiler optimizes out the "for" loop. So I need to replace the "for" >> loop with a delay function. Now the question is "how much delay would >> be appropriate". >> >> Any replies in this regard would be appreciated. > > You sent me the same question in private mail -- I wonder how many > other people you've sent this question to. > > As I told you in private mail as well, any recent version of the driver > will wait for SMI completion by waiting for the appropriate interrupt. > If you really cannot use that option, then even though the transaction > is on the order of tens of microseconds, I would still try to go to > sleep at least for a little bit (say, msleep(10)) as SMI accesses aren't > in a critical path and not busy-waiting while sucking up CPU is more > important than getting the access done as quick as you can. > -- Regards, Upakul Barkakaty ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-06 12:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <bb58ac4d0905010108n77ca98c8t59409952150c3a11@mail.gmail.com>
2009-05-06 5:38 ` mv643xx_eth: Delay required in reading the PHY registers Upakul Barkakaty
2009-05-06 12:18 ` Lennert Buytenhek
2009-05-06 12:26 ` Upakul Barkakaty
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox