1. 10 2月, 2007 2 次提交
  2. 03 2月, 2007 1 次提交
  3. 26 1月, 2007 1 次提交
  4. 25 1月, 2007 1 次提交
  5. 24 1月, 2007 2 次提交
  6. 20 1月, 2007 1 次提交
    • T
      libata: initialize qc->dma_dir to DMA_NONE · 501e0c50
      Tejun Heo 提交于
      libata didn't used to init qc->dma_dir to any specific value on qc
      initialization and command translation path didn't set qc->dma_dir if
      the command doesn't need data transfer.  This made non-data commands
      to have random qc->dma_dir.
      
      This usually doesn't cause problem because LLDs usually check
      qc->protocol first and look at qc->dma_dir iff the command needs data
      transfer but this doesn't hold for all LLDs.
      
      It might be worthwhile to rename qc->dma_dir to qc->data_dir as we use
      the field to tag data direction for both PIO and DMA protocols.
      
      This problem has been spotted by James Bottomley.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: James Bottomley <James.Bottomley@SteelEye.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      501e0c50
  7. 03 12月, 2006 3 次提交
    • 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: 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
    • T
      [PATCH] libata: remove unused HSM_ST_UNKNOWN · 582982e6
      Tejun Heo 提交于
      HSM_ST_UNKNOWN is not used anywhere.  Its value is zero and supposed
      to serve sanity check purpose but HSM_ST_IDLE is used for that
      purpose.  This unused state causes confusion.  After a port is
      initialized but before the first command is executed, the idle hsm
      state is UNKNOWN.  However, once a command has completed, the idle hsm
      state is IDLE.  This defeats sanity check in ata_pio_task() for the
      first command.
      
      This patch removes HSM_ST_UNKNOWN and consequently make HSM_ST_IDLE
      the default state.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      582982e6
  8. 02 12月, 2006 8 次提交
    • T
      [PATCH] libata: implement presence detection via polling IDENTIFY · 55a8e2c8
      Tejun Heo 提交于
      On some controllers (ICHs in piix mode), there is *NO* reliable way to
      determine device presence other than issuing IDENTIFY and see how the
      transaction proceeds by watching the TF status register.
      
      libata acted this way before irq-pio and phantom devices caused very
      little problem but now that IDENTIFY is performed using IRQ drive PIO,
      such phantom devices now result in multiple 30sec timeouts during
      boot.
      
      This patch implements ATA_FLAG_DETECT_POLLING.  If a LLD sets this
      flag, libata core issues the initial IDENTIFY in polling mode and if
      the initial data transfer fails w/ HSM violation, the port is
      considered to be empty thus replicating the old libata and IDE
      behavior.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      55a8e2c8
    • 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
  9. 22 11月, 2006 2 次提交
    • D
      WorkStruct: Pass the work_struct pointer instead of context data · 65f27f38
      David Howells 提交于
      Pass the work_struct pointer to the work function rather than context data.
      The work function can use container_of() to work out the data.
      
      For the cases where the container of the work_struct may go away the moment the
      pending bit is cleared, it is made possible to defer the release of the
      structure by deferring the clearing of the pending bit.
      
      To make this work, an extra flag is introduced into the management side of the
      work_struct.  This governs auto-release of the structure upon execution.
      
      Ordinarily, the work queue executor would release the work_struct for further
      scheduling or deallocation by clearing the pending bit prior to jumping to the
      work function.  This means that, unless the driver makes some guarantee itself
      that the work_struct won't go away, the work function may not access anything
      else in the work_struct or its container lest they be deallocated..  This is a
      problem if the auxiliary data is taken away (as done by the last patch).
      
      However, if the pending bit is *not* cleared before jumping to the work
      function, then the work function *may* access the work_struct and its container
      with no problems.  But then the work function must itself release the
      work_struct by calling work_release().
      
      In most cases, automatic release is fine, so this is the default.  Special
      initiators exist for the non-auto-release case (ending in _NAR).
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      65f27f38
    • D
      WorkStruct: Separate delayable and non-delayable events. · 52bad64d
      David Howells 提交于
      Separate delayable work items from non-delayable work items be splitting them
      into a separate structure (delayed_work), which incorporates a work_struct and
      the timer_list removed from work_struct.
      
      The work_struct struct is huge, and this limits it's usefulness.  On a 64-bit
      architecture it's nearly 100 bytes in size.  This reduces that by half for the
      non-delayable type of event.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      52bad64d
  10. 01 11月, 2006 1 次提交
  11. 22 10月, 2006 1 次提交
  12. 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
  13. 30 9月, 2006 2 次提交
  14. 28 9月, 2006 1 次提交
  15. 26 9月, 2006 1 次提交
  16. 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
  17. 31 8月, 2006 1 次提交
  18. 30 8月, 2006 1 次提交
  19. 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
  20. 15 8月, 2006 1 次提交
  21. 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
  22. 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