Commit Graph

118 Commits

Author SHA1 Message Date
Jeff Garzik 7a9f8f93d2 Merge branch 'master' 2005-10-28 12:29:23 -04:00
Alan Cox 91190758d4 [libata] ata_timing fix 2005-10-26 12:17:46 -04:00
Randy Dunlap 6f0ef4fa57 [PATCH] libata kernel-doc fixes
Correct some function names in kernel-doc.
Add some kernel-doc descriptions.
Fix some typos.
Remove a few blank lines.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-10-25 01:44:30 -04:00
Jeff Garzik 057ace5e79 libata: const-ification bombing run
Enforce access rules where appropriate.

If the compiler is smart enough, this may buy us an optimization or two
as a side effect.
2005-10-22 14:27:05 -04:00
Alan Cox 452503f993 Add ide-timing functionality to libata.
This is needed for full AMD and VIA drivers and possibly more. Functions
to turn actual clocking and cycle timings into register values. Also to
merge shared timings to compute an optimal timing set.

Built from the drivers/ide version by Vojtech Pavlik

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-10-21 19:01:32 -04:00
Alan Cox 11e29e2151 libata: handle early device PIO modes correctly 2005-10-21 18:46:32 -04:00
Jeff Garzik b194b4250c Merge branch 'upstream' 2005-10-18 21:52:42 -04:00
Albert Lee 59a10b172f [PATCH] libata CHS: reread device identify info (revise #6)
problem:
      id[53-58] might be changed after initializing device CHS settings.

changes:
    - call ata_dev_reread_id() to reread the identify device info,
      after initializing device CHS settings.

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

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-10-18 17:16:14 -04:00
Albert Lee 8cbd6df1f0 [PATCH] libata CHS: calculate read/write commands and protocol on the fly (revise #6)
- merge ata_prot_to_cmd() and ata_dev_set_protocol() as
       ata_rwcmd_protocol()
     - pave road for read/write multiple support
     - remove usage of pre-cached command and protocol values and call
       ata_rwcmd_protocol() instead

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

==============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-10-18 17:16:13 -04:00
Albert Lee 07506697d1 [PATCH] libata CHS: move the initialization of taskfile LBA flags (revise #6)
move the initialization of taskfile LBA flags
     "ATA_TFLAG_LBA" and "ATA_TFLAG_LBA48 flags"
   to the SCSI translation functions

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

=============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-10-18 17:16:13 -04:00
Jeff Garzik c4052da6f0 Merge branch 'upstream' 2005-10-09 11:16:14 -04:00
Jeff Garzik e12669e774 libata: minor cleanups
A few code shuffles, to make merging future code easier.

Add (DRIVER_SENSE << 24) to certain result codes, as noted by Douglas
Gilbert.
2005-10-05 18:39:23 -04:00
Jeff Garzik a939c96315 libata: move atapi_request_sense() to libata-scsi module
No content changes, just moving code around.
2005-10-05 17:09:16 -04:00
Jeff Garzik cedc9a478d libata: fix ATAPI DMA alignment issues
ATAPI needs to be padded to next 4 byte boundary, if misaligned.

Original work by me, many fixes from Tejun Heo.
2005-10-05 07:13:30 -04:00
Jeff Garzik 67846b3017 libata: add ata_ratelimit(), use it in AHCI driver irq handler 2005-10-05 02:58:32 -04:00
Jeff Garzik 643736a58d Merge branch 'scsi-scan' 2005-10-04 14:24:04 -04:00
Alan Cox 47a8659380 libata: bitmask based pci init functions for one or two ports
This redoes the n_ports logic I proposed before as a bitmask.
ata_pci_init_native_mode is now used with a mask allowing for mixed mode
stuff later on. ata_pci_init_legacy_port is called with port number and
does one port now not two. Instead it is called twice by the ata init
logic which cleans both of them up.

There are stil limits in the original code left over

- IRQ/port mapping for legacy mode should be arch specific values
- You can have one legacy mode IDE adapter per PCI root bridge on some systems
- Doesn't handle mixed mode devices yet (but is now a lot closer to it)
2005-10-04 08:09:19 -04:00
Jeff Garzik 644dd0cc49 [libata] improve device scan
Replace SCSI's legacy "bang at the door" method of probing with one
directly controlled by the underlying ATA transport layer.

We now only call scsi_scan_target() for devices we find, rather than
probing every possible channel/id within a certain range.
2005-10-03 15:55:19 -04:00
Jeff Garzik 64f09c98d7 /spare/repo/libata-dev branch 'chs-support' 2005-09-28 12:11:15 -04:00
Albert Lee 14be71f4c5 [PATCH] libata: rename host states
Changes:
s/PIO_ST_/HSM_ST_/ and s/pio_task_state/hsm_task_state/.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-09-28 11:58:39 -04:00
Albert Lee ee500aabf1 [PATCH] libata: indent and whitespace change
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-09-28 11:57:29 -04:00
Jeff Garzik 98ed72deeb Merge /spare/repo/linux-2.6/ 2005-09-24 00:26:49 -04:00
Jeff Garzik 536f809802 Merge /spare/repo/linux-2.6/ 2005-09-23 19:03:21 -04:00
Jeff Garzik 7fb6ec287a [libata] fix PIO completion race
Make sure we that completion is the final action we take; prior to this
change, another CPU may have changed ap->pio_task_state before we tested
it a final time.

Spotted by, and original patch by Albert Lee @ IBM.

Also includes a minor optimization:  eliminate a ton of unnecessary
queue_work() calls, simply by jumping to the beginning of the FSM
function ata_pio_task().
2005-09-16 06:01:48 -04:00
Alan Cox 17b14451fd [PATCH] PATCH: remove function for non-PCI as requested
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-09-16 02:39:01 -04:00
Jeff Garzik 142e27fc8a Merge /spare/repo/linux-2.6/ 2005-09-08 05:41:28 -04:00
Jeff Garzik 344babaa9d [kernel-doc] fix various DocBook build problems/warnings
Most serious is fixing include/sound/pcm.h, which breaks the DocBook
build.

The other stuff is just filling in things that cause warnings.
2005-09-07 01:15:17 -04:00
Jeff Garzik d0bd99299b /spare/repo/libata-dev branch 'iomap-try3' 2005-09-05 05:20:33 -04:00
Jeff Garzik 374b187357 [libata] update several drivers to use pci_iomap()/pci_iounmap() 2005-08-30 05:42:52 -04:00
Jeff Garzik 1623c81eec [libata] allow ATAPI to be enabled with new atapi_enabled module option
ATAPI is getting close to being ready.  To increase exposure, we enable
the code in the upstream kernel, but default it to off (present
behavior).  Users must pass atapi_enabled=1 as a module option (if
module) or on the kernel command line (if built in) to turn on
discovery of their ATAPI devices.
2005-08-30 03:37:42 -04:00
Jeff Garzik 76b2bf9b4d Merge libata branch 'chs-support' to latest upstream kernel. 2005-08-29 19:24:43 -04:00
Jeff Garzik 2fca877b68 /spare/repo/libata-dev branch 'v2.6.13' 2005-08-29 16:12:36 -04:00
Jeff Garzik 70d374ea99 Merge /spare/repo/linux-2.6/ 2005-08-29 15:59:42 -04:00
Jeff Garzik af36d7f0df [libata] license change, other bits
- changes license of all code from OSL+GPL to plain ole GPL
  - except for NVIDIA, who hasn't yet responded about sata_nv
  - copyright holders were already contacted privately

- adds info in each driver about where hardware/protocol docs may be
  obtained

- where I have made major contributions, updated copyright dates
2005-08-28 20:18:39 -04:00
Alan Cox b73fc89f6d [PATCH] libata: regularize dma_start/stop arguments
Needed for a few PATA drivers.

Also fix up a wrong comment.
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-08-26 17:36:26 -04:00
Alan Cox 31433ea369 [PATCH] libata: typo
You spelt heuristic wrongly. Also reformatted to 80 columns,
ignore the diff and fix the typo if you prefer that.
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-08-26 17:36:25 -04:00
Jeff Garzik b8f6153ee4 libata: fix EH locking
Wrap ata_qc_complete() calls in EH context in spinlocks, to prevent
races (mainly in ATAPI code paths).
2005-08-25 22:01:20 -04:00
Jeff Garzik 4887f76ec3 /spare/repo/libata-dev branch 'upstream-fixes' 2005-08-23 03:35:44 -04:00
Jeff Garzik 6885433c25 libata: release prep (bump versions, etc.)
- bump versions where necessary
- remove two duplicated+outdated doc comments
- add MODULE_VERSION() to AHCI driver
2005-08-23 02:53:51 -04:00
Tejun Heo 40e8c82c74 [PATCH] libata: implement ata_poll_qc_complete and use it in polling functions
[PATCH libata-dev-2.6:upstream] implement ata_poll_qc_complete and use it in polling functions

 Previously, libata polling functions turned irq back on and completed
qc commands without holding host lock.  This creates a race condition
between the polling task and interrupts from other ports on the same
host set or spurious interrupt from itself.

 This patch implements ata_poll_qc_complete which enables irq and
completes qc atomically and convert all polling functions.

 Note: atapi_packet_task() didn't use to turn irq back on or clear
ATA_FLAG_NOINTR on error exits.  This patch makes it use
ata_poll_qc_complete which does both.

 Note: With this change, ALL invocations of ata_qc_complete() are now
done under host_set lock.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-08-23 01:05:55 -04:00
Tejun Heo c138950371 [PATCH] fix atapi_packet_task vs. intr race (take 2)
Interrupts from devices sharing the same IRQ could cause
ata_host_intr to finish commands being processed by atapi_packet_task
if the commands are using ATA_PROT_ATAPI_NODATA or ATA_PROT_ATAPI_DMA
protocol.  This is because libata interrupt handler is unaware that
interrupts are not expected during that period.  This patch adds
ATA_FLAG_NOINTR flag to tell the interrupt handler that we're not
expecting interrupts.

 Note that once proper HSM is implemented for interrupt-driven PIO,
this should be merged into it and this flag will be removed.

 ahci.c is a different kind of beast, so it's left alone.

* The following drivers use ata_qc_issue_prot and ata_interrupt, so
  changes in libata core will do.

  ata_piix sata_sil sata_svw sata_via sata_sis sata_uli

* The following drivers use ata_qc_issue_prot and custom intr handler.
  They need this change to work correctly.

  sata_nv sata_vsc

* The following drivers use custom issue function and intr handler.
  Currently all custom issue functions don't support ATAPI, so this
  change is irrelevant, updated for consistency and to avoid later
  mistakes.

  sata_promise sata_qstor sata_sx4

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-08-23 01:05:55 -04:00
Albert Lee 3f3791d300 [PATCH] libata: Clear ATA_QCFLAG_ACTIVE flag before calling the completion callback
Description:
  After calling the completion callback, the libata error handler might be
running and getting atapi sense data. Clearing the ATA_QCFLAG_ACTIVE flag
at this point might interfere with the libata error handler.

Changes:
   - Clear the ATA_QCFLAG_ACTIVE flag before calling the completion callback
     (and also before the error handler)
   - Add some comment

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-08-23 01:03:38 -04:00
Jeff Garzik 443d089703 /spare/repo/libata-dev branch 'upstream-fixes' 2005-08-23 00:59:54 -04:00
Albert Lee 563a6e1fb0 [PATCH] libata handle the case when device returns/needs extra data
PATCH 2/2:  handle the case when device returns/needs extra data

Description:
   Sometimes the device returns/needs extra data than expected.

Changes:
   Modify __atapi_pio_bytes() to handle the case where device returns/needs extra data.
     - for read case, discard trailing data from the device
     - for write case, padding zero data to the device

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-08-12 02:44:20 -04:00
Albert Lee 6ae4cfb571 [PATCH] libata ata_data_xfer() fix
PATCH 1/2: ata_data_xfer() fix

Changes:
   - Modify ata_mmio_data_xfer() and ata_pio_data_xfer() to handle odd-lengthed buffer.
   - Add some function comments

This patch does not reuse ap->pad as alignment buffer since
using local variable seems good enough.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-08-12 02:44:20 -04:00
Jeff Garzik 8a60a07129 libata: trim trailing whitespace.
Also, fixup a tabs-to-spaces block of code in ata_piix.
2005-07-31 13:13:24 -04:00
Linus Torvalds 2d986010ad Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6 2005-07-26 13:28:47 -07:00
Tejun Heo 62ba2841f2 [PATCH] libata: lengthen COMMRESET delay
This patch lengthens the delay between DET setting and clearing for
COMMRESET from 400us to 1ms.  I couldn't find any requiremen regarding
the duration of COMMRESET in SATA I/II specs but AHCI-1.1 10.4.2
states that it should be at least 1ms.

Signed-off-by: Tejun Heo <htejun@gmail.com>
2005-06-28 00:05:57 -04:00
Jeff Garzik e922256ae4 libata: update DMA blacklist
Contributions from Alan Cox and maximilian attems.
2005-06-28 00:03:37 -04:00
Christoph Hellwig 3111b0d164 [SCSI] remove scsi_eh_eflags_ macros
Just opencoded access to eh_eflags, it's much more readable anyway.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-26 12:17:24 -05:00
Christoph Hellwig 12413197ee [SCSI] remove scsi_set_device
scsi_add_host is the proper place to set the device, but people copy
the scsi_set_device usage from older drivers again and again.

note that this leaves some legacy drivers like qlogicisp/qlogicfc
without pci association in sysfs, but they're scheduled to go away soon
anyway.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-26 08:31:47 -05:00
Jeff Garzik ff40c6d3d1 Merge upstream kernel changes into 'C/H/S support' branch of libata. 2005-06-22 13:07:28 -04:00
Jeff Garzik f9d1fe9630 Merge /spare/repo/linux-2.6/ 2005-06-18 13:21:24 -04:00
Albert Lee 6952df0355 [PATCH] sg traverse fix for __atapi_pio_bytes()
Problem:
Incorrect md5sum when using ATAPI PIO mode to verify a distro CD.

Root cause:  sg traverse problem.
In __atapi_pio_bytes(), if qc->cursg++ is increased and "goto
next_page" is executed, then sg is not updated to the new qc->cursg
and the old sg is overwritten with the new data.

Changes:
- Replace "goto next_page" with "goto next_sg" to make sg updated.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
2005-06-09 03:14:59 -04:00
73561695b2 Automatic merge of /spare/repo/linux-2.6/.git branch HEAD 2005-06-03 23:54:56 -04:00
d7aaf48128 Automatic merge of /spare/repo/linux-2.6/.git branch HEAD 2005-06-02 18:43:09 -04:00
Jeff Garzik decc6d0b68 libata: kernel-doc warning fixes 2005-06-02 18:42:33 -04:00
Edward Falk 0baab86b00 libata: update inline source docs 2005-06-02 18:17:13 -04:00
Jeff Garzik 0cba632b73 libata: doc updates 2005-05-30 19:49:12 -04:00
Jeff Garzik 780a87f718 libata: more doc updates
Document recently-added ata_port_operations hooks.

Fill several doc stubs in libata-core.c.
2005-05-30 15:41:05 -04:00
d582c4ea30 Automatic merge of /spare/repo/netdev-2.6 branch use-after-unmap 2005-05-29 14:24:57 -04:00
Jeff Garzik aa8f0dc6c3 libata: Fix use-after-iounmap
Jens Axboe pointed out that the iounmap() call in libata was occurring
too early, and some drivers (ahci, probably others) were using ioremap'd
memory after it had been unmapped.

The patch should address that problem by way of improving the libata
driver API:

* move ->host_stop() call after all ->port_stop() calls have occurred.

* create default helper function ata_host_stop(), and move iounmap()
call there.

* add ->host_stop_prewalk() hook, use it in sata_qstor.c (hi Mark).
sata_qstor appears to require the host-stop-before-port-stop ordering
that existed prior to applying the attached patch.
2005-05-26 21:54:27 -04:00
Albert Lee 32529e0128 [PATCH] libata: Fix zero sg_dma_len() on 64-bit platform
When testing ATAPI PIO data transfer on the ppc64 platform,  __atapi_pio_bytes() got zero when
sg_dma_len() is used. I checked the <asm-ppc64/scatterlish.h>, the struct scatterlist is defined as:

struct scatterlist {
	struct page *page;
	unsigned int offset;
	unsigned int length;

	/* For TCE support */
	u32 dma_address;
	u32 dma_length;
};

#define sg_dma_address(sg)	((sg)->dma_address)
#define sg_dma_len(sg)		((sg)->dma_length)

So, if the scatterlist is not DMA mapped, sg_dma_len() will return zero on ppc64.
The same problem should occur on the x86-64 platform.
On the i386 platform, sg_dma_len() returns sg->length, that's why the problem does not occur on an i386.

Changes:
- Use sg->length if the scatterlist is not DMA mapped (yet).

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
2005-05-26 03:49:42 -04:00
Brett Russ cdcca89e1a [PATCH] libata: flush COMRESET set and clear
Updated patch to fix erroneous flush of COMRESET set and missing flush
of COMRESET clear.  Created a new routine scr_write_flush() to try to
prevent this in the future.  Also, this patch is based on libata-2.6
instead of the previous libata-dev-2.6 based patch.

Signed-off-by: Brett Russ <russb@emc.com>

Index: libata-2.6/drivers/scsi/libata-core.c
===================================================================
2005-05-15 19:00:51 -04:00
Albert Lee 21b1ed74ee [PATCH] libata: Prevent the interrupt handler from completing a command twice
Problem:
   During the libata CD-ROM stress test, sometimes the "BUG: timeout
without command" error is seen.

Root cause:
  Unexpected interrupt occurs after the ata_qc_complete() is called,
but before the SCSI error handler.  The interrupt handler is invoked
before the SCSI error handler, and it clears the command by calling
ata_qc_complete() again.  Later when the SCSI error handler is run,
the ata_queued_cmd is already gone, causing the "BUG: timeout without
command" error.

Changes:
  - Use the ATA_QCFLAG_ACTIVE flag to prevent the interrupt handler
from completing the command twice, before the scsi_error_handler.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
2005-05-15 18:46:59 -04:00
Albert Lee 8bf62ecee5 [libata] C/H/S support, for older devices 2005-05-12 15:29:42 -04:00
Brad Campbell 6f2f381281 [PATCH] libata basic detection and errata for PATA->SATA bridges
This patch works around an issue with WD drives (and possibly others)
over SiL PATA->SATA Bridges on SATA controllers locking up with
transfers > 200 sectors.

Signed-off-by: Brad Campbell <brad@wasp.net.au>
2005-05-12 15:07:47 -04:00
Linus Torvalds 1da177e4c3 Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
2005-04-16 15:20:36 -07:00