1. 18 1月, 2012 1 次提交
  2. 09 1月, 2012 5 次提交
  3. 15 10月, 2011 1 次提交
  4. 03 10月, 2011 1 次提交
  5. 24 7月, 2011 4 次提交
    • T
      libata: report link resume failure as KERN_WARNING instead of ERR · 38941c95
      Tejun Heo 提交于
      Link resume failure in itself isn't an error condition and may happen
      regularly depending on hardware configuration.  Reporting it as
      KERN_ERR makes the condition unnecessarily prominent (e.g. reported
      during boot).  Use KERN_WARNING instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NDavid Shaw <dshaw@jabberwocky.com>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      38941c95
    • J
      ata: Add and use ata_print_version_once · 06296a1e
      Joe Perches 提交于
      Use a single mechanism to show driver version.
      Reduces text a tiny bit too.
      
      Remove uses of static int printed_version
      Add and use ata_print_version(const struct device *, const char *ver)
      and ata_print_version_once.
      
      $ size drivers/ata/built-in.*
         text	   data	    bss	    dec	    hex	filename
       544969	  73893	 116584	 735446	  b38d6	drivers/ata/built-in.allyesconfig.ata.o
       543870	  73893	 116592	 734355	  b34ad	drivers/ata/built-in.allyesconfig.print_once.o
       141328	  14689	   4220	 160237	  271ed	drivers/ata/built-in.defconfig.ata.o
       141212	  14689	   4220	 160121	  27179	drivers/ata/built-in.defconfig.print_once.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      06296a1e
    • J
      ata: Convert ata_<foo>_printk(KERN_<LEVEL> to ata_<foo>_<level> · a9a79dfe
      Joe Perches 提交于
      Saves text by removing nearly duplicated text format strings by
      creating ata_<foo>_printk functions and printf extension %pV.
      
      ata defconfig size shrinks ~5% (~8KB), allyesconfig ~2.5% (~13KB)
      
      Format string duplication comes from:
      
       #define ata_link_printk(link, lv, fmt, args...) do { \
             if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link)    \
                     printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id,   \
                            (link)->pmp , ##args); \
             else \
                     printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \
             } while(0)
      
      Coalesce long formats.
      
      $ size drivers/ata/built-in.*
         text	   data	    bss	    dec	    hex	filename
       544969	  73893	 116584	 735446	  b38d6	drivers/ata/built-in.allyesconfig.ata.o
       558429	  73893	 117864	 750186	  b726a	drivers/ata/built-in.allyesconfig.dev_level.o
       141328	  14689	   4220	 160237	  271ed	drivers/ata/built-in.defconfig.ata.o
       149567	  14689	   4220	 168476	  2921c	drivers/ata/built-in.defconfig.dev_level.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      a9a79dfe
    • J
      ata: Convert dev_printk(KERN_<LEVEL> to dev_<level>( · a44fec1f
      Joe Perches 提交于
      Saves a bit of text as the call takes fewer args.
      
      Coalesce a few formats.
      Convert a few bare printks to pr_cont.
      
      $ size drivers/ata/built-in.o*
         text	   data	    bss	    dec	    hex	filename
       558429	  73893	 117864	 750186	  b726a	drivers/ata/built-in.o.allyesconfig.new
       559574	  73893	 117888	 751355	  b76fb	drivers/ata/built-in.o.allyesconfig.old
       149567	  14689	   4220	 168476	  2921c	drivers/ata/built-in.o.defconfig.new
       149851	  14689	   4220	 168760	  29338	drivers/ata/built-in.o.defconfig.old
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      a44fec1f
  6. 24 6月, 2011 1 次提交
  7. 20 5月, 2011 1 次提交
  8. 24 4月, 2011 2 次提交
  9. 31 3月, 2011 1 次提交
  10. 02 3月, 2011 2 次提交
  11. 14 2月, 2011 1 次提交
    • J
      [SCSI] libata: plumb sas port scan into standard libata paths · 1f723867
      James Bottomley 提交于
      The function ata_sas_port_init() has always really done its own thing.
      However, as a precursor to moving to the libata new eh, it has to be
      properly using the standard libata scan paths.  This means separating
      the current libata scan paths into pieces which can be shared with
      libsas and pieces which cant (really just the async call and the host
      scan).
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      1f723867
  12. 28 1月, 2011 1 次提交
  13. 25 12月, 2010 1 次提交
    • T
      libata: no special completion processing for EH commands · f08dc1ac
      Tejun Heo 提交于
      ata_qc_complete() contains special handling for certain commands.  For
      example, it schedules EH for device revalidation after certain
      configurations are changed.  These shouldn't be applied to EH
      commands but they were.
      
      In most cases, it doesn't cause an actual problem because EH doesn't
      issue any command which would trigger special handling; however, ACPI
      can issue such commands via _GTF which can cause weird interactions.
      
      Restructure ata_qc_complete() such that EH commands are always passed
      on to __ata_qc_complete().
      
      stable: Please apply to -stable only after 2.6.38 is released.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NKyle McMartin <kyle@mcmartin.ca>
      Cc: stable@kernel.org
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f08dc1ac
  14. 15 12月, 2010 1 次提交
    • T
      workqueue: convert cancel_rearming_delayed_work[queue]() users to cancel_delayed_work_sync() · afe2c511
      Tejun Heo 提交于
      cancel_rearming_delayed_work[queue]() has been superceded by
      cancel_delayed_work_sync() quite some time ago.  Convert all the
      in-kernel users.  The conversions are completely equivalent and
      trivial.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: N"David S. Miller" <davem@davemloft.net>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: NEvgeniy Polyakov <zbr@ioremap.net>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: netdev@vger.kernel.org
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Alex Elder <aelder@sgi.com>
      Cc: xfs-masters@oss.sgi.com
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: netfilter-devel@vger.kernel.org
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: linux-nfs@vger.kernel.org
      afe2c511
  15. 02 11月, 2010 1 次提交
  16. 22 10月, 2010 7 次提交
    • T
      libata: implement cross-port EH exclusion · c0c362b6
      Tejun Heo 提交于
      In libata, the non-EH code paths should always take and release
      ap->lock explicitly when accessing hardware or shared data structures.
      However, once EH is active, it's assumed that the port is owned by EH
      and EH methods don't explicitly take ap->lock unless race from irq
      handler or other code paths are expected.  However, libata EH didn't
      guarantee exclusion among EHs for ports of the same host.  IOW,
      multiple EHs may execute in parallel on multiple ports of the same
      controller.
      
      In many cases, especially in SATA, the ports are completely
      independent of each other and this doesn't cause problems; however,
      there are cases where different ports share the same resource, which
      lead to obscure timing related bugs such as the one fixed by commit
      213373cf (ata_piix: fix locking around SIDPR access).
      
      This patch implements exclusion among EHs of the same host.  When EH
      begins, it acquires per-host EH ownership by calling ata_eh_acquire().
      When EH finishes, the ownership is released by calling
      ata_eh_release().  EH ownership is also released whenever the EH
      thread goes to sleep from ata_msleep() or explicitly and reacquired
      after waking up.
      
      This ensures that while EH is actively accessing the hardware, it has
      exclusive access to it while allowing EHs to interleave and progress
      in parallel as they hit waiting stages, which dominate the time spent
      in EH.  This achieves cross-port EH exclusion without pervasive and
      fragile changes while still allowing parallel EH for the most part.
      
      This was first reported by yuanding02@gmail.com more than three years
      ago in the following bugzilla.  :-)
      
        https://bugzilla.kernel.org/show_bug.cgi?id=8223Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Reported-by: yuanding02@gmail.com
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c0c362b6
    • T
      libata: add @ap to ata_wait_register() and introduce ata_msleep() · 97750ceb
      Tejun Heo 提交于
      Add optional @ap argument to ata_wait_register() and replace msleep()
      calls with ata_msleep() which take optional @ap in addition to the
      duration.  These will be used to implement EH exclusion.
      
      This patch doesn't cause any behavior difference.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      97750ceb
    • T
      libata: reimplement link power management · 6b7ae954
      Tejun Heo 提交于
      The current LPM implementation has the following issues.
      
      * Operation order isn't well thought-out.  e.g. HIPM should be
        configured after IPM in SControl is properly configured.  Not the
        other way around.
      
      * Suspend/resume paths call ata_lpm_enable/disable() which must only
        be called from EH context directly.  Also, ata_lpm_enable/disable()
        were called whether LPM was in use or not.
      
      * Implementation is per-port when it should be per-link.  As a result,
        it can't be used for controllers with slave links or PMP.
      
      * LPM state isn't managed consistently.  After a link reset for
        whatever reason including suspend/resume the actual LPM state would
        be reset leaving ap->lpm_policy inconsistent.
      
      * Generic/driver-specific logic boundary isn't clear.  Currently,
        libahci has to mangle stuff which libata EH proper should be
        handling.  This makes the implementation unnecessarily complex and
        fragile.
      
      * Tied to ALPM.  Doesn't consider DIPM only cases and doesn't check
        whether the device allows HIPM.
      
      * Error handling isn't implemented.
      
      Given the extent of mismatch with the rest of libata, I don't think
      trying to fix it piecewise makes much sense.  This patch reimplements
      LPM support.
      
      * The new implementation is per-link.  The target policy is still
        port-wide (ap->target_lpm_policy) but all the mechanisms and states
        are per-link and integrate well with the rest of link abstraction
        and can work with slave and PMP links.
      
      * Core EH has proper control of LPM state.  LPM state is reconfigured
        when and only when reconfiguration is necessary.  It makes sure that
        LPM state is reset when probing for new device on the link.
        Controller agnostic logic is now implemented in libata EH proper and
        driver implementation only has to deal with controller specifics.
      
      * Proper error handling.  LPM config failure is attributed to the
        device on the link and LPM is disabled for the link if it fails
        repeatedly.
      
      * ops->enable/disable_pm() are replaced with single ops->set_lpm()
        which takes @policy and @hints.  This simplifies driver specific
        implementation.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      6b7ae954
    • T
      libata: implement sata_link_scr_lpm() and make ata_dev_set_feature() global · 1152b261
      Tejun Heo 提交于
      Link power management is about to be reimplemented.  Prepare for it.
      
      * Implement sata_link_scr_lpm().
      
      * Drop static from ata_dev_set_feature() and make it available to
        other libata files.
      
      * Trivial whitespace adjustments.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      1152b261
    • T
      libata: clean up lpm related symbols and sysfs show/store functions · c93b263e
      Tejun Heo 提交于
      Link power management related symbols are in confusing state w/ mixed
      usages of lpm, ipm and pm.  This patch cleans up lpm related symbols
      and sysfs show/store functions as follows.
      
      * lpm states - NOT_AVAILABLE, MIN_POWER, MAX_PERFORMANCE and
        MEDIUM_POWER are renamed to ATA_LPM_UNKNOWN and
        ATA_LPM_{MIN|MAX|MED}_POWER.
      
      * Pre/postfixes are unified to lpm.
      
      * sysfs show/store functions for link_power_management_policy were
        curiously named get/put and unnecessarily complex.  Renamed to
        show/store and simplified.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c93b263e
    • T
      libata: always use ata_qc_complete_multiple() for NCQ command completions · 1aadf5c3
      Tejun Heo 提交于
      Currently, sata_fsl, mv and nv call ata_qc_complete() multiple times
      from their interrupt handlers to indicate completion of NCQ commands.
      This limits the visibility the libata core layer has into how commands
      are being executed and completed, which is necessary to support IRQ
      expecting in generic way.  libata already has an interface to complete
      multiple commands at once - ata_qc_complete_multiple() which ahci and
      sata_sil24 already use.
      
      This patch updates the three drivers to use ata_qc_complete_multiple()
      too and updates comments on ata_qc_complete[_multiple]() regarding
      their usages with NCQ completions.  This change not only provides
      better visibility into command execution to the core layer but also
      simplifies low level drivers.
      
      * sata_fsl: It already builds done_mask.  Conversion is straight
        forward.
      
      * sata_mv: mv_process_crpb_response() no longer checks for illegal
        completions, it just returns whether the tag is completed or not.
        mv_process_crpb_entries() builds done_mask from it and passes it to
        ata_qc_complete_multiple() which will check for illegal completions.
      
      * sata_nv adma: Similar to sata_mv.  nv_adma_check_cpb() now just
        returns the tag status and nv_adma_interrupt() builds done_mask from
        it and passes it to ata_qc_complete_multiple().
      
      * sata_nv swncq: It already builds done_mask.  Drop unnecessary
        illegal transition checks and call ata_qc_complete_multiple().
      
      In the long run, it might be a good idea to make ata_qc_complete()
      whine if called when multiple NCQ commands are in flight.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Ashish Kalra <ashish.kalra@freescale.com>
      Cc: Saeed Bishara <saeed@marvell.com>
      Cc: Mark Lord <liml@rtr.ca>
      Cc: Robert Hancock <hancockr@shaw.ca>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      1aadf5c3
    • G
      [libata] Add ATA transport class · d9027470
      Gwendal Grignou 提交于
      This is a scheleton for libata transport class.
      All information is read only, exporting information from libata:
      - ata_port class: one per ATA port
      - ata_link class: one per ATA port or 15 for SATA Port Multiplier
      - ata_device class: up to 2 for PATA link, usually one for SATA.
      Signed-off-by: NGwendal Grignou <gwendal@google.com>
      Reviewed-by: NGrant Grundler <grundler@google.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      d9027470
  17. 10 9月, 2010 1 次提交
  18. 26 8月, 2010 1 次提交
  19. 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
  20. 02 8月, 2010 5 次提交
  21. 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