scsi: reduce the informational log messages during initial probe

There are many informational log messages printed during the LUN detection
and while binding the scsi device with upper level driver. Most of these
messages are KERN_NOTICE level and hence would show up on serial console.
In fact, as we are using the dev_printk() APIs even KERN_DEBUG level
messages are ending up on console. This patch removes most of these
informational log messages to reduce the load on serial console during
boot up.

Change-Id: I332b71f529e04039645d1f41783395da8abc7f0b
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This commit is contained in:
Subhash Jadavani 2015-07-15 16:42:49 -07:00 committed by David Keitel
parent 2b80aee4b6
commit 628aaf1ba9
3 changed files with 1 additions and 38 deletions

View file

@ -819,13 +819,8 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
* well-known logical units. Force well-known type
* to enumerate them correctly.
*/
if (scsi_is_wlun(sdev->lun) && sdev->type != TYPE_WLUN) {
sdev_printk(KERN_WARNING, sdev,
"%s: correcting incorrect peripheral device type 0x%x for W-LUN 0x%16xhN\n",
__func__, sdev->type, (unsigned int)sdev->lun);
if (scsi_is_wlun(sdev->lun) && sdev->type != TYPE_WLUN)
sdev->type = TYPE_WLUN;
}
}
if (sdev->type == TYPE_RBC || sdev->type == TYPE_ROM) {

View file

@ -2347,11 +2347,6 @@ got_data:
sizeof(cap_str_10));
if (sdkp->first_scan || old_capacity != sdkp->capacity) {
sd_printk(KERN_NOTICE, sdkp,
"%llu %d-byte logical blocks: (%s/%s)\n",
(unsigned long long)sdkp->capacity,
sector_size, cap_str_10, cap_str_2);
if (sdkp->physical_block_size != sector_size)
sd_printk(KERN_NOTICE, sdkp,
"%u-byte physical blocks\n",
@ -2396,7 +2391,6 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer)
int res;
struct scsi_device *sdp = sdkp->device;
struct scsi_mode_data data;
int old_wp = sdkp->write_prot;
set_disk_ro(sdkp->disk, 0);
if (sdp->skip_ms_page_3f) {
@ -2437,13 +2431,6 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer)
} else {
sdkp->write_prot = ((data.device_specific & 0x80) != 0);
set_disk_ro(sdkp->disk, sdkp->write_prot);
if (sdkp->first_scan || old_wp != sdkp->write_prot) {
sd_printk(KERN_NOTICE, sdkp, "Write Protect is %s\n",
sdkp->write_prot ? "on" : "off");
sd_printk(KERN_DEBUG, sdkp,
"Mode Sense: %02x %02x %02x %02x\n",
buffer[0], buffer[1], buffer[2], buffer[3]);
}
}
}
@ -2463,10 +2450,6 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
int first_len;
struct scsi_mode_data data;
struct scsi_sense_hdr sshdr;
int old_wce = sdkp->WCE;
int old_rcd = sdkp->RCD;
int old_dpofua = sdkp->DPOFUA;
if (sdkp->cache_override)
return;
@ -2591,15 +2574,6 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
if (sdkp->WCE && sdkp->write_prot)
sdkp->WCE = 0;
if (sdkp->first_scan || old_wce != sdkp->WCE ||
old_rcd != sdkp->RCD || old_dpofua != sdkp->DPOFUA)
sd_printk(KERN_NOTICE, sdkp,
"Write cache: %s, read cache: %s, %s\n",
sdkp->WCE ? "enabled" : "disabled",
sdkp->RCD ? "disabled" : "enabled",
sdkp->DPOFUA ? "supports DPO and FUA"
: "doesn't support DPO or FUA");
return;
}
@ -3058,8 +3032,6 @@ static void sd_probe_async(void *data, async_cookie_t cookie)
sd_revalidate_disk(gd);
sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n",
sdp->removable ? "removable " : "");
scsi_autopm_put_device(sdp);
put_device(&sdkp->dev);
}
@ -3304,7 +3276,6 @@ static int sd_suspend_common(struct device *dev, bool ignore_stop_errors)
return 0; /* this can happen */
if (sdkp->WCE && sdkp->media_present) {
sd_printk(KERN_DEBUG, sdkp, "Synchronizing SCSI cache\n");
ret = sd_sync_cache(sdkp);
if (ret) {
/* ignore OFFLINE device */

View file

@ -1515,9 +1515,6 @@ sg_add_device(struct device *cl_dev, struct class_interface *cl_intf)
} else
pr_warn("%s: sg_sys Invalid\n", __func__);
sdev_printk(KERN_NOTICE, scsidp, "Attached scsi generic sg%d "
"type %d\n", sdp->index, scsidp->type);
dev_set_drvdata(cl_dev, sdp);
return 0;