public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: Scott O'Connor <soconnor@sanblaze.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: scsi_transport_sas and device hotplug
Date: Fri, 19 May 2006 10:49:37 -0500	[thread overview]
Message-ID: <1148053777.3410.41.camel@mulgrave.il.steeleye.com> (raw)
In-Reply-To: <446DC84B.1070203@sanblaze.com>

On Fri, 2006-05-19 at 09:29 -0400, Scott O'Connor wrote:
> With a LSI1068 (SAS) card, I'm trying to do device hotplug.
> Back in the day I used the /proc calls below to hotplug a device.
> 
> scsi remove-single-device <args>
> scsi add_single-device <args>
> 
> With 2.6.16-1 kernel, the "remove" call below works, the /dev/sd*
> structure is removed.
> 
> echo scsi remove-single-device 0 07 00 00 > /proc/scsi/scsi
> 
> However, this does not add the device back (the /dev/sd* node
> is not created):
> 
> echo scsi add-single-device 0 07 00 00 > /proc/scsi/scsi
> 
> I see the scsi_proc.c to scsi_transport_sas.c user_scan transport
> layer code and it seems hooked up properly.  Before I debug, has
> anyone else seen a problem here?

Actually, when I try this with 2.6.17-rc4, I get a BUG triggered in the
transport class at line 579 ... it's finding the wrong device in the
user_scan callback.

Does this attached patch fix it for you?

James

diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -955,7 +955,8 @@ static int sas_user_scan(struct Scsi_Hos
 	list_for_each_entry(rphy, &sas_host->rphy_list, list) {
 		struct sas_phy *parent = dev_to_phy(rphy->dev.parent);
 
-		if (rphy->scsi_target_id == -1)
+		if (rphy->identify.device_type != SAS_END_DEVICE ||
+		    rphy->scsi_target_id == -1)
 			continue;
 
 		if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) &&



      reply	other threads:[~2006-05-19 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-19 13:29 scsi_transport_sas and device hotplug Scott O'Connor
2006-05-19 15:49 ` James Bottomley [this message]

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=1148053777.3410.41.camel@mulgrave.il.steeleye.com \
    --to=james.bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=soconnor@sanblaze.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