Commit Graph

163 Commits

Author SHA1 Message Date
Jeff Garzik 7103c7bc86 Merge branch 'tmp' 2006-01-27 02:39:25 -05:00
Jeff Garzik b4d28889f7 Merge branch 'tmp' 2006-01-27 02:37:46 -05:00
Jeff Garzik 7dfb869c8e Merge branch 'tmp' 2006-01-27 02:36:14 -05:00
Jeff Garzik 628e386e27 Merge branch 'tmp' 2006-01-27 02:29:20 -05:00
Jeff Garzik 8dd2e3bd57 Merge branch 'tmp' 2006-01-27 02:26:46 -05:00
Jeff Garzik 2af5920b81 Merge branch 'master' 2006-01-27 02:20:42 -05:00
Tejun Heo a72ec4ce6d [PATCH] libata: implement and apply ata_eh_qc_complete/retry()
Implement ata_eh_qc_complete/retry() using scsi_eh_finish_cmd() and
scsi_eh_flush_done_q().  This removes all eh scsicmd finish hacks from
low level drivers.

This change was first suggested by Jeff Garzik.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-26 22:36:28 -05:00
Tejun Heo 11a56d2439 [PATCH] libata: add detailed AC_ERR_* flags
Add detailed AC_ERR_* flags and use them.  Long-term goal is to
describe all errors with err_mask and tf combination (tf for failed
sector information, etc...).  After proper error diagnosis is
implemented, sense data should also be generated from err_mask instead
of directly from hardware tf registers as it is currently.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-26 22:36:27 -05:00
Tejun Heo 9a3d9eb017 [PATCH] libata: return AC_ERR_* from issue functions
Return AC_ERR_* mask from issue fuctions instead of 0/-1.  This
enables things like failing a qc with AC_ERR_HSM when the device
doesn't set DRDY when the qc is about to be issued.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-26 22:36:27 -05:00
Tejun Heo 8e436af932 [PATCH] libata: fix ata_qc_issue() error handling
When ata_qc_issue() fails, the qc might have been dma mapped or not.
So, performing only ata_qc_free() results in dma map leak.  This patch
makes ata_qc_issue() mark dma map flags correctly on failure and calls
ata_qc_complete() after ata_qc_issue() fails.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-26 22:33:50 -05:00
Tejun Heo 77853bf2b4 [PATCH] libata: make the owner of a qc responsible for freeing it
qc used to be freed automatically on command completion.  However, as
a qc can carry information about its completion status, it can be
useful to its owner/issuer after command completion.  This patch makes
freeing qc responsibility of its owner.  This simplifies
ata_exec_internal() and makes command turn-around for atapi request
sensing less hackish.

This change was originally suggested by Jeff Garzik.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-26 22:33:49 -05:00
Tejun Heo 4ba946e9d8 [PATCH] libata: fold __ata_qc_complete() into ata_qc_free()
All ata_qc_free() does is calling __ata_qc_complete() which isn't used
anywhere else.  Fold __ata_qc_complete() into ata_qc_free().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-26 22:33:49 -05:00
Albert Lee 000080c349 [PATCH] libata-dev: filter out noisy ATAPI error messages
Changes:
 - Filter out ATAPI packet command error messages in ata_pio_error()
 - Filter out ATAPI packet command error messages in ata_host_intr()

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

======
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-17 19:55:03 -05:00
Albert Lee a4f1661008 [PATCH] libata-dev: determine err_mask when error is found
Changes:
- Determine err_mask directly when an error is found.
- Remove "qc->err_mask |= __ac_err_mask(status);" in ata_host_intr()

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-17 19:55:03 -05:00
Tejun Heo 3be680b732 [PATCH] libata: separate out ata_sata_print_link_status
Separate out sata_print_link_status() from __sata_phy_reset().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-17 19:49:10 -05:00
Alan Cox a1bd9e6857 [PATCH] libata: Code for the IRQ mask flag
Signed-off-by: Alan Cox <alan@redhat.com>

