Skip to contentSkip to conversation

hpsa: expose enclosures

PATCH Superseded Hannes Reinecke 2 participants 3 messages Dec 2, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hpsa: expose enclosures

Some servers have a built-in enclosure which will show up on the same bus as the internal physical devices. As the driver doesn't differentiate here they'll be hidden from the OS.
This patch add a module parameter 'hpsa_expose_enclosure' which will expose these enclosures.

---
 drivers/scsi/hpsa.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/scsi/hpsa.c +9 -1
index 3783ef6..b9e05b3 100644
@@ -90,6 +90,10 @@
 module_param(hpsa_simple_mode, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(hpsa_simple_mode,
 	"Use 'simple mode' rather than 'performant mode'");
+static int hpsa_expose_enclosure;
+module_param(hpsa_expose_enclosure, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(hpsa_expose_enclosure,
+	     "Expose enclosure devices to the OS");
 
 /* define the PCI info for the cards we can control */
 static const struct pci_device_id hpsa_pci_device_id[] = {
@@ -4417,7 +4421,11 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h)
 		 * Expose all devices except for physical devices that
 		 * are masked.
 		 */
-		if (MASKED_DEVICE(lunaddrbytes) && this_device->physical_device)
+		if (hpsa_expose_enclosure &&
+		    this_device->devtype == TYPE_ENCLOSURE)
+			this_device->expose_device = 1;
+		else if (MASKED_DEVICE(lunaddrbytes) &&
+			 this_device->physical_device)
 			this_device->expose_device = 0;
 		else
 			this_device->expose_device = 1;
Signature · 1 line
1.8.5.6
#1 lore raw
Quoted 5 lines · Hannes Reinecke

Some servers have a built-in enclosure which will show up on the same bus as the internal physical devices. As the driver doesn't differentiate here they'll be hidden from the OS.
This patch add a module parameter 'hpsa_expose_enclosure' which will expose these enclosures.

Any reason for not doing this unconditionally?

#2 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Hannes Reinecke

Some servers have a built-in enclosure which will show up on the same bus as the internal physical devices. As the driver doesn't differentiate here they'll be hidden from the OS.
This patch add a module parameter 'hpsa_expose_enclosure' which will expose these enclosures.

Any reason for not doing this unconditionally?

Backwards compability.
hpsa never did, so it _might_ be by design.
You never know :-)

I surely can make this the default if Don agrees.

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)