From 628aaf1ba9b1c99fce40a0a3b958201024884597 Mon Sep 17 00:00:00 2001 From: Subhash Jadavani Date: Wed, 15 Jul 2015 16:42:49 -0700 Subject: [PATCH] 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 --- drivers/scsi/scsi_scan.c | 7 +------ drivers/scsi/sd.c | 29 ----------------------------- drivers/scsi/sg.c | 3 --- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 32060a418a62..7808ef94ff07 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -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) { diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 79cef194b9a1..ffcbe2e89e97 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -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 */ diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 503ab8b46c0b..57bdf8087fde 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -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;