aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:13 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:13 -0400
commit06a449e30135aabb6686c95bf0c42b46d169a3b3 (patch)
tree7774a868c28b11d375428d1aaeb04fc8a5956be0
parenta08915ba594da66145f33a972db578a58b9135f1 (diff)
ide-cd: fix non-SECTOR_SIZE-multiples PIO transfers for fs requests
We now support arbitrary number of bytes per-IRQ also for fs requests so remove ide_cd_check_transfer_size() and IDE_AFLAG_LIMIT_NFRAMES. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-cd.c36
-rw-r--r--include/linux/ide.h5
2 files changed, 1 insertions, 40 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 5f15859c2c73..c0cefe5becf3 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. */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index c2841c0c36c8..cb501bf78f7d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -458,11 +458,6 @@ enum {
458 IDE_AFLAG_TOCADDR_AS_BCD = (1 << 3), 458 IDE_AFLAG_TOCADDR_AS_BCD = (1 << 3),
459 /* TOC track numbers are in BCD. */ 459 /* TOC track numbers are in BCD. */
460 IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 4), 460 IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 4),
461 /*
462 * Drive does not provide data in multiples of SECTOR_SIZE
463 * when more than one interrupt is needed.
464 */
465 IDE_AFLAG_LIMIT_NFRAMES = (1 << 5),
466 /* Saved TOC information is current. */ 461 /* Saved TOC information is current. */
467 IDE_AFLAG_TOC_VALID = (1 << 6), 462 IDE_AFLAG_TOC_VALID = (1 << 6),
468 /* We think that the drive door is locked. */ 463 /* We think that the drive door is locked. */