public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Malicki <jmalicki@metacarta.com>
To: megaraidlinux@lsi.com, linux-poweredge <linux-poweredge@dell.com>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: megaraid_sas: Optionally add SCSI devices for individual disks in a raidset
Date: Tue, 19 Aug 2008 17:20:54 -0400 (EDT)	[thread overview]
Message-ID: <2834632.1190561219180854948.JavaMail.root@ouachita> (raw)

This is very dangerous, and you shouldn't use it/apply it unless you're feeling adventurous.

This lets one, optionally, add /dev/sg* devices, and optionally also /dev/sd* devices, for
disks in a RAIDset.  It is modeled after similar functionality in the aacraid driver.

I've been successfully using this to upgrade individual disk firmwares behind a Dell PERC 
RAID controller with sgdskfl from scsirastools - AFTER the RAID array has been stopped
with other tools.

Use the kernel option "megaraid_sas.export_disks=-1" to get /dev/sg* devices.  Unless a
specific option has been given, the patch doesn't modify behavior.

Note that the driver currently says (and has said for some time):

         * FIXME: Currently we don't export them to the midlayer at all.
	 * 	  That will be fixed once LSI engineers have audited the
	 * 	  firmware for possible issues.

So using this is certainly high risk and one should be careful.
(only signing off so others may feel free to use it, not encouraging this
to go anywhere unless LSI feels it's safe)

Signed-off-by: jmalicki@metacarta.com

------------
--- linux-2.6.26.2-orig/drivers/scsi/megaraid/megaraid_sas.c    2008-08-06 12:19:01.000000000 -0400
+++ linux-2.6.26.2/drivers/scsi/megaraid/megaraid_sas.c 2008-08-19 17:12:02.000000000 -0400
@@ -46,6 +46,12 @@
 #include <scsi/scsi_host.h>
 #include "megaraid_sas.h"

+static int export_disks = 0;
+module_param(export_disks, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(export_disks, "Export physical disks to the SCSI midlayer (DANGEROUS)"
+       " -1=protect 0=off 1=on");
+
+
 /*
  * poll_mode_io:1- schedule complete completion from q cmd
  */
@@ -905,8 +911,12 @@
         *        That will be fixed once LSI engineers have audited the
         *        firmware for possible issues.
         */
-       if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == TYPE_DISK)
-               return -ENXIO;
+       if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == TYPE_DISK)
{
+               if (export_disks < 0)
+                       sdev->no_uld_attach = 1;
+               else if (export_disks == 0)
+                       return -ENXIO;
+       }

        /*
         * The RAID firmware may require extended timeouts.
--------

             reply	other threads:[~2008-08-19 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-19 21:20 Joe Malicki [this message]
2008-08-20 19:53 ` megaraid_sas: Optionally add SCSI devices for individual disks in a raidset Yang, Bo
2008-08-24 14:51 ` Jochen Radmacher

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=2834632.1190561219180854948.JavaMail.root@ouachita \
    --to=jmalicki@metacarta.com \
    --cc=linux-poweredge@dell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=megaraidlinux@lsi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox