Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a62caa4f authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

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: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 35afb780
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -821,15 +821,10 @@ 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) {
		/* RBC and MMC devices can return SCSI-3 compliance and yet
		 * still not support REPORT LUNS, so make them act as
+0 −29
Original line number Diff line number Diff line
@@ -2285,11 +2285,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",
@@ -2339,7 +2334,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) {
@@ -2380,13 +2374,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]);
		}
	}
}

@@ -2406,10 +2393,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;
@@ -2534,15 +2517,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;
	}

@@ -2978,8 +2952,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);
}
@@ -3227,7 +3199,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 */
+0 −3
Original line number Diff line number Diff line
@@ -1539,9 +1539,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;