1. 26 8月, 2010 1 次提交
  2. 11 8月, 2010 1 次提交
    • R
      docbook: fix fatal error from libata · 3d2be54b
      Randy Dunlap 提交于
      'make htmldocs' has a fatal error when processing libata.xml, as seen
      below.  The string "Example patterns:" (or any string with "example.*:"
      in it AFAIK) causes some part of the doc generation tool chain to try to
      produce an <informalexample> block without a beginning <para>, but
      there is an ending </para> generated, which throws things out of kilter.
      
      I don't even know where (what program) this is happening in.
      I searched in docproc and xmlto and in some XML stylesheets without
      finding anything.  If anyone can give me pointers about this, please do.
      Until this is fixed, let's just spell "Example" as "Sample"
      and match up the double quotation marks while there.
      
        Documentation/DocBook/libata.xml:6575: parser error : Opening and ending tag mismatch: programlisting line 6573 and para
           </para><para>
                  ^
        Documentation/DocBook/libata.xml:6580: parser error : Opening and ending tag mismatch: para line 6575 and programlisting
        </programlisting></informalexample>
                         ^
        unable to parse Documentation/DocBook/libata.xml
        make[2]: *** [Documentation/DocBook/libata.html] Error 1
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3d2be54b
  3. 02 8月, 2010 5 次提交
  4. 02 7月, 2010 1 次提交
    • T
      libata: take advantage of cmwq and remove concurrency limitations · ad72cf98
      Tejun Heo 提交于
      libata has two concurrency related limitations.
      
      a. ata_wq which is used for polling PIO has single thread per CPU.  If
         there are multiple devices doing polling PIO on the same CPU, they
         can't be executed simultaneously.
      
      b. ata_aux_wq which is used for SCSI probing has single thread.  In
         cases where SCSI probing is stalled for extended period of time
         which is possible for ATAPI devices, this will stall all probing.
      
      #a is solved by increasing maximum concurrency of ata_wq.  Please note
      that polling PIO might be used under allocation path and thus needs to
      be served by a separate wq with a rescuer.
      
      #b is solved by using the default wq instead and achieving exclusion
      via per-port mutex.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NJeff Garzik <jgarzik@pobox.com>
      ad72cf98
  5. 03 6月, 2010 2 次提交
  6. 26 5月, 2010 2 次提交
    • T
      libata: implement dump_id force param · 43c9c591
      Tejun Heo 提交于
      Add dump_id libata.force parameter.  If specified, libata dumps full
      IDENTIFY data during device configuration.  This is to aid debugging.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Larry Baker <baker@usgs.gov>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      43c9c591
    • T
      libata: disable ATAPI AN by default · e7ecd435
      Tejun Heo 提交于
      There are ATAPI devices which raise AN when hit by commands issued by
      open().  This leads to infinite loop of AN -> MEDIA_CHANGE uevent ->
      udev open() to check media -> AN.
      
      Both ACS and SerialATA standards don't define in which case ATAPI
      devices are supposed to raise or not raise AN.  They both list media
      insertion event as a possible use case for ATAPI ANs but there is no
      clear description of what constitutes such events.  As such, it seems
      a bit too naive to export ANs directly to userland as MEDIA_CHANGE
      events without further verification (which should behave similarly to
      windows as it apparently is the only thing that some hardware vendors
      are testing against).
      
      This patch adds libata.atapi_an module parameter and disables ATAPI AN
      by default for now.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Nick Bowler <nbowler@elliptictech.com>
      Cc: David Zeuthen <david@fubar.dk>
      Cc: stable@kernel.org
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      e7ecd435
  7. 20 5月, 2010 4 次提交
    • T
      libata-sff: port_task is SFF specific · c429137a
      Tejun Heo 提交于
      port_task is tightly bound to the standard SFF PIO HSM implementation.
      Using it for any other purpose would be error-prone and there's no
      such user and if some drivers need such feature, it would be much
      better off using its own.  Move it inside CONFIG_ATA_SFF and rename it
      to sff_pio_task.
      
      The only function which is exposed to the core layer is
      ata_sff_flush_pio_task() which is renamed from ata_port_flush_task()
      and now also takes care of resetting hsm_task_state to HSM_ST_IDLE,
      which is possible as it's now specific to PIO HSM.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c429137a
    • T
      libata-sff: ap->[last_]ctl are SFF specific · 5fe7454a
      Tejun Heo 提交于
      ap->[last_]ctl are specific to SFF controllers.  Put them inside
      CONFIG_ATA_SFF and move initialization into ata_sff_port_init().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      5fe7454a
    • T
      libata-sff: introduce ata_sff_init/exit() and ata_sff_port_init() · 270390e1
      Tejun Heo 提交于
      In preparation of proper SFF/BMDMA separation, introduce
      ata_sff_init/exit() and ata_sff_port_init().  These functions
      currently don't do anything.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      270390e1
    • T
      libata-sff: clean up BMDMA initialization · c7087652
      Tejun Heo 提交于
      When BMDMA initialization failed or BMDMA was not available for
      whatever reason, bmdma_addr was left at zero and used as an indication
      that BMDMA shouldn't be used.  This leads to the following problems.
      
      p1. For BMDMA drivers which don't use traditional BMDMA register,
          ata_bmdma_mode_filter() incorrectly inhibits DMA modes.  Those
          drivers either have to inherit from ata_sff_port_ops or clear
          ->mode_filter explicitly.
      
      p2. non-BMDMA drivers call into BMDMA PRD table allocation.  It
          doesn't actually allocate PRD table if bmdma_addr is not
          initialized but is still confusing.
      
      p3. For BMDMA drivers which don't use traditional BMDMA register, some
          methods might not be invoked as expected (e.g. bmdma_stop from
          ata_sff_post_internal_cmd()).
      
      p4. SFF drivers w/ custom DMA interface implement noop BMDMA ops
          worrying libata core might call into one of them.
      
      These problems are caused by the muddy line between SFF and BMDMA and
      the assumption that all BMDMA controllers initialize bmdma_addr.
      
      This patch fixes p1 and p2 by removing the bmdma_addr assumption and
      moving prd allocation to BMDMA port start.  Later patches will fix the
      remaining issues.
      
      This patch improves BMDMA initialization such that
      
      * When BMDMA register initialization fails, falls back to PIO instead
        of failing.  ata_pci_bmdma_init() never fails now.
      
      * When ata_pci_bmdma_init() falls back to PIO, it clears
        ap->mwdma_mask and udma_mask instead of depending on
        ata_bmdma_mode_filter().  This makes ata_bmdma_mode_filter()
        unnecessary thus resolving p1.
      
      * ata_port_start() which actually is BMDMA specific is moved to
        ata_bmdma_port_start().  ata_port_start() and ata_sff_port_start()
        are killed.
      
      * ata_sff_port_start32() is moved and renamed to
        ata_bmdma_port_start32().
      
      Drivers which no longer call into PRD table allocation are...
      
        pdc_adma, sata_inic162x, sata_qstor, sata_sx4, pata_cmd640 and all
        drivers which inherit from ata_sff_port_ops.
      
      pata_icside sets ->port_start to ATA_OP_NULL as it doesn't need PRD
      but is a BMDMA controller and doesn't have custom port_start like
      other such controllers.
      
      Note that with the previous patch which makes all and only BMDMA
      drivers inherit from ata_bmdma_port_ops, this change doesn't break
      drivers which need PRD table.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c7087652
  8. 18 5月, 2010 1 次提交
    • T
      libata: kill ATA_FLAG_DISABLED · 3e4ec344
      Tejun Heo 提交于
      ATA_FLAG_DISABLED is only used by drivers which don't use
      ->error_handler framework and is largely broken.  Its only meaningful
      function is to make irq handlers skip processing if the flag is set,
      which is largely useless and even harmful as it makes those ports more
      likely to cause IRQ storms.
      
      Kill ATA_FLAG_DISABLED and makes the callers disable attached devices
      instead.  ata_port_probe() and ata_port_disable() which manipulate the
      flag are also killed.
      
      This simplifies condition check in IRQ handlers.  While updating IRQ
      handlers, remove ap NULL check as libata guarantees consecutive port
      allocation (unoccupied ports are initialized with dummies) and
      long-obsolete ATA_QCFLAG_ACTIVE check (checked by ata_qc_from_tag()).
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      3e4ec344
  9. 15 5月, 2010 2 次提交
    • A
      libata: use __ratelimit · 9990b6f3
      Akinobu Mita 提交于
      Use __ratelimit() instead of its own private rate limit implementation.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: linux-ide@vger.kernel.org
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      9990b6f3
    • T
      libata: use longer 0xff wait if parallel scan is enabled · b48d58f5
      Tejun Heo 提交于
      There are some SATA devices which take relatively long to get out of
      0xff status after reset.  In libata, this timeout is determined by
      ATA_TMOUT_FF_WAIT.  Quantum GoVault is the worst requring about 2s for
      reliable detection.  However, because 2s 0xff timeout can introduce
      rather long spurious delay during boot, libata has been compromising
      at the next longest timeout of 800ms for HHD424020F7SV00 iVDR drive.
      
      Now that parallel scan is in place for common drivers, libata can
      afford 2s 0xff timeout.  Use 2s 0xff timeout if parallel scan is
      enabled.
      
      Please note that the chance of spurious wait is pretty slim w/ working
      SCR access so this will only affect SATA controllers w/o SCR access
      which isn't too common these days.
      
      Please read the following thread for more information on the GoVault
      drive.
      
        http://thread.gmane.org/gmane.linux.ide/14545/focus=14663Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Gary Hade <garyhade@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b48d58f5
  10. 06 4月, 2010 2 次提交
    • T
      libata: unlock HPA if device shrunk · 445d211b
      Tejun Heo 提交于
      Some BIOSes don't configure HPA during boot but do so while resuming.
      This causes harddrives to shrink during resume making libata detach
      and reattach them.  This can be worked around by unlocking HPA if old
      size equals native size.
      
      Add ATA_DFLAG_UNLOCK_HPA so that HPA unlocking can be controlled
      per-device and update ata_dev_revalidate() such that it sets
      ATA_DFLAG_UNLOCK_HPA and fails with -EIO when the above condition is
      detected.
      
      This patch fixes the following bug.
      
        https://bugzilla.kernel.org/show_bug.cgi?id=15396Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NOleksandr Yermolenko <yaa.bta@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      445d211b
    • T
      libata: disable NCQ on Crucial C300 SSD · 68b0ddb2
      Tejun Heo 提交于
      Crucial said,
      
        Thank you for contacting us. We know that with our M225 line of SSDs
        you sometimes need to disable NCQ (native command queuing) to avoid
        just the type of errors you're seeing. Our recommendation for the
        M225 is to add libata.force=noncq to your Linux kernel boot options,
        under the kernel ATA library option.
      
        I have sent your feedback to the engineers working on the C300, and
        asked them to please pass it on to the firmware team. I have been
        notified that they are in the process of testing and finalizing a
        new firmware version, that you can expect to see released around the
        end of April. We’ll keep you posted as to when it will be available
        for download.
      
      So, turn off NCQ on the drive w/ the current firmware revision.
      
      Reported in the following bug.
      
        https://bugzilla.kernel.org/show_bug.cgi?id=15573Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: lethalwp@scarlet.be
      Reported-by: NLuke Macken <lmacken@redhat.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      68b0ddb2
  11. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  12. 02 3月, 2010 1 次提交
  13. 05 2月, 2010 1 次提交
  14. 13 1月, 2010 1 次提交
  15. 04 12月, 2009 1 次提交
  16. 04 11月, 2009 1 次提交
  17. 16 10月, 2009 1 次提交
    • T
      libata: fix internal command failure handling · f4b31db9
      Tejun Heo 提交于
      When an internal command fails, it should be failed directly without
      invoking EH.  In the original implemetation, this was accomplished by
      letting internal command bypass failure handling in ata_qc_complete().
      However, later changes added post-successful-completion handling to
      that code path and the success path is no longer adequate as internal
      command failure path.  One of the visible problems is that internal
      command failure due to timeout or other freeze conditions would
      spuriously trigger WARN_ON_ONCE() in the success path.
      
      This patch updates failure path such that internal command failure
      handling is contained there.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: stable@kernel.org
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f4b31db9
  18. 06 10月, 2009 1 次提交
  19. 18 9月, 2009 1 次提交
  20. 09 9月, 2009 1 次提交
  21. 02 9月, 2009 1 次提交
  22. 12 8月, 2009 1 次提交
  23. 29 7月, 2009 1 次提交
  24. 15 7月, 2009 1 次提交
  25. 23 6月, 2009 2 次提交
  26. 10 6月, 2009 1 次提交
  27. 12 5月, 2009 1 次提交
    • B
      libata: fix suspend/resume for ATA SEMB devices · f0d0613d
      Borislav Petkov 提交于
      79b42bab fixed identifying ATA devices
      reporting 3c/c3 signature which belongs to SEMB devices now. However,
      suspending the machine with such device (WDC WD2500AAJS-6 01.0) fails
      with the following:
      
      hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
      hda: UDMA/100 mode selected
      hdb: host max PIO4 wanted PIO255(auto-tune) selected PIO4
      hdb: UDMA/66 mode selected
      sd 1:0:0:0: [sda] Starting disk
      ata5: SATA link down (SStatus 0 SControl 300)
      ata1: SATA link down (SStatus 0 SControl 300)
      ata3: SATA link down (SStatus 0 SControl 300)
      ata6: SATA link down (SStatus 0 SControl 300)
      ata2: softreset failed (device not ready)
      ata2: failed due to HW bug, retry pmp=0
      ata4: softreset failed (device not ready)
      ata4: failed due to HW bug, retry pmp=0
      ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
      ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
      ata2.00: class mismatch 1 != 7
      ata2.00: revalidation failed (errno=-19)
      ata2: limiting SATA link speed to 1.5 Gbps
      ata4.00: configured for UDMA/133
      ata2: softreset failed (device not ready)
      ata2: failed due to HW bug, retry pmp=0
      ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
      ata2.00: class mismatch 1 != 7
      ata2.00: revalidation failed (errno=-19)
      ata2.00: disabled
      sd 1:0:0:0: rejecting I/O to offline device
      sd 1:0:0:0: [sda] START_STOP FAILED
      sd 1:0:0:0: [sda] Result: hostbyte=0x01 driverbyte=0x00
      PM: Device 1:0:0:0 failed to thaw: error 65536
      sd 3:0:0:0: [sdb] Starting disk
      
      due to a class mismatch in ata_dev_revalidate(). Fix it by adding the
      ATA_DEV_SEMB device class to the check.
      
      CC: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f0d0613d
  28. 17 4月, 2009 1 次提交