BACKPORT: FROMLIST: scsi: sd: Contribute to randomness when running rotational device

Currently a scsi device won't contribute to kernel randomness when it
uses blk-mq. Since we commonly use scsi on rotational device with
blk-mq, it make sense to keep contributing to kernel randomness in these
cases. This is especially important for virtual machines.

commit b5b6e8c8d3b4 ("scsi: virtio_scsi: fix IO hang caused by automatic
irq vector affinity") made all virtio-scsi device to use blk-mq, which
does not contribute to randomness today. So for a virtual machine only
having virtio-scsi disk (which is common), it will simple stop getting
randomness from its disks in today's implementation.

With this patch, if the above VM has rotational virtio-scsi device, then
it can still benefit from the entropy generated from the disk.

Reported-by: Xuewei Zhang <xueweiz@google.com>
Signed-off-by: Xuewei Zhang <xueweiz@google.com>

BUG=b:113183351
TEST=COS validation test

(am from https://patchwork.kernel.org/patch/10591031/)

Change-Id: Ia1822f1ec9f1887474e7c67edd695d6f1bfb823e
Reviewed-on: https://chromium-review.googlesource.com/1212547
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Commit-Queue: Xuewei Zhang <xueweiz@google.com>
Tested-by: Xuewei Zhang <xueweiz@google.com>
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 4a53231..7998709 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2968,6 +2968,9 @@
 	if (rot == 1) {
 		queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
 		queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, q);
+	} else {
+		queue_flag_clear_unlocked(QUEUE_FLAG_NONROT, q);
+		queue_flag_set_unlocked(QUEUE_FLAG_ADD_RANDOM, q);
 	}
 
 	if (sdkp->device->type == TYPE_ZBC) {