scsi: ses: don't ask for diagnostic pages repeatedly during probe
authorLi Dongyang <dongyang.li@anu.edu.au>
Mon, 13 Nov 2017 23:48:04 +0000 (10:48 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 07:42:51 +0000 (08:42 +0100)
commit65722e73086da79b107b1022ce9b07d2402efa2d
tree8f29f2b2b02594783cd07c6649d90184c0d64e8c
parent5d8c64ea75f3c9b3a5ba09ec37bd73a720d92b2e
scsi: ses: don't ask for diagnostic pages repeatedly during probe

[ Upstream commit 9c0a50022b8ac7e863e6ec8342fa476fe5d1d75c ]

We are testing if there is a match with the ses device in a loop by
calling ses_match_to_enclosure(), which will issue scsi receive
diagnostics commands to the ses device for every device on the same
host.  On one of our boxes with 840 disks, it takes a long time to load
the driver:

[root@g1b-oss06 ~]# time modprobe ses

real 40m48.247s
user 0m0.001s
sys 0m0.196s

With the patch:

[root@g1b-oss06 ~]# time modprobe ses

real 0m17.915s
user 0m0.008s
sys 0m0.053s

Note that we still need to refresh page 10 when we see a new disk to
create the link.

Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Tested-by: Jason Ozolins <jason.ozolins@hpe.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/ses.c