1. 10 2月, 2007 6 次提交
    • T
      sata_promise: kill qc->nsect · 0feb573f
      Tejun Heo 提交于
      Merge order left qc->nsect usage in sata_promise dangling.  Kill it.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0feb573f
    • M
      sata_promise: handle ATAPI_NODATA ourselves · fba6edbd
      Mikael Pettersson 提交于
      This patch extends sata_promise to handle ATAPI_NODATA
      commands internally. However, commands destined to
      ATA_DFLAG_CDB_INTR devices are excluded from this and
      continue to be returned to libata.
      
      Concrete changes:
      - pdc_atapi_dma_pkt() is renamed to pdc_atapi_pkt(), and is
        extended to set up correct headers for NODATA packets
      - pdc_qc_prep() calls pdc_atapi_pkt() for ATAPI_NODATA
      - pdc_host_intr() handles ATAPI_NODATA
      - pdc_qc_issue_prot() sends ATAPI_NODATA packets via the
        chip's packet mechanism, except for CDB_INTR devices
      
      Tested on first- and second-generation chips, SATAPI and PATAPI,
      with no observable regressions.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      fba6edbd
    • M
      sata_promise: issue ATAPI commands as normal packets · 4113bb6b
      Mikael Pettersson 提交于
      This patch (against libata #upstream + the ATAPI cleanup patch)
      reimplements sata_promise's ATAPI support to format ATAPI DMA
      commands as normal packets, and to issue them via the hardware's
      normal packet machinery.
      
      It turns out that the only reason for issuing ATAPI DMA
      commands via the pdc_issue_atapi_pkt_cmd() procedure was to
      perform two interrupt-fiddling steps for ATA_DFLAG_CDB_INTR
      devices. But these steps aren't needed because sata_promise
      sets ATA_FLAG_PIO_POLLING, which disables DMA for those devices.
      The remaining steps can easily be done in ATA taskfile packets.
      
      Concrete changes:
      - pdc_atapi_dma_pkt() is extended to program all packet setup
        steps, and not just contain the CDB; the sequence of steps
        exactly mirrors what pdc_issue_atapi_pkt_cmd() did
      - pdc_atapi_dma_pkt() needed more parameters: simplify it by
        just passing 'qc' and having it extract the data it needs
      - pdc_issue_atai_pkt_cmd() and its two helper procedures
        pdc_wait_for_drq() and pdc_wait_on_busy() are removed
      
      Tested on first- and second-generation chips, SATAPI and PATAPI,
      with no observable regressions.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4113bb6b
    • M
      sata_promise: ATAPI cleanup · 73fd456b
      Mikael Pettersson 提交于
      Here's a cleanup for yesterday's sata_promise ATAPI patch:
      - add and use a symbolic constant for the altstatus register
      - check return status from ata_busy_wait()
      - add missing newline in a warning printk()
      - update comment in pdc_issue_atapi_pkt_cmd() to clarify
        that the maybe-wait-for-INT issue cannot occur in the
        current driver, but may occur if the driver starts issuing
        ATAPI non-DMA commands as PDC packets
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      73fd456b
    • M
      sata_promise: ATAPI support · 95006188
      Mikael Pettersson 提交于
      This patch adds ATAPI support to the sata_promise driver.
      This has been tested on both first- and second-generation
      chips (20378 and 20575), and with both SATAPI and PATAPI
      devices. CD-writing works.
      
      SATAPI DMA works on second-generation chips, but on
      first-generation chips SATAPI is limited to PIO due
      to what appears to be HW limitations.
      PATAPI DMA works on both first- and second-generation
      chips, but requires the separate PATA support patch
      before it can be used on TX2plus chips.
      
      The functional changes to the driver are:
      - remove ATA_FLAG_NO_ATAPI from PDC_COMMON_FLAGS
      - add ->check_atapi_dma() operation to enable DMA for bulk data
        transfers but force PIO for other ATAPI commands; this filter
        is from Promise's driver and largely matches pata_pdc207x.c
      - use a more restrictive ->check_atapi_dma() on first-generation
        chips to force SATAPI to always use PIO
      - add handling of ATAPI protocols to pdc_qc_prep(), pdc_host_intr(),
        and pdc_qc_issue_prot(): ATAPI_DMA is handled by the driver
        while non-DMA protocols are handed over to libata generic code
      - add pdc_issue_atapi_pkt_cmd() to handle the initial steps in
        issuing ATAPI DMA commands before sending the actual CDB;
        this procedure was ported from Promise's driver
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      95006188
    • M
      sata_promise: TX2plus PATA support · 870ae337
      Mikael Pettersson 提交于
      This patch implements a simple way of setting up per-port
      flags on the SATA+PATA Promise TX2plus chips, which is a
      prerequisite for supporting the PATA port on those chips.
      
      It is based on the observation that ap->flags isn't really
      used until after ->port_start() has been invoked. So it
      places the "exceptional" per-port flags array in the driver's
      private host structure, and uses it in ->port_start() to
      finalise the port's flags.
      
      This patch obsoletes the #promise-sata-pata branch included
      in the #all branch.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      870ae337
  2. 07 12月, 2006 2 次提交
    • M
      [PATCH] sata_promise: new EH conversion, take 2 · 25b93d81
      Mikael Pettersson 提交于
      This patch converts sata_promise to use new-style libata error
      handling on Promise SATA chips, for both SATA and PATA ports.
      
      * ATA_FLAG_SRST is no longer set
      * ->phy_reset is no longer set as it is unused when ->error_handler
         is present, and pdc_sata_phy_reset() has been removed
      * pdc_freeze() masks interrupts and halts DMA via PDC_CTLSTAT
      * pdc_thaw() clears interrupt status in PDC_INT_SEQMASK and then
        unmasks interrupts in PDC_CTLSTAT
      * pdc_error_handler() reinitialises the port if it isn't frozen,
        and then invokes ata_do_eh() with standard {s,}ata reset methods
      * pdc_post_internal_cmd() resets the port in case of errors
      * the PATA-only 20619 chip continues to use old-style EH:
        not by necessity but simply because I don't have documentation
        for it or any way to test it
      
      Since the previous version pdc_error_handler() has been rewritten
      and it now mostly matches ahci and sata_sil24. In case anyone
      wonders: the call to pdc_reset_port() isn't a heavy-duty reset,
      it's a light-weight reset to quickly put a port into a sane state.
      
      The discussion about the PCI flushes in pdc_freeze() and pdc_thaw()
      seemed to end with a consensus that the flushes are OK and not
      obviously redundant, so I decided to keep them for now.
      
      This patch was prepared against 2.6.19-git7, but it also applies
      to 2.6.19 + libata #upstream, with or without the revised sata_promise
      cleanup patch I recently submitted.
      
      This patch does conflict with the #promise-sata-pata patch:
      this patch removes pdc_sata_phy_reset() while #promise-sata-pata
      modifies it. The correct patch resolution is to remove the function.
      
      Tested on 2037x and 2057x chips, with PATA patches on top and disks
      on both SATA and PATA ports.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      25b93d81
    • M
      [PATCH] sata_promise: cleanups, take 2 · d324d462
      Mikael Pettersson 提交于
      This patch performs two simple cleanups of sata_promise.
      
      * Remove board_20771 and map device id 0x3577 to board_2057x.
        After the recent corrections for SATAII chips, board_20771 and
        board_2057x were equivalent in the driver.
      
      * Remove hp->hotplug_offset and use hp->flags & PDC_FLAG_GEN_II
        to compute hotplug_offset in pdc_host_init(). hp->hotplug_offset
        was used to distinguish 1st and 2nd generation chips in one
        particular case, but now we have that information in a more
        general form in hp->flags, so hp->hotplug_offset is redundant.
      
      Changes since previous submission: rebased on libata-dev #upstream,
      cleaned up hotplug_offset computation based on Tejun's comments,
      expanded hotplug_offset removal rationale.
      
      This patch does not depend on the pending new EH conversion patch.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d324d462
  3. 03 12月, 2006 1 次提交
    • M
      [PATCH] sata_promise: PHYMODE4 fixup · 599b7202
      Mikael Pettersson 提交于
      This patch adds code to fix up the PHYMODE4 "align timing"
      register value on second-generation Promise SATA chips.
      Failure to correct this value on non-x86 machines makes
      drive detection prone to failure due to timeouts. (I've
      observed about 50% detection failure rates on SPARC64.)
      
      The HW boots with a bad value in this register, but on x86
      machines the Promise BIOS corrects it to the value recommended
      by the manual, so most people have been unaffected by this issue.
      
      After developing the patch I checked Promise's SATAII driver,
      and discovered that it also corrects PHYMODE4 just like this
      patch does.
      
      This patch depends on the sata_promise SATAII updates
      patch I sent recently.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      599b7202
  4. 02 12月, 2006 2 次提交
    • M
      [PATCH] sata_promise fixes and updates · b2d1eee1
      Mikael Pettersson 提交于
      This patch updates the sata_promise driver as follows:
      - Correct typo in definition of PDC_TBG_MODE: it's at 0x41C not 0x41
        in first-generation chips. This error caused PCI access alignment
        exceptions on SPARC64, and on all platforms it disabled the expected
        initialisation of TBG mode.
      - Add flags field to struct pdc_host_priv. Define PDC_FLAG_GEN_II
        and use it to distinguish first- and second-generation chips.
      - Prevent the FLASH_CTL FIFO_SHD bit from being set to 1 on second-
        generation chips. This matches Promises' ulsata2 driver.
      - Prevent TBG mode and SLEW rate initialisation in second-generation chips.
        These two registers have moved, TBG mode has been redefined, and
        Promise's ulsata2 driver no longer attempts to initialise them.
      - Correct PCI device table so devices 0x3570, 0x3571, and 0x3d73 are
        marked as 2057x (2nd gen) not 2037x (1st gen).
      - Correct PCI device table so device 0x3d17 is marked as 40518
        (2nd gen 4 ports) not 20319 (1st gen 4 ports).
      - Correct pdc_ata_init_one() to treat 20771 as a second-generation chip.
      
      Tested on 0x3d75 (2nd gen), 0x3d73 (2nd gen), and 0x3373 (1st gen) chips.
      The information comes from the newly uploaded Promise SATA HW specs,
      Promise's ultra and ulsata2 drivers, and debugging on 3d75/3d73/3373 chips.
      
      hp->hotplug_offset could now be removed and its value recomputed
      in pdc_host_init() using hp->flags, but that would be a cleanup
      not a functional change, so I'm ignoring it for now.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b2d1eee1
    • J
      [libata] sata_promise: fix TBG mode register offset · 46b027cc
      Jeff Garzik 提交于
      Fixes crashes on sparc, and may correct weird behavior reported on
      occasions, because we were never programming this register correctly (or
      at all).
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      46b027cc
  5. 11 10月, 2006 2 次提交
  6. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  7. 28 9月, 2006 1 次提交
  8. 24 8月, 2006 1 次提交
    • J
      libata: Grand renaming. · cca3974e
      Jeff Garzik 提交于
      The biggest change is that ata_host_set is renamed to ata_host.
      
      * ata_host_set			=> ata_host
      * ata_probe_ent->host_flags	=> ata_probe_ent->port_flags
      * ata_probe_ent->host_set_flags	=> ata_probe_ent->_host_flags
      * ata_host_stats		=> ata_port_stats
      * ata_port->host		=> ata_port->scsi_host
      * ata_port->host_set		=> ata_port->host
      * ata_port_info->host_flags	=> ata_port_info->flags
      * ata_(.*)host_set(.*)\(\)	=> ata_\1host\2()
      
      The leading underscore in ata_probe_ent->_host_flags is to avoid
      reusing ->host_flags for different purpose.  Currently, the only user
      of the field is libata-bmdma.c and probe_ent itself is scheduled to be
      removed.
      
      ata_port->host is reused for different purpose but this field is used
      inside libata core proper and of different type.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      cca3974e
  9. 10 8月, 2006 2 次提交
  10. 24 7月, 2006 1 次提交
  11. 03 7月, 2006 1 次提交
  12. 31 5月, 2006 1 次提交
  13. 24 5月, 2006 2 次提交
  14. 15 5月, 2006 1 次提交
  15. 11 4月, 2006 1 次提交
  16. 03 4月, 2006 1 次提交
  17. 02 4月, 2006 1 次提交
  18. 22 3月, 2006 1 次提交
  19. 05 3月, 2006 1 次提交
  20. 13 2月, 2006 1 次提交
  21. 10 2月, 2006 2 次提交
  22. 29 1月, 2006 1 次提交
  23. 27 1月, 2006 2 次提交
  24. 17 1月, 2006 1 次提交
  25. 06 1月, 2006 1 次提交
  26. 14 12月, 2005 1 次提交
  27. 13 12月, 2005 1 次提交
    • J
      [libata] mark certain hardware (or drivers) with a no-atapi flag · 50630195
      Jeff Garzik 提交于
      Some hardware does not support the PACKET command at all.
      Other hardware supports ATAPI, but the driver does something nasty such
      as calling BUG() when an ATAPI command is issued.
      
      For these such cases, we mark them with a new flag, ATA_FLAG_NO_ATAPI.
      
      Initial version contributed by Ben Collins.
      50630195
  28. 06 12月, 2005 1 次提交