1. 18 Dec, 2007 16 commits
    • Tejun Heo's avatar
      libata: fix ATAPI draining · 140b5e59
      Tejun Heo authored
      With ATAPI transfer chunk size properly programmed, libata PIO HSM
      should be able to handle full spurious data chunks.  Also, it's a good
      idea to suppress trailing data warning for misc ATAPI commands as
      there can be many of them per command - for example, if the chunk size
      is 16 and the drive tries to transfer 510 bytes, there can be 31
      trailing data messages.
      
      This patch makes the following updates to libata ATAPI PIO HSM
      implementation.
      
      * Make it drain full spurious chunks.
      
      * Suppress trailing data warning message for misc commands.
      
      * Put limit on how many bytes can be drained.
      
      * If odd, round up consumed bytes and the number of bytes to be
        drained.  This gets the number of bytes to drain right for drivers
        which do 16bit PIO.
      
      This patch is partial backport of improve-ATAPI-data-xfer patchset
      pending for #upstream.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      140b5e59
    • Tejun Heo's avatar
      libata: update atapi_eh_request_sense() such that lbam/lbah contains buffer size · f2dfc1a1
      Tejun Heo authored
      While updating lbam/h for ATAPI commands, atapi_eh_request_sense() was
      left out.  Update it.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      f2dfc1a1
    • Tejun Heo's avatar
      libata-acpi: implement _GTF command filtering · 3264a8d8
      Tejun Heo authored
      Implement _GTF command filtering which can be controlled by
      libata.acpi_filter kernel parameter.  Currently SETXFER and LOCK
      commands are filtered.
      
      libata configures transfer mode by itself and _GTF SETXFER commands
      can potentially disrupt device configuration.  _GTM/_STM mechanism
      can't handle hotplugging too well and when _GTF is executed,
      controller is in PIO0 rather than the mode _STM configured.
      
      Note that detecting SET MAX LOCK requires looking at the previous
      command.  This adds a bit to code complexity.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      3264a8d8
    • Tejun Heo's avatar
      libata-acpi: improve _GTF execution error handling and reporting · 0e8634bf
      Tejun Heo authored
      As _GTF commands can't transfer data, device error never signals
      transfer error.  It indicates that the device vetoed the operation, so
      it's meaningless to retry.
      
      This patch makes libata-acpi to report and continue on device errors
      when executing _GTF commands.  Also commands rejected by device don't
      contribute to the number of _GTF commands executed.
      
      While at it, update _GTF execution reporting such that all successful
      commands are logged at KERN_DEBUG and rename taskfile_load_raw() to
      ata_acpi_run_tf() for consistency.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      0e8634bf
    • Tejun Heo's avatar
      libata-acpi: improve ACPI disabling · 66fa7f21
      Tejun Heo authored
      * If _GTF evalution fails, it's pointless to retry.  If nothing else
        is wrong, just ignore the error.
      
      * After disabling ACPI, return success iff the number of executed _GTF
        command equals zero.  Otherwise, tell EH to retry.  This change
        fixes bogus 1 return bug where ata_acpi_on_devcfg() expects the
        caller to reload IDENTIFY data and continue but the caller
        interprets it as an error.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      66fa7f21
    • Tejun Heo's avatar
      libata-acpi: implement dev->gtf_cache and evaluate _GTF right after _STM during resume · 398e0782
      Tejun Heo authored
      On certain implementations, _GTF evaluation depends on preceding _STM
      and both can be pretty picky about the configuration.  Using _GTM
      result cached during controller initialization satisfies the most
      neurotic _STM implementation.  However, libata evaluates _GTF after
      reset during device configuration and the hardware state can be
      different from what _GTF expects and can cause evaluation failure.
      
      This patch adds dev->gtf_cache and updates ata_dev_get_GTF() such that
      it uses the cached value if available.  Cache is cleared with a call
      to ata_acpi_clear_gtf().
      
      Because for SATA ACPI nodes _GTF must be evaluated after _SDD which
      can't be done till IDENTIFY is complete, _GTF caching from
      ata_acpi_on_resume() is used only for IDE ACPI nodes.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      398e0782
    • Tejun Heo's avatar
      libata-acpi: implement and use ata_acpi_init_gtm() · c05e6ff0
      Tejun Heo authored
      _GTM fetches currently configured transfer mode while _STM configures
      controller according to _GTM parameter and prepares transfer mode
      configuration TFs for _GTF.  In many cases _GTM and _STM
      implementations are quite brittle and can't cope with configuration
      changed by libata.
      
      libata does not depend on ATA ACPI to configure devices.  The only
      reason libata performs _GTM and _STM are to make _GTF evaluation
      succeed and libata also doesn't care about how _GTF TFs configure
      transfer mode.  It overrides that configuration anyway, so from
      libata's POV, it doesn't matter what value is feeded to _STM as long
      as evaluation succeeds for _STM and following _GTF.
      
      This patch adds dev->__acpi_init_gtm and store initial _GTM values on
      host initialization before modified by reset and mode configuration.
      If the field is valid, ata_acpi_init_gtm() returns pointer to the
      saved _GTM structure; otherwise, NULL.
      
      This saved value is used for _STM during resume and peek at
      BIOS/firmware programmed initial timing for later use.  The accessor
      is there to make building w/o ACPI easy as dev->__acpi_init doesn't
      exist if ACPI is not enabled.
      
      On driver detach, the initial BIOS configuration is restored by
      executing _STM with the initial _GTM values such that the next driver
      can also use the initial BIOS configured values.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      c05e6ff0
    • Tejun Heo's avatar
      libata-acpi: add new hooks ata_acpi_dissociate() and ata_acpi_on_disable() · 562f0c2d
      Tejun Heo authored
      Add two hooks - ata_acpi_dissociate() which is called during driver
      detach after the whole host is shutdown and ata_acpi_on_disable()
      which is called when a device is disabled.
      Signed-off-by: default avatarTejun heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      562f0c2d
    • Tejun Heo's avatar
      libata: ata_dev_disable() should be called from EH context · 7f9ad9b8
      Tejun Heo authored
      ata_port_detach() calls ata_dev_disable() with host lock held but
      ata_dev_disable() should be called from EH context.  ata_port_detach()
      steals EH context by setting ATA_PFLAG_UNLOADAING and flushing EH.
      Drop locking around ata_dev_disable() and note that ata_port_detach()
      owns EH context at that point.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      7f9ad9b8
    • Tejun Heo's avatar
      libata: add more opcodes to ata.h · ce2e0abb
      Tejun Heo authored
      Add constants for DEVICE CONFIGURATION OVERLAY and SET_MAX to
      include/linux/ata.h.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      ce2e0abb
    • Tejun Heo's avatar
      libata: update ata_*_printk() macros such that level can be a variable · c2e366a1
      Tejun Heo authored
      Make prink helpers format @lv together rather than prepending to the
      format string as constant.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      c2e366a1
    • Tejun Heo's avatar
      libata-acpi: adjust constness in ata_acpi_gtm/stm() parameters · 0d02f0b2
      Tejun Heo authored
      * No internal function uses const ata_port.  Drop const from @ap.
      
      * Make ata_acpi_stm() copy @stm before using it and change @stm to
        const.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      0d02f0b2
    • Mark Lord's avatar
      sata_mv: improve warnings about Highpoint RocketRAID 23xx cards · 4e520033
      Mark Lord authored
      Improve the existing boot/load time warnings from sata_mv
      for Highpoint RocketRAID 23xx cards, based on new knowledge
      about where the BIOS likes to overwrite sectors with metadata.
      
      Harmless to us, but very useful for end users.
      Signed-off-by: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      4e520033
    • Tejun Heo's avatar
      libata: add ST3160023AS / 3.42 to NCQ blacklist · e41bd3e8
      Tejun Heo authored
      Like ST380817AS / 3.42, ST3160023AS / 3.42 times out commands if NCQ
      is used.  Blacklist it.  This is reported by Matheus Izvekov in the
      following thread.
      
        http://thread.gmane.org/gmane.linux.ide/24202Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Cc: Matheus Izvekov <mizvekov@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      e41bd3e8
    • Tejun Heo's avatar
      libata: clear link->eh_info.serror from ata_std_postreset() · f7fe7ad4
      Tejun Heo authored
      link->eh_info.serror is used to cache SError for controllers which
      need it cleared from interrupt handler to clear IRQ.  It also should
      be cleared after reset just like SError itself.
      
      Make ata_std_postreset() clear link->eh_info.serror too and update
      sata_sil such that it doesn't care about bookkeeping the value.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      f7fe7ad4
    • Tejun Heo's avatar
      sata_sil: fix spurious IRQ handling · 8cf32ac6
      Tejun Heo authored
      Interestingly, sata_sil raises spurious interrupts if it's coupled
      with Sil SATA_PATA bridge.  Currently, sata_sil interrupt handler is
      strict about spurious interrupts and freezes the port when it occurs.
      This patch makes it more forgiving.
      
      * On SATA PHY event interrupt, serror value is checked to see whether
        it really is PHYRDY CHG event.  If not, SATA PHY event interrupt is
        ignored.
      
      * If ATA interrupt occurs while no command is in progress, it's
        cleared and ignored.
      
      This fixes bugzilla bug 9505.
      
        http://bugzilla.kernel.org/show_bug.cgi?id=9505Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      8cf32ac6
  2. 17 Dec, 2007 24 commits