1. 04 12月, 2009 2 次提交
  2. 06 6月, 2009 1 次提交
    • J
      pata_legacy: wait for async probing · 45bc955b
      James Bottomley 提交于
      The basic problem here that pata_legacy attaches the host, sees if it found
      any devices and detaches it if none were found.  With async probing, it's not
      waiting until discovery is finished before deciding it has no devices and
      trying the detach leading to this warning:
      
      ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
      ------------[ cut here ]------------
      WARNING: at drivers/ata/libata-core.c:6222 ata_host_detach+0x75/0x90()
      Modules linked in:
      Pid: 1, comm: swapper Not tainted 2.6.30-rc7 #1
      Call Trace:
       [<c01fbb05>] ? ata_host_detach+0x75/0x90
       [<c01fbb05>] ? ata_host_detach+0x75/0x90
       [<c01139b5>] ? warn_slowpath_common+0x45/0x80
       [<c01139fa>] ? warn_slowpath_null+0xa/0x10
       [<c01fbb05>] ? ata_host_detach+0x75/0x90
       [<c02f40e0>] ? legacy_init+0x44e/0x87f
       [<c02f3c92>] ? legacy_init+0x0/0x87f
       [<c0101021>] ? _stext+0x21/0x140
       [<c01890ff>] ? proc_register+0x2f/0x190
       [<c018938c>] ? create_proc_entry+0x5c/0xc0
       [<c0135ebe>] ? register_irq_proc+0x6e/0x90
       [<c02e6484>] ? kernel_init+0x6e/0xbf
       [<c02e6416>] ? kernel_init+0x0/0xbf
       [<c01031d7>] ? kernel_thread_helper+0x7/0x10
      ---[ end trace ef1ee36e873ae3a0 ]---
      
      Because it detaches before the probe is complete.
      
      One way to fix it would be to put an async_synchronize_full() before looking
      for devices, which this patch does.  A better way might be to separate libata
      into its own domain and only wait for that.
      Reported-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      45bc955b
  3. 18 4月, 2009 1 次提交
    • Z
      [libata] fix build error on drivers/ata/pata_legacy.c · 16e6aeca
      Zhenwen Xu 提交于
      fix those errors:
      
      drivers/ata/pata_legacy.c: In function ‘pdc_data_xfer_vlb’:
      drivers/ata/pata_legacy.c:289: error: ‘ap’ undeclared (first use in this function)
      drivers/ata/pata_legacy.c:289: error: (Each undeclared identifier is reported only once
      drivers/ata/pata_legacy.c:289: error: for each function it appears in.)
      drivers/ata/pata_legacy.c: At top level:
      drivers/ata/pata_legacy.c:869: error: ‘ATA_PFLAG_PIO32_CHANGE’ undeclared here (not in a
      +function)
      make[2]: *** [drivers/ata/pata_legacy.o] Error 1
      make[1]: *** [drivers/ata] Error 2
      Signed-off-by: NZhenwen Xu <helight.xu@gmail.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      16e6aeca
  4. 17 4月, 2009 2 次提交
  5. 25 3月, 2009 1 次提交
  6. 26 2月, 2009 1 次提交
  7. 29 12月, 2008 2 次提交
    • Q
      bd353ffd
    • 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
  8. 28 10月, 2008 1 次提交
  9. 15 7月, 2008 1 次提交
    • H
      ata: endianness annotations in pata drivers · 6ad67403
      Harvey Harrison 提交于
      drivers/ata/pata_qdi.c:142:9: warning: incorrect type in assignment (different base types)
      drivers/ata/pata_qdi.c:142:9:    expected unsigned int [unsigned] [usertype] pad
      drivers/ata/pata_qdi.c:142:9:    got restricted __le32 [usertype] <noident>
      drivers/ata/pata_qdi.c:146:15: warning: cast to restricted __le32
      
      drivers/ata/pata_winbond.c:110:9: warning: incorrect type in assignment (different base types)
      drivers/ata/pata_winbond.c:110:9:    expected unsigned int [unsigned] [usertype] pad
      drivers/ata/pata_winbond.c:110:9:    got restricted __le32 [usertype] <noident>
      drivers/ata/pata_winbond.c:114:15: warning: cast to restricted __le32
      
      drivers/ata/pata_legacy.c:310:9: warning: incorrect type in assignment (different base types)
      drivers/ata/pata_legacy.c:310:9:    expected unsigned int [unsigned] [usertype] pad
      drivers/ata/pata_legacy.c:310:9:    got restricted __le32 [usertype] <noident>
      drivers/ata/pata_legacy.c:314:15: warning: cast to restricted __le32
      drivers/ata/pata_legacy.c:752:11: warning: cast to restricted __le32
      drivers/ata/pata_legacy.c:756:9: warning: incorrect type in assignment (different base types)
      drivers/ata/pata_legacy.c:756:9:    expected unsigned int [unsigned] [addressable] [assigned] [usertype] pad
      drivers/ata/pata_legacy.c:756:9:    got restricted __le32 [usertype] <noident>
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      6ad67403
  10. 20 5月, 2008 1 次提交
  11. 18 4月, 2008 5 次提交
    • T
      libata: rename SFF port ops · 5682ed33
      Tejun Heo 提交于
      Add sff_ prefix to SFF specific port ops.
      
      This rename is in preparation of separating SFF support out of libata
      core layer.  This patch strictly renames ops and doesn't introduce any
      behavior difference.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      5682ed33
    • T
      libata: rename SFF functions · 9363c382
      Tejun Heo 提交于
      SFF functions have confusing names.  Some have sff prefix, some have
      bmdma, some std, some pci and some none.  Unify the naming by...
      
      * SFF functions which are common to both BMDMA and non-BMDMA are
        prefixed with ata_sff_.
      
      * SFF functions which are specific to BMDMA are prefixed with
        ata_bmdma_.
      
      * SFF functions which are specific to PCI but apply to both BMDMA and
        non-BMDMA are prefixed with ata_pci_sff_.
      
      * SFF functions which are specific to PCI and BMDMA are prefixed with
        ata_pci_bmdma_.
      
      * Drop generic prefixes from LLD specific routines.  For example,
        bfin_std_dev_select -> bfin_dev_select.
      
      The following renames are noteworthy.
      
        ata_qc_issue_prot() -> ata_sff_qc_issue()
        ata_pci_default_filter() -> ata_bmdma_mode_filter()
        ata_dev_try_classify() -> ata_sff_dev_classify()
      
      This rename is in preparation of separating SFF support out of libata
      core layer.  This patch strictly renames functions and doesn't
      introduce any behavior difference.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      9363c382
    • T
      libata: implement and use ops inheritance · 029cfd6b
      Tejun Heo 提交于
      libata lets low level drivers build ata_port_operations table and
      register it with libata core layer.  This allows low level drivers
      high level of flexibility but also burdens them with lots of
      boilerplate entries.
      
      This becomes worse for drivers which support related similar
      controllers which differ slightly.  They share most of the operations
      except for a few.  However, the driver still needs to list all
      operations for each variant.  This results in large number of
      duplicate entries, which is not only inefficient but also error-prone
      as it becomes very difficult to tell what the actual differences are.
      
      This duplicate boilerplates all over the low level drivers also make
      updating the core layer exteremely difficult and error-prone.  When
      compounded with multi-branched development model, it ends up
      accumulating inconsistencies over time.  Some of those inconsistencies
      cause immediate problems and fixed.  Others just remain there dormant
      making maintenance increasingly difficult.
      
      To rectify the problem, this patch implements ata_port_operations
      inheritance.  To allow LLDs to easily re-use their own ops tables
      overriding only specific methods, this patch implements poor man's
      class inheritance.  An ops table has ->inherits field which can be set
      to any ops table as long as it doesn't create a loop.  When the host
      is started, the inheritance chain is followed and any operation which
      isn't specified is taken from the nearest ancestor which has it
      specified.  This operation is called finalization and done only once
      per an ops table and the LLD doesn't have to do anything special about
      it other than making the ops table non-const such that libata can
      update it.
      
      libata provides four base ops tables lower drivers can inherit from -
      base, sata, pmp, sff and bmdma.  To avoid overriding these ops
      accidentaly, these ops are declared const and LLDs should always
      inherit these instead of using them directly.
      
      After finalization, all the ops table are identical before and after
      the patch except for setting .irq_handler to ata_interrupt in drivers
      which didn't use to.  The .irq_handler doesn't have any actual effect
      and the field will soon be removed by later patch.
      
      * sata_sx4 is still using old style EH and currently doesn't take
        advantage of ops inheritance.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      029cfd6b
    • T
      libata: implement and use SHT initializers · 68d1d07b
      Tejun Heo 提交于
      libata lets low level drivers build scsi_host_template and register it
      to the SCSI layer.  This allows low level drivers high level of
      flexibility but also burdens them with lots of boilerplate entries.
      
      This patch implements SHT initializers which can be used to initialize
      all the boilerplate entries in a sht.  Three variants of them are
      implemented - BASE, BMDMA and NCQ - for different types of drivers.
      Note that entries can be overriden by putting individual initializers
      after the helper macro.
      
      All sht tables are identical before and after this patch.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      68d1d07b
    • T
      libata: implement and use ata_noop_irq_clear() · 358f9a77
      Tejun Heo 提交于
      ->irq_clear() is used to clear IRQ bit of a SFF controller and isn't
      useful for drivers which don't use libata SFF HSM implementation.
      However, it's a required callback and many drivers implement their own
      noop version as placeholder.  This patch implements ata_noop_irq_clear
      and use it to replace those custom placeholders.
      
      Also, SFF drivers which don't support BMDMA don't need to use
      ata_bmdma_irq_clear().  It becomes noop if BMDMA address isn't
      initialized.  Convert them to use ata_noop_irq_clear().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      358f9a77
  12. 21 2月, 2008 1 次提交
    • H
      ata: fix sparse warnings in pata_legacy.c · cb616dd5
      Harvey Harrison 提交于
      Use ld_qdi and ld_winbond to avoid shadowing static int
      variables qdi and winbond.  The ld_ prefix refers to
      legacy_data.
      
      drivers/ata/pata_legacy.c:777:21: warning: symbol 'qdi' shadows an earlier one
      drivers/ata/pata_legacy.c:128:12: originally declared here
      drivers/ata/pata_legacy.c:811:21: warning: symbol 'qdi' shadows an earlier one
      drivers/ata/pata_legacy.c:128:12: originally declared here
      drivers/ata/pata_legacy.c:848:21: warning: symbol 'qdi' shadows an earlier one
      drivers/ata/pata_legacy.c:128:12: originally declared here
      drivers/ata/pata_legacy.c:882:21: warning: symbol 'qdi' shadows an earlier one
      drivers/ata/pata_legacy.c:128:12: originally declared here
      drivers/ata/pata_legacy.c:1040:21: warning: symbol 'winbond' shadows an earlier one
      drivers/ata/pata_legacy.c:129:12: originally declared here
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      cb616dd5
  13. 16 2月, 2008 1 次提交
  14. 12 2月, 2008 1 次提交
  15. 23 1月, 2008 4 次提交
  16. 16 1月, 2008 1 次提交
    • A
      libata fixes for sparse-found problems · b50e56d8
      Al Viro 提交于
      In pata_legacy and pata_winbond we've got bugs - cpu_to_le16() instead
      of cpu_to_le32().  Fortunately, both affected suckers are VLB, thus
      l-e-only, so we might get away with that unless we hit it with slop == 3
      (hadn't checked if playing with badly aligned sg could trigger that).
      Still buggy...  Moreover, pata_legacy, pata_winbond and pata_qdi forgot to
      initialize pad on the write side of 32bit case in their ->data_xfer().
      Hopefully the hardware does't care, but still, sending uninitialized
      data to it...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b50e56d8
  17. 13 10月, 2007 6 次提交
    • T
      libata: implement and use ata_port_desc() to report port configuration · cbcdd875
      Tejun Heo 提交于
      Currently, port configuration reporting has the following problems.
      
      * iomapped address is reported instead of raw address
      * report contains irrelevant fields or lacks necessary fields for
        non-SFF controllers.
      * host->irq/irq2 are there just for reporting and hacky.
      
      This patch implements and uses ata_port_desc() and
      ata_port_pbar_desc().  ata_port_desc() is almost identical to
      ata_ehi_push_desc() except that it takes @ap instead of @ehi, has no
      locking requirement, can only be used during host initialization and "
      " is used as separator instead of ", ".  ata_port_pbar_desc() is a
      helper to ease reporting of a PCI BAR or an offsetted address into it.
      
      LLD pushes whatever description it wants using the above two
      functions.  The accumulated description is printed on host
      registration after "[S/P]ATA max MAX_XFERMODE ".
      
      SFF init helpers and ata_host_activate() automatically add
      descriptions for addresses and irq respectively, so only LLDs which
      isn't standard SFF need to add custom descriptions.  In many cases,
      such controllers need to report different things anyway.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      cbcdd875
    • J
      [libata] Remove ->port_disable() hook · ac8869d5
      Jeff Garzik 提交于
      It was always set to ata_port_disable().  Removed the hook, and replaced
      the very few ap->ops->port_disable() callsites with direct calls to
      ata_port_disable().
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ac8869d5
    • J
      [libata] Remove ->irq_ack() hook, and ata_dummy_irq_on() · 6d32d30f
      Jeff Garzik 提交于
      * ->irq_ack() is redundant to what the irq handler already
        performs... chk-status + irq-clear.  Furthermore, it is only
        called in one place, when screaming-irq-debugging is enabled,
        so we don't want to bother with a hook just for that.
      
      * ata_dummy_irq_on() is only ever used in drivers that have
        no callpath reaching ->irq_on().  Remove .irq_on hook from
        those drivers, and the now-unused ata_dummy_irq_on()
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6d32d30f
    • T
      libata-link: linkify config/EH related functions · 0260731f
      Tejun Heo 提交于
      Make the following functions deal with ata_link instead of ata_port.
      
      * ata_set_mode()
      * ata_eh_autopsy() and related functions
      * ata_eh_report() and related functions
      * suspend/resume related functions
      * ata_eh_recover() and related functions
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0260731f
    • T
      libata-link: implement and use link/device iterators · f58229f8
      Tejun Heo 提交于
      Multiple links and different number of devices per link should be
      considered to iterate over links and devices.  This patch implements
      and uses link and device iterators - ata_port_for_each_link() and
      ata_link_for_each_dev() - and ata_link_max_devices().
      
      This change makes a lot of functions iterate over only possible
      devices instead of from dev 0 to dev ATA_MAX_DEVICES.  All such
      changes have been examined and nothing should be broken.
      
      While at it, add a separating comment before device helpers to
      distinguish them better from link helpers and others.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f58229f8
    • T
      libata-link: introduce ata_link · 9af5c9c9
      Tejun Heo 提交于
      Introduce ata_link.  It abstracts PHY and sits between ata_port and
      ata_device.  This new level of abstraction is necessary to support
      SATA Port Multiplier, which basically adds a bunch of links (PHYs) to
      a ATA host port.  Fields related to command execution, spd_limit and
      EH are per-link and thus moved to ata_link.
      
      This patch only defines the host link.  Multiple link handling will be
      added later.  Also, a lot of ap->link derefences are added but many of
      them will be removed as each part is converted to deal directly with
      ata_link instead of ata_port.
      
      This patch introduces no behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: James Bottomley <James.Bottomley@SteelEye.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9af5c9c9
  18. 22 5月, 2007 1 次提交
  19. 29 4月, 2007 2 次提交
  20. 06 3月, 2007 1 次提交
    • M
      pata_legacy: fix io/irq mismatch · 8b966ddd
      Mikael Pettersson 提交于
      pata_legacy fails to detect the disk on my old ISA/VLB 486:
      it starts to probe io=0x1f0 ctr=0x3f6 irq=15, complains
      loudly about IDENTIFYs timing out, and finally fails.
      (Sorry I couldn't capture the kernel's boot messages.)
      
      It turns out that the driver's mapping from io to irq in
      legacy_irq[] is wrong: index 0 for io=0x1f0 has irq=15 but
      should have irq=14, and index 1 for io=0x170 has irq=14 but
      should have irq=15. This is confirmed by a comparison with
      include/asm-i386/ide.h:ide_default_irq().
      
      This patch swaps the first two elements in legacy_irq[],
      which makes pata_legacy work on my 486.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      8b966ddd
  21. 03 3月, 2007 1 次提交
  22. 26 2月, 2007 1 次提交
  23. 16 2月, 2007 1 次提交
  24. 10 2月, 2007 1 次提交