Somewhat cleaner in the resync as someone cleaned up the pio xfer users
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-17 19:37:45 -05:00
Alan Cox 9d824d0710 [PATCH] libata: Fix sector lock to apply to both drives not drive 0 twice
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-17 19:37:45 -05:00
Alan Cox 8d238e0124 [PATCH] libata: Fix heuristic typos add LBA48PIO flag and support code, add IRQ flag for next diff
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-17 19:37:45 -05:00
Jeff Garzik ea9b395fe2 Merge branch 'upstream' 2006-01-17 10:29:06 -05:00
Alan Cox 1bc4ccfff8 [PATCH] libata: add a function to decide if we need iordy
This ought to be simple but for PIO2 we have to poke around the drive
data to get it 100% correct.

Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-17 08:25:39 -05:00
Alan Cox ffa29456cd [PATCH] libata: Pre UDMA EIDE PIO mode selection
I misread the spec when doing the original. I've tested the corrected
version with pre UDMA drives and it now picks the right modes. This is a
specific bug fix rather than an update or new feature item.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-01-17 08:25:39 -05:00
Arjan van de Ven 858119e159 [PATCH] Unlinline a bunch of other functions
Remove the "inline" keyword from a bunch of big functions in the kernel with
the goal of shrinking it by 30kb to 40kb

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-14 18:27:06 -08:00
Linus Torvalds d99cf9d679 Merge branch 'post-2.6.15' of git://brick.kernel.dk/data/git/linux-2.6-block
Manual fixup for merge with Jens' "Suspend support for libata", commit
ID 9b84754866.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-06 09:01:25 -08:00
Jens Axboe 9b84754866 [PATCH] Suspend support for libata
This patch adds suspend patch to libata, and ata_piix in particular. For
most low level drivers, they should just need to add the 4 hooks to
work. As I can only test ata_piix, I didn't enable it for more
though.

Suspend support is the single most important feature on a notebook, and
most new notebooks have sata drives. It's quite embarrassing that we
_still_ do not support this. Right now, it's perfectly possible to
suspend the drive in mid-transfer.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-06 08:36:09 -08:00
Tejun Heo 9a3dccc425 [BLOCK] add FUA support to libata
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
2006-01-06 09:56:18 +01:00
Jeff Garzik d1397f8376 Merge branch 'upstream' 2005-12-13 01:47:05 -05:00
Tejun Heo b563230340 [PATCH] libata: remove unused qc->waiting
There is no user of qc->waiting left after ata_exec_internal()
changes.  Kill the field.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-13 01:34:46 -05:00
Tejun Heo 82033adf0a [PATCH] libata: remove unused functions
There is no user of ata_qc_wait_err() and ata_qc_complete_noop() after
ata_exec_internal() changes.  Remove unused functions.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-13 01:34:45 -05:00
Tejun Heo a012370322 [PATCH] libata: use ata_exec_internal()
This patch converts all users of libata internal commands to use
ata_exec_internal().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-13 01:34:45 -05:00
Tejun Heo a2a7a662f8 [PATCH] libata: implement ata_exec_internal()
This patch implements ata_exec_internal() function which performs
libata internal command execution.  Previously, this was done by each
user by manually initializing a qc, issueing it, waiting for its
completion and handling errors.  In addition to obvious code
factoring, using ata_exec_internal() fixes the following bugs.

* qc not freed on issue failure
* ap->qactive clearing could race with the next internal command
* race between timeout handling and irq
* ignoring error condition not represented in tf->status

Also, qc & hardware are not accessed anymore once it's completed,
making internal commands more conformant with general semantics.
ata_exec_internal() also makes it easy to issue internal commands from
multiple threads if that becomes necessary.

This patch only implements ata_exec_internal().  A following patch
will convert all users.

Signed-off-by: Tejun Heo <htejun@gmail.com>

--

Jeff, all patches have been regenerated against upstream branch as of
today.  (575ab52a21)

Also, I took out a debug printk from ata_exec_internal (don't know how
that one got left there).  Other than that, all patches are identical
to the previous posting.

Thanks. :-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-13 01:34:45 -05:00
Jeff Garzik 575ab52a21 Merge branch 'upstream-fixes' 2005-12-12 23:51:01 -05:00
Mark Lord dfa159886f [PATCH] libata-core.c: fix parameter bug on kunmap_atomic() calls
Fix incorrect pointer usage on two calls to kunmap_atomic().
This seems to happen a lot, because kunmap() wants the struct page *,
whereas kunmap_atomic() instead wants the mapped virtual address.

Signed-off-by: Mark Lord <liml@rtr.ca>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-12 23:19:28 -05:00
Jeff Garzik 278efe9509 [libata] irq-pio: fix breakage related to err_mask merge 2005-12-06 05:01:27 -05:00
Jeff Garzik 701db69d66 Merge branch 'upstream' 2005-12-06 04:52:48 -05:00
Albert Lee fe79e683cc [PATCH] libata: err_mask misc fix
1. ata_pio_complete():
     It seems unnecessary to wait for the clearing of the DRQ bit.
     (Waiting for BSY=0 should be enough.
     ata_ok() also checks the correctness of the status bits later.)

  2. ata_pio_block():
     - added error checking, before transfering data.
     - minor comments fix

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:23 -05:00
Albert Lee d8fe452b3e [PATCH] libata: determine the err_mask directly in atapi_packet_task()
- set qc->err_mask directly when we found the error
  - remove the code to determine err_mask from device status

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:23 -05:00
Albert Lee 1c8489840e [PATCH] libata: determine the err_mask when the error is found
- move "qc->err_mask |= AC_ERR_ATA_BUS" to where the error is found
  - add "assert(qc->err_mask)" to ata_pio_error() to make sure qc->err_mask was available when we enter the error state

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:23 -05:00
Albert Lee a22e2eb071 [PATCH] libata: move err_mask to ata_queued_cmd
- remove err_mask from the parameter list of the complete functions
  - move err_mask to ata_queued_cmd
  - initialize qc->err_mask when needed
  - for each function call to ata_qc_complete(), replace the err_mask parameter with qc->err_mask.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

