public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Praveen Murali <pmurali@logicube.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>
Subject: Re: [libsas] Kernel Crash in smp_execute_task
Date: Wed, 04 Mar 2015 16:18:33 -0800	[thread overview]
Message-ID: <1425514713.7581.46.camel@HansenPartnership.com> (raw)
In-Reply-To: <68a5e8f0ce4f4630bafe5f3505334f3e@EX01.lg.local>

On Wed, 2015-03-04 at 23:29 +0000, Praveen Murali wrote:
> On second thoughts, should we even let smp commands/requests thru for
> sas end devices (dev->dev_type == SAS_END_DEV) ? if so, wont the
> following patch more sense? (also, in my last mail the kernel logs
> were all messed up; sorry dint realize that when I sent the mail.
> Trying to fix it here)

I think the bug is deeper than this: we shouldn't be trying expander
revalidation on non-expander devices.  If the device changes from end to
expander via hotplug, we'll see the remove and add (via the identify
frame) so the device type should be correct by the time we do the
revalidation.

Does this fix the problem?

James

---
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index 62b58d3..60de662 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -500,6 +500,7 @@ static void sas_revalidate_domain(struct work_struct *work)
 	struct sas_discovery_event *ev = to_sas_discovery_event(work);
 	struct asd_sas_port *port = ev->port;
 	struct sas_ha_struct *ha = port->ha;
+	struct domain_device *ddev = port->port_dev;
 
 	/* prevent revalidation from finding sata links in recovery */
 	mutex_lock(&ha->disco_mutex);
@@ -514,8 +515,9 @@ static void sas_revalidate_domain(struct work_struct *work)
 	SAS_DPRINTK("REVALIDATING DOMAIN on port %d, pid:%d\n", port->id,
 		    task_pid_nr(current));
 
-	if (port->port_dev)
-		res = sas_ex_revalidate_domain(port->port_dev);
+	if (ddev && (ddev->dev_type == SAS_FANOUT_EXPANDER_DEVICE ||
+		     ddev->dev_type == SAS_EDGE_EXPANDER_DEVICE))
+		res = sas_ex_revalidate_domain(ddev);
 
 	SAS_DPRINTK("done REVALIDATING DOMAIN on port %d, pid:%d, res 0x%x\n",
 		    port->id, task_pid_nr(current), res);




  parent reply	other threads:[~2015-03-05  0:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 21:42 [libsas] Kernel Crash in smp_execute_task Praveen Murali
2015-03-04 23:29 ` Praveen Murali
2015-03-04 23:59   ` Douglas Gilbert
2015-03-05  0:56     ` Praveen Murali
2015-03-05  0:18   ` James Bottomley [this message]
2015-03-05  0:44     ` Praveen Murali
2015-03-05  1:04       ` James Bottomley
2015-03-05  1:43         ` Praveen Murali

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=1425514713.7581.46.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=pmurali@logicube.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