]> git.baikalelectronics.ru Git - kernel.git/commit
firewire: ohci: wait for PHY register accesses to complete
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 10 Apr 2010 14:04:56 +0000 (16:04 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 10 Apr 2010 14:51:14 +0000 (16:51 +0200)
commit13f19660ef6612317e33347e81d1d824c5fbde77
tree4c9838cd44e7f2539f986ff3acbe4c45ce12bc8e
parentf085bf34121d91fd3916681c0a36c67290ec5a45
firewire: ohci: wait for PHY register accesses to complete

Rather than having the arbitrary msleep(2) pause, let read_phy_reg()
loop until the link--phy access was finished.

Factor write_phy_reg() out of ohci_update_phy_reg() and of
read_paged_phy_reg() and let it loop too until the link--phy access was
finished.

Like in the older ohci1394 driver, a timeout of 100 milliseconds is
chosen.  Unlike the old driver, we sleep instead of busy-wait in each
waiting loop iteration.  Instead of a loop, the waiting could probably
also be implemented interrupt driven, but why bother.  It would require
up and running interrupt handling before the link was fully configured
and enabled.

Also modify functions a bit:  Error return and value return can be
combined in read_phy_reg() since the domain of values is only u8.
Likewise in read_paged_phy_reg().

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/ohci.c