firewire: ohci: skip regAccessFail checks on OHCI 1.0 controllers

SCLK domain register accesses are quite costly:
  - Local IRQs are disabled and a spinlock taken,
  - the real MMIO read or write happens,
  - another MMIO read happens,
  - and finally the spinlock is released and local IRQs conditionally
    enabled again.

Luckily, none of those accesses happen in real fast paths.  Nonetheless
they are a bit of a waste on controllers which are guaranteed to never
raise intEvent.regAccessFail.  This includes all OHCI 1.0 controllers.

Hence introduce a QUIRK_REG_ACCESS_FAIL flag, set it for all OHCI 1.1
and later controllers, and reduce the above four steps to just the real
MMIO read or write if the flag was not set.

With this, my test_cycle_time tool gets from 8.1 million samples per
minute to 10.6 million samples per minute with a VT6306 based OHCI 1.0
noname CardBus card.  This is a card with nonatomic cycle timer, i.e.
typically required 4 reg_read per cyle timer access before this patch
and 3 reg_read after this patch.

Signed-off-by: Stefan Richter <>
1 file changed