Commit graph

1280 commits

Author SHA1 Message Date
Tejun Heo
208a9933bc [PATCH] libata: re-initialize parameters before configuring
In ata_dev_configure(), reinitialize parameters before configuring.
This change is for revalidation and hotplug.  As ata_dev_configure()
can be entered multiple times, parameters need to be reinitialized.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 11:09:42 -05:00
Tejun Heo
e653a1e613 [PATCH] sata_sil: cosmetic flag/constant changes
Collect common host flags into SIL_DFL_HOST_FLAGS and add comments to
constants.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 02:39:55 -05:00
Tejun Heo
48d4ef2a1d [PATCH] sata_sil: replace register address constants with sil_port[] entry
Kill SIL_FIFO_* and SIL_IDE2_BMDMA and replace them with proper
sil_port[] entry.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 02:39:55 -05:00
Tejun Heo
9a5314432a [PATCH] sata_sil: use kzalloc
Use kzalloc instead of kmalloc/memset.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 02:39:55 -05:00
Tejun Heo
81c2af3561 [PATCH] sata_sil: replace sil_3112_m15w board id with sil_3112
All 3112's have m15w.  Replace sil_3112_m15w with sil_3112 and flag
sil_3112 with SIL_FLAG_MOD15WRITE.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Carlos Pardo <Carlos.Pardo@siliconimage.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 02:39:55 -05:00
Tejun Heo
219e621443 [PATCH] ata_piix: rename PIIX_FLAG_IGN_PRESENT to PIIX_FLAG_IGNORE_PCS
Rename PIIX_FLAG_IGN_PRESENT to PIIX_FLAG_IGNORE_PCS as Jeff
requested.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-05 00:36:28 -05:00
Daniel Drake
e1fd263c77 [PATCH] sata_promise: Support FastTrak TX4300/TX4310
This patch adds support for the Promise FastTrak TX4300/TX4310 4-port PCI SATA
controllers based on the PDC40719 chip.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-04 12:20:06 -05:00
Tejun Heo
28ca5c57dc [PATCH] libata: reorganize ata_bus_probe()
Now that reset and configure are converted such that they don't modify
or disable libata core data structures, reorganize ata_bus_probe() to
reflect this change.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 17:31:04 -05:00
Tejun Heo
4b2f3ededc [PATCH] libata: fold ata_dev_config() into ata_dev_configure()
ata_dev_config() needs to be done everytime a device is configured.
Fold it into ata_dev_configure().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 17:31:04 -05:00
Tejun Heo
ffeae418c1 [PATCH] libata: separate out ata_dev_configure()
Separate out ata_dev_configure() from ata_dev_identify() such that
ata_dev_configure() only configures @dev according to passed in @id.
The function now does not disable device on failure, it just returns
appropirate error code.

As this change leaves ata_dev_identify() with only reading ID, calling
configure and disabling devices according to the results, this patch
also kills ata_dev_identify() and inlines the logic into
ata_bus_probe().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 17:31:04 -05:00
Tejun Heo
d9572b1d5e [PATCH] libata: convert dev->id to pointer
Convert dev->id from array to pointer.  This is to accomodate
revalidation.  During revalidation, both old and new IDENTIFY pages
should be accessible and single ->id array doesn't cut it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 17:31:04 -05:00
Tejun Heo
d133ecab8f [PATCH] ata_piix: reimplement piix_sata_probe()
Reimplement piix_sata_probe() such that it turns on PCS enable bits on
all avaliable ports and check present bits after a while to determine
device presence.  This should help broken BIOSes.  After device
presence detection is complete, PCS enable bits of unoccupied bits are
turned off unless the controller supports AHCI (ICH6/7 docs mandate
all enables bits are always set on AHCI capable controllers).

Note that PCS present bits are ignored on 6300ESB as described in the
datasheet.  This should fix device detection problems reported with
the controller.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 15:39:54 -05:00
Tejun Heo
d33f58b883 [PATCH] ata_piix: implement proper port map
Replace combined mode handling via PIIX_COMB/COMB_PATA_P0 with proper
port map.  PIIX now prints port configuration during initialization.
ATA_FLAG_SLAVE_POSS is now turned on for SATA ports only when the
slave device is actually avaliable.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 15:39:54 -05:00
Tejun Heo
d435804803 [PATCH] ata_piix: add a couple of flags
Add PIIX_FLAG_IGN_PRESENT and SCR flags.  Thi patch doesn't cause any
functional change.  To be used by later init/scr updates.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 15:39:54 -05:00
Tejun Heo
1d076e5b8d [PATCH] ata_piix: finer-grained port_info
Make port_info finer-grained.  This patch doesn't cause any functional
change.  Later init reimplementation will make use of it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-03 15:39:54 -05:00
Tejun Heo
348edc59a8 [PATCH] sata_sil: remove unneeded ATA_FLAG_SRST from 3512 port info
Now unneeded ATA_FLAG_SRST sneaked into sil_3512 port info while
merging upstream-fixes.  Kill it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-01 14:56:05 -05:00
Tejun Heo
a9d01d2b49 [PATCH] libata: kill illegal kfree(id)
Kill kfree(id) in failure path of ata_dev_read_id().  id is not
dynamically allocated yet.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-01 14:48:42 -05:00
Tejun Heo
4b9d7e04a8 [PATCH] sata_sil24: add a new PCI ID for SiI 3124
Add a new PCI ID for SiI 3124.  Reported by Silicon Image.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Carlos Pardo <Carlos.Pardo@siliconimage.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-01 14:48:41 -05:00
Jeff Garzik
d2dbaad855 Merge branch 'master' 2006-03-01 14:45:47 -05:00
Linus Torvalds
71efa38c0e Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2006-03-01 10:22:04 -08:00
Jrgen E. Fischer
e2482fa16e [SCSI] aha152x: fix variable use before initialisation and other bugs
- change interface of the reset functions from Scsi_Cmnd to Scsi_Host.
- add functions with the original interface and rename the new
  functions to reflect the new interface.
