1. 29 4月, 2007 6 次提交
    • T
      libata: improve AC_ERR_DEV handling for ->post_internal_cmd · a51d644a
      Tejun Heo 提交于
      ->post_internal_cmd is simplified EH for internal commands.  Its
      primary mission is to stop the controller such that no rogue memory
      access or other activities occur after the internal command is
      released.  It may provide error diagnostics by setting qc->err_mask
      but this hasn't been a requirement.
      
      To ignore SETXFER failure for CFA devices, libata needs to know
      whether a command was failed by the device or for any other reason.
      ie. internal command needs to get AC_ERR_DEV right.
      
      This patch makes the following changes to AC_ERR_DEV handling and
      ->post_internal_cmd semantics to accomodate this need and simplify
      callback implementation.
      
      1. As long as the correct bits in the result TF registers are set,
         there is no need to set AC_ERR_DEV explicitly.  libata EH core
         takes care of that for both normal and internal commands.
      
      2. The only requirement for ->post_internal_cmd() is to put the
         controller into quiescent state.  It needs not to set any err_mask.
      
      3. ata_exec_internal_sg() performs minimal error analysis such that
         AC_ERR_DEV is automatically set as long as result_tf is filled
         correctly.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a51d644a
    • M
      sata_promise: fix error decode regression · ce2d3abc
      Mikael Pettersson 提交于
      Promise ATA ports should always be reset by pdc_reset_port()
      when errors are detected, but the recent error reason decoding
      update to sata_promise replaced that reset with a freeze.
      
      This patch changes the error detection to do a reset again.
      This makes the error decoding update safer, as it now only
      adds error decoding without changing any other behaviour.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ce2d3abc
    • M
      sata_promise: decode and report error reasons · 176efb05
      Mikael Pettersson 提交于
      This patch adds much needed error reason decoding and
      reporting to sata_promise. It's simplistic but should
      log all relevant error info the controller provides.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      176efb05
    • M
      sata_promise: separate SATA and PATA ops · 724114a5
      Mikael Pettersson 提交于
      This patch changes sata_promise so that the PATA ports
      on TX2plus chips are bound to the pdc_pata_ops structure.
      This means that operations called from the SATA ops
      structures don't need any SATA-vs-PATA tests any more.
      Instead, operations that depend on a port being SATA or
      PATA are separated into different procedures.
      
      * pdc_cable_type() is split into a PATA version and a
        SATA version
      * pdc_error_handler() is split into a PATA version and a
        SATA version, that both call a common version after
        setting up the `hardreset' function pointer
      * pdc_old_check_atapi_dma() is now only used for SATAI
        ports, so is renamed to pdc_old_sata_check_atapi_dma()
        and simplified
      * pdc_sata_scr_{read,write}() are now only used for SATA
        ports, so their is-not-SATA tests are removed
      * pdc_port_start() is split into three procedures: a wrapper
        which performs the ->ops adjustment on TX2plus PATA ports,
        a procedure with the common code, and a procedure with
        the SATA-specific code (this bit might be cleaned up by
        Tejun's new init model)
      
      Tested on 20619, 20575, and 20775 chips.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      724114a5
    • M
      sata_promise: add missing cable_detect hooks · 799331fd
      Mikael Pettersson 提交于
      The recent change which moved cable detection from
      pdc_pre_reset() to the new ->cable_detect hook only
      added the hook for SATAII chips, leaving SATAI chips
      and the 20619 without the hook. Fixed by this patch.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      799331fd
    • A
  2. 26 2月, 2007 3 次提交
  3. 16 2月, 2007 2 次提交
  4. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  5. 10 2月, 2007 9 次提交
    • A
      libata: add another IRQ calls (libata drivers) · 246ce3b6
      Akira Iguchi 提交于
      This patch is against each libata driver.
      
      Two IRQ calls are added in ata_port_operations.
      - irq_on() is used to enable interrupts.
      - irq_ack() is used to acknowledge a device interrupt.
      
      In most drivers, ata_irq_on() and ata_irq_ack() are used for
      irq_on and irq_ack respectively.
      
      In some drivers (ex: ahci, sata_sil24) which cannot use them
      as is, ata_dummy_irq_on() and ata_dummy_irq_ack() are used.
      Signed-off-by: NKou Ishizaki <kou.ishizaki@toshiba.co.jp>
      Signed-off-by: NAkira Iguchi <akira2.iguchi@toshiba.co.jp>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      246ce3b6
    • T
      libata: convert to iomap · 0d5ff566
      Tejun Heo 提交于
      Convert libata core layer and LLDs to use iomap.
      
      * managed iomap is used.  Pointer to pcim_iomap_table() is cached at
        host->iomap and used through out LLDs.  This basically replaces
        host->mmio_base.
      
      * if possible, pcim_iomap_regions() is used
      
      Most iomap operation conversions are taken from Jeff Garzik
      <jgarzik@pobox.com>'s iomap branch.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0d5ff566
    • T
      libata: update libata LLDs to use devres · 24dc5f33
      Tejun Heo 提交于
      Update libata LLDs to use devres.  Core layer is already converted to
      support managed LLDs.  This patch simplifies initialization and fixes
      many resource related bugs in init failure and detach path.  For
      example, all converted drivers now handle ata_device_add() failure
      gracefully without excessive resource rollback code.
      
      As most resources are released automatically on driver detach, many
      drivers don't need or can do with much simpler ->{port|host}_stop().
      In general, stop callbacks are need iff port or host needs to be given
      commands to shut it down.  Note that freezing is enough in many cases
      and ports are automatically frozen before being detached.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      24dc5f33
    • 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
  6. 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
  7. 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
  8. 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
  9. 11 10月, 2006 2 次提交
  10. 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
  11. 28 9月, 2006 1 次提交
  12. 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
  13. 10 8月, 2006 2 次提交
  14. 24 7月, 2006 1 次提交
  15. 03 7月, 2006 1 次提交
  16. 31 5月, 2006 1 次提交
  17. 24 5月, 2006 2 次提交
  18. 15 5月, 2006 1 次提交
  19. 11 4月, 2006 1 次提交