1. 03 12月, 2006 7 次提交
    • T
      [PATCH] libata: always use polling IDENTIFY · 800b3996
      Tejun Heo 提交于
      libata switched to IRQ-driven IDENTIFY when IRQ-driven PIO was
      introduced.  This has caused a lot of problems including device
      misdetection and phantom device.
      
      ATA_FLAG_DETECT_POLLING was added recently to selectively use polling
      IDENTIFY on problemetic drivers but many controllers and devices are
      affected by this problem and trying to adding ATA_FLAG_DETECT_POLLING
      for each such case is diffcult and not very rewarding.
      
      This patch makes libata always use polling IDENTIFY.  This is
      consistent with libata's original behavior and drivers/ide's behavior.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      800b3996
    • T
      [PATCH] libata: prepare ata_sg_clean() for invocation from EH · 70e6ad0c
      Tejun Heo 提交于
      Make ata_sg_clean() global and don't allow NCQ for internal commands.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      70e6ad0c
    • T
      [PATCH] libata: separate out rw ATA taskfile building into ata_build_rw_tf() · bd056d7e
      Tejun Heo 提交于
      Separate out rw ATA taskfile building from ata_scsi_rw_xlat() into
      ata_build_rw_tf().  This will be used to improve media error handling.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      bd056d7e
    • T
      [PATCH] libata: implement ata_exec_internal_sg() · 2432697b
      Tejun Heo 提交于
      Sg'ify ata_exec_internal() and call it ata_exec_internal_sg().
      Wrapper function around ata_exec_internal_sg() is implemented to
      provide ata_exec_internal() interface.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      2432697b
    • T
      [PATCH] libata: make sure IRQ is cleared after ata_bmdma_freeze() · 0f0a3ad3
      Tejun Heo 提交于
      Now that BMDMA status is recorded in irq handler.  ata_bmdma_freeze()
      is free to manipulate host status.  Under certain circumstances, some
      controllers (ICH7 in enhanced mode w/ IRQ shared) raise IRQ when CTL
      register is written to and ATA_NIEN doesn't mask it.
      
      This patch makes ata_bmdma_freeze() clear all pending IRQs after
      freezing a port.  This change makes explicit clearing in
      ata_device_add() unnecessary and thus kills it.  The removed code was
      SFF-specific and was in the wrong place.
      
      Note that ->freeze() handler is always called under ap->lock held and
      irq disabled.  Even if CTL manipulation causes stuck IRQ, it's cleared
      immediately.  This should be safe (enough) even in SMP environment.
      More correct solution is to mask the IRQ from IRQ controller but that
      would be an overkill.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      0f0a3ad3
    • T
      [PATCH] libata: move BMDMA host status recording from EH to interrupt handler · ea54763f
      Tejun Heo 提交于
      For certain errors, interrupt handler alter BMDMA host status before
      entering EH (clears active and intr).  Thus altered BMDMA host status
      value is recorded by BMDMA EH and reported to user.  Move BMDMA host
      status recording from EH to interrupt handler.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      ea54763f
    • T
      [PATCH] libata: implement ATA_FLAG_SETXFER_POLLING and use it in pata_via, take #2 · 3d3cca37
      Tejun Heo 提交于
      This patch implements ATA_FLAG_SETXFER_POLLING and use in pata_via.
      If this flag is set, transfer mode setting performed by polling not by
      interrupt.  This should help those controllers which raise interrupt
      before the command is actually complete on SETXFER.
      
      Rationale for this approach.
      
      * uses existing facility and relatively simple
      * no busy sleep in the interrupt handler
      * updating drivers is easy
      
      While at it, kill now unused flag ATA_FLAG_SRST in pata_via.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      3d3cca37
  2. 02 12月, 2006 13 次提交
  3. 15 11月, 2006 1 次提交
  4. 01 11月, 2006 1 次提交
  5. 05 10月, 2006 2 次提交
    • 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
    • A
      46767aeb
  6. 29 9月, 2006 1 次提交
  7. 28 9月, 2006 3 次提交
  8. 27 9月, 2006 1 次提交
  9. 19 9月, 2006 2 次提交
    • A
      [PATCH] libata: improve handling of diagostic fail (and hardware that misreports it) · 93590859
      Alan Cox 提交于
      Our ATA probe code checks that a device is not reporting a diagnostic
      failure during start up. Unfortunately at least one device seems to like
      doing this - the Gigabyte iRAM.
      
      This is only done for the master right now (which is fine for the iRAM
      as it is SATA), as with PATA some combinations of ATAPI device seem to
      fool the check into seeing a drive that isn't there if it is applied to
      the slave.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      93590859
    • T
      [PATCH] libata: fix non-uniform ports handling · fea63e38
      Tejun Heo 提交于
      Non-uniform ports handling got broken while updating libata to handle
      those in the same host.  Only separate irq for the non-uniform
      secondary port was implemented while all other fields (host flags,
      transfer mode...) of the secondary port simply shared those of the
      first.
      
      For ata_piix combined mode, which ATM is the only user of non-uniform
      ports, this causes the secondary port assume the wrong type.  This can
      cause PATA port to use SATA ops, which results in bogus check on PCS
      and detection failure.
      
      This patch adds ata_probe_ent->pinfo2 which points to optional
      port_info for the secondary port.  For the time being, this seems to
      be the simplest solution.  This workaround will be removed together
      with ata_probe_ent itself after init model is updated to allow more
      flexibility.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Nelson A. de Oliveira <naoliv@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      fea63e38
  10. 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
  11. 15 8月, 2006 1 次提交
  12. 10 8月, 2006 7 次提交
    • J
      Move libata to drivers/ata. · c6fd2807
      Jeff Garzik 提交于
      c6fd2807
    • T
      [PATCH] libata: kill unused hard_port_no and legacy_mode · 4852ba24
      Tejun Heo 提交于
      Kill unused probe_ent/ap->hard_port_no and probe_ent->legacy_mode.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      4852ba24
    • T
      [PATCH] libata: use dummy port for stolen legacy ports · c4b01f1d
      Tejun Heo 提交于
      Use dummy port for stolen legacy ports.  This makes ap->port_no always
      equal ap->hard_port_no.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      c4b01f1d
    • T
      [PATCH] libata: implement dummy port · dd5b06c4
      Tejun Heo 提交于
      Implement dummy port which can be requested by setting appropriate bit
      in probe_ent->dummy_port_mask.  The dummy port is used as placeholder
      for stolen legacy port.  This allows libata to guarantee that
      index_of(ap) == ap->port_no == actual_device_port_no, and thus to
      remove error-prone ap->hard_port_no.
      
      As it's used only when one port of a legacy controller is reserved by
      some other entity (e.g. IDE), the focus is on keeping the added *code*
      complexity at minimum, so dummy port allocates all libata core
      resources and acts as a normal port.  It just has all dummy port_ops.
      
      This patch only implements dummy port.  The following patch will make
      libata use it for stolen legacy ports.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      dd5b06c4
    • A
      [PATCH] libata: rework legacy handling to remove much of the cruft · 2ec7df04
      Alan Cox 提交于
      Kill host_set->next
      Fix simplex support
      Allow per platform setting of IDE legacy bases
      
      Some of this can be tidied further later on, in particular all the
      legacy port gunge belongs as a PCI quirk/PCI header decode to understand
      the special legacy IDE rules in the PCI spec.
      
      Longer term Jeff also wants to move the request_irq/free_irq out of core
      which will make this even cleaner.
      
      tj: folded in three followup patches - ata_piix-fix, broken-arch-fix
      and fix-new-legacy-handling, and separated per-dev xfermask into
      separate patch preceding this one.  Folded in fixes are...
      
      * ata_piix-fix: fix build failure due to host_set->next removal
      * broken-arch-fix: add missing include/asm-*/libata-portmap.h
      * fix-new-legacy-handling:
      	* In ata_pci_init_legacy_port(), probe_num was incorrectly
                incremented during initialization of the secondary port and
                probe_ent->n_ports was incorrectly fixed to 1.
      
      	* Both legacy ports ended up having the same hard_port_no.
      
      	* When printing port information, both legacy ports printed
      	  the first irq.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      2ec7df04
    • T
      [PATCH] libata: implement per-dev xfermask · 37deecb5
      Tejun Heo 提交于
      Implement per-dev xfermask.  libata used to determine xfermask
      per-port - the fastest mode of the slowest device on the port.  This
      patch enables per-dev xfermask.
      
      Original patch is from Alan Cox <alan@redhat.com>.  The following
      changes are made by me.
      
      * simplex warning message is added
      * remove disabled device handling code which is never invoked
        (originally for choosing port-wide lowest PIO mode)
      
      Cc: Alan Cox <alan@redhat.com>
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      37deecb5
    • J
      [PATCH] [libata] Kill 'count' var in ata_device_add() · 6d0500df
      Jeff Garzik 提交于
      Eliminate redundant loop variable 'count'
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      6d0500df