- call these from the pcmcia driver, thereby avoiding the need to
  construct a (broken) Scsi_Cmnd from a Scsi_Host.
- just run the bh if the interrupt is from the controller and if so
  ensure that it's only called once per interrupt.

Signed-off-by: Juergen E. Fischer <fischer@linux-buechse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 11:20:45 -06:00
Matthew Wilcox
23ff51e9fe [SCSI] Fix uninitialised width and speed in sym2
sym2 boards without NVRAM currently negotiate narrow due to this missed
initialisation

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 09:36:14 -06:00
Ralf Baechle
123fc7fd6f [SCSI] Delete duplicate driver template.
Stuborn as compilers are they don't like duplicate definitions.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-28 09:36:11 -06:00
Brian King
8884efab15 [SCSI] scsi: scsi command retries off by one fix
Fix up an off by one error in calculating retries for scsi
commands. This bug was discovered when an SG_IO request
was sent to scsi core with retries = 0, causing the overall
timeout check to go off in scsi_softirq_done.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:38:39 -06:00
Christoph Hellwig
147aab6aa2 [SCSI] megaraid_sas: fix physical disk handling
This patch hides the devices completely from the midlayer instead.
It requires the patch to handle the slave_configure failure I posted
earlier.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:36:46 -06:00
Jeff Garzik
c3c013a2c2 [libata] Disable FUA
Until problems are sorted.
2006-02-27 22:31:19 -05:00
Christoph Hellwig
938050916f [SCSI] scsi: handle ->slave_configure return value
When >slave_configure fails the scsi midlayer should handle it.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:26:45 -06:00
Andrew Vasquez
8b097a6726 [SCSI] fc_transport: stop creating duplicate rport entries.
Current fc_transport consumers initially register rports
with an UNKNOWN role-state and follow-up with a call to
fc_remote_port_rolechg().  Modify code in
fc_remote_port_add() to scan the fc_host_rport_bindings()
array for consistent bindings regardless of role-type.
Original code would only scan bindings array for targets,
causing duplicate fc_remote_ports/rport-X:Y-Z entries to be
created for the yet-to-be-role-changed rports.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:25:40 -06:00
Brian King
eca7be5e18 [SCSI] sg: Remove aha1542 hack
Remove a hack in the sg driver that alters the total buffer
length for SG_IO commands to ensure buffers are not odd byte
lengths. This breaks on the ipr driver since it requires the
request_bufflen to equal the length specified in the cdb.
The block layer SG_IO code does not appear to have this hack.

Signed-off-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27 21:25:40 -06:00
Jeff Garzik
cccc65a3b6 Merge branch 'master' 2006-02-27 11:49:05 -05:00
Linus Torvalds
e95a9ec1bb Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev 2006-02-27 07:41:30 -08:00
Al Viro
4897080077 [PATCH] sd: fix memory corruption with broken mode page headers
There's a problem in sd where we blindly believe the length of the
headers and block descriptors.  Some devices return insane values for
these and cause our length to end up greater than the actual buffer
size, so check to make sure.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Also removed the buffer size magic number (512) and added DPOFUA of
zero to the defaults

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-26 09:09:49 -08:00
Tejun Heo
e4e10e3e79 [PATCH] sata_sil: implement R_ERR on DMA activate FIS errata fix
Silicon Image has disclosed a new sil3114/3152 errata and workaround
which causes the controller to return R_ERR on DMA activate FIS if the
FIS is received while the next PRD is being fetched.  This patch
implements the workaround.

