1. 08 Oct, 2006 1 commit
  2. 23 Sep, 2006 1 commit
  3. 17 Sep, 2006 28 commits
    • Stefan Richter's avatar
      ieee1394: sbp2: enable auto spin-up for all SBP-2 devices · c394f1ea
      Stefan Richter authored
      
      
      This is a follow-up to patch "ieee1394: sbp2: enable auto spin-up for
      Maxtor disks".  When I 'ejected' an OXUF922 based HDD from a Mac OS X
      box, it was spun down by the Mac and did not spin up by itself when
      attached to a Linux box right after that.  The first SCSI command that
      required the bridge to access the drive ended in
      sda:<6>sd 18:0:0:0: Device not ready: <6>: Current: sense key: Not Ready
          Additional sense: Logical unit not ready, initializing cmd. required
      
      Therefore the flag which instructs scsi_mod to send START STOP UNIT with
      START=1 ("make medium ready") after such a condition is now enabled
      unconditionally for all FireWire storage devices.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      c394f1ea
    • Stefan Richter's avatar
      ieee1394: ohci1394: check for errors in suspend or resume · ea6104c2
      Stefan Richter authored
      
      
      Some of the suspend and resume litany may fail.
      Tell the PCI core about it.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      ea6104c2
    • Pavel Machek's avatar
      set power state of firewire host during suspend · f0645e77
      Pavel Machek authored
      
      
      Put firewire host controller in PCI Dx state for system suspend.
      (I was not able to measure any power savings, but it sounds like right
      thing to do, anyway.)
      Signed-off-by: default avatarPavel Machek <pavel@suse.cz>
      
      Update by stefanr:  Shuffle with existing PPC_PMAC code.  Set power
      state in the resume hook too.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      f0645e77
    • Stefan Richter's avatar
      ieee1394: ohci1394: more obvious endianess handling · 9531f13a
      Stefan Richter authored
      
      
      Rename ohci1394's packet_swab to header_le32_to_cpu to better reflect
      what it actually does.  Also, define a constant array as 'const' and
      check the array index properly.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      9531f13a
    • Stefan Richter's avatar
      ieee1394: ohci1394: fix endianess bug in debug message · cf82703d
      Stefan Richter authored
      
      
      The transaction labels were misprinted int the debug printk "Packet
      received from node..." due two byte-swapping once too often.  Affected
      were big endian machines, except UniNorth based ones.  Fix tested by
      Wolfgang Pfeiffer.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      cf82703d
    • Stefan Richter's avatar
      ieee1394: sbp2: don't prefer MODE SENSE 10 · 98e238cd
      Stefan Richter authored
      
      
      In the old days, sbp2 used to coerce all MODE SENSE commands into the
      10 bytes version.  When all command set conversions were removed from
      sbp2 several months ago, sdev->use_10_for_ms = 1 was added.  Meaning,
      higher SCSI layers preferred the 10 bytes version but would try the 6
      bytes version if the former failed.
      
      Recently, a problem with the 10 bytes version was discovered.  An Initio
      INIC-1530 firmware accepted the 10 bytes version but replied with bogus
      data, showing the HDD incorrectly as write-protected.  Since RBC
      actually mandates MODE SENSE (6), I checked which version was sent by
      Windows XP and Mac OS X 10.3 to an SBP-2 target hosted by Linux --- it
      was the 6 bytes version.  (Exception: OS X sent the 10 bytes version to
      an MMC target.  RBC and SBC got MODE SENSE (6).)
      
      Therefore, drop the use_10_for_ms flag from sbp2.  Now the upper layers
      will try MODE SENSE (6) before MODE SENSE (10) on all SBP-2 devices.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      98e238cd
    • Stefan Richter's avatar
      ieee1394: nodemgr: grab class.subsys.rwsem in nodemgr_resume_ne · a1842be8
      Stefan Richter authored
      
      
      nodemgr_resume_ne was iterating over nodemgr_ud_class.children without
      protection by nodemgr_ud_class.subsys.rwsem.
      
      FIXME:
      Shouldn't we rather use class->sem there, not class->subsys.rwsem?
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      a1842be8
    • Stefan Richter's avatar
      ieee1394: nodemgr: fix rwsem recursion · 9b516010
      Stefan Richter authored
      
      
      nodemgr_update_pdrv grabbed an rw semaphore (as reader) which was
      already taken by its caller's caller, nodemgr_probe_ne (as reader too).
      Reported by Miles Lane, call path pointed out by Arjan van de Ven.
      
      FIXME:
      Shouldn't we rather use class->sem there, not class->subsys.rwsem?
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      9b516010
    • Stefan Richter's avatar
      ieee1394: sbp2: more help in Kconfig · b809289d
      Stefan Richter authored
      
      
      Add some pointers to SCSI to the configuration menu item of sbp2.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      b809289d
    • Stefan Richter's avatar
      ieee1394: sbp2: prevent rare deadlock in shutdown · 2cccbb55
      Stefan Richter authored
      
      
      Scsi_remove_device() may go into uninterruptible sleep if blocked.
      Therefore sbp2_remove() unblocks the Scsi_Host before the device is
      requested to be removed.  But there could be another 1394 bus reset
      after that which would block the host again.  The 1394 subsystem won't
      call sbp2_update() concurrently to sbp2_remove(), which is why there is
      no chance for sbp2_remove() to be unblocked by sbp2_update().
      
      The fix is to tell sbp2's bus reset handler when a device is to be shut
      down so that it skips scsi_block_requests() on that host.  As before,
      any new commands after a reset without reconnect will be failed quickly
      by sbp2scsi_queuecommand().
      
      In the long term, means to go without scsi_block_requests() should be
      found.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      2cccbb55
    • Stefan Richter's avatar
      ieee1394: sbp2: update includes · 902abed1
      Stefan Richter authored
      
      
      Remove unused includes.  Add missing includes, i.e. explicitly include
      all used headers.  Sort includes alphabetically.  Replace one call to
      signal_pending(current) to avoid to include headers just for this line.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      902abed1
    • Stefan Richter's avatar
      ieee1394: sbp2: better handling of transport errors · abbca103
      Stefan Richter authored
      
      
      If the target signals a transport failure via status block, complete the
      request with DID_BUSY to indicate to the SCSI subsystem that the command
      may succeed when retried.
      
      Also log diagnostic information if the status block shows a transport
      related problem.  It may point to hardware faults.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      abbca103
    • Stefan Richter's avatar
      ieee1394: sbp2: recheck node generation in sbp2_update · 4fc383c0
      Stefan Richter authored
      
      
      While sbp2_update() is doing its duties after a bus reset, another reset
      could happen.  Don't accept new requests until the next undisturbed
      sbp2_update() or until sbp2_remove().
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      4fc383c0
    • Stefan Richter's avatar
      ieee1394: sbp2: safer agent reset in error handlers · 1f427e80
      Stefan Richter authored
      
      
      The scsi_host_template's eh_abort_handler and eh_device_reset_handler
      are allowed to sleep.  Use this to run sbp2_agent_reset in the more
      reliable mode which returns _after_ its write transaction was finished.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      1f427e80
    • Stefan Richter's avatar
      ieee1394: sbp2: handle "sbp2util_node_write_no_wait failed" · 09ee67ab
      Stefan Richter authored
      Fix for http://bugzilla.kernel.org/show_bug.cgi?id=6948
      
      
      
      Because sbp2 writes to the target's fetch agent's registers from within
      atomic context, it cannot sleep to guaranteedly get a free transaction
      label.  This may repeatedly lead to "sbp2util_node_write_no_wait failed"
      and consequently to SCSI command abortion after timeout.  A likely cause
      is that many queue_command softirqs may occur before khpsbpkt (the
      ieee1394 driver's thread which cleans up after finished transactions) is
      woken up to recycle tlabels.
      
      Sbp2 now schedules a workqueue job whenever sbp2_link_orb_command fails
      in sbp2util_node_write_no_wait.  The job will reliably get a transaction
      label because it can sleep.
      
      We use the kernel-wide shared workqueue because it is unlikely that the
      job itself actually needs to sleep.  In the improbable case that it has
      to sleep, it doesn't need to sleep long since the standard transaction
      timeout is 100ms.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      09ee67ab
    • Alexey Dobriyan's avatar
      CONFIG_PM=n slim: drivers/ieee1394/ohci1394.c · 2a874182
      Alexey Dobriyan authored
      
      
      Remove some code which is unneeded if CONFIG_PM=n.
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      2a874182
    • Stefan Richter's avatar
      ieee1394: safer definition of empty macros · 611aa19f
      Stefan Richter authored
      
      
      A deactivated macro, defined as "#define foo(bar)", will result in
      silent corruption if somebody forgets a semicolon after a call to foo.
      Replace it by "#define foo(bar) do {} while (0)" which will reveal any
      respective syntax errors.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      611aa19f
    • David Moore's avatar
      video1394: add poll file operation support · 4b60912e
      David Moore authored
      
      
      This patch adds support for the poll file operation to the video1394
      driver.
      Signed-off-by: default avatarDavid Moore <dcm@acm.org>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      4b60912e
    • Adrian Bunk's avatar
      the scheduled removal of drivers/ieee1394/sbp2.c:force_inquiry_hack · a1b3206b
      Adrian Bunk authored
      
      
      This patch contains the scheduled removal of the force_inquiry_hack
      module parameter.
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      a1b3206b
    • Andi Kleen's avatar
      Initialize ieee1394 early when built in · 8df4083c
      Andi Kleen authored
      This makes debugging with firescope easier.
      
      Signed-off-by: Andi Kleen <ak@suse.de> (original patch)
      
      Update:
       - no need for #ifdef MODULE
       - add comment in ieee1394_core, more verbose comment in ohci1394
      
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (update)
      8df4083c
    • Stefan Richter's avatar
      ieee1394: sbp2: convert sbp2util_down_timeout to waitqueue · e8398bb7
      Stefan Richter authored
      
      
      The waitqueue API is used to replace a custom wait mechanism.  Only one
      global waitqueue (instead of per-device waitqueues or completions) is
      added because there is usually just one waiter.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      e8398bb7
    • Stefan Richter's avatar
      ieee1394: sbp2: more checks of status block · 6065772d
      Stefan Richter authored
      
      
       - Add checks for the (very unlikely) cases that the target writes too
         little or too much status data or writes unsolicited status.
       - Indicate that these and similar conditions are unlikely().
       - Check the 'resp' and 'sbp_status' fields for possible failure status.
       - Slightly optimize access macros for the status block bitfields.
       - Unify a few related log messages.
      
      TODO:  Check if 'src'==1, then withhold the respective ORB from reuse
      until status for any subsequent ORB was received.  This is an old bug
      whose fix requires more complex command queue handling.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      6065772d
    • Stefan Richter's avatar
      ieee1394: sbp2: safer initialization of status fifo · 3e98eab4
      Stefan Richter authored
      
      
      Sbp2's copy of the status fifo was cleared when management ORBs or new
      command ORBs were prepared.  The latter had potential for a race
      condition if the block layer's soft IRQ and the 1394 LLD's interrupt
      handler ran on different CPUs.  It would also yield wrong status if a
      command was completed with non-zero completion status before other
      commands that had zero completion status, and no new command was
      enqueued in the meantime.
      
      Now, the status buffer is cleared right before it is written.  Thus it
      ends up in the following simpler and safer access pattern:
       - sbp2_alloc_device: allocates and implicitly clears once,
       - sbp2_handle_status_write: clears, writes, and reads,
       - sbp2_query_logins, sbp2_login_device, sbp2_reconnect_device: read.
      The latter three do not race with sbp2_handle_status_write because of
      how the protocol works.
      
      As a tiny optimization, the first two quadlets of the status never need
      to be cleared.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      3e98eab4
    • Stefan Richter's avatar
      ieee1394: sbp2: optimize DMA direction of command ORBs · d4018d7f
      Stefan Richter authored
      
      
      Only the driver writes ORBs, the device just reads them.  Therefore
      PCI_DMA_BIDIRECTIONAL can be replaced by PCI_DMA_TODEVICE which may be
      cheaper on some architectures.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      d4018d7f
    • Stefan Richter's avatar
      ieee1394: sbp2: discard return value of sbp2_link_orb_command · 28212767
      Stefan Richter authored
      
      
      Since sbp2 is at the moment unable to do anything with the return value
      of sbp2_link_orb_command, just discard it.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      28212767
    • Stefan Richter's avatar
      ieee1394: sbp2: safer last_orb and next_ORB handling · cc078189
      Stefan Richter authored
      
      
      The sbp2 initiator has two ways to tell a target's fetch agent about new
      command ORBs:
       - Write the ORB's address to the ORB_POINTER register.  This must not
         be done while the fetch agent is active.
       - Put the ORB's address into the previously submitted ORB's next_ORB
         field and write to the DOORBELL register.  This may be done while the
         fetch agent is active or suspended.  It must not be done while the
         fetch agent is in reset state.
      Sbp2 has a last_orb pointer which indicates in what way a new command
      should be announced.  That pointer is concurrently accessed at various
      occasions.  Furthermore, initiator and target are accessing the next_ORB
      field of ORBs concurrently and asynchronously.
      
      This patch does:
       - Protect all initiator accesses to last_orb by sbp2_command_orb_lock.
       - Add pci_dma_sync_single_for_device before a previously submitted
         ORB's next_ORB field is overwritten.
       - Insert a memory barrier between when next_ORB_lo and next_ORB_hi are
         overwritten.  Next_ORB_hi must not be updated before next_ORB_lo.
       - Remove the rather unspecific and now superfluous qualifier "volatile"
         from the next_ORB fields.
       - Add comments on how last_orb is connected with what is known about
         the target's fetch agent's state.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      cc078189
    • Stefan Richter's avatar
      ieee1394: remove #include <asm/semaphore.h> · 9154df53
      Stefan Richter authored
      
      
      These includes in ieee1394_core and eth1394 are obsolete.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      9154df53
    • Stefan Richter's avatar
      ieee1394: shrink tlabel pools, remove tpool semaphores · 9951903e
      Stefan Richter authored
      
      
      This patch reduces the size of struct hpsb_host and also removes
      semaphores from ieee1394_transactions.c.  On i386, struct hpsb_host
      shrinks from 10656 bytes to 6688 bytes.  This is accomplished by
       - using a single wait_queue for hpsb_get_tlabel instead of many
         instances of semaphores,
       - using a single lock to serialize access to all tlabel pools (the
         protected code regions are small, i.e. lock contention very low),
       - omitting the sysfs attribute tlabels_allocations.
      
      Drawback:  In the rare case that a process needs to sleep because all
      transaction labels for the node are temporarily exhausted, it is also
      woken up if a tlabel for a different node became free, checks for an
      available tlabel, and is put to sleep again.  The check is not costly
      and the situation occurs extremely rarely.  (Tlabels are typically
      only exhausted if there was no context switch to the khpsbpkt thread
      which recycles tlables.)  Therefore the benefit of reduced tpool size
      outweighs this drawback.
      
      The sysfs attributes tlabels_free and tlabels_mask are not compiled
      anymore unless CONFIG_IEEE1394_VERBOSEDEBUG is set.
      
      The by far biggest member of struct hpsb_host, the struct csr_control
      csr (5272 bytes on i386), is now placed at the end of struct hpsb_host.
      
      Note, hpsb_get_tlabel calls the macro wait_event_interruptible with a
      condition argument which has a side effect (allocation of a tlabel and
      manipulation of the packet).  This side effect happens only if the
      condition is true.  The patch relies on wait_event_interruptible not
      evaluating the condition again after it became true.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      9951903e
  4. 27 Aug, 2006 1 commit
  5. 06 Aug, 2006 1 commit
  6. 03 Jul, 2006 8 commits