All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	Don Brace <don.brace@microsemi.com>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>,
	Hannes Reinecke <hare@suse.com>
Subject: [PATCH] hpsa: expose enclosures
Date: Fri,  2 Dec 2016 11:36:33 +0100	[thread overview]
Message-ID: <1480674993-118324-1-git-send-email-hare@suse.de> (raw)

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.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/hpsa.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 3783ef6..b9e05b3 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -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;
-- 
1.8.5.6


             reply	other threads:[~2016-12-02 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 10:36 Hannes Reinecke [this message]
2016-12-02 11:39 ` [PATCH] hpsa: expose enclosures Christoph Hellwig
2016-12-02 11:41   ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480674993-118324-1-git-send-email-hare@suse.de \
    --to=hare@suse.de \
    --cc=don.brace@microsemi.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.