1. 10 2月, 2007 5 次提交
  2. 30 1月, 2007 2 次提交
  3. 24 1月, 2007 1 次提交
  4. 21 12月, 2006 3 次提交
    • T
      [PATCH] libata: take scmd->cmd_len into account when translating SCSI commands · 2e5704f6
      Tejun Heo 提交于
      libata depended on SCSI command to have the correct length when
      tranlating it into an ATA command.  This generally worked for commands
      issued by SCSI HLD but user could issue arbitrary broken command using
      sg interface.
      
      Also, when building ATAPI command, full command size was always
      copied.  Because some ATAPI devices needs bytes after CDB cleared, if
      upper layer doesn't clear bytes after CDB, such devices will
      malfunction.  This necessiated recent clear-garbage-after-CDB fix in
      sg interfaces.  However, scsi_execute() isn't fixed yet and HL-DT-ST
      DVD-RAM GSA-H30N malfunctions on initialization commands issued from
      SCSI.
      
      This patch makes xlat functions always consider SCSI cmd_len.  Each
      translation function checks for proper cmd_len and ATAPI translaation
      clears bytes after CDB.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Douglas Gilbert <dougg@torque.net>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      2e5704f6
    • T
      [PATCH] libata: kill @cdb argument from xlat methods · ad706991
      Tejun Heo 提交于
      xlat function will be updated to consider qc->scsicmd->cmd_len and
      many xlat functions deference qc->scsicmd already.  It doesn't make
      sense to pass qc->scsicmd->cmnd as @cdb separately.  Kill the
      argument.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ad706991
    • T
      [PATCH] libata: clean up variable name usage in xlat related functions · 542b1444
      Tejun Heo 提交于
      Variable names in xlat functions are quite confusing now.  'scsicmd'
      is used for CDB while qc->scsicmd points to struct scsi_cmnd while
      'cmd' is used for struct scsi_cmnd.
      
      This patch cleans up variable names in xlat functions such that 'scmd'
      is used for struct scsi_cmnd and 'cdb' for CDB.  Also, 'scmd' local
      variable is added if qc->scsicmd is used multiple times.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      542b1444
  5. 16 12月, 2006 1 次提交
    • J
      [libata] use kmap_atomic(KM_IRQ0) in SCSI simulator · da02d2a1
      Jeff Garzik 提交于
      We are inside spin_lock_irqsave().  quoth akpm's debug facility:
      
       [  231.948000] SCSI device sda: 195371568 512-byte hdwr sectors (100030 MB)
       [  232.232000] ata1.00: configured for UDMA/33
       [  232.404000] WARNING (1) at arch/i386/mm/highmem.c:47 kmap_atomic()
       [  232.404000]  [<c01162e6>] kmap_atomic+0xa9/0x1ab
       [  232.404000]  [<c0242c81>] ata_scsi_rbuf_get+0x1c/0x30
       [  232.404000]  [<c0242caf>] ata_scsi_rbuf_fill+0x1a/0x87
       [  232.404000]  [<c0243ab2>] ata_scsiop_mode_sense+0x0/0x309
       [  232.404000]  [<c01729d5>] end_bio_bh_io_sync+0x0/0x37
       [  232.404000]  [<c02311c6>] scsi_done+0x0/0x16
       [  232.404000]  [<c02311c6>] scsi_done+0x0/0x16
       [  232.404000]  [<c0242dcc>] ata_scsi_simulate+0xb0/0x13f
      [...]
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      da02d2a1
  6. 03 12月, 2006 3 次提交
  7. 02 12月, 2006 6 次提交
  8. 28 11月, 2006 2 次提交
  9. 22 11月, 2006 1 次提交
    • D
      WorkStruct: Pass the work_struct pointer instead of context data · 65f27f38
      David Howells 提交于
      Pass the work_struct pointer to the work function rather than context data.
      The work function can use container_of() to work out the data.
      
      For the cases where the container of the work_struct may go away the moment the
      pending bit is cleared, it is made possible to defer the release of the
      structure by deferring the clearing of the pending bit.
      
      To make this work, an extra flag is introduced into the management side of the
      work_struct.  This governs auto-release of the structure upon execution.
      
      Ordinarily, the work queue executor would release the work_struct for further
      scheduling or deallocation by clearing the pending bit prior to jumping to the
      work function.  This means that, unless the driver makes some guarantee itself
      that the work_struct won't go away, the work function may not access anything
      else in the work_struct or its container lest they be deallocated..  This is a
      problem if the auxiliary data is taken away (as done by the last patch).
      
      However, if the pending bit is *not* cleared before jumping to the work
      function, then the work function *may* access the work_struct and its container
      with no problems.  But then the work function must itself release the
      work_struct by calling work_release().
      
      In most cases, automatic release is fine, so this is the default.  Special
      initiators exist for the non-auto-release case (ending in _NAR).
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      65f27f38
  10. 14 11月, 2006 1 次提交
    • D
      libata: fix double-completion on error · 253b92ec
      Darrick J. Wong 提交于
      A curious thing happens, however, when ata_qc_new_init fails to get
      an ata_queued_cmd:
      
      First, ata_qc_new_init handles the failure like this:
          cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1);
          done(cmd);
      
      Then, we return to ata_scsi_translate and do this:
          err_mem:
              cmd->result = (DID_ERROR << 16);
              done(cmd);
      
      It appears to me that first we set a status code indicating that we're
      ok but the device queue is full and finish the command,  but then
      we blow away that status code and replace it with an error flag and
      finish the command a second time!  That does not seem to be desirable
      behavior since we merely want the I/O to wait until a command slot
      frees up, not send errors up the block layer.
      
      In the err_mem case, we should simply exit out of ata_scsi_translate
      instead.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      253b92ec
  11. 11 10月, 2006 1 次提交
  12. 30 9月, 2006 1 次提交
  13. 29 9月, 2006 1 次提交
  14. 24 8月, 2006 1 次提交
    • J
      libata: Grand renaming. · cca3974e
      Jeff Garzik 提交于
      The biggest change is that ata_host_set is renamed to ata_host.
      
      * ata_host_set			=> ata_host
      * ata_probe_ent->host_flags	=> ata_probe_ent->port_flags
      * ata_probe_ent->host_set_flags	=> ata_probe_ent->_host_flags
      * ata_host_stats		=> ata_port_stats
      * ata_port->host		=> ata_port->scsi_host
      * ata_port->host_set		=> ata_port->host
      * ata_port_info->host_flags	=> ata_port_info->flags
      * ata_(.*)host_set(.*)\(\)	=> ata_\1host\2()
      
      The leading underscore in ata_probe_ent->_host_flags is to avoid
      reusing ->host_flags for different purpose.  Currently, the only user
      of the field is libata-bmdma.c and probe_ent itself is scheduled to be
      removed.
      
      ata_port->host is reused for different purpose but this field is used
      inside libata core proper and of different type.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      cca3974e
  15. 10 8月, 2006 1 次提交
  16. 09 8月, 2006 2 次提交
    • T
      [PATCH] libata: clear sdev->locked on door lock failure · 22aac089
      Tejun Heo 提交于
      SCSI EH locks door if sdev->locked is set.  Sometimes door lock
      command fails continuously (e.g. when medium is not present) and as
      libata uses EH to acquire sense data, this easily creates a loop where
      a failed lock door invokes EH and EH issues lock door on completion.
      
      This patch clears sdev->locked on door lock failure to break this
      loop.  This problem has been spotted and diagnosed by Unicorn Chang
      <uchang@tw.ibm.com>.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      22aac089
    • B
      [PATCH] libata: Add support for SATA attachment to SAS adapters · 80289167
      Brian King 提交于
      The following patch enhances libata to allow SAS device drivers
      to utilize libata to talk to SATA devices. It introduces some
      new APIs which allow libata to be used without allocating a
      virtual scsi host.
      
      New APIs:
      
      ata_sas_port_alloc - Allocate an ata_port
      ata_sas_port_init - Initialize an ata_port (probe device, etc)
      ata_sas_port_destroy - Free an ata_port allocated by ata_sas_port_alloc
      ata_sas_slave_configure - configure scsi device
      ata_sas_queuecmd - queue a scsi command, similar to ata_scsi_queuecomand
      
      These new APIs can be used either directly by a SAS LLDD or could be used
      by the SAS transport class.
      
      Possible usage for a SAS LLDD would be:
      
      scsi_scan_host
      	target_alloc
      		ata_sas_port_alloc
      	slave_alloc
      		ata_sas_port_init
      	slave_configure
      		ata_sas_slave_configure
      
      Commands received by the LLDD for SATA devices would call ata_sas_queuecmd.
      
      Device teardown would occur with:
      
      slave_destroy
      	port_disable
      target_destroy
      	ata_sas_port_destroy
      Signed-off-by: NBrian King <brking@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      80289167
  17. 29 7月, 2006 1 次提交
  18. 06 7月, 2006 3 次提交
    • 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 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: 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
  19. 28 6月, 2006 1 次提交
  20. 23 6月, 2006 2 次提交
  21. 12 6月, 2006 1 次提交