1. 29 6月, 2012 2 次提交
  2. 24 7月, 2011 1 次提交
    • 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
  3. 17 7月, 2011 1 次提交
  4. 02 3月, 2011 1 次提交
  5. 15 8月, 2010 1 次提交
  6. 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
  7. 28 1月, 2010 1 次提交
  8. 03 12月, 2009 1 次提交
  9. 06 10月, 2009 3 次提交
  10. 02 9月, 2009 1 次提交
    • R
      libata: add command name parsing for error output · 6521148c
      Robert Hancock 提交于
      This patch improve libata's output for error/notification messages
      to allow easier comprehension and debugging:
      
      When ATAPI commands issued through the SCSI layer fail, use SCSI
      functions to print the CDB in human-readable form instead of just
      dumping out the CDB in hex.
      
      Print out the name of the failed command (as defined by the ATA
      specification) in error handling output along with the raw register
      contents.
      
      When reporting status of ACPI taskfile commands executed on resume,
      also output the names of the commands being executed (or not) in
      readable form.
      
      Since the extra data for printing command names increases kernel
      size slightly, a config option has been added to allow disabling
      command name output (as well as some of the error register parsing)
      for those highly sensitive to kernel text size.
      Signed-off-by: NRobert Hancock <hancockrwd@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      6521148c
  11. 13 6月, 2009 1 次提交
  12. 31 12月, 2008 1 次提交
  13. 29 12月, 2008 1 次提交
    • T
      libata: beef up iterators · 1eca4365
      Tejun Heo 提交于
      There currently are the following looping constructs.
      
      * __ata_port_for_each_link() for all available links
      * ata_port_for_each_link() for edge links
      * ata_link_for_each_dev() for all devices
      * ata_link_for_each_dev_reverse() for all devices in reverse order
      
      Now there's a need for looping construct which is similar to
      __ata_port_for_each_link() but iterates over PMP links before the host
      link.  Instead of adding another one with long name, do the following
      cleanup.
      
      * Implement and export ata_link_next() and ata_dev_next() which take
        @mode parameter and can be used to build custom loop.
      * Implement ata_for_each_link() and ata_for_each_dev() which take
        looping mode explicitly.
      
      The following iteration modes are implemented.
      
      * ATA_LITER_EDGE		: loop over edge links
      * ATA_LITER_HOST_FIRST		: loop over all links, host link first
      * ATA_LITER_PMP_FIRST		: loop over all links, PMP links first
      
      * ATA_DITER_ENABLED		: loop over enabled devices
      * ATA_DITER_ENABLED_REVERSE	: loop over enabled devices in reverse order
      * ATA_DITER_ALL			: loop over all devices
      * ATA_DITER_ALL_REVERSE		: loop over all devices in reverse order
      
      This change removes exlicit device enabledness checks from many loops
      and makes it clear which ones are iterated over in which direction.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      1eca4365
  14. 11 10月, 2008 1 次提交
  15. 24 9月, 2008 2 次提交
  16. 11 7月, 2008 2 次提交
  17. 04 6月, 2008 1 次提交
    • H
      [libata] ACPI: Properly handle bay devices in dock stations · 664d080c
      Holger Macht 提交于
      * Differentiate between bay devices in dock stations and others:
      
       - When an ACPI_NOTIFY_EJECT_REQUEST appears, just signal uevent to
         userspace (that is when the optional eject button on a bay device is
         pressed/pulled) giving the possibility to unmount file systems and to
         clean up. Also, only send uevent in case we get an EJECT_REQUEST
         without doing anything else. In other cases, you'll get an add/remove
         event because libata attaches/detaches the device.
      
       - In case of a dock event, which in turn signals an
         ACPI_NOTIFY_EJECT_REQUEST, immediately detach the device, because it
         may already have been gone
      
      * In case of an ACPI_NOTIFY_DEVICE/BUS_CHECK, evaluate _STA to check if
        the device has been plugged or unplugged. If plugged, hotplug it, if
        unplugged, just signal event to userspace
        (initial patch by Matthew Garrett <mjg59@srcf.ucam.org>)
      
      * Call ACPI _EJ0 for detached devices
      Signed-off-by: NHolger Macht <hmacht@suse.de>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      664d080c
  18. 20 5月, 2008 2 次提交
    • J
      drivers/ata: trim trailing whitespace · c85665ff
      Jeff Garzik 提交于
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c85665ff
    • M
      Fixups to ATA ACPI hotplug · ae6c23c4
      Matthew Garrett 提交于
      The libata-acpi.c code currently accepts hotplug messages from both the
      port and the device. This does not match the behaviour of the bay
      driver, and may result in confusion when two hotplug requests are
      received for the same device. This patch limits the hotplug notification
      to removable ACPI devices, which in turn allows it to use the _STA
      method to determine whether the device has been removed or inserted.
      On removal, devices are marked as detached. On insertion, a hotplug scan
      is started. This should avoid lockups caused by the ata layer attempting
      to scan devices which have been removed. The uevent sending is moved
      outside the spinlock in order to avoid a warning generated by it firing
      when interrupts are disabled.
      Signed-off-by: NMatthew Garrett <mjg@redhat.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      ae6c23c4
  19. 25 4月, 2008 1 次提交
  20. 18 4月, 2008 2 次提交
    • S
      ata-acpi: don't call _GTF for disabled drive · 48feb3c4
      Shaohua Li 提交于
      I got below log after a S3 resume in a ASUS A6VC laptop. The system has
      only one IDE drive. It appears there is no reason calling _GTF for
      disabled drive.
      
      ACPI Error (dsopcode-0483): Attempt to CreateField of length zero [20070126]
      ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.RATA] (Node df822a7c), AE_AML_OPERAND_VALUE
      ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.CHN1.DRV0._GTF] (Node df822bd0), AE_AML_OPERAND_VALUE
      ata2.00: _GTF evaluation failed (AE 0x3006)
      ACPI Error (dsopcode-0483): Attempt to CreateField of length zero [20070126]
      ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.RATA] (Node df822a7c), AE_AML_OPERAND_VALUE
      ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.CHN1.DRV1._GTF] (Node df822b94), AE_AML_OPERAND_VALUE
      ata2.01: _GTF evaluation failed (AE 0x3006)
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      48feb3c4
    • 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
  21. 17 3月, 2008 1 次提交
    • T
      libata-acpi: improve dock event handling · 233f1120
      Tejun Heo 提交于
      Improve ACPI hotplug handling such that dock event is handled properly.
      
      * Register handlers for dock events.
      
      * Directly detach device on EJECT_REQUEST instead of signaling hotplug
        event.  This prevents libata from accessing severed controller
        and/or device.
      
      * While at it, use named constants for ACPI events and move uevent
        signaling inside host lock.
      
      Original patch and testing by Holger Macht.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Holger Macht <hmacht@suse.de>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      233f1120
  22. 11 3月, 2008 1 次提交
  23. 23 1月, 2008 5 次提交
  24. 18 12月, 2007 6 次提交
    • T
      libata-acpi: implement _GTF command filtering · 3264a8d8
      Tejun Heo 提交于
      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: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3264a8d8
    • T
      libata-acpi: improve _GTF execution error handling and reporting · 0e8634bf
      Tejun Heo 提交于
      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: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0e8634bf
    • T
      libata-acpi: improve ACPI disabling · 66fa7f21
      Tejun Heo 提交于
      * 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: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      66fa7f21
    • T
      libata-acpi: implement dev->gtf_cache and evaluate _GTF right after _STM during resume · 398e0782
      Tejun Heo 提交于
      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: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      398e0782
    • T
      libata-acpi: implement and use ata_acpi_init_gtm() · c05e6ff0
      Tejun Heo 提交于
      _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: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c05e6ff0
    • T
      libata-acpi: add new hooks ata_acpi_dissociate() and ata_acpi_on_disable() · 562f0c2d
      Tejun Heo 提交于
      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: NTejun heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      562f0c2d