aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-cd.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 5f15859c2c7..c0cefe5becf 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -509,31 +509,6 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
509 return -1; 509 return -1;
510} 510}
511 511
512/*
513 * Assume that the drive will always provide data in multiples of at least
514 * SECTOR_SIZE, as it gets hairy to keep track of the transfers otherwise.
515 */
516static int ide_cd_check_transfer_size(ide_drive_t *drive, int len)
517{
518 ide_debug_log(IDE_DBG_FUNC, "len: %d", len);
519
520 if ((len % SECTOR_SIZE) == 0)
521 return 0;
522
523 printk(KERN_ERR PFX "%s: %s: Bad transfer size %d\n", drive->name,
524 __func__, len);
525
526 if (drive->atapi_flags & IDE_AFLAG_LIMIT_NFRAMES)
527 printk(KERN_ERR PFX "This drive is not supported by this "
528 "version of the driver\n");
529 else {
530 printk(KERN_ERR PFX "Trying to limit transfer sizes\n");
531 drive->atapi_flags |= IDE_AFLAG_LIMIT_NFRAMES;
532 }
533
534 return 1;
535}
536
537static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, 512static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive,
538 struct request *rq) 513 struct request *rq)
539{ 514{
@@ -752,13 +727,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
752 if (rc) 727 if (rc)
753 goto out_end; 728 goto out_end;
754 729
755 if (blk_fs_request(rq)) { 730 cmd->last_xfer_len = 0;
756 if (write == 0) {
757 if (ide_cd_check_transfer_size(drive, len))
758 goto out_end;
759 }
760 cmd->last_xfer_len = 0;
761 }
762 731
763 if (ireason == 0) { 732 if (ireason == 0) {
764 write = 1; 733 write = 1;
@@ -1619,9 +1588,6 @@ static const struct ide_proc_devset *ide_cd_proc_devsets(ide_drive_t *drive)
1619#endif 1588#endif
1620 1589
1621static const struct cd_list_entry ide_cd_quirks_list[] = { 1590static const struct cd_list_entry ide_cd_quirks_list[] = {
1622 /* Limit transfer size per interrupt. */
1623 { "SAMSUNG CD-ROM SCR-2430", NULL, IDE_AFLAG_LIMIT_NFRAMES },
1624 { "SAMSUNG CD-ROM SCR-2432", NULL, IDE_AFLAG_LIMIT_NFRAMES },
1625 /* SCR-3231 doesn't support the SET_CD_SPEED command. */ 1591 /* SCR-3231 doesn't support the SET_CD_SPEED command. */
1626 { "SAMSUNG CD-ROM SCR-3231", NULL, IDE_AFLAG_NO_SPEED_SELECT }, 1592 { "SAMSUNG CD-ROM SCR-3231", NULL, IDE_AFLAG_NO_SPEED_SELECT },
1627 /* Old NEC260 (not R) was released before ATAPI 1.2 spec. */ 1593 /* Old NEC260 (not R) was released before ATAPI 1.2 spec. */