diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 2c91524ece7..7206fa5db32 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2332,6 +2332,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer) { int len = 0, res; struct scsi_device *sdp = sdkp->device; + struct Scsi_Host *host = sdp->host; int dbd; int modepage; @@ -2363,7 +2364,10 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer) dbd = 8; } else { modepage = 8; - dbd = 0; + if (host->set_dbd_for_caching) + dbd = 8; + else + dbd = 0; } /* cautiously ask */ diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 8cbadbde368..c776e368075 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -685,6 +685,13 @@ struct Scsi_Host { * units along with standard LUs. */ unsigned report_wlus:1; + + /* + * Set "DBD" field in mode_sense caching mode page in case it is + * mandatory by LLD standard. + */ + unsigned set_dbd_for_caching:1; + /* * Optional work queue to be utilized by the transport */