1. 23 1月, 2008 4 次提交
  2. 11 1月, 2008 1 次提交
  3. 24 10月, 2007 1 次提交
  4. 20 10月, 2007 1 次提交
  5. 19 10月, 2007 1 次提交
  6. 18 10月, 2007 1 次提交
  7. 13 10月, 2007 4 次提交
    • 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 ->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 PHY-related functions · 936fd732
      Tejun Heo 提交于
      Make the following PHY-related functions to deal with ata_link instead
      of ata_port.
      
      * sata_print_link_status()
      * sata_down_spd_limit()
      * ata_set_sata_spd_limit() and friends
      * sata_link_debounce/resume()
      * sata_scr_valid/read/write/write_flush()
      * ata_link_on/offline()
      
      This patch introduces no behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      936fd732
    • 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
  8. 21 9月, 2007 1 次提交
  9. 01 8月, 2007 1 次提交
  10. 20 7月, 2007 2 次提交
  11. 11 7月, 2007 1 次提交
    • T
      libata: simplify PCI legacy SFF host handling · d583bc18
      Tejun Heo 提交于
      With PCI resource fix up for legacy hosts.  We can use the same code
      path to allocate IO resources and initialize host for both legacy and
      native SFF hosts.  Only IRQ requesting needs to be different.
      
      Rename ata_pci_*_native_host() to ata_pci_*_sff_host(), kill all
      legacy specific functions and use the renamed functions instead.  This
      simplifies code a lot.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d583bc18
  12. 03 7月, 2007 1 次提交
    • T
      libata: fix assigned IRQ reporting · 4031826b
      Tejun Heo 提交于
      host->irq and host->irq2 should be set before ata_host_register() for
      IRQ reporting to work.  Move up host->irq assignment in
      ata_host_activate() and add it to ata_pci_init_one() native path and
      pata_cs5520.
      
      The port info printing in ata_host_register() doesn't fit all the
      different controllers.  It should probably be moved out to LLDs with
      some helpers in the future.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4031826b
  13. 10 6月, 2007 1 次提交
    • A
      libata-core/sff: Fix multiple assumptions about DMA · d92e74d3
      Alan Cox 提交于
      The ata IRQ ack functions are only used when debugging. Unfortunately
      almost every controller that calls them can cause crashes in some
      configurations as there are missing checks for bmdma presence.
      
      In addition ata_port_start insists of installing DMA buffers and pad
      buffers for controllers regardless. The SFF controllers actually need to
      make that decision dynamically at controller setup time and all need the
      same helper - so we add ata_sff_port_start. Future patches will switch
      the SFF drivers to use this.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d92e74d3
  14. 12 5月, 2007 1 次提交
    • T
      libata: clean up SFF init mess · 1626aeb8
      Tejun Heo 提交于
      The intention of using port_mask in SFF init helpers was to eventually
      support exoctic configurations such as combination of legacy and
      native port on the same controller.  This never became actually
      necessary and the related code always has been subtly broken one way
      or the other.  Now that new init model is in place, there is no reason
      to make common helpers capable of handling all corner cases.  Exotic
      cases can simply dealt within LLDs as necessary.
      
      This patch removes port_mask handling in SFF init helpers.  SFF init
      helpers don't take n_ports argument and interpret it into port_mask
      anymore.  All information is carried via port_info.  n_ports argument
      is dropped and always two ports are allocated.  LLD can tell SFF to
      skip certain port by marking it dummy.  Note that SFF code has been
      treating unuvailable ports this way for a long time until recent
      breakage fix from Linus and is consistent with how other drivers
      handle with unavailable ports.
      
      This fixes 1-port legacy host handling still broken after the recent
      native mode fix and simplifies SFF init logic.  The following changes
      are made...
      
      * ata_pci_init_native_host() and ata_init_legacy_host() both now try
        to initialized whatever they can and mark failed ports dummy.  They
        return 0 if any port is successfully initialized.
      
      * ata_pci_prepare_native_host() and ata_pci_init_one() now doesn't
        take n_ports argument.  All info should be specified via port_info
        array.  Always two ports are allocated.
      
      * ata_pci_init_bmdma() exported to be used by LLDs in exotic cases.
      
      * port_info handling in all LLDs are standardized - all port_info
        arrays are const stack variable named ppi.  Unless the second port
        is different from the first, its port_info is specified as NULL
        (tells libata that it's identical to the last non-NULL port_info).
      
      * pata_hpt37x/hpt3x2n: don't modify static variable directly.  Make an
        on-stack copy instead as ata_piix does.
      
      * pata_uli: It has 4 ports instead of 2.  Don't use
        ata_pci_prepare_native_host().  Allocate the host explicitly and use
        init helpers.  It's simple enough.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1626aeb8
  15. 01 5月, 2007 1 次提交
    • L
      libata: honour host controllers that want just one host · dc87c398
      Linus Torvalds 提交于
      The Marvell IDE interface on my machine would hit a BUG_ON() in
      lib/iomem.c because it was calling ata_pci_init_one() specifying just a
      single port on the host, but that would actually end up trying to
      initialize two ports, the second one with bogus information.
      
      This fixes "ata_pci_init_one()" so that it actually passes down the
      n_ports variable that it got from the low-level driver to the host
      allocation routine ("ata_host_alloc_pinfo()"), which results in the ATA
      layer actually having the correct port number information.
      
      And in order to make it all work, I also needed to fix a few places that
      had incorrectly hard-coded the fact that a host always had exactly two
      ports (both ata_pci_init_bmdma() and ata_request_legacy_irqs() would
      just always iterate over both ports).
      Acked-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dc87c398
  16. 29 4月, 2007 7 次提交
    • T
      libata: kill probe_ent and related helpers · 6bfff31e
      Tejun Heo 提交于
      All drivers are converted to new init model.  Kill probe_ent,
      ata_device_add() and ata_pci_init_native_mode().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6bfff31e
    • T
      libata: add init helpers including ata_pci_prepare_native_host() · 21b0ad4f
      Tejun Heo 提交于
      These will be used to convert LLDs to new init model.
      
      * Add irq_handler field to port_info.  In new init model, requesting
        IRQ is LLD's responsibility and libata doesn't need to know about
        irq_handler.  Most LLDs can simply register their irq_handler but
        some need different irq_handler depending on specific chip.  The
        added port_info->irq_handler field can be used by LLDs to select
        the matching IRQ handler in such cases.
      
      * Add ata_dummy_port_info.
      
      * Implement ata_pci_prepare_native_host(), a helper to alloc ATA host,
        acquire all resources and init the host in one go.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      21b0ad4f
    • T
      libata: convert native PCI host handling to new init model · d491b27b
      Tejun Heo 提交于
      Convert native PCI host handling to alloc-init-register model.  New
      function ata_pci_init_native_host() follows the new init model and
      replaces ata_pci_init_native_mode().  As there are remaining LLD
      users, the old function isn't removed yet.
      
      ata_pci_init_one() is reimplemented using the new function and now
      fully converted to new init model.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d491b27b
    • T
      libata: convert legacy PCI host handling to new init model · 0f834de3
      Tejun Heo 提交于
      Convert legacy PCI host handling to alloc-init-register model.
      ata_init_legacy_host(), ata_request_legacy_irqs() and
      ata_pci_init_bmdma() are separated out and follow the new init model.
      
      The two legacy handling functions use separate ata_legacy_devres
      instead of generic devm_* resources.  This reduces devres overhead for
      legacy hosts which was a bit high because it didn't use PCI/iomap
      merged resoruces.
      
      ata_pci_init_one() is rewritten in terms of the aboved functions but
      native mode handling is still using the old method.  Conversion will
      be completed when native mode handling is updated.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0f834de3
    • T
      libata: fix native mode disabled port handling · 55a6adee
      Tejun Heo 提交于
      Disabled port handling in ata_pci_init_native_mode() is slightly
      broken in that it may end up using the wrong port_info.  This patch
      updates it such that disables ports are made dummy as done in the
      legacy and other cases.
      
      While at it, fix indentation in ata_resources_present().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      55a6adee
    • J
      libata/IDE: remove combined mode quirk · 8cdfb29c
      Jeff Garzik 提交于
      Both old-IDE and libata should be able handle all controllers and
      devices found using normal resource reservation methods.
      
      This eliminates the awful, low-performing split-driver configuration
      where old-IDE drove the PATA portion of a PCI device, in PIO-only mode,
      and libata drove the SATA portion of the /same/ PCI device, in DMA mode.
      Typically vendors would ship SATA hard drive / PATA optical
      configuration, which would lend itself to slow (PIO-only) CD-ROM
      performance.
      
      For Intel users running in combined mode, it is now wholly dependent on
      your driver choice (potentially link order, if you compile both drivers
      in) whether old-IDE or libata will drive your hardware.
      
      In either case, you will get full performance from both SATA and PATA
      ports now, without having to pass a kernel command line parameter.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      8cdfb29c
    • A
      libata: Change prototype of mode_filter to remove ata_port* · a76b62ca
      Alan Cox 提交于
      With Tejun having added adev->ap some time ago we can get rid of the
      almost unused port being passed to mode filters. And while we are
      doing filters, lets turn on the !IORDY filter as well.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      
      With some hand massaging from
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a76b62ca
  17. 26 2月, 2007 1 次提交
  18. 21 2月, 2007 1 次提交
    • T
      libata: s/ap->id/ap->print_id/g · 44877b4e
      Tejun Heo 提交于
      ata_port has two different id fields - id and port_no.  id is
      system-wide 1-based unique id for the port while port_no is 0-based
      host-wide port number.  The former is primarily used to identify the
      ATA port to the user in printk messages while the latter is used in
      various places in libata core and LLDs to index the port inside the
      host.
      
      The two fields feel quite similar and sometimes ap->id is used in
      place of ap->port_no, which is very difficult to spot.  This patch
      renames ap->id to ap->print_id to reduce the possibility of such bugs.
      
      Some printk messages are adjusted such that id string (ata%u[.%u])
      isn't printed twice and/or to use ata_*_printk() instead of hardcoded
      id format.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      44877b4e
  19. 10 2月, 2007 5 次提交
  20. 27 1月, 2007 1 次提交
    • D
      Fix Maple PATA IRQ assignment. · 8cdf92a9
      David Woodhouse 提交于
      On the Maple board, the AMD8111 IDE is in legacy mode... except that it
      appears on IRQ 20 instead of IRQ 15. For drivers/ide this was handled by
      the architecture's "pci_get_legacy_ide_irq()" function, but in libata we
      just hard-code the numbers 14 and 15.
      
      This patch provides asm-powerpc/libata-portmap.h which maps the IRQ as
      appropriate, having added a pci_dev argument to the
      ATA_{PRIM,SECOND}ARY_IRQ macros.
      
      There's probably a better way to do this -- especially if we observe
      that the _only_ case in which this seemingly-generic
      "pci_get_legacy_ide_irq()" function returns anything other than 14 and
      15 for primary and secondary respectively is the case of the AMD8111 on
      the Maple board -- couldn't we handle that with a special case in the
      pata_amd driver, or perhaps with a PCI quirk for Maple to switch it into
      native mode during early boot and assign resources properly?
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      8cdf92a9
  21. 26 1月, 2007 2 次提交
  22. 03 1月, 2007 1 次提交
    • A
      [PATCH] libata: fix combined mode · dc3c3377
      Alan 提交于
      This is a slight variant on the patch I posted December 16th to fix
      libata combined mode handling. The only real change is that we now
      correctly also reserve BAR1,2,4. That is basically a neatness issue.
      
      Jeff was unhappy about two things
      
      1. That it didn't work in the case of one channel native one channel
      legacy.
      
      This is a silly complaint because the SFF layer in libata doesn't handle
      this case yet anyway.
      
      2. The case where combined mode is in use and IDE=n.
      
      In this case the libata quirk code reserves the resources in question
      correctly already.
      
      Once the combined mode stuff is redone properly (2.6.21) then the entire
      mess turns into a single pci_request_regions() for all cases and all the
      ugly resource hackery goes away.
      
      I'm sending this now rather than after running full test suites so that
      it can get the maximal testing in a short time. I'll be running tests on
      this after lunch.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Acked-by: NAlessandro Suardi <alessandro.suardi@gmail.com>
      Acked-by: NTheodore Tso <tytso@mit.edu>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      dc3c3377