Commit 9db4a6ed authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] IDE CD is very noisy

The ide-cd code has never been updated over the years to include printk
levels.  This patch extracts the printk level updating from the -ac tree
seperated from other changes.
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5349e12b
...@@ -456,7 +456,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive, ...@@ -456,7 +456,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
s = "(reserved error code)"; s = "(reserved error code)";
} }
printk(" %s -- (asc=0x%02x, ascq=0x%02x)\n", printk(KERN_ERR " %s -- (asc=0x%02x, ascq=0x%02x)\n",
s, sense->asc, sense->ascq); s, sense->asc, sense->ascq);
if (failed_command != NULL) { if (failed_command != NULL) {
...@@ -478,7 +478,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive, ...@@ -478,7 +478,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
lo = mid+1; lo = mid+1;
} }
printk (" The failed \"%s\" packet command was: \n \"", s); printk (KERN_ERR " The failed \"%s\" packet command was: \n \"", s);
for (i=0; i<sizeof (failed_command->cmd); i++) for (i=0; i<sizeof (failed_command->cmd); i++)
printk ("%02x ", failed_command->cmd[i]); printk ("%02x ", failed_command->cmd[i]);
printk ("\"\n"); printk ("\"\n");
...@@ -491,13 +491,13 @@ void cdrom_analyze_sense_data(ide_drive_t *drive, ...@@ -491,13 +491,13 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
*/ */
if (sense->sense_key == NOT_READY && (sense->sks[0] & 0x80)) { if (sense->sense_key == NOT_READY && (sense->sks[0] & 0x80)) {
int progress = (sense->sks[1] << 8 | sense->sks[2]) * 100; int progress = (sense->sks[1] << 8 | sense->sks[2]) * 100;
printk(" Command is %02d%% complete\n", progress / 0xffff); printk(KERN_ERR " Command is %02d%% complete\n", progress / 0xffff);
} }
if (sense->sense_key == ILLEGAL_REQUEST && if (sense->sense_key == ILLEGAL_REQUEST &&
(sense->sks[0] & 0x80) != 0) { (sense->sks[0] & 0x80) != 0) {
printk(" Error in %s byte %d", printk(KERN_ERR " Error in %s byte %d",
(sense->sks[0] & 0x40) != 0 ? (sense->sks[0] & 0x40) != 0 ?
"command packet" : "command data", "command packet" : "command data",
(sense->sks[1] << 8) + sense->sks[2]); (sense->sks[1] << 8) + sense->sks[2]);
...@@ -519,7 +519,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive, ...@@ -519,7 +519,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
sense->asc == 0x3a))) sense->asc == 0x3a)))
return; return;
printk("%s: error code: 0x%02x sense_key: 0x%02x asc: 0x%02x ascq: 0x%02x\n", printk(KERN_ERR "%s: error code: 0x%02x sense_key: 0x%02x asc: 0x%02x ascq: 0x%02x\n",
drive->name, drive->name,
sense->error_code, sense->sense_key, sense->error_code, sense->sense_key,
sense->asc, sense->ascq); sense->asc, sense->ascq);
...@@ -958,7 +958,7 @@ int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason) ...@@ -958,7 +958,7 @@ int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason)
return 0; return 0;
else if (ireason == 0) { else if (ireason == 0) {
/* Whoops... The drive is expecting to receive data from us! */ /* Whoops... The drive is expecting to receive data from us! */
printk("%s: read_intr: Drive wants to transfer data the " printk(KERN_ERR "%s: read_intr: Drive wants to transfer data the "
"wrong way!\n", drive->name); "wrong way!\n", drive->name);
/* Throw some data at the drive so it doesn't hang /* Throw some data at the drive so it doesn't hang
...@@ -976,7 +976,7 @@ int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason) ...@@ -976,7 +976,7 @@ int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason)
return 0; return 0;
} else { } else {
/* Drive wants a command packet, or invalid ireason... */ /* Drive wants a command packet, or invalid ireason... */
printk("%s: read_intr: bad interrupt reason %x\n", drive->name, printk(KERN_ERR "%s: read_intr: bad interrupt reason %x\n", drive->name,
ireason); ireason);
} }
...@@ -1029,7 +1029,7 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive) ...@@ -1029,7 +1029,7 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive)
/* If we're not done filling the current buffer, complain. /* If we're not done filling the current buffer, complain.
Otherwise, complete the command normally. */ Otherwise, complete the command normally. */
if (rq->current_nr_sectors > 0) { if (rq->current_nr_sectors > 0) {
printk ("%s: cdrom_read_intr: data underrun (%d blocks)\n", printk (KERN_ERR "%s: cdrom_read_intr: data underrun (%d blocks)\n",
drive->name, rq->current_nr_sectors); drive->name, rq->current_nr_sectors);
rq->flags |= REQ_FAILED; rq->flags |= REQ_FAILED;
cdrom_end_request(drive, 0); cdrom_end_request(drive, 0);
...@@ -1046,12 +1046,12 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive) ...@@ -1046,12 +1046,12 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive)
of at least SECTOR_SIZE, as it gets hairy to keep track of at least SECTOR_SIZE, as it gets hairy to keep track
of the transfers otherwise. */ of the transfers otherwise. */
if ((len % SECTOR_SIZE) != 0) { if ((len % SECTOR_SIZE) != 0) {
printk ("%s: cdrom_read_intr: Bad transfer size %d\n", printk (KERN_ERR "%s: cdrom_read_intr: Bad transfer size %d\n",
drive->name, len); drive->name, len);
if (CDROM_CONFIG_FLAGS(drive)->limit_nframes) if (CDROM_CONFIG_FLAGS(drive)->limit_nframes)
printk (" This drive is not supported by this version of the driver\n"); printk (KERN_ERR " This drive is not supported by this version of the driver\n");
else { else {
printk (" Trying to limit transfer sizes\n"); printk (KERN_ERR " Trying to limit transfer sizes\n");
CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1;
} }
cdrom_end_request(drive, 0); cdrom_end_request(drive, 0);
...@@ -1165,7 +1165,7 @@ static int cdrom_read_from_buffer (ide_drive_t *drive) ...@@ -1165,7 +1165,7 @@ static int cdrom_read_from_buffer (ide_drive_t *drive)
paranoid and check. */ paranoid and check. */
if (rq->current_nr_sectors < bio_cur_sectors(rq->bio) && if (rq->current_nr_sectors < bio_cur_sectors(rq->bio) &&
(rq->sector & (sectors_per_frame - 1))) { (rq->sector & (sectors_per_frame - 1))) {
printk("%s: cdrom_read_from_buffer: buffer botch (%ld)\n", printk(KERN_ERR "%s: cdrom_read_from_buffer: buffer botch (%ld)\n",
drive->name, (long)rq->sector); drive->name, (long)rq->sector);
cdrom_end_request(drive, 0); cdrom_end_request(drive, 0);
return -1; return -1;
...@@ -1200,7 +1200,7 @@ static ide_startstop_t cdrom_start_read_continuation (ide_drive_t *drive) ...@@ -1200,7 +1200,7 @@ static ide_startstop_t cdrom_start_read_continuation (ide_drive_t *drive)
/* Sanity check... */ /* Sanity check... */
if (rq->current_nr_sectors != bio_cur_sectors(rq->bio) && if (rq->current_nr_sectors != bio_cur_sectors(rq->bio) &&
(rq->sector & (sectors_per_frame - 1))) { (rq->sector & (sectors_per_frame - 1))) {
printk ("%s: cdrom_start_read_continuation: buffer botch (%u)\n", printk(KERN_ERR "%s: cdrom_start_read_continuation: buffer botch (%u)\n",
drive->name, rq->current_nr_sectors); drive->name, rq->current_nr_sectors);
cdrom_end_request(drive, 0); cdrom_end_request(drive, 0);
return ide_stopped; return ide_stopped;
...@@ -1425,7 +1425,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) ...@@ -1425,7 +1425,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
rq->sense_len += thislen; rq->sense_len += thislen;
} else { } else {
confused: confused:
printk ("%s: cdrom_pc_intr: The drive " printk (KERN_ERR "%s: cdrom_pc_intr: The drive "
"appears confused (ireason = 0x%02x)\n", "appears confused (ireason = 0x%02x)\n",
drive->name, ireason); drive->name, ireason);
rq->flags |= REQ_FAILED; rq->flags |= REQ_FAILED;
...@@ -1539,7 +1539,7 @@ static inline int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ire ...@@ -1539,7 +1539,7 @@ static inline int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ire
return 0; return 0;
else if (ireason == 2) { else if (ireason == 2) {
/* Whoops... The drive wants to send data. */ /* Whoops... The drive wants to send data. */
printk("%s: write_intr: wrong transfer direction!\n", printk(KERN_ERR "%s: write_intr: wrong transfer direction!\n",
drive->name); drive->name);
while (len > 0) { while (len > 0) {
...@@ -1549,7 +1549,7 @@ static inline int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ire ...@@ -1549,7 +1549,7 @@ static inline int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ire
} }
} else { } else {
/* Drive wants a command packet, or invalid ireason... */ /* Drive wants a command packet, or invalid ireason... */
printk("%s: write_intr: bad interrupt reason %x\n", printk(KERN_ERR "%s: write_intr: bad interrupt reason %x\n",
drive->name, ireason); drive->name, ireason);
} }
...@@ -1615,7 +1615,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) ...@@ -1615,7 +1615,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
*/ */
if (dma) { if (dma) {
if (dma_error) { if (dma_error) {
printk("ide-cd: dma error\n"); printk(KERN_ERR "ide-cd: dma error\n");
__ide_dma_off(drive); __ide_dma_off(drive);
return ide_error(drive, "dma error", stat); return ide_error(drive, "dma error", stat);
} }
...@@ -1680,7 +1680,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) ...@@ -1680,7 +1680,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
} }
if (!ptr) { if (!ptr) {
printk("%s: confused, missing data\n", drive->name); printk(KERN_ERR "%s: confused, missing data\n", drive->name);
break; break;
} }
...@@ -1742,7 +1742,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive) ...@@ -1742,7 +1742,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
if (dma) { if (dma) {
info->dma = 0; info->dma = 0;
if ((dma_error = HWIF(drive)->ide_dma_end(drive))) { if ((dma_error = HWIF(drive)->ide_dma_end(drive))) {
printk("ide-cd: write dma error\n"); printk(KERN_ERR "ide-cd: write dma error\n");
__ide_dma_off(drive); __ide_dma_off(drive);
} }
} }
...@@ -1775,7 +1775,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive) ...@@ -1775,7 +1775,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
*/ */
uptodate = 1; uptodate = 1;
if (rq->current_nr_sectors > 0) { if (rq->current_nr_sectors > 0) {
printk("%s: write_intr: data underrun (%d blocks)\n", printk(KERN_ERR "%s: write_intr: data underrun (%d blocks)\n",
drive->name, rq->current_nr_sectors); drive->name, rq->current_nr_sectors);
uptodate = 0; uptodate = 0;
} }
...@@ -1796,7 +1796,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive) ...@@ -1796,7 +1796,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
int this_transfer; int this_transfer;
if (!rq->current_nr_sectors) { if (!rq->current_nr_sectors) {
printk("ide-cd: write_intr: oops\n"); printk(KERN_ERR "ide-cd: write_intr: oops\n");
break; break;
} }
...@@ -1942,7 +1942,7 @@ ide_do_rw_cdrom (ide_drive_t *drive, struct request *rq, sector_t block) ...@@ -1942,7 +1942,7 @@ ide_do_rw_cdrom (ide_drive_t *drive, struct request *rq, sector_t block)
ide_stall_queue(drive, IDECD_SEEK_TIMER); ide_stall_queue(drive, IDECD_SEEK_TIMER);
return ide_stopped; return ide_stopped;
} }
printk ("%s: DSC timeout\n", drive->name); printk (KERN_ERR "%s: DSC timeout\n", drive->name);
} }
CDROM_CONFIG_FLAGS(drive)->seeking = 0; CDROM_CONFIG_FLAGS(drive)->seeking = 0;
} }
...@@ -2078,7 +2078,7 @@ cdrom_lockdoor(ide_drive_t *drive, int lockflag, struct request_sense *sense) ...@@ -2078,7 +2078,7 @@ cdrom_lockdoor(ide_drive_t *drive, int lockflag, struct request_sense *sense)
if (stat != 0 && if (stat != 0 &&
sense->sense_key == ILLEGAL_REQUEST && sense->sense_key == ILLEGAL_REQUEST &&
(sense->asc == 0x24 || sense->asc == 0x20)) { (sense->asc == 0x24 || sense->asc == 0x20)) {
printk ("%s: door locking not supported\n", printk (KERN_ERR "%s: door locking not supported\n",
drive->name); drive->name);
CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1;
stat = 0; stat = 0;
...@@ -2196,7 +2196,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) ...@@ -2196,7 +2196,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense)
GFP_KERNEL); GFP_KERNEL);
info->toc = toc; info->toc = toc;
if (toc == NULL) { if (toc == NULL) {
printk ("%s: No cdrom TOC buffer!\n", drive->name); printk (KERN_ERR "%s: No cdrom TOC buffer!\n", drive->name);
return -ENOMEM; return -ENOMEM;
} }
} }
...@@ -2883,7 +2883,7 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive) ...@@ -2883,7 +2883,7 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
if (drive->media == ide_optical) { if (drive->media == ide_optical) {
CDROM_CONFIG_FLAGS(drive)->mo_drive = 1; CDROM_CONFIG_FLAGS(drive)->mo_drive = 1;
CDROM_CONFIG_FLAGS(drive)->ram = 1; CDROM_CONFIG_FLAGS(drive)->ram = 1;
printk("%s: ATAPI magneto-optical drive\n", drive->name); printk(KERN_ERR "%s: ATAPI magneto-optical drive\n", drive->name);
return nslots; return nslots;
} }
...@@ -2973,7 +2973,7 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive) ...@@ -2973,7 +2973,7 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
/* don't print speed if the drive reported 0. /* don't print speed if the drive reported 0.
*/ */
printk("%s: ATAPI", drive->name); printk(KERN_INFO "%s: ATAPI", drive->name);
if (CDROM_CONFIG_FLAGS(drive)->max_speed) if (CDROM_CONFIG_FLAGS(drive)->max_speed)
printk(" %dX", CDROM_CONFIG_FLAGS(drive)->max_speed); printk(" %dX", CDROM_CONFIG_FLAGS(drive)->max_speed);
printk(" %s", CDROM_CONFIG_FLAGS(drive)->dvd ? "DVD-ROM" : "CD-ROM"); printk(" %s", CDROM_CONFIG_FLAGS(drive)->dvd ? "DVD-ROM" : "CD-ROM");
...@@ -3216,7 +3216,7 @@ int ide_cdrom_setup (ide_drive_t *drive) ...@@ -3216,7 +3216,7 @@ int ide_cdrom_setup (ide_drive_t *drive)
#endif #endif
if (ide_cdrom_register(drive, nslots)) { if (ide_cdrom_register(drive, nslots)) {
printk ("%s: ide_cdrom_setup failed to register device with the cdrom driver.\n", drive->name); printk (KERN_ERR "%s: ide_cdrom_setup failed to register device with the cdrom driver.\n", drive->name);
info->devinfo.handle = NULL; info->devinfo.handle = NULL;
return 1; return 1;
} }
...@@ -3243,7 +3243,7 @@ int ide_cdrom_cleanup(ide_drive_t *drive) ...@@ -3243,7 +3243,7 @@ int ide_cdrom_cleanup(ide_drive_t *drive)
struct gendisk *g = drive->disk; struct gendisk *g = drive->disk;
if (ide_unregister_subdriver(drive)) { if (ide_unregister_subdriver(drive)) {
printk("%s: %s: failed to ide_unregister_subdriver\n", printk(KERN_ERR "%s: %s: failed to ide_unregister_subdriver\n",
__FUNCTION__, drive->name); __FUNCTION__, drive->name);
return 1; return 1;
} }
...@@ -3254,7 +3254,7 @@ int ide_cdrom_cleanup(ide_drive_t *drive) ...@@ -3254,7 +3254,7 @@ int ide_cdrom_cleanup(ide_drive_t *drive)
if (info->changer_info != NULL) if (info->changer_info != NULL)
kfree(info->changer_info); kfree(info->changer_info);
if (devinfo->handle == drive && unregister_cdrom(devinfo)) if (devinfo->handle == drive && unregister_cdrom(devinfo))
printk("%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name); printk(KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
kfree(info); kfree(info);
drive->driver_data = NULL; drive->driver_data = NULL;
blk_queue_prep_rq(drive->queue, NULL); blk_queue_prep_rq(drive->queue, NULL);
...@@ -3403,21 +3403,21 @@ static int ide_cdrom_attach (ide_drive_t *drive) ...@@ -3403,21 +3403,21 @@ static int ide_cdrom_attach (ide_drive_t *drive)
/* skip drives that we were told to ignore */ /* skip drives that we were told to ignore */
if (ignore != NULL) { if (ignore != NULL) {
if (strstr(ignore, drive->name)) { if (strstr(ignore, drive->name)) {
printk("ide-cd: ignoring drive %s\n", drive->name); printk(KERN_INFO "ide-cd: ignoring drive %s\n", drive->name);
goto failed; goto failed;
} }
} }
if (drive->scsi) { if (drive->scsi) {
printk("ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name); printk(KERN_INFO "ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name);
goto failed; goto failed;
} }
info = (struct cdrom_info *) kmalloc (sizeof (struct cdrom_info), GFP_KERNEL); info = (struct cdrom_info *) kmalloc (sizeof (struct cdrom_info), GFP_KERNEL);
if (info == NULL) { if (info == NULL) {
printk("%s: Can't allocate a cdrom structure\n", drive->name); printk(KERN_ERR "%s: Can't allocate a cdrom structure\n", drive->name);
goto failed; goto failed;
} }
if (ide_register_subdriver(drive, &ide_cdrom_driver)) { if (ide_register_subdriver(drive, &ide_cdrom_driver)) {
printk("%s: Failed to register the driver with ide.c\n", printk(KERN_ERR "%s: Failed to register the driver with ide.c\n",
drive->name); drive->name);
kfree(info); kfree(info);
goto failed; goto failed;
...@@ -3441,7 +3441,7 @@ static int ide_cdrom_attach (ide_drive_t *drive) ...@@ -3441,7 +3441,7 @@ static int ide_cdrom_attach (ide_drive_t *drive)
if (info->changer_info != NULL) if (info->changer_info != NULL)
kfree(info->changer_info); kfree(info->changer_info);
if (devinfo->handle == drive && unregister_cdrom(devinfo)) if (devinfo->handle == drive && unregister_cdrom(devinfo))
printk ("%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name); printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
kfree(info); kfree(info);
drive->driver_data = NULL; drive->driver_data = NULL;
goto failed; goto failed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment