1. 02 12月, 2006 7 次提交
    • T
      [PATCH] libata: use FLUSH_EXT only when driver is larger than LBA28 limit · 6fc49adb
      Tejun Heo 提交于
      Many drives support LBA48 even when its capacity is smaller than
      1<<28, as LBA48 is required for many functionalities.  FLUSH_EXT is
      mandatory for drives w/ LBA48 support.
      
      Interestingly, at least one of such drives (ST960812A) has problems
      dealing with FLUSH_EXT.  It eventually completes the command but takes
      around 7 seconds to finish in many cases thus drastically slowing down
      IO transactions.  This seems to be a firmware bug which sneaked into
      production probably because no other ATA driver including linux IDE
      issues FLUSH_EXT to drives which report support for LBA48 & FLUSH_EXT
      but is smaller than 1<<28 blocks.
      
      This patch adds ATA_DFLAG_FLUSH_EXT which is set iff the drive
      supports LBA48 & FLUSH_EXT and is larger than LBA28 limit.  Both cache
      flush paths are updated to issue FLUSH_EXT only when the flag is set.
      Note that the changed behavior is more inline with the rest of libata.
      libata prefers shorter commands whenever possible.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Danny Kukawka <dkukawka@novell.com>
      Cc: Stefan Seyfried <seife@novell.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6fc49adb
    • T
      [PATCH] libata: implement ATA_EHI_SETMODE and ATA_EHI_POST_SETMODE · baa1e78a
      Tejun Heo 提交于
      libata EH used to perform ata_set_mode() iff the EH session performed
      reset as indicated by ATA_EHI_DID_RESET.  This is incorrect because
      ->dev_config() called by revalidation is allowed to modify transfer
      mode which ata_set_mode() should take care of.  This patch implements
      the following two flags.
      
      * ATA_EHI_SETMODE: set during EH to schedule ata_set_mode().  Both new
        device attachment and revalidation set this flag.
      
      * ATA_EHI_POST_SETMODE: set while the device is revalidated after
        ata_set_mode().  Post-setmode revalidation is different from initial
        configuaration and EH revalidation in that ->dev_config() is not
        allowed tune transfer mode.  LLD can use this flag to determine
        whether it's allowed to tune transfer mode.  Note that POST_SETMODE
        ->dev_config() is guaranteed to be preceded by non-POST_SETMODE
        ->dev_config().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      baa1e78a
    • T
      [PATCH] libata: implement ATA_EHI_PRINTINFO · efdaedc4
      Tejun Heo 提交于
      Implement ehi flag ATA_EHI_PRINTINFO.  This flag is set when device
      configuration needs to print out device info.  This used to be handled
      by @print_info argument to ata_dev_configure() but LLDs also need to
      know about it in ->dev_config() callback.
      
      This patch replaces @print_info w/ ATA_EHI_PRINTINFO and make sata_sil
      print workaround messages only on the initial configuration.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      efdaedc4
    • T
      [PATCH] libata: separate out and export sata_port_hardreset() · b6103f6d
      Tejun Heo 提交于
      Separate out sata_port_hardreset() from sata_std_hardreset().  This
      will be used by LLD hardreset implementation and later by PMP.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b6103f6d
    • T
      [PATCH] libata: move ata_irq_on() into libata-sff.c · 90088bb4
      Tejun Heo 提交于
      ata_irq_on() isn't used outside of libata core layer.  The function is
      TF/SFF interface specific but currently used by core path with some
      hack too.  Move it from include/linux/libata.h to
      drivers/ata/libata-sff.c.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      90088bb4
    • T
      [PATCH] libata: handle 0xff status properly · d1adc1bb
      Tejun Heo 提交于
      libata waits for !BSY even when the status register reports 0xff.
      This causes long boot delays when D8 isn't pulled down properly.  This
      patch does the followings.
      
      * don't wait if status register is 0xff in all wait functions
      
      * make ata_busy_sleep() return 0 on success and -errno on failure.
        -ENODEV is returned on 0xff status and -EBUSY on other failures.
      
      * make ata_bus_softreset() succeed on 0xff status.  0xff status is not
        reset failure.  It indicates no device.  This removes unnecessary
        retries on such ports.  Note that the code change assumes unoccupied
        port reporting 0xff status does not produce valid device signature.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Joe Jin <lkmaillist@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d1adc1bb
    • A
      [PATCH] libata: Revamp blacklist support to allow multiple kinds of blacklisting flaws · 6919a0a6
      Alan Cox 提交于
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6919a0a6
  2. 01 11月, 2006 1 次提交
  3. 22 10月, 2006 1 次提交
  4. 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
  5. 30 9月, 2006 2 次提交
  6. 28 9月, 2006 1 次提交
  7. 26 9月, 2006 1 次提交
  8. 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
  9. 31 8月, 2006 1 次提交
  10. 30 8月, 2006 1 次提交
  11. 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
  12. 15 8月, 2006 1 次提交
  13. 10 8月, 2006 4 次提交
    • J
      [ATA] Increase lba48 max-sectors from 200 to 256. · 8b881b04
      Jeff Garzik 提交于
      Also, moved ATA_MAX_SECTORS and ATA_MAX_SECTORS_LBA48 from
      linux/libata.h to linux/ata.h, now that they truly reflect the standard
      (well... mostly; note TODO comment).
      
      This changes the performance profile (and potential bug profile)
      for a bunch of drivers, so be wary.
      8b881b04
    • 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: 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
  14. 09 8月, 2006 2 次提交
    • B
      [PATCH] libata: Add support for SATA attachment to SAS adapters · 80289167
      Brian King 提交于
      The following patch enhances libata to allow SAS device drivers
      to utilize libata to talk to SATA devices. It introduces some
      new APIs which allow libata to be used without allocating a
      virtual scsi host.
      
      New APIs:
      
      ata_sas_port_alloc - Allocate an ata_port
      ata_sas_port_init - Initialize an ata_port (probe device, etc)
      ata_sas_port_destroy - Free an ata_port allocated by ata_sas_port_alloc
      ata_sas_slave_configure - configure scsi device
      ata_sas_queuecmd - queue a scsi command, similar to ata_scsi_queuecomand
      
      These new APIs can be used either directly by a SAS LLDD or could be used
      by the SAS transport class.
      
      Possible usage for a SAS LLDD would be:
      
      scsi_scan_host
      	target_alloc
      		ata_sas_port_alloc
      	slave_alloc
      		ata_sas_port_init
      	slave_configure
      		ata_sas_slave_configure
      
      Commands received by the LLDD for SATA devices would call ata_sas_queuecmd.
      
      Device teardown would occur with:
      
      slave_destroy
      	port_disable
      target_destroy
      	ata_sas_port_destroy
      Signed-off-by: NBrian King <brking@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      80289167
    • B
      [PATCH] libata: Add ata_host_set_init · b03732f0
      Brian King 提交于
      Add ata_host_set_init in preparation for SAS attached SATA.
      Signed-off-by: NBrian King <brking@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b03732f0
  15. 29 7月, 2006 1 次提交
  16. 20 7月, 2006 1 次提交
    • T
      [PATCH] libata: improve EH action and EHI flag handling · 13abf50d
      Tejun Heo 提交于
      Update ata_eh_about_to_do() and ata_eh_done() to improve EH action and
      EHI flag handling.
      
      * There are two types of EHI flags - one which expires on successful
        EH and the other which expires on a successful reset.  Make this
        distinction clear.
      
      * Unlike other EH actions, reset actions are represented by two EH
        action masks and a EHI modifier.  Implement correct about_to_do/done
        semantics for resets.  That is, prior to reset, related EH info is
        sucked in from ehi and cleared, and after reset is complete, related
        EH info in ehc is cleared.
      
      These changes improve consistency and remove unnecessary EH actions
      caused by stale EH action masks and EHI flags.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      13abf50d
  17. 06 7月, 2006 8 次提交
    • T
      [PATCH] libata: reimplement controller-wide PM · 500530f6
      Tejun Heo 提交于
      Reimplement controller-wide PM.  ata_host_set_suspend/resume() are
      defined to suspend and resume a host_set.  While suspended, EHs for
      all ports in the host_set are pegged using ATA_FLAG_SUSPENDED and
      frozen.
      
      Because SCSI device hotplug is done asynchronously against the rest of
      libata EH and the same mutex is used when adding new device, suspend
      cannot wait for hotplug to complete.  So, if SCSI device hotplug is in
      progress, suspend fails with -EBUSY.
      
      In most cases, host_set resume is followed by device resume.  As each
      resume operation requires a reset, a single host_set-wide resume
      operation may result in multiple resets.  To avoid this, resume waits
      upto 1 second giving PM to request resume for devices.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      500530f6
    • T
      [PATCH] libata: reimplement per-dev PM · d6f26d1f
      Tejun Heo 提交于
      Reimplement per-dev PM.  The original implementation directly put the
      device into suspended mode and didn't synchronize w/ EH operations
      including hotplug.  This patch reimplements ata_scsi_device_suspend()
      and ata_scsi_device_resume() such that they request EH to perform the
      respective operations.  Both functions synchronize with hotplug such
      that it doesn't operate on detached devices.
      
      Suspend waits for completion but resume just issues request and
      returns.  This allows parallel wake up of devices and thus speeds up
      system resume.
      
      Due to sdev detach synchronization, it's not feasible to separate out
      EH requesting from sdev handling; thus, ata_device_suspend/resume()
      are removed and everything is implemented in the respective
      libata-scsi functions.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d6f26d1f
    • T
      [PATCH] libata: implement PM EH actions · 02670bf3
      Tejun Heo 提交于
      Implement two PM per-dev EH actions - ATA_EH_SUSPEND and
      ATA_EH_RESUME.  Each action puts the target device into suspended mode
      and resumes from it respectively.
      
      Once a device is put to suspended mode, no EH operations other than
      RESUME is allowed on the device.  The device will stay suspended till
      it gets resumed and thus reset and revalidated.  To implement this, a
      new device state helper - ata_dev_ready() - is implemented and used in
      EH action implementations to make them operate only on attached &
      running devices.
      
      If all possible devices on a port are suspended, reset is skipped too.
      This prevents spurious events including hotplug events from disrupting
      suspended devices.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      02670bf3
    • T
      [PATCH] libata: separate out __ata_ehi_hotplugged() · c0b6c037
      Tejun Heo 提交于
      Separate out __ata_ehi_hotplugged() from ata_ehi_hotplugged().  The
      underscored version doesn't set AC_ERR_ATA_BUS.  This will be used for
      resume which is a hotplug event but not an ATA bus error.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c0b6c037
    • T
      [PATCH] libata: implement ATA_EHI_NO_AUTOPSY and QUIET · 1cdaf534
      Tejun Heo 提交于
      Implement ATA_EHI_NO_AUTOPSY and QUIET.  These used to be implied by
      ATA_PFLAG_LOADING, but new power management and PMP support need to
      use these separately.  e.g. Suspend/resume operations shouldn't print
      full EH messages and resume shouldn't be recorded as an error.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1cdaf534
    • T
      [PATCH] libata: clean up debounce parameters and improve parameter selection · e9c83914
      Tejun Heo 提交于
      The names of predefined debounce timing parameters didn't exactly
      match their usages.  Rename to more generic names and implement param
      selection helper sata_ehc_deb_timing() which uses EHI_HOTPLUGGED to
      select params.
      
      Combined with the previous EHI_RESUME_LINK differentiation, this makes
      parameter selection accurate.  e.g. user scan resumes link but normal
      deb param is used instead of hotplug param.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e9c83914
    • T
      [PATCH] libata: implement ATA_EHI_RESUME_LINK · 28324304
      Tejun Heo 提交于
      Implement ATA_EHI_RESUME_LINK, which indicates that the link needs to
      be resumed.  This used to be implied by ATA_EHI_HOTPLUGGED.  However,
      hotplug isn't the only event which requires link resume and separating
      this out allows other places to request link resume.  This
      differentiation also allows better debounce timing selection.
      
      This patch converts user scan to use ATA_EHI_RESUME_LINK.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      28324304
    • T
      [PATCH] libata: add ap->pflags and move core dynamic flags to it · b51e9e5d
      Tejun Heo 提交于
      ap->flags is way too clamped.  Separate out core dynamic flags to
      ap->pflags.  ATA_FLAG_DISABLED is a dynamic flag but left alone as
      it's referenced by a lot of LLDs and it's gonna be removed once all
      LLDs are converted to new EH.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b51e9e5d
  18. 27 6月, 2006 2 次提交
    • T
      [PATCH] libata: implement ata_port_max_devices() · 5806db22
      Tejun Heo 提交于
      Implement ata_port_max_devices().  This function returns the number of
      possible devices on a port.  This will be used by new PM
      implementation.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      5806db22
    • A
      [PATCH] libata.h needs scatterlist.h · 41542dbe
      Andrew Morton 提交于
      From: Andrew Morton <akpm@osdl.org>
      
      s390:
      
      In file included from drivers/scsi/libata-bmdma.c:39:                           include/linux/libata.h:391: error: field 'sgent' has incomplete type
      include/linux/libata.h:392: error: field 'pad_sgent' has incomplete type
      include/linux/libata.h: In function 'ata_sg_is_last':                           include/linux/libata.h:849: error: arithmetic on pointer to an incomplete type
      include/linux/libata.h:849: error: arithmetic on pointer to an incomplete type
      include/linux/libata.h: In function 'ata_qc_next_sg':
      include/linux/libata.h:869: error: increment of pointer to unknown structure
      include/linux/libata.h:869: error: arithmetic on pointer to an incomplete type
      include/linux/libata.h:869: error: arithmetic on pointer to an incomplete type
      include/linux/libata.h:869: error: arithmetic on pointer to an incomplete type
      
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      41542dbe
  19. 23 6月, 2006 2 次提交