1. 29 4月, 2007 24 次提交
    • A
      ata: printk warning fixes · bd1d5ec6
      Andrew Morton 提交于
      drivers/ata/libata-core.c: In function 'ata_hpa_resize':
      drivers/ata/libata-core.c:986: warning: format '%lld' expects type 'long long int', but argument 5 has type 'u64'
      drivers/ata/libata-core.c:986: warning: format '%lld' expects type 'long long int', but argument 6 has type 'u64'
      drivers/ata/libata-core.c:990: warning: format '%lld' expects type 'long long int', but argument 4 has type 'u64'
      drivers/ata/libata-core.c:990: warning: format '%lld' expects type 'long long int', but argument 5 has type 'u64'
      drivers/ata/libata-core.c:1003: warning: format '%lld' expects type 'long long int', but argument 4 has type 'u64'
      
      Also fix various 80-col bustage.
      
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      bd1d5ec6
    • A
      ata_timing: ensure t->cycle is always correct · 4f701d1e
      Alan Cox 提交于
      Russell King hit a case where quantisation errors accumulated such that
      the cycle time was shorter than rather than equal to the active/recovery
      time. The code already knows how to stretch times to fit the cycle time
      but does not know about the reverse.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4f701d1e
    • M
      libata: Handle drives that require a spin-up command before first access · 169439c2
      Mark Lord 提交于
      (S)ATA drives can be configured for "power-up in standby",
      a mode whereby a specific "spin up now!" command is required
      before the first media access.
      
      Currently, a drive with this feature enabled can not be used at all
      with libata, and once in this mode, the drive becomes a doorstop.
      
      The older drivers/ide subsystem at least enumerates the drive,
      so that it can be woken up after the fact from a userspace HDIO_*
      command, but not libata.
      
      This patch adds support to libata for the "power-up in standby"
      mode where a "spin up now!" command (SET_FEATURES) is needed.
      With this, libata will recognize such drives, spin them up,
      and then re-IDENTIFY them if necessary to get a full/complete
      set of drive features data.
      
      Drives in this state are determined by looking for
      special values in id[2], as documented in the current ATA specs.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      169439c2
    • A
      libata: HPA support · 1e999736
      Alan Cox 提交于
      Signed-off-by: NAlan Cox <alan@redhat.com>
      
      Add support for ignoring the BIOS HPA result (off by default) and setting
      the disk to the full available size unless already frozen.
      
      Tested with various platforms/disks and confirmed to work with the
      Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
      readback that Tejun fixed).
      
      For normal users this brings us, I believe, to feature parity with old IDE
      (and of course more featured in some areas too).
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1e999736
    • T
      libata: kill probe_ent and related helpers · 6bfff31e
      Tejun Heo 提交于
      All drivers are converted to new init model.  Kill probe_ent,
      ata_device_add() and ata_pci_init_native_mode().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6bfff31e
    • T
      libata: add init helpers including ata_pci_prepare_native_host() · 21b0ad4f
      Tejun Heo 提交于
      These will be used to convert LLDs to new init model.
      
      * Add irq_handler field to port_info.  In new init model, requesting
        IRQ is LLD's responsibility and libata doesn't need to know about
        irq_handler.  Most LLDs can simply register their irq_handler but
        some need different irq_handler depending on specific chip.  The
        added port_info->irq_handler field can be used by LLDs to select
        the matching IRQ handler in such cases.
      
      * Add ata_dummy_port_info.
      
      * Implement ata_pci_prepare_native_host(), a helper to alloc ATA host,
        acquire all resources and init the host in one go.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      21b0ad4f
    • T
      libata: convert native PCI host handling to new init model · d491b27b
      Tejun Heo 提交于
      Convert native PCI host handling to alloc-init-register model.  New
      function ata_pci_init_native_host() follows the new init model and
      replaces ata_pci_init_native_mode().  As there are remaining LLD
      users, the old function isn't removed yet.
      
      ata_pci_init_one() is reimplemented using the new function and now
      fully converted to new init model.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d491b27b
    • T
      libata: implement ata_host_alloc_pinfo() and ata_host_register() · f5cda257
      Tejun Heo 提交于
      Implement ata_host_alloc_pinfo() and ata_host_register().  These helpers
      will be used in the following patches to adopt new init model.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f5cda257
    • T
      libata: separate out ata_host_alloc() and ata_host_register() · f3187195
      Tejun Heo 提交于
      Reorganize ata_host_alloc() and its subroutines into the following
      three functions.
      
      * ata_host_alloc() : allocates host and its ports.  shost is not
        registered automatically.
      
      * ata_scsi_add_hosts() : allocates and adds shosts associated with an
        ATA host.  Used by ata_host_register().
      
      * ata_host_register() : takes a fully initialized ata_host structure
        and registers it to libata layer and probes it.
      
      Only ata_host_alloc() and ata_host_register() are exported.
      ata_device_add() is rewritten using the above functions.  This patch
      does not introduce any observable behavior change.  Things worth
      mentioning.
      
      * print_id is assigned at registration time and LLDs are allowed to
        overallocate ports and reduce host->n_ports during initialization.
        ata_host_register() will throw away unused ports automatically.
      
      * All SCSI host initialization stuff now resides in
        ata_scsi_add_hosts() in libata-scsi.c, where it should be.
      
      * ipr is now the only user of ata_host_init().  Either kill it by
        converting ipr to use ata_host_alloc() and friends or rename and
        move it to libata-scsi.c
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f3187195
    • T
      libata: separate out ata_host_start() · ecef7253
      Tejun Heo 提交于
      Separate out ata_host_start() from ata_device_add().  ata_host_start()
      calls ->port_start on each port if available and freezes the port.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ecef7253
    • T
      libata: allocate ap separately from shost · 4911487a
      Tejun Heo 提交于
      Don't embed ap inside shost.  Allocate it separately and point it back
      from shosts's hostdata.  This makes port allocation more flexible and
      allows regular ATA and SAS share host alloc/init paths.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4911487a
    • T
      libata: kill type mismatch compile warning · 03ec52de
      Tejun Heo 提交于
      kill the following compile warning.
      
      drivers/ata/libata-core.c:1786: warning: comparison of distinct pointer types lacks a cast
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      03ec52de
    • T
      libata: improve AC_ERR_DEV handling for ->post_internal_cmd · a51d644a
      Tejun Heo 提交于
      ->post_internal_cmd is simplified EH for internal commands.  Its
      primary mission is to stop the controller such that no rogue memory
      access or other activities occur after the internal command is
      released.  It may provide error diagnostics by setting qc->err_mask
      but this hasn't been a requirement.
      
      To ignore SETXFER failure for CFA devices, libata needs to know
      whether a command was failed by the device or for any other reason.
      ie. internal command needs to get AC_ERR_DEV right.
      
      This patch makes the following changes to AC_ERR_DEV handling and
      ->post_internal_cmd semantics to accomodate this need and simplify
      callback implementation.
      
      1. As long as the correct bits in the result TF registers are set,
         there is no need to set AC_ERR_DEV explicitly.  libata EH core
         takes care of that for both normal and internal commands.
      
      2. The only requirement for ->post_internal_cmd() is to put the
         controller into quiescent state.  It needs not to set any err_mask.
      
      3. ata_exec_internal_sg() performs minimal error analysis such that
         AC_ERR_DEV is automatically set as long as result_tf is filled
         correctly.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a51d644a
    • M
      libata: add support for READ/WRITE LONG · 5a5dbd18
      Mark Lord 提交于
      The READ/WRITE LONG commands are theoretically obsolete,
      but the majority of drives in existance still implement them.
      
      The WRITE_LONG and WRITE_LONG_ONCE commands are of particular
      interest for fault injection testing -- eg. creating "media errors"
      at specific locations on a disk.
      
      The fussy bit is that these commands require a non-standard
      sector size, usually 520 bytes instead of 512.
      
      This patch adds support to libata for READ/WRITE LONG commands
      issued via SG_IO/ATA_16.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      5a5dbd18
    • J
      [libata] turn on !IORDY filter · e424675f
      Jeff Garzik 提交于
      The previous commit erroneously noted that the !IORDY filter was turned
      on.  No true, that change was split out into this commit.
      
      Originally authored and signed-off-by Alan Cox.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e424675f
    • A
      libata: Change prototype of mode_filter to remove ata_port* · a76b62ca
      Alan Cox 提交于
      With Tejun having added adev->ap some time ago we can get rid of the
      almost unused port being passed to mode filters. And while we are
      doing filters, lets turn on the !IORDY filter as well.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      
      With some hand massaging from
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a76b62ca
    • A
      libata-core: Fix the iordy methods · 432729f0
      Alan Cox 提交于
      This alone isn't sufficient to save the universe from prehistoric disks
      and controllers but it is a first important step. Split off a separate
      function to provide a mode filter when controller iordy is not available.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      432729f0
    • A
      pata: expose set_mode method so it can be wrapped · 04351821
      Alan 提交于
      This splits set_mode into do_set_mode and the wrapper so that a driver can
      call the standard method inside its own.  This in theory also obsoletes
      ->post_set_mode().
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      04351821
    • A
      libata-core: fix comments on cable type · 2e41e8e6
      Alan Cox 提交于
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      2e41e8e6
    • A
      libata: cable detection fixes · be0d18df
      Alan Cox 提交于
      2.6.21-rc has horrible problems with libata and PATA cable types (and
      thus speeds). This occurs because Tejun fixed a pile of other bugs and
      we now do cable detect enforcement for drive side detection properly.
      
      Unfortunately we don't do the process around cable detection right. Tejun
      identified the problem and pointed to the right Annex in the spec, this patch
      implements the rest of the needed changes.
      
      We add a ->cable_detect() method called after the identify
      sequence which allows a host to do host side detection at this point
      should it wish, or to modify the results of the drive side identify.
      
      This separate ->cable_detect method also cleans up a lot of code because
      many drivers have their own error_handler methods which really just set
      the cable type.
      
      If there is no ->cable_detect method the cable type is left alone so a
      driver setting it earlier (eg because it has the SATA flags set or
      because it uses the old error_handler approach) will still do the right
      thing (or at least the same thing) as before.
      
      This patch simply adds the cable_detect method and helpers it doesn't use
      them but other follow up patches will (ie Adrian please don't submit
      patches to unexport them ;))
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      be0d18df
    • R
      libata: warn if speed limited due to 40-wire cable · 8343f889
      Robert Hancock 提交于
      Warn the user if a drive's transfer rate is limited because of a 40-wire
      cable detection.
      Signed-off-by: NRobert Hancock <hancockr@shaw.ca>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      8343f889
    • M
      RESEND: libata: check cdb len per dev instead of per host · f0ef88ed
      Mark Lord 提交于
      Resending, with s/printk/DPRINTK/ as pointed out by Alan.
      
      Fix libata to perform CDB len validation per device
      rather than per host.  This way, validation still works
      when we have a mix of 12-byte and 16-byte devices on
      a common host interface.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f0ef88ed
    • A
      libata: dev_config does not need ap and adev passing · cd0d3bbc
      Alan 提交于
      It used to be impossible to get from ata_device to ata_port but that is
      no longer true. Various methods have been cleaned up over time but
      dev_config still takes both and most users don't need both anyway. Tidy
      this one up
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      cd0d3bbc
    • J
      [libata] export sata_print_link_status() · 43727fbc
      Jeff Garzik 提交于
      To be used in sata_mv's exception handling code, and overall is a
      generally useful function.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      43727fbc
  2. 04 4月, 2007 4 次提交
  3. 31 3月, 2007 1 次提交
  4. 28 3月, 2007 2 次提交
  5. 19 3月, 2007 1 次提交
  6. 09 3月, 2007 2 次提交
    • T
      libata: fix ata_host_release() free order · 1aa506e4
      Tejun Heo 提交于
      host->ops->host_stop() might access ports.  Free ports after
      host_stop.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1aa506e4
    • P
      Fix simplex adapters with libata · 14d66ab7
      Petr Vandrovec 提交于
      Recently I got my hands on nVidia's MCP61 PM-AM board, and
      it contains IDE chip configured by BIOS with only primary
      channel enabled.  This confuses code which probes for
      device DMA capabilities - it gets 0x60 (happy duplex
      device) from primary channel BMDMA, but 0xFF (nobody here)
      from secondary channel BMDMA.  Due to this code then believes
      that chip is simplex.  I do not address this problem in
      my patch, as I'm not sure how to handle this.  Probably
      ata_pci_init_one should have bitmap of enabled/possible
      interfaces instead of their count, but it looks like
      quite intrusive change, and maybe we do not care - for device
      with only one channel simplex and regular DMA engines are
      same.
      
      But making device simplex pointed out that support for
      DMA on simplex devices is currently broken - ata_dev_xfermask
      tests whether device is simplex and if it is whether DMA
      engine was assigned to this port.  If not then it strips
      out DMA bits from device.  Problem is that code which assigns
      DMA engine to port in ata_set_mode first detect device
      mode and assigns DMA engine to channel only if some DMA
      capable device was found.
      
      And as xfermask stripped out DMA bits, host->simplex_claimed
      is always NULL with current implementation.
      
      By allowing DMA either if simplex_claimed is NULL or if it
      points to current port DMA can be finally used - it gets
      assigned to first port which contains any DMA capable
      device.
      
      Before:
      pata_amd 0000:00:06.0: version 0.2.8
      PCI: Setting latency timer of device 0000:00:06.0 to 64
      ata5: PATA max UDMA/133 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x0001f000 irq 14
      ata6: PATA max UDMA/133 cmd 0x00010170 ctl 0x00010376 bmdma 0x0001f008 irq 15
      scsi4 : pata_amd
      ata5.00: ATAPI, max UDMA/66
      ata5.00: simplex DMA is claimed by other device, disabling DMA
      ata5.00: configured for PIO4
      scsi5 : pata_amd
      ata6: port disabled. ignoring.
      ata6: reset failed, giving up
      scsi 4:0:0:0: CD-ROM            ATAPI    DVD W  DH16W1P   LG12 PQ: 0 ANSI: 5
      
      After:
      pata_amd 0000:00:06.0: version 0.2.8
      PCI: Setting latency timer of device 0000:00:06.0 to 64
      ata5: PATA max UDMA/133 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x0001f000 irq 14
      ata6: PATA max UDMA/133 cmd 0x00010170 ctl 0x00010376 bmdma 0x0001f008 irq 15
      scsi4 : pata_amd
      ata5.00: ATAPI, max UDMA/66
      ata5.00: configured for UDMA/33
      scsi5 : pata_amd
      ata6: port disabled. ignoring.
      ata6: reset failed, giving up
      scsi 4:0:0:0: CD-ROM            ATAPI    DVD W  DH16W1P   LG12 PQ: 0 ANSI: 5
      Signed-off-by: NPetr Vandrovec <petr@vandrovec.name>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      14d66ab7
  7. 03 3月, 2007 3 次提交
    • T
      libata: add CONFIG_PM to libata core layer · 6ffa01d8
      Tejun Heo 提交于
      Conditionalize all PM related stuff in libata core layer using
      CONFIG_PM.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6ffa01d8
    • J
      [libata] change master/slave IDENTIFY order · f31f0cc2
      Jeff Garzik 提交于
      2.6.21-rc has horrible problems with libata and PATA cable types (and
      thus speeds). This occurs because Tejun fixed a pile of other bugs and
      we now do cable detect enforcement for drive side detection properly.
      
      Unfortunately we don't do the process around cable detection right. Tejun
      identified the problem and pointed to the right Annex in the spec, this patch
      implements the needed changes.
      
      The basic requirement is that we have to identify the slave before the
      master.
      
      The patch switches the identify order so that we can do the drive side
      detection correctly.
      
      [NOTE: patch and description extracted from a larger work written
      and signed-off-by Alan Cox]
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f31f0cc2
    • A
      libata-core: Fix simplex handling · 032af1ce
      Alan 提交于
      The initial simplex handling code is fooled if you suspend and resume.
      This also causes problems with some single channel controllers which
      claim to be simplex.
      
      The fix is fairly simple, instead of keeping a flag to remember if we
      gave away the simplex channel we remember the actual owner. As the owner
      is always part of the host_set we don't even need a refcount.
      
      Knowing the owner also means we can reassign simplex DMA channels in
      future hotplug code etc if we need to
      Signed-off-by: NAlan Cox <alan@redhat.com>
      (and a signed-off for the patch I sent before while I remember)
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      032af1ce
  8. 02 3月, 2007 2 次提交
  9. 26 2月, 2007 1 次提交