1. 06 7月, 2006 10 次提交
    • T
      [PATCH] libata: reimplement per-dev PM · d6f26d1f
      Tejun Heo 提交于
      Reimplement per-dev PM.  The original implementation directly put the
      device into suspended mode and didn't synchronize w/ EH operations
      including hotplug.  This patch reimplements ata_scsi_device_suspend()
      and ata_scsi_device_resume() such that they request EH to perform the
      respective operations.  Both functions synchronize with hotplug such
      that it doesn't operate on detached devices.
      
      Suspend waits for completion but resume just issues request and
      returns.  This allows parallel wake up of devices and thus speeds up
      system resume.
      
      Due to sdev detach synchronization, it's not feasible to separate out
      EH requesting from sdev handling; thus, ata_device_suspend/resume()
      are removed and everything is implemented in the respective
      libata-scsi functions.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d6f26d1f
    • T
      [PATCH] libata: implement PM EH actions · 02670bf3
      Tejun Heo 提交于
      Implement two PM per-dev EH actions - ATA_EH_SUSPEND and
      ATA_EH_RESUME.  Each action puts the target device into suspended mode
      and resumes from it respectively.
      
      Once a device is put to suspended mode, no EH operations other than
      RESUME is allowed on the device.  The device will stay suspended till
      it gets resumed and thus reset and revalidated.  To implement this, a
      new device state helper - ata_dev_ready() - is implemented and used in
      EH action implementations to make them operate only on attached &
      running devices.
      
      If all possible devices on a port are suspended, reset is skipped too.
      This prevents spurious events including hotplug events from disrupting
      suspended devices.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      02670bf3
    • T
      [PATCH] libata: implement ATA_EHI_NO_AUTOPSY and QUIET · 1cdaf534
      Tejun Heo 提交于
      Implement ATA_EHI_NO_AUTOPSY and QUIET.  These used to be implied by
      ATA_PFLAG_LOADING, but new power management and PMP support need to
      use these separately.  e.g. Suspend/resume operations shouldn't print
      full EH messages and resume shouldn't be recorded as an error.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1cdaf534
    • T
      [PATCH] libata: clean up debounce parameters and improve parameter selection · e9c83914
      Tejun Heo 提交于
      The names of predefined debounce timing parameters didn't exactly
      match their usages.  Rename to more generic names and implement param
      selection helper sata_ehc_deb_timing() which uses EHI_HOTPLUGGED to
      select params.
      
      Combined with the previous EHI_RESUME_LINK differentiation, this makes
      parameter selection accurate.  e.g. user scan resumes link but normal
      deb param is used instead of hotplug param.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e9c83914
    • T
      [PATCH] libata: implement ATA_EHI_RESUME_LINK · 28324304
      Tejun Heo 提交于
      Implement ATA_EHI_RESUME_LINK, which indicates that the link needs to
      be resumed.  This used to be implied by ATA_EHI_HOTPLUGGED.  However,
      hotplug isn't the only event which requires link resume and separating
      this out allows other places to request link resume.  This
      differentiation also allows better debounce timing selection.
      
      This patch converts user scan to use ATA_EHI_RESUME_LINK.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      28324304
    • T
      [PATCH] libata: replace ap_lock w/ ap->lock in ata_scsi_error() · e30349d2
      Tejun Heo 提交于
      ap_lock was used because &ap->host_set->lock was too long and used a
      lot.  Now that &ap->host_set->lock is replaced with ap->lock, there's
      no reason to keep ap_lock.
      
      [ed. note: that's not entirely true.  ap_lock is a local variable,
      caching the results of a de-ref.  In theory, if the compiler is smart
      enough, this patch is cosmetic.  However, since this is not a fast
      path (it is the error path), this patch is nonetheless acceptable,
      even though it _may_ introduce a performance regression.]
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e30349d2
    • T
      [PATCH] libata: fix ehc->i.action setting in ata_eh_autopsy() · 0662c58b
      Tejun Heo 提交于
      ata_eh_autopsy() used to directly assign determined action mask to
      ehc->i.action thus overriding actions set by some of nested analyze
      functions.  This patch makes ata_eh_autopsy() add action masks just as
      it's done in other places.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0662c58b
    • T
      [PATCH] libata: add ap->pflags and move core dynamic flags to it · b51e9e5d
      Tejun Heo 提交于
      ap->flags is way too clamped.  Separate out core dynamic flags to
      ap->pflags.  ATA_FLAG_DISABLED is a dynamic flag but left alone as
      it's referenced by a lot of LLDs and it's gonna be removed once all
      LLDs are converted to new EH.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b51e9e5d
    • B
      [PATCH] libata: Conditionally set host->max_cmd_len · e6d902a3
      Brian King 提交于
      In preparation for SAS attached SATA devices, which will
      not have a libata scsi_host, only setup host->max_cmd_len
      if ap->host exists.
      Signed-off-by: NBrian King <brking@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e6d902a3
    • M
      [PATCH] sata_vsc: data_xfer should use mmio · a93620b8
      Martin Hicks 提交于
      Hi,
      
      sata_vsc is an MMIO device, and should use the correct data_xfer
      function.  This problem was introduced by:
      
         commit a6b2c5d4
         Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
         Date:   Mon May 22 16:59:59 2006 +0100
      
              [PATCH] PATCH: libata. Add ->data_xfer method
      Signed-off-by: NMartin Hicks <mort@bork.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a93620b8
  2. 04 7月, 2006 1 次提交
  3. 03 7月, 2006 2 次提交
  4. 01 7月, 2006 7 次提交
  5. 30 6月, 2006 1 次提交
  6. 29 6月, 2006 13 次提交
    • M
      [SCSI] iscsi: add async notification of session events · 53cb8a1f
      Mike Christie 提交于
      This patch adds or modifies the transport class functions
      used to notify userspace of session state events.
      
      We modify the session addition up event and add a destruction event
      to notify userspace of session creation, relogin and destruction.
      
      And we modify the conn error event to be sent by broadcast
      since multiple listeners may want to listen for it.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      53cb8a1f
    • M
      [SCSI] iscsi: pass target nr to session creation · 6a8a0d36
      Mike Christie 提交于
      So the drivers do not use the channel numbers, but some do
      use the target numbers. We were just adding some goofy
      variable that just increases for the target nr. This is useless
      for software iscsi because it is always zero. And for qla4xxx
      the target nr is actually the index of the target/session
      in its FW or FLASH tables. We needed to expose this to userspace
      so apps could access those numbers so this patch just adds the
      target nr to the iscsi session creation functions. This way
      when qla4xxx's Hw thinks a session is at target nr 4
      in its hw, it is exposed as that number in sysfs.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      6a8a0d36
    • M
      [SCSI] iscsi: break up session creation into two stages · 8434aa8b
      Mike Christie 提交于
      qla4xxx is initialized in two steps like other HW drivers.
      It allocates the host, sets up the HW, then adds the host.
      For iscsi part of HW setup is setting up persistent iscsi
      sessions. At that time, the interupts are off and the driver
      is not completely set up so we just want to allocate them.
      We do not want to add them to sysfs and expose them to userspace
      because userspace could try to do lots of fun things with them
      like scanning and at that time the driver is not ready.
      
      So this patch breakes up the session creation like other
      functions that use the driver model in two the alloc
      and add parts. When the driver is ready, it can then add
      the sessions and userspace can begin using them.
      
      This also fixes a bug in the addition error patch where
      we forgot to do a get on the session.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      8434aa8b
    • M
      [SCSI] iscsi: rm channel usage from iscsi · e6f3b63f
      Mike Christie 提交于
      I do not remember what I was thinking when we added the channel
      as a argument to the session create function. It was probably
      due to too much cut and paste work from the FC transport class.
      
      The channel is meaningless for iscsi drivers so this patch drops
      its usage everywhere in the iscsi related code.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      e6f3b63f
    • M
      [SCSI] iscsi: fix session refcouting · f53a88da
      Mike Christie 提交于
      iscsi_tcp and iser cannot be rmmod from the kernel when sessions
      are running because session removal is driven from userspace. For
      those modules we get a module reference when a session is
      created then drop it when the session is removed.
      
      For qla4xxx, they can jsut remove the sessions from the pci remove
      function like normal HW drivers, so this patch moves the module
      reference from the transport class functions shared by all
      drivers to the libiscsi functions only used be software iscsi
      modules.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      f53a88da
    • M
      [SCSI] iscsi: convert iscsi_tcp to new set/get param fns · 5c75b7fc
      Mike Christie 提交于
      Convert iscsi_tcp to new lib functions.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      5c75b7fc
    • M
      [SCSI] iscsi: fixup set/get param functions · a54a52ca
      Mike Christie 提交于
      Reduce duplication in the software iscsi_transport modules by
      adding a libiscsi function to handle the common grunt work.
      
      This also has the drivers return specifc -EXXX values for different
      errors so userspace can finally handle them in a sane way.
      
      Also just pass the sysfs buffers to the drivers so HW iscsi can
      get/set its string values, like targetname, and initiatorname.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      a54a52ca
    • M
      [SCSI] iscsi: add target discvery event to transport class · 01cb225d
      Mike Christie 提交于
      Patch from david.somayajulu@qlogic.com:
      
      Add target discovery event. We may have a setup where the iscsi traffic
      is on a different netowrk than the other network traffic. In this case
      we will want to do discovery though the iscsi card. This patch adds
      a event to the transport class that can be used by hw iscsi cards that
      support this.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      01cb225d
    • M
      [SCSI] st: remove unused st_buffer.in_use · 332959cb
      Martin Habets 提交于
      I noticed that in_use in st_buffer is not used. The patch below
      against 2.6.17-rc3 removes it, assuming there is no future use for it.
      It was tested in a sparc SS20 with a DLT4000.
      Signed-off-by: NMartin Habets <errandir_news@mph.eclipse.co.uk>
      Acked-by: NKai Mäkisara <kai.makisara@kolumbus.fi>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      332959cb
    • R
      [SCSI] atp870u: reduce huge stack usage · dc6a78f1
      Randy Dunlap 提交于
      The atp870u driver is the largest stack eater reported by checkstack
      (on x86_864, allmodconfig).  This converts the offending function
      to kmalloc+kfree struct atp_unit instead of allocating it on the stack.
      Was:
      0x0000164c atp870u_probe [atp870u]:			3176
      Now:
      0x0000164c atp870u_probe [atp870u]:			408
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      dc6a78f1
    • J
      [SCSI] scsi_transport_sas: introduce a sas_port entity · 65c92b09
      James Bottomley 提交于
      this patch introduces a port object, separates out ports and phys,
      with ports becoming the primary objects of the tree.
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      65c92b09
    • B
      [SCSI] scsi: Device scanning oops for offlined devices (resend) · 309bd271
      Brian King 提交于
      If a device gets offlined as a result of the Inquiry sent
      during scanning, the following oops can occur. After the
      disk gets put into the SDEV_OFFLINE state, the error handler
      sends back the failed inquiry, which wakes the thread doing
      the scan. This starts a race between the scanning thread
      freeing the scsi device and the error handler calling
      scsi_run_host_queues to restart the host. Since the disk
      is in the SDEV_OFFLINE state, scsi_device_get will still
      work, which results in __scsi_iterate_devices getting
      a reference to the scsi disk when it shouldn't.
      
      The following execution thread causes the oops:
      
      CPU 0 (scan)				CPU 1 (eh)
      
      ---------------------------------------------------------
      scsi_probe_and_add_lun
                              ....
                                              scsi_eh_offline_sdevs
                                              scsi_eh_flush_done_q
      scsi_destroy_sdev
      scsi_device_dev_release
                                              scsi_restart_operations
                                               scsi_run_host_queues
                                                __scsi_iterate_devices
                                                 get_device
      scsi_device_dev_release_usercontext
                                                scsi_run_queue
                                                  <---OOPS--->
      
      The patch fixes this by changing the state of the sdev to SDEV_DEL
      before doing the final put_device, which should prevent the race
      from occurring.
      
      Original oops follows:
      
      Badness in kref_get at lib/kref.c:32
      Call Trace:
      [C00000002F4476D0] [C00000000000EE20] .show_stack+0x68/0x1b0 (unreliable)
      [C00000002F447770] [C00000000037515C] .program_check_exception+0x1cc/0x5a8
      [C00000002F447840] [C00000000000446C] program_check_common+0xec/0x100
       Exception: 700 at .kref_get+0x10/0x28
          LR = .kobject_get+0x20/0x3c
      [C00000002F447B30] [C00000002F447BC0] 0xc00000002f447bc0 (unreliable)
      [C00000002F447BB0] [C000000000254BDC] .get_device+0x20/0x3c
      [C00000002F447C30] [D000000000063188] .scsi_device_get+0x34/0xdc [scsi_mod]
      [C00000002F447CC0] [D0000000000633EC] .__scsi_iterate_devices+0x50/0xbc [scsi_mod]
      [C00000002F447D60] [D00000000006A910] .scsi_run_host_queues+0x34/0x5c [scsi_mod]
      [C00000002F447DF0] [D000000000069054] .scsi_error_handler+0xdb4/0xe44 [scsi_mod]
      [C00000002F447EE0] [C00000000007B4E0] .kthread+0x128/0x178
      [C00000002F447F90] [C000000000025E84] .kernel_thread+0x4c/0x68
      Unable to handle kernel paging request for <7>PCI: Enabling device: (0002:41:01.1), cmd 143
      data at address 0x000001b8
      Faulting instruction address: 0xd0000000000698e4
      sym1: <1010-66> rev 0x1 at pci 0002:41:01.1 irq 216
      sym1: No NVRAM, ID 7, Fast-80, LVD, parity checking
      sym1: SCSI BUS has been reset.
      scsi2 : sym-2.2.2
      cpu 0x0: Vector: 300 (Data Access) at [c00000002f447a30]
          pc: d0000000000698e4: .scsi_run_queue+0x2c/0x218 [scsi_mod]
          lr: d00000000006a904: .scsi_run_host_queues+0x28/0x5c [scsi_mod]
          sp: c00000002f447cb0
         msr: 9000000000009032
         dar: 1b8
       dsisr: 40000000
        current = 0xc0000000045fecd0
        paca    = 0xc00000000048ee80
          pid   = 1123, comm = scsi_eh_1
      enter ? for help
      [c00000002f447d60] d00000000006a904 .scsi_run_host_queues+0x28/0x5c [scsi_mod]
      [c00000002f447df0] d000000000069054 .scsi_error_handler+0xdb4/0xe44 [scsi_mod]
      [c00000002f447ee0] c00000000007b4e0 .kthread+0x128/0x178
      [c00000002f447f90] c000000000025e84 .kernel_thread+0x4c/0x68
      Signed-off-by: NBrian King <brking@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      309bd271
    • B
      [SCSI] scsi: Add allow_restart sysfs class attribute · a144c5ae
      Brian King 提交于
      This is a resend of a patch I generated in response to an email sent
      by Ruben Faelens <parasietje@gmail.com>. His original email to
      linux-scsi requested a method in which he could spin down a scsi disk
      when not in use and have the kernel automatically spin it back up when
      an I/O was generated to the disk. The infrastructure to automatically
      spin a disk up has been in the scsi error handler for some time now,
      but it is not enabled by default. This patch adds an sd sysfs attribute
      which allows userspace to enable this behavior.
      Signed-off-by: NBrian King <brking@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      a144c5ae
  7. 28 6月, 2006 4 次提交
  8. 27 6月, 2006 2 次提交
    • J
      [SCSI] update max sdev block limit · 1c9e16e4
      James Smart 提交于
      Updated patch to address comments from Pat Mansfield and Michael Reed:
      Bumped max to 600 (10mins). Set default dev_loss_tmo to a value other
      than the max (30s).
      Signed-off-by: NJames Smart <James.Smart@emulex.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      1c9e16e4
    • J
      [SCSI] fc transport: resolve scan vs delete deadlocks · a0785edf
      James Smart 提交于
      In a prior posting to linux-scsi on the fc transport and workq
      deadlocks, we noted a second error that did not have a patch:
        http://marc.theaimsgroup.com/?l=linux-scsi&m=114467847711383&w=2
        - There's a deadlock where scsi_remove_target() has to sit behind
          scsi_scan_target() due to contention over the scan_lock().
      
      Subsequently we posted a request for comments about the deadlock:
        http://marc.theaimsgroup.com/?l=linux-scsi&m=114469358829500&w=2
      
      This posting resolves the second error. Here's what we now understand,
      and are implementing:
      
        If the lldd deletes the rport while a scan is active, the sdev's queue
        is blocked which stops the issuing of commands associated with the scan.
        At this point, the scan stalls, and does so with the shost->scan_mutex held.
        If, at this point, if any scan or delete request is made on the host, it
        will stall waiting for the scan_mutex.
      
        For the FC transport, we queue all delete work to a single workq.
        So, things worked fine when competing with the scan, as long as the
        target blocking the scan was the same target at the top of our delete
        workq, as the delete workq routine always unblocked just prior to
        requesting the delete.  Unfortunately, if the top of our delete workq
        was for a different target, we deadlock.  Additionally, if the target
        blocking scan returned, we were unblocking it in the scan workq routine,
        which really won't execute until the existing stalled scan workq
        completes (e.g. we're re-scheduling it while it is in the midst of its
        execution).
      
        This patch moves the unblock out of the workq routines and moves it to
        the context that is scheduling the work. This ensures that at some point,
        we will unblock the target that is blocking scan.  Please note, however,
        that the deadlock condition may still occur while it waits for the
        transport to timeout an unblock on a target.  Worst case, this is bounded
        by the transport dev_loss_tmo (default: 30 seconds).
      
      Finally, Michael Reed deserves the credit for the bulk of this patch,
      analysis, and it's testing. Thank you for your help.
      
      Note: The request for comments statements about the gross-ness of the
        scan_mutex still stand.
      Signed-off-by: NMichael Reed <mdr@sgi.com>
      Signed-off-by: NJames Smart <james.smart@emulex.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      a0785edf