diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 11:38:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 11:38:06 -0400 |
| commit | 8019aa946af5218bc4446c21e43cc19c9401ac68 (patch) | |
| tree | 6681b73a560f5a4e4a4e8f97b3833a087a488439 /drivers/scsi | |
| parent | 73e3e6481f56b3b5b618671a8d32b19a35f84316 (diff) | |
| parent | 48feb3c419508487becfb9ea3afcc54c3eac6d80 (diff) | |
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (79 commits)
ata-acpi: don't call _GTF for disabled drive
sata_mv add temporary 3 second init delay for SiliconImage PMs
sata_mv remove redundant edma init code
sata_mv add basic port multiplier support
sata_mv fix SOC flags, enable NCQ on SOC
sata_mv disable hotplug for now
sata_mv cosmetics
sata_mv hardreset rework
[libata] improve Kconfig help text for new PMP, SFF options
libata: make EH fail gracefully if no reset method is available
libata: Be a bit more slack about early devices
libata: cable logic
libata: move link onlineness check out of softreset methods
libata: kill dead code paths in reset path
pata_scc: fix build breakage
libata: make PMP support optional
libata: implement PMP helpers
libata: separate PMP support code from core code
libata: make SFF support optional
libata: don't use ap->ioaddr in non-SFF drivers
...
Diffstat (limited to 'drivers/scsi')
| -rw-r--r-- | drivers/scsi/ipr.c | 74 | ||||
| -rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 19 |
2 files changed, 30 insertions, 63 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index c72014a3e7d4..65dc18dea845 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
| @@ -3937,7 +3937,7 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd) | |||
| 3937 | if (ipr_is_gata(res) && res->sata_port) { | 3937 | if (ipr_is_gata(res) && res->sata_port) { |
| 3938 | ap = res->sata_port->ap; | 3938 | ap = res->sata_port->ap; |
| 3939 | spin_unlock_irq(scsi_cmd->device->host->host_lock); | 3939 | spin_unlock_irq(scsi_cmd->device->host->host_lock); |
| 3940 | ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL); | 3940 | ata_std_error_handler(ap); |
| 3941 | spin_lock_irq(scsi_cmd->device->host->host_lock); | 3941 | spin_lock_irq(scsi_cmd->device->host->host_lock); |
| 3942 | 3942 | ||
| 3943 | list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { | 3943 | list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { |
| @@ -5041,33 +5041,6 @@ static void ipr_ata_post_internal(struct ata_queued_cmd *qc) | |||
| 5041 | } | 5041 | } |
| 5042 | 5042 | ||
| 5043 | /** | 5043 | /** |
| 5044 | * ipr_tf_read - Read the current ATA taskfile for the ATA port | ||
| 5045 | * @ap: ATA port | ||
| 5046 | * @tf: destination ATA taskfile | ||
| 5047 | * | ||
| 5048 | * Return value: | ||
| 5049 | * none | ||
| 5050 | **/ | ||
| 5051 | static void ipr_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | ||
| 5052 | { | ||
| 5053 | struct ipr_sata_port *sata_port = ap->private_data; | ||
| 5054 | struct ipr_ioasa_gata *g = &sata_port->ioasa; | ||
| 5055 | |||
| 5056 | tf->feature = g->error; | ||
| 5057 | tf->nsect = g->nsect; | ||
| 5058 | tf->lbal = g->lbal; | ||
| 5059 | tf->lbam = g->lbam; | ||
| 5060 | tf->lbah = g->lbah; | ||
| 5061 | tf->device = g->device; | ||
| 5062 | tf->command = g->status; | ||
| 5063 | tf->hob_nsect = g->hob_nsect; | ||
| 5064 | tf->hob_lbal = g->hob_lbal; | ||
| 5065 | tf->hob_lbam = g->hob_lbam; | ||
| 5066 | tf->hob_lbah = g->hob_lbah; | ||
| 5067 | tf->ctl = g->alt_status; | ||
| 5068 | } | ||
| 5069 | |||
| 5070 | /** | ||
| 5071 | * ipr_copy_sata_tf - Copy a SATA taskfile to an IOA data structure | 5044 | * ipr_copy_sata_tf - Copy a SATA taskfile to an IOA data structure |
| 5072 | * @regs: destination | 5045 | * @regs: destination |
| 5073 | * @tf: source ATA taskfile | 5046 | * @tf: source ATA taskfile |
| @@ -5245,40 +5218,41 @@ static unsigned int ipr_qc_issue(struct ata_queued_cmd *qc) | |||
| 5245 | } | 5218 | } |
| 5246 | 5219 | ||
| 5247 | /** | 5220 | /** |
| 5248 | * ipr_ata_check_status - Return last ATA status | 5221 | * ipr_qc_fill_rtf - Read result TF |
| 5249 | * @ap: ATA port | 5222 | * @qc: ATA queued command |
| 5250 | * | 5223 | * |
| 5251 | * Return value: | 5224 | * Return value: |
| 5252 | * ATA status | 5225 | * true |
| 5253 | **/ | 5226 | **/ |
| 5254 | static u8 ipr_ata_check_status(struct ata_port *ap) | 5227 | static bool ipr_qc_fill_rtf(struct ata_queued_cmd *qc) |
| 5255 | { | 5228 | { |
| 5256 | struct ipr_sata_port *sata_port = ap->private_data; | 5229 | struct ipr_sata_port *sata_port = qc->ap->private_data; |
| 5257 | return sata_port->ioasa.status; | 5230 | struct ipr_ioasa_gata *g = &sata_port->ioasa; |
| 5258 | } | 5231 | struct ata_taskfile *tf = &qc->result_tf; |
| 5259 | 5232 | ||
| 5260 | /** | 5233 | tf->feature = g->error; |
| 5261 | * ipr_ata_check_altstatus - Return last ATA altstatus | 5234 | tf->nsect = g->nsect; |
| 5262 | * @ap: ATA port | 5235 | tf->lbal = g->lbal; |
| 5263 | * | 5236 | tf->lbam = g->lbam; |
| 5264 | * Return value: | 5237 | tf->lbah = g->lbah; |
| 5265 | * Alt ATA status | 5238 | tf->device = g->device; |
| 5266 | **/ | 5239 | tf->command = g->status; |
| 5267 | static u8 ipr_ata_check_altstatus(struct ata_port *ap) | 5240 | tf->hob_nsect = g->hob_nsect; |
| 5268 | { | 5241 | tf->hob_lbal = g->hob_lbal; |
| 5269 | struct ipr_sata_port *sata_port = ap->private_data; | 5242 | tf->hob_lbam = g->hob_lbam; |
| 5270 | return sata_port->ioasa.alt_status; | 5243 | tf->hob_lbah = g->hob_lbah; |
| 5244 | tf->ctl = g->alt_status; | ||
| 5245 | |||
| 5246 | return true; | ||
| 5271 | } | 5247 | } |
| 5272 | 5248 | ||
| 5273 | static struct ata_port_operations ipr_sata_ops = { | 5249 | static struct ata_port_operations ipr_sata_ops = { |
| 5274 | .check_status = ipr_ata_check_status, | ||
| 5275 | .check_altstatus = ipr_ata_check_altstatus, | ||
| 5276 | .dev_select = ata_noop_dev_select, | ||
| 5277 | .phy_reset = ipr_ata_phy_reset, | 5250 | .phy_reset = ipr_ata_phy_reset, |
| 5251 | .hardreset = ipr_sata_reset, | ||
| 5278 | .post_internal_cmd = ipr_ata_post_internal, | 5252 | .post_internal_cmd = ipr_ata_post_internal, |
| 5279 | .tf_read = ipr_tf_read, | ||
| 5280 | .qc_prep = ata_noop_qc_prep, | 5253 | .qc_prep = ata_noop_qc_prep, |
| 5281 | .qc_issue = ipr_qc_issue, | 5254 | .qc_issue = ipr_qc_issue, |
| 5255 | .qc_fill_rtf = ipr_qc_fill_rtf, | ||
| 5282 | .port_start = ata_sas_port_start, | 5256 | .port_start = ata_sas_port_start, |
| 5283 | .port_stop = ata_sas_port_stop | 5257 | .port_stop = ata_sas_port_stop |
| 5284 | }; | 5258 | }; |
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index b0e5ac372a32..a4811e4106df 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
| @@ -225,10 +225,12 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) | |||
| 225 | return 0; | 225 | return 0; |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | static u8 sas_ata_check_status(struct ata_port *ap) | 228 | static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc) |
| 229 | { | 229 | { |
| 230 | struct domain_device *dev = ap->private_data; | 230 | struct domain_device *dev = qc->ap->private_data; |
| 231 | return dev->sata_dev.tf.command; | 231 | |
| 232 | memcpy(&qc->result_tf, &dev->sata_dev.tf, sizeof(qc->result_tf)); | ||
| 233 | return true; | ||
| 232 | } | 234 | } |
| 233 | 235 | ||
| 234 | static void sas_ata_phy_reset(struct ata_port *ap) | 236 | static void sas_ata_phy_reset(struct ata_port *ap) |
| @@ -292,12 +294,6 @@ static void sas_ata_post_internal(struct ata_queued_cmd *qc) | |||
| 292 | } | 294 | } |
| 293 | } | 295 | } |
| 294 | 296 | ||
| 295 | static void sas_ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | ||
| 296 | { | ||
| 297 | struct domain_device *dev = ap->private_data; | ||
| 298 | memcpy(tf, &dev->sata_dev.tf, sizeof (*tf)); | ||
| 299 | } | ||
| 300 | |||
| 301 | static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, | 297 | static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, |
| 302 | u32 val) | 298 | u32 val) |
| 303 | { | 299 | { |
| @@ -348,14 +344,11 @@ static int sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in, | |||
| 348 | } | 344 | } |
| 349 | 345 | ||
| 350 | static struct ata_port_operations sas_sata_ops = { | 346 | static struct ata_port_operations sas_sata_ops = { |
| 351 | .check_status = sas_ata_check_status, | ||
| 352 | .check_altstatus = sas_ata_check_status, | ||
| 353 | .dev_select = ata_noop_dev_select, | ||
| 354 | .phy_reset = sas_ata_phy_reset, | 347 | .phy_reset = sas_ata_phy_reset, |
| 355 | .post_internal_cmd = sas_ata_post_internal, | 348 | .post_internal_cmd = sas_ata_post_internal, |
| 356 | .tf_read = sas_ata_tf_read, | ||
| 357 | .qc_prep = ata_noop_qc_prep, | 349 | .qc_prep = ata_noop_qc_prep, |
| 358 | .qc_issue = sas_ata_qc_issue, | 350 | .qc_issue = sas_ata_qc_issue, |
| 351 | .qc_fill_rtf = sas_ata_qc_fill_rtf, | ||
| 359 | .port_start = ata_sas_port_start, | 352 | .port_start = ata_sas_port_start, |
| 360 | .port_stop = ata_sas_port_stop, | 353 | .port_stop = ata_sas_port_stop, |
| 361 | .scr_read = sas_ata_scr_read, | 354 | .scr_read = sas_ata_scr_read, |