===============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:22 -05:00
Albert Lee c14b8331ec [PATCH] libata: minor patch before moving err_mask
- add qc to ata_pio_poll()
  - reorder the initialization of qc in ata_pio_complete()

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

===================
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:22 -05:00
Arjan van de Ven 98ac62defe [PATCH] mark several libata datastructures const
Hi,

the patch below marks several libata (and libata-driver) structures
const so that they end up in the .rodata segment and don't false-share
cachelines with things that get dirtied often.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-01 02:29:35 -05:00
Jeff Garzik 5f3fdeb624 Merge branch 'upstream' 2005-11-29 03:57:29 -05:00
Jeff Garzik 656563e32c [libata] Print out SATA speed, if link is up
Make the SATA phy probe messages a bit more informative.

Note this only applies to drivers that use __sata_phy_reset(),
which excludes some drivers.
2005-11-20 03:36:45 -05:00
Jeff Garzik f333b3f111 Merge branch 'upstream' 2005-11-18 11:44:17 -05:00
Jeff Garzik 64f043d807 [libata] add timeout to commands for which we call wait_completion() 2005-11-17 10:50:01 -05:00
Albert Lee 75b1f2f865 [PATCH] libata: honor the transfer cycle time speficied by the EIDE device
The following code segment is not functional because the transfer cycle time speficied by
  the EIDE device is later overwritten by ata_timing_quantize():

	/*
	 * If the drive is an EIDE drive, it can tell us it needs extended
	 * PIO/MW_DMA cycle timing.
	 */
	if (adev->id[ATA_ID_FIELD_VALID] & 2) {	/* EIDE drive */
		memset(&p, 0, sizeof(p));
		(snip)
		ata_timing_merge(&p, t, t, ATA_TIMING_CYCLE | ATA_TIMING_CYC8B);
               <== uninitialized "t" is used here
	}

	/*
	 * Convert the timing to bus clock counts.
	 */
	ata_timing_quantize(s, t, T, UT);  <== t is overwritten by quantized s

  The patch has been submitted for ide-timing.h before:
  http://marc.theaimsgroup.com/?l=linux-ide&m=110820013425454&w=2
  Resubmitted for libata.

Changes:
  - Minor fix to honor the following transfer cycle time speficied by the device
    - id[65]: Minimum Multiword DMA transfer cycle time per word
    - id[67]: Minimum PIO transfer cycle time without flow control
    - id[68]: Minimum PIO transfer cycle time with IORDY

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

=======
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-16 07:59:22 -05:00
Jeff Garzik c6e6e666cb [libata] REQUEST SENSE handling fixes
- Move ATAPI check-condition handling out of the timeout handler
- Use multi-qc-issue feature to issue REQUEST SENSE ATAPI PACKET
  command upon receiving an ATAPI check-condition.

This cleans things up a lot, and eliminates a nasty recursion bug.
2005-11-14 14:50:05 -05:00
Jeff Garzik 2c13b7cee0 [libata] minor fixes, new helpers
- in ata_dev_identify(), don't assume that all devices are either
  ATA or ATAPI.  In the future, this code will see port multipliers
  and other devices.
- make a debugging printk less verbose
- add new helper ata_qc_reinit()
- add new helper BPRINTK() and port flag ATA_FLAG_DEBUGMSG, for
  fine-grained debugging use.
2005-11-14 14:14:16 -05:00
Jeff Garzik e1410f2d95 [libata] fix bugs in ATAPI padding DMA mapping code
The ATAPI pad-to-next-32bit-boundary code modifies the scatterlist's
length variable, sometimes to zero.  x86-64 platform would oops if a
zero-length scatterlist entry was asked to be mapped.  Work around this
by ensuring that we never DMA-map a zero length buffer or SG entry.
2005-11-14 14:06:26 -05:00
Mark Lord e12a1be6e8 [PATCH] libata: fix comments on ata_tf_from_fis()
Fix description on comments for ata_tf_from_fis().

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-13 16:19:26 -05:00
Jeff Garzik f4256e301d Merge branch 'master' 2005-11-11 23:39:35 -05:00