This errata results in lock up and doesn't trigger if m15w workaround
is in effect.  We stopped applying m15w to 3512 and 3114 in 2.6.14-rc1
which makes 3512/3114 lock up with some drives on all kernel versions
since 2.6.14-rc1 upto now (2.6.16-rc4).  This patch should fix the
regression.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-02-25 16:52:31 -05:00
Tejun Heo
0ee304d580 [PATCH] sata_sil: add board ID for 3512
3512 is slightly different from 3112 errata-wise.  Differentiate it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-02-25 16:52:31 -05:00
Christoph Hellwig
a6ceda7457 [SCSI] esp: fix eh locking
esp_reset didn't get fixed when the EH locking changed.
->eh_bus_reset_handler is now called without the host lock held.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-02-22 14:35:52 -08:00
Tejun Heo
ba70d06147 [PATCH] libata: kill ata_dev_reread_id()
Kill now-unused ata_dev_reread_id().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 18:56:59 -05:00
Tejun Heo
49016aca2e [PATCH] libata: separate out ata_dev_read_id()
Separate out ata_dev_read_id() from ata_dev_identify().  This is the
first half of splitting ata_dev_identify().  ata_dev_read_id() will
also be used for revalidation.  This patch does not make any behavior
change.

ata_dev_read_id() doesn't modify any of libata-internal data
structures.  It simply reads IDENTIFY page and returns error code on
failure.  INIT_DEV_PARAMS and EDD wrong class code are also handled by
this function.

Re-reading IDENTIFY after INIT_DEV_PARAMS is performed by jumping to
retry: instead of calling ata_dev_reread_id().  This is done because
1. there's retry label anyway 2. ata_dev_reread_id() cannot be used
anywhere else so there's no reason to keep it.

This function is probably the place to set transfer mode to PIO0
before IDENTIFY.  However, reset -> identify -> init_dev_params order
should be kept for pre-ATA4 devices so we cannot set transfer mode
before IDENTIFY for them.  How do we know if a device is post-ATA4
before IDENTIFY?

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 18:56:58 -05:00
Jeff Garzik
f131883e73 Merge branch 'upstream-fixes' 2006-02-20 16:55:56 -05:00
Tejun Heo
2e242fa994 [PATCH] libata: make ata_sg_setup_one() trim zero length sg
This patch makes ata_sg_setup_one() trim sg entry (thus making
qc->n_elem zero) if padding results in zero length sg entry.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 16:48:18 -05:00
Tejun Heo
9ae61c6cb6 [PATCH] libata: fix WARN_ON() condition in *_fill_sg()
For ATAPI commands, padding can reduce qc->n_elem by one and thus to
zero making assert(qc->n_elem > 0)'s in ata_fill_sg() and qs_fill_sg()
fail for legal commands.  This patch fixes the assert()'s to take
qc->pad_len into account.

Although the condition check seems a bit excessive, as this part of
code isn't still stable yet, I think it's worth to keep those.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 16:48:17 -05:00
Tejun Heo
ccbe6d5ee0 [PATCH] ata_piix: convert sata to new reset mechanism
Convert ata_piix sata ->phy_reset to new reset mechanism.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 06:19:53 -05:00
Tejun Heo
573db6b8f9 [PATCH] ata_piix: convert pata to new reset mechanism
Convert ata_piix pata ->phy_reset to new reset mechanism.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 06:19:53 -05:00
Tejun Heo
56497bd5f1 [PATCH] libata: fix comment regarding setting cable type
The comment above ata_std_postreset() specified that setting cable
type is the responsibility of postreset(), which isn't possible /
optimal depending on controller / driver.  This patch kills the
comment.  Setting cable type is responsibility of ->probe_reset.
libata doesn't care whether it's done in probeinit, reset or
postreset.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 06:19:53 -05:00
Tejun Heo
6aff8f1f07 [PATCH] libata: update ata_dev_init_params()
Update ata_dev_init_params() such that it doesn't disable port
directly but return with appropriate error mask on failure.  This is
preparation for splitting ata_dev_identify().  Note that this patch
changes behavior of dev_init_params failure such that only failing
devices are taken offline not the whole port.  This change is
intended.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 05:07:52 -05:00
Tejun Heo
6a62a04d47 [PATCH] libata: rename ata_dev_id_[c_]string()
This patch renames ata_dev_id_[c_]string() to ata_id_[c_]string().
All other functions which read data from ATA ID data start with ata_id
and those two function names were getting too long.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 04:54:22 -05:00
Jeff Garzik
5b2ffed906 Merge branch 'master' 2006-02-20 02:16:23 -05:00
Jens Axboe
c15d85c8f3 [PATCH] Add missing FUA write to sata_mv dma command list
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:31:18 -05:00
Albert Lee
0565c26de7 [PATCH] libata: minor fix for 2.6.16-rc3
- Fix the array index value in ata_rwcmd_protocol() for the added FUA commands.
 - Filter out ATAPI packet command error messages in ata_pio_error()

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:29:07 -05:00
Dan Williams
2ae5b30ff0 [PATCH] Necessary evil to get sata_vsc to initialize with Intel iq3124h hba
* libata does not care about error interrupts, so handle them locally
* the interrupts that are ignored only appear to happen at init time

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:27:19 -05:00
Linus Torvalds
26d451b603 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2006-02-16 12:47:44 -08:00