OSDN Git Service

megaraid_sas : Do not scan non syspd drives
authorSumit.Saxena@avagotech.com <Sumit.Saxena@avagotech.com>
Fri, 12 Sep 2014 13:27:13 +0000 (18:57 +0530)
committerChristoph Hellwig <hch@lst.de>
Tue, 16 Sep 2014 16:14:22 +0000 (09:14 -0700)
commit07e38d94ef3646ccee4f222ae1f3033bb37f7fa0
tree7fb8b292b6d82327545efd528463fe751824c75f
parentb65f1d4da7df44835bd0a2452332e253a5c66d9b
megaraid_sas : Do not scan non syspd drives

Resending the patch. Addressed the review comments from Tomas Henzl.

Current driver allow device scan for all the devices on channel 0 and 1.
E.a If we have two single drive raid volumes, we may see prints like below.
First two prints are for physical device which are used to form VD.
Prints like this creates confusion as it is really not required to scan any
hidden physical devices.

scsi1 : LSI SAS based MegaRAID driver
scsi 1:0:0:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
scsi 1:0:1:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
scsi 1:2:0:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
scsi 1:2:1:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5

When slave_alloc called, sdev-type will not be set, so current code will always
return "0" in slave_alloc callback.
This patch make sure that driver return "-ENXIO" for non-syspd devices.

After this patch, we will see prints in syslog only for devices which are exposed.
For current example, below print will be available in syslog.

scsi1 : LSI SAS based MegaRAID driver
scsi 1:2:0:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
scsi 1:2:1:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/megaraid/megaraid_sas_base.c