diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index a04488f..ccf204c 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -3088,6 +3088,7 @@ static int atapi_eh_clear_ua(struct ata_device *dev) "UNIT ATTENTION (err_mask=0x%x)\n", err_mask); return -EIO; } + ata_dev_printk(dev, KERN_INFO, "atapi_eh_clear_ua: cleared UA\n"); } ata_dev_printk(dev, KERN_WARNING, diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index b98f763..08a889d 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -114,6 +114,7 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, break; case UNIT_ATTENTION: if (sdev->removable) { + sdev_printk(KERN_INFO, sdev, "XXX UA on ioctl_internal_command\n"); sdev->changed = 1; result = 0; /* This is no longer considered an error */ break; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f3c4089..459db74 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -804,6 +804,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) /* Detected disc change. Set a bit * and quietly refuse further access. */ + sdev_printk(KERN_INFO, cmd->device, "XXX UA on EH\n"); cmd->device->changed = 1; description = "Media Changed"; action = ACTION_FAIL; @@ -1992,8 +1993,10 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries, result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr, timeout, retries, NULL); if (sdev->removable && scsi_sense_valid(sshdr) && - sshdr->sense_key == UNIT_ATTENTION) + sshdr->sense_key == UNIT_ATTENTION) { + sdev_printk(KERN_INFO, sdev, "XXX UA on generic TUR\n"); sdev->changed = 1; + } } while (scsi_sense_valid(sshdr) && sshdr->sense_key == UNIT_ATTENTION && --retries); @@ -2004,6 +2007,7 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries, if (sdev->removable && scsi_sense_valid(sshdr) && (sshdr->sense_key == UNIT_ATTENTION || sshdr->sense_key == NOT_READY)) { + sdev_printk(KERN_INFO, sdev, "XXX UA on generic TUR 1\n"); sdev->changed = 1; result = 0; } diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index cce0fe4..275d783 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -179,8 +179,10 @@ int sr_test_unit_ready(struct scsi_device *sdev, struct scsi_sense_hdr *sshdr) 0, sshdr, SR_TIMEOUT, retries--, NULL); if (scsi_sense_valid(sshdr) && - sshdr->sense_key == UNIT_ATTENTION) + sshdr->sense_key == UNIT_ATTENTION) { + sdev_printk(KERN_INFO, sdev, "XXX UA on SR_TUR\n"); sdev->changed = 1; + } } while (retries > 0 && (!scsi_status_is_good(the_result) || @@ -205,6 +207,8 @@ static int sr_media_change(struct cdrom_device_info *cdi, int slot) int retval; struct scsi_sense_hdr *sshdr; + printk("XXX %s: sr_media_change() entered\n", cdi->name); + if (CDSL_CURRENT != slot) { /* no changer support */ return -EINVAL; @@ -215,6 +219,7 @@ static int sr_media_change(struct cdrom_device_info *cdi, int slot) if (retval || (scsi_sense_valid(sshdr) && /* 0x3a is medium not present */ sshdr->asc == 0x3a)) { + printk("XXX %s: sr_media_change: media unavailable\n", cdi->name); /* Media not present or unable to test, unit probably not * ready. This usually means there is no disc in the drive. * Mark as changed, and we will figure it out later once @@ -227,6 +232,8 @@ static int sr_media_change(struct cdrom_device_info *cdi, int slot) }; retval = cd->device->changed; + printk("XXX %s: sr_media_change: cd->device->changed=%d\n", cdi->name, + cd->device->changed); cd->device->changed = 0; /* If the disk changed, the capacity will now be different, * so we force a re-read of this information */ @@ -681,6 +688,8 @@ static void get_sectorsize(struct scsi_cd *cd) if (the_result) { + printk("XXX %s: get_sectorsize: result=%d setting default\n", + cd->cdi.name, the_result); cd->capacity = 0x1fffff; sector_size = 2048; /* A guess, just in case */ } else { @@ -724,6 +733,8 @@ static void get_sectorsize(struct scsi_cd *cd) * what the device is capable of. */ set_capacity(cd->disk, cd->capacity); + printk("XXX %s: get_sectorsize: sect=%d cap=%u\n", + cd->cdi.name, sector_size, cd->capacity); } queue = cd->device->request_queue;