All of lore.kernel.org
 help / color / mirror / Atom feed
* aic94xx or libsas crash on X7DB3 supermicro with enclosure and sata drives
@ 2007-11-30  9:22 Krzysztof Błaszkowski
  2007-11-30 21:33 ` Darrick J. Wong
  0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Błaszkowski @ 2007-11-30  9:22 UTC (permalink / raw)
  To: linux-scsi; +Cc: Vladislav Bolkhovitin

Hello all,

I noticed this according to syslog. furthermore if aic94xx is connected to 
single sata drive only then there is no crash but device is not recognized 
too. (mysterious: "ERROR: Unidentified device type 5").

A crash recorded in syslog:

aic94xx: Adaptec aic94xx SAS/SATA driver version 1.0.3 loaded
ACPI: PCI Interrupt 0000:04:02.0[A] -> GSI 16 (level, low) -> IRQ 16
aic94xx: found Adaptec AIC-9410W SAS/SATA Host Adapter, device 0000:04:02.0
scsi6 : aic94xx
PM: Adding info for No Bus:host6
PM: Adding info for No Bus:0000:04:02.0
PM: Removing info for No Bus:0000:04:02.0
aic94xx: Found sequencer Firmware version 1.1 (V30)
aic94xx: device 0000:04:02.0: SAS addr 500304800004ce20, PCBA SN ORG, 8 phys, 
8 enabled phys, flash present, BIOS build 1822
PM: Adding info for No Bus:phy-6:0

<snip>

BUG: unable to handle kernel NULL pointer dereference at virtual address 
00000074
 printing eip:
f8e2daf9
*pde = 00000000
Oops: 0000 [#1]
SMP 
Modules linked in: aic94xx firmware_class libsas scsi_transport_sas nfsd 
exportfs nvram speedstep_lib freq_table thermal processor fan button battery 
edd ac ipv6 evdev joydev sr_mod ide_cd cdrom e1000 ehci_hcd i2c_i801 uhci_hcd 
rng_core dm_mod usbcore
CPU:    0
EIP:    0060:[<f8e2daf9>]    Not tainted VLI
EFLAGS: 00010286   (2.6.22.8 #6)
EIP is at sas_rphy_add+0x9/0x100 [scsi_transport_sas]
eax: 00000000   ebx: 00000000   ecx: 00000004   edx: 00000282
esi: f2d8c080   edi: 00000000   ebp: f2d8c080   esp: f33bbe84
ds: 007b   es: 007b   fs: 00d8  gs: 0000  ss: 0068
Process scsi_wq_6 (pid: 8265, ti=f33ba000 task=f5712a90 task.ti=f33ba000)
Stack: f2d8c080 00000000 00000000 f2d8c080 f2d8c0d7 f2d8c080 f8e8bdc2 f46b49e0 
       f2d8c114 f8e8d040 f7c4446c f704e724 f704e6c0 00000000 00000001 00000000 
       f46b49fc f8e8d741 f7c44438 00000000 f33bbedc 402e9267 f7c44380 ffffffed 
Call Trace:
 [<f8e8bdc2>] sas_discover_sata+0x42/0x80 [libsas]
 [<f8e8d040>] sas_ex_discover_end_dev+0x120/0x2d0 [libsas]
 [<f8e8d741>] sas_ex_discover_dev+0x2d1/0x470 [libsas]
 [<402e9267>] attribute_container_device_trigger+0xa7/0xb0
 [<f8e8daa3>] sas_ex_discover_devices+0x83/0xb0 [libsas]
 [<f8e8e6d3>] sas_ex_level_discovery+0x43/0x70 [libsas]
 [<f8e8e71b>] sas_ex_bfs_disc+0x1b/0x30 [libsas]
 [<f8e8e76e>] sas_discover_root_expander+0x3e/0x80 [libsas]
 [<f8e8bf40>] sas_discover_domain+0x0/0xc0 [libsas]
 [<f8e8bfea>] sas_discover_domain+0xaa/0xc0 [libsas]
 [<40131541>] run_workqueue+0x71/0x100
 [<4013167c>] worker_thread+0xac/0x110
 [<401352a0>] autoremove_wake_function+0x0/0x50
 [<401352a0>] autoremove_wake_function+0x0/0x50
 [<401315d0>] worker_thread+0x0/0x110
 [<40134d24>] kthread+0x64/0xa0
 [<40134cc0>] kthread+0x0/0xa0
 [<401048b7>] kernel_thread_helper+0x7/0x10
 =======================
Code: f0 83 c4 1c 5b 5e 5f 5d c3 0f 0b 8d b4 26 00 00 00 00 eb fe 8d b4 26 00 
00 00 00 8d bc 27 00 00 00 00 55 57 89 c7 56 53 83 ec 08 <8b> 70 74 8b 5e 74 
eb 0b 8b 43 74 31 d2 85 c0 74 13 89 c3 89 d8 
EIP: [<f8e2daf9>] sas_rphy_add+0x9/0x100 [scsi_transport_sas] SS:ESP 
0068:f33bbe84


let me know if you need any more information. i used latest firmware available 
from Adaptec's site.

Best regards,
Krzysztof Blaszkowski

Systemy mikroprocesorowe
Storrady 1
PL71602 Szczecin, Poland
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH] libsas: Don't issue commands to devices that have been hot-removed
@ 2010-10-01 20:55 Dan Williams
  0 siblings, 0 replies; 15+ messages in thread
From: Dan Williams @ 2010-10-01 20:55 UTC (permalink / raw)
  To: james.bottomley
  Cc: Haipao Fan, linux-scsi, Jeff Garzik, Maciej Trela,
	Patrick Thomson, Jeff Skirvin, Brian King, Darrick J. Wong

From: Darrick J. Wong <djwong@us.ibm.com>

sd will get hung up issuing commands to flush write cache if a SAS
device behind the expander is unplugged without warning.  Change libsas
to reject commands to domain devices that have already gone away.

[maciej.trela@intel.com: removed setting ->gone in sas_deform_port() to
 permit sync cache commands at module removal]

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
linux-scsi-reference: <20071204223516.GA6767@tree.beaverton.ibm.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Patrick Thomson <patrick.s.thomson@intel.com>
Cc: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Tested-by: Haipao Fan <haipao.fan@intel.com>
Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/scsi/libsas/sas_ata.c       |    4 ++++
 drivers/scsi/libsas/sas_expander.c  |    3 +++
 drivers/scsi/libsas/sas_scsi_host.c |    7 +++++++
 include/scsi/libsas.h               |    1 +
 4 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 042153c..da2e740 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -162,6 +162,10 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
 	unsigned int xfer = 0;
 	unsigned int si;
 
+	/* If the device fell off, no sense in issuing commands */
+	if (dev->gone)
+		return AC_ERR_SYSTEM;
+
 	task = sas_alloc_task(GFP_ATOMIC);
 	if (!task)
 		return AC_ERR_SYSTEM;
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 83dd507..61d81f8 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -1724,6 +1724,7 @@ static void sas_unregister_ex_tree(struct domain_device *dev)
 	struct domain_device *child, *n;
 
 	list_for_each_entry_safe(child, n, &ex->children, siblings) {
+		child->gone = 1;
 		if (child->dev_type == EDGE_DEV ||
 		    child->dev_type == FANOUT_DEV)
 			sas_unregister_ex_tree(child);
@@ -1744,6 +1745,7 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
 			&ex_dev->children, siblings) {
 			if (SAS_ADDR(child->sas_addr) ==
 			    SAS_ADDR(phy->attached_sas_addr)) {
+				child->gone = 1;
 				if (child->dev_type == EDGE_DEV ||
 				    child->dev_type == FANOUT_DEV)
 					sas_unregister_ex_tree(child);
@@ -1752,6 +1754,7 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
 				break;
 			}
 		}
+		parent->gone = 1;
 		sas_disable_routing(parent, phy->attached_sas_addr);
 	}
 	memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index f0cfba9..1787bd2 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -228,6 +228,13 @@ int sas_queuecommand(struct scsi_cmnd *cmd,
 			goto out;
 		}
 
+		/* If the device fell off, no sense in issuing commands */
+		if (dev->gone) {
+			cmd->result = DID_BAD_TARGET << 16;
+			scsi_done(cmd);
+			goto out;
+		}
+
 		res = -ENOMEM;
 		task = sas_create_task(cmd, dev, GFP_ATOMIC);
 		if (!task)
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index d06e13b..3dec194 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -205,6 +205,7 @@ struct domain_device {
         };
 
         void *lldd_dev;
+	int gone;
 };
 
 struct sas_discovery_event {


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-10-01 20:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-30  9:22 aic94xx or libsas crash on X7DB3 supermicro with enclosure and sata drives Krzysztof Błaszkowski
2007-11-30 21:33 ` Darrick J. Wong
2007-12-03 15:11   ` Krzysztof Błaszkowski
2007-12-03 16:09   ` Krzysztof Błaszkowski
2007-12-03 19:36     ` Darrick J. Wong
2007-12-03 19:43       ` Jeff Garzik
2007-12-03 21:31         ` Darrick J. Wong
2007-12-03 20:06       ` Krzysztof Błaszkowski
2007-12-04 22:35         ` [PATCH] libsas: Don't issue commands to devices that have been hot-removed Darrick J. Wong
2007-12-04 22:48           ` Jeff Garzik
2007-12-04 23:17             ` Darrick J. Wong
2007-12-04 23:40               ` Jeff Garzik
2007-12-06 16:55               ` Brian King
2008-02-25 23:39               ` Jeff Garzik
2010-10-01 20:55 Dan Williams

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.