aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 00:05:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 00:05:33 -0400
commit0fcf12d510b6d1b1b090a090c62009310eca4be4 (patch)
treebdede7832707c398856cc18578dfa7a0d4a34083 /drivers
parent4d15393d20c1934a296a999d8ede125532d21cc4 (diff)
parentcd078af65d5c2f19c0f378062b07a0a79b000723 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6: tx493xide: use min_t() macro instead of min() drivers/ide: Use memdup_user via82cxxx: fix typo for VT6415 PCIE PATA IDE Host Controller support. ide-cd: Do not access completed requests in the irq handler
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-cd.c14
-rw-r--r--drivers/ide/ide-taskfile.c10
-rw-r--r--drivers/ide/tx4938ide.c2
-rw-r--r--drivers/ide/tx4939ide.c2
-rw-r--r--drivers/ide/via82cxxx.c2
5 files changed, 17 insertions, 13 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 64207df8da82..2de76cc08f61 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -506,15 +506,22 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
506 return (flags & REQ_FAILED) ? -EIO : 0; 506 return (flags & REQ_FAILED) ? -EIO : 0;
507} 507}
508 508
509static void ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd) 509/*
510 * returns true if rq has been completed
511 */
512static bool ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
510{ 513{
511 unsigned int nr_bytes = cmd->nbytes - cmd->nleft; 514 unsigned int nr_bytes = cmd->nbytes - cmd->nleft;
512 515
513 if (cmd->tf_flags & IDE_TFLAG_WRITE) 516 if (cmd->tf_flags & IDE_TFLAG_WRITE)
514 nr_bytes -= cmd->last_xfer_len; 517 nr_bytes -= cmd->last_xfer_len;
515 518
516 if (nr_bytes > 0) 519 if (nr_bytes > 0) {
517 ide_complete_rq(drive, 0, nr_bytes); 520 ide_complete_rq(drive, 0, nr_bytes);
521 return true;
522 }
523
524 return false;
518} 525}
519 526
520static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) 527static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
@@ -679,7 +686,8 @@ out_end:
679 } 686 }
680 687
681 if (uptodate == 0 && rq->bio) 688 if (uptodate == 0 && rq->bio)
682 ide_cd_error_cmd(drive, cmd); 689 if (ide_cd_error_cmd(drive, cmd))
690 return ide_stopped;
683 691
684 /* make sure it's fully ended */ 692 /* make sure it's fully ended */
685 if (blk_fs_request(rq) == 0) { 693 if (blk_fs_request(rq) == 0) {
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 67fb73559fd5..34b9872f35d1 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -480,13 +480,9 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
480 u16 nsect = 0; 480 u16 nsect = 0;
481 char __user *buf = (char __user *)arg; 481 char __user *buf = (char __user *)arg;
482 482
483 req_task = kzalloc(tasksize, GFP_KERNEL); 483 req_task = memdup_user(buf, tasksize);
484 if (req_task == NULL) 484 if (IS_ERR(req_task))
485 return -ENOMEM; 485 return PTR_ERR(req_task);
486 if (copy_from_user(req_task, buf, tasksize)) {
487 kfree(req_task);
488 return -EFAULT;
489 }
490 486
491 taskout = req_task->out_size; 487 taskout = req_task->out_size;
492 taskin = req_task->in_size; 488 taskin = req_task->in_size;
diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c
index 1d80f1fdbc97..7002765b593c 100644
--- a/drivers/ide/tx4938ide.c
+++ b/drivers/ide/tx4938ide.c
@@ -64,7 +64,7 @@ static void tx4938ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
64 64
65 pair = ide_get_pair_dev(drive); 65 pair = ide_get_pair_dev(drive);
66 if (pair) 66 if (pair)
67 safe = min(safe, pair->pio_mode - XFER_PIO_0); 67 safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0);
68 tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, safe); 68 tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, safe);
69} 69}
70 70
diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c
index 3c7367751873..bed3e39aac96 100644
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -114,7 +114,7 @@ static void tx4939ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
114 114
115 pair = ide_get_pair_dev(drive); 115 pair = ide_get_pair_dev(drive);
116 if (pair) 116 if (pair)
117 safe = min(safe, pair->pio_mode - XFER_PIO_0); 117 safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0);
118 /* 118 /*
119 * Update Command Transfer Mode for master/slave and Data 119 * Update Command Transfer Mode for master/slave and Data
120 * Transfer Mode for this drive. 120 * Transfer Mode for this drive.
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c
index 101f40022386..d2a0997b78f8 100644
--- a/drivers/ide/via82cxxx.c
+++ b/drivers/ide/via82cxxx.c
@@ -79,7 +79,7 @@ static struct via_isa_bridge {
79 { "vt8261", PCI_DEVICE_ID_VIA_8261, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 79 { "vt8261", PCI_DEVICE_ID_VIA_8261, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
80 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 80 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
81 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 81 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
82 { "vt6415", PCI_DEVICE_ID_VIA_6410, 0x00, 0xff, ATA_UDMA6, VIA_BAD_AST }, 82 { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0xff, ATA_UDMA6, VIA_BAD_AST },
83 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 83 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
84 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 84 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
85 { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 85 { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },