1. 24 10月, 2008 1 次提交
  2. 11 10月, 2008 1 次提交
  3. 09 10月, 2008 1 次提交
  4. 29 9月, 2008 1 次提交
    • E
      libata: Implement disk shock protection support · 45fabbb7
      Elias Oltmanns 提交于
      On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD
      FEATURE as specified in ATA-7 is issued to the device and processing of
      the request queue is stopped thereafter until the specified timeout
      expires or user space asks to resume normal operation. This is supposed
      to prevent the heads of a hard drive from accidentally crashing onto the
      platter when a heavy shock is anticipated (like a falling laptop
      expected to hit the floor). In fact, the whole port stops processing
      commands until the timeout has expired in order to avoid any resets due
      to failed commands on another device.
      Signed-off-by: NElias Oltmanns <eo@nebensachen.de>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      45fabbb7
  5. 31 7月, 2008 1 次提交
    • T
      libata: update atapi disable handling · 2486fa56
      Tejun Heo 提交于
      Global and per-LLD ATAPI disable checks were done in the command issue
      path probably because it was left out during EH conversion.  On
      affected machines, this can cause lots of warning messages.  Move them
      to where they belong - the probing path.
      
      Reported by Chunbo Luo.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Chunbo Luo <chunbo.luo@windriver.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      2486fa56
  6. 15 7月, 2008 2 次提交
  7. 04 7月, 2008 1 次提交
  8. 19 6月, 2008 1 次提交
  9. 31 5月, 2008 1 次提交
  10. 20 5月, 2008 1 次提交
  11. 29 4月, 2008 2 次提交
    • T
      libata-scsi: improve rbuf handling for simulated commands · 87340e98
      Tejun Heo 提交于
      Buffer length handling in simulated commands is error-prone and full
      of bugs.  There are a number of places where necessary length checks
      are missing and if the output buffer is passed in as sglist, nothing
      works.
      
      This patch adds a static buffer ata_scsi_rbuf which is sufficiently
      large to handle the larges output from simulated commands (4k
      currently), let all simulte functions write to the buffer and removes
      all length checks as we know that there always is enough buffer space.
      Copying in (for ATAPI inquiry fix up) and out are handled by
      sg_copy_to/from_buffer() behind ata_scsi_rbuf_get/put() interface
      which handles sglist properly.
      
      This patch is inspired from buffer length check fix patch from Petr
      Vandrovec.
      
      Updated to use sg_copy_to/from_buffer() as suggested by FUJITA
      Tomonori.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Petr Vandrovec <petr@vmware.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      87340e98
    • T
      libata-scsi: clean up inquiry / mode sense related functions · f0761be3
      Tejun Heo 提交于
      * make ata_scsiop_*() static
      * make ata_scsi_set_sense() static and move it above its users
      * make ata_scsi_rbuf_fill() static
      * kill unused ata_scsi_badcmd()
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f0761be3
  12. 20 4月, 2008 1 次提交
  13. 19 4月, 2008 1 次提交
  14. 18 4月, 2008 6 次提交
    • T
      libata: implement PMP helpers · 071f44b1
      Tejun Heo 提交于
      Implement helpers to test whether PMP is supported, attached and
      determine pmp number to use when issuing SRST to a link.  While at it,
      move ata_is_host_link() so that it's together with the two new PMP
      helpers.
      
      This change simplifies LLDs and helps making PMP support optional.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      071f44b1
    • T
      libata: make SFF support optional · 127102ae
      Tejun Heo 提交于
      Now that SFF support is completely separated out from the core layer,
      it can be made optional.  Add CONFIG_ATA_SFF and let SFF drivers
      depend on it.  If CONFIG_ATA_SFF isn't set, all codes in libata-sff.c
      and data structures for SFF support are disabled.  This saves good
      number of bytes for small systems.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      127102ae
    • T
      libata: rename SFF port ops · 5682ed33
      Tejun Heo 提交于
      Add sff_ prefix to SFF specific port ops.
      
      This rename is in preparation of separating SFF support out of libata
      core layer.  This patch strictly renames ops and doesn't introduce any
      behavior difference.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      5682ed33
    • T
      libata: kill ata_ehi_schedule_probe() · b558eddd
      Tejun Heo 提交于
      ata_ehi_schedule_probe() was created to hide details of link-resuming
      reset magic.  Now that all the softreset workarounds are gone,
      scheduling probe is very simple - set probe_mask and request RESET.
      Kill ata_ehi_schedule_probe() and open code it.  This also increases
      consistency as ata_ehi_schedule_probe() couldn't cover individual
      device probings so they were open-coded even when the helper existed.
      
      While at it, define ATA_ALL_DEVICES as mask of all possible devices on
      a link and always use it when requesting probe on link level for
      simplicity and consistency.  Setting extra bits in the probe_mask
      doesn't hurt anybody.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      b558eddd
    • T
      libata: kill ATA_EHI_RESUME_LINK · 672b2d65
      Tejun Heo 提交于
      ATA_EHI_RESUME_LINK has two functions - promote reset to hardreset if
      ATA_LFLAG_HRST_TO_RESUME is set and preventing EH from shortcutting
      reset action when probing is requested.  The former is gone now and
      the latter can easily be achieved by making EH to perform at least one
      reset if reset is requested, which also makes more sense than
      depending on RESUME_LINK flag.
      
      As ATA_EHI_RESUME_LINK was the only EHI reset modifier, this also
      kills reset modifier handling.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      672b2d65
    • T
      libata: prefer hardreset · cf480626
      Tejun Heo 提交于
      When both soft and hard resets are available, libata preferred
      softreset till now.  The logic behind it was to be softer to devices;
      however, this doesn't really help much.  Rationales for the change:
      
      * BIOS may freeze lock certain things during boot and softreset can't
        unlock those.  This by itself is okay but during operation PHY event
        or other error conditions can trigger hardreset and the device may
        end up with different configuration.
      
        For example, after a hardreset, previously unlockable HPA can be
        unlocked resulting in different device size and thus revalidation
        failure.  Similar condition can occur during or after resume.
      
      * Certain ATAPI devices require hardreset to recover after certain
        error conditions.  On PATA, this is done by issuing the DEVICE RESET
        command.  On SATA, COMRESET has equivalent effect.  The problem is
        that DEVICE RESET needs its own execution protocol.
      
        For SFF controllers with bare TF access, it can be easily
        implemented but more advanced controllers (e.g. ahci and sata_sil24)
        require specialized implementations.  Simply using hardreset solves
        the problem nicely.
      
      * COMRESET initialization sequence is the norm in SATA land and many
        SATA devices don't work properly if only SRST is used.  For example,
        some PMPs behave this way and libata works around by always issuing
        hardreset if the host supports PMP.
      
        Like the above example, libata has developed a number of mechanisms
        aiming to promote softreset to hardreset if softreset is not going
        to work.  This approach is time consuming and error prone.
      
        Also, note that, dependingon how you read the specs, it could be
        argued that PMP fan-out ports require COMRESET to start operation.
        In fact, all the PMPs on the market except one don't work properly
        if COMRESET is not issued to fan-out ports after PMP reset.
      
      * COMRESET is an integral part of SATA connection and any working
        device should be able to handle COMRESET properly.  After all, it's
        the way to signal hardreset during reboot.  This is the most used
        and recommended (at least by the ahci spec) method of resetting
        devices.
      
      So, this patch makes libata prefer hardreset over softreset by making
      the following changes.
      
      * Rename ATA_EH_RESET_MASK to ATA_EH_RESET and use it whereever
        ATA_EH_{SOFT|HARD}RESET used to be used.  ATA_EH_{SOFT|HARD}RESET is
        now only used to tell prereset whether soft or hard reset will be
        issued.
      
      * Strip out now unneeded promote-to-hardreset logics from
        ata_eh_reset(), ata_std_prereset(), sata_pmp_std_prereset() and
        other places.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      cf480626
  15. 08 4月, 2008 1 次提交
  16. 25 3月, 2008 1 次提交
  17. 04 3月, 2008 2 次提交
  18. 01 3月, 2008 1 次提交
  19. 24 2月, 2008 1 次提交
    • T
      libata: automatically use DMADIR if drive/bridge requires it · 91163006
      Tejun Heo 提交于
      Back in 2.6.17-rc2, a libata module parameter was added for atapi_dmadir.
      
      That's nice, but most SATA devices which need it will tell us about it
      in their IDENTIFY PACKET response, as bit-15 of word-62 of the
      returned data (as per ATA7, ATA8 specifications).
      
      So for those which specify it, we should automatically use the DMADIR bit.
      Otherwise, disc writing will fail by default on many SATA-ATAPI drives.
      
      This patch adds ATA_DFLAG_DMADIR and make ata_dev_configure() set it
      if atapi_dmadir is set or identify data indicates DMADIR is necessary.
      atapi_xlat() is converted to check ATA_DFLAG_DMADIR before setting
      DMADIR.
      
      Original patch is from Mark Lord.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Mark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      91163006
  20. 21 2月, 2008 1 次提交
  21. 19 2月, 2008 2 次提交
    • J
      libata: implement drain buffers · fa2fc7f4
      James Bottomley 提交于
      This just updates the libata slave configure routine to take advantage
      of the block layer drain buffers.  It also adjusts the size lengths in
      the atapi code to add the drain buffer to the DMA length so the driver
      knows it can rely on it.
      
      I suspect I should also be checking for AHCI as well as ATA_DEV_ATAPI,
      but I couldn't see how to do that easily.
      
      tj: * atapi_drain_needed() added such that draining is applied to only
            misc ATAPI commands.
          * q->bounce_gfp used when allocating drain buffer.
          * Now duplicate ATAPI PIO drain logic dropped.
          * ata_dev_printk() used instead of sdev_printk().
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      fa2fc7f4
    • J
      libata: eliminate the home grown dma padding in favour of · dde20207
      James Bottomley 提交于
      that provided by the block layer
      
      ATA requires that all DMA transfers begin and end on word boundaries.
      Because of this, a large amount of machinery grew up in ide to adjust
      scatterlists on this basis.  However, as of 2.5, the block layer has a
      dma_alignment variable which ensures both the beginning and length of a
      DMA transfer are aligned on the dma_alignment boundary.  Although the
      block layer does adjust the beginning of the transfer to ensure this
      happens, it doesn't actually adjust the length, it merely makes sure
      that space is allocated for transfers beyond the declared length.  The
      upshot of this is that scatterlists may be padded to any size between
      the actual length and the length adjusted to the dma_alignment safely
      knowing that memory is allocated in this region.
      
      Right at the moment, SCSI takes the default dma_aligment which is on a
      512 byte boundary.  Note that this aligment only applies to transfers
      coming in from user space.  However, since all kernel allocations are
      automatically aligned on a minimum of 32 byte boundaries, it is safe to
      adjust them in this manner as well.
      
      tj: * Adjusting sg after padding is done in block layer.  Make libata
            set queue alignment correctly for ATAPI devices and drop broken
            sg mangling from ata_sg_setup().
          * Use request->raw_data_len for ATAPI transfer chunk size.
          * Killed qc->raw_nbytes.
          * Separated out killing qc->n_iter.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      dde20207
  22. 16 2月, 2008 1 次提交
  23. 24 1月, 2008 1 次提交
  24. 23 1月, 2008 7 次提交
    • J
      [libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof() · 7ccd720d
      James Bottomley 提交于
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      7ccd720d
    • A
      [libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof() · cadb7345
      akpm@linux-foundation.org 提交于
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      cadb7345
    • A
      libata annotations and fixes · 4ca4e439
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4ca4e439
    • T
      libata: convert to chained sg · ff2aeb1e
      Tejun Heo 提交于
      libata used private sg iterator to handle padding sg.  Now that sg can
      be chained, padding can be handled using standard sg ops.  Convert to
      chained sg.
      
      * s/qc->__sg/qc->sg/
      
      * s/qc->pad_sgent/qc->extra_sg[]/.  Because chaining consumes one sg
        entry.  There need to be two extra sg entries.  The renaming is also
        for future addition of other extra sg entries.
      
      * Padding setup is moved into ata_sg_setup_extra() which is organized
        in a way that future addition of other extra sg entries is easy.
      
      * qc->orig_n_elem is unused and removed.
      
      * qc->n_elem now contains the number of sg entries that LLDs should
        map.  qc->mapped_n_elem is added to carry the original number of
        mapped sgs for unmapping.
      
      * The last sg of the original sg list is used to chain to extra sg
        list.  The original last sg is pointed to by qc->last_sg and the
        content is stored in qc->saved_last_sg.  It's restored during
        ata_sg_clean().
      
      * All sg walking code has been updated.  Unnecessary assertions and
        checks for conditions the core layer already guarantees are removed.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ff2aeb1e
    • T
      libata: rename ATA_PROT_ATAPI_* to ATAPI_PROT_* · 0dc36888
      Tejun Heo 提交于
      ATA_PROT_ATAPI_* are ugly and naming schemes between ATA_PROT_* and
      ATA_PROT_ATAPI_* are inconsistent causing confusion.  Rename them to
      ATAPI_PROT_* and make them consistent with ATA counterpart.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      0dc36888
    • T
      libata: make atapi_request_sense() use sg · 93f8fecb
      Tejun Heo 提交于
      atapi_request_sense() is now the only left user of ata_sg_init_one().
      Convert it to use sg interface.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Rusty Russel <rusty@rustcorp.com.au>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      93f8fecb
    • A
      libata: Disable ATA8-ACS proposed Trusted Computing features by default · ae8d4ee7
      Alan Cox 提交于
      Historically word 48 in the identify data was used to mean 32bit I/O
      was supported for VLB IDE etc. ATA8 reassigns this word to the Trusted
      Computing Group, where it is used for TCG features. This means that
      an ATA8 TCG drive is going to trigger 32bit I/O on some systems which
      will be funny.
      
      Anyway we need to sort this out ready for ATA8 so:
      - Reorder the ata.h header a bit so the ata_version function occurs early
        in it
      - Make dword_io check the ATA version
      - Add an ATA8 version checking TCG presence test
      
      While we are at it the current drafts have a flaw where it may not be
      possible to disable TCG features at boot (and opt out of the trusted
      model) as TCG intends because it relies on presence of a different
      optional feature (DCS). Handle this in software by refusing the TCG
      commands if libata.allow_tpm is not set. (We must make it possible
      as some environments such as proprietary VDR devices will doubtless
      want to use it to lock up content)
      
      Finally as with CPRM print a warning so that the user knows they may
      not be able to full access and use the device.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      ae8d4ee7
  25. 15 1月, 2008 1 次提交