Skip to contentSkip to conversation

scsi_scan.c reports 'target allocation failed, error -6' w/ mptsas

DISCUSSION Sander Smeenk 2 participants 5 messages Jan 18, 2012 – Feb 2, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

i'm experiencing issues while hot(re)plugging SAS-drives in a server running 2.6.32-37 (stock Ubuntu Lucid). The disks are connected to an LSI Logic / Symbios Logic SAS1064 PCI-X Fusion-MPT SAS HBA (1000:0500 r2) Google has no information at all on this specific errormessage.

Situation:
The server is running on 4xSAS drives with the mptsas module, disks are JBODed to the OS, the OS has them in mdadm software raid.

Each disk needs to be replaced so i unconfigure one in mdadm, ask the kernel to 'delete' the device node:
| # echo 1 > /sys/block/sdN/device/delete

And then i pull the disk after which the kernel logs:

| scsi: killing requests for dead queue
| scsi target4:0:1: mptsas: ioc0: delete device: fw_channel 0, fw_id 1,
|                   phy 1, sas_addr 0x500000e019670902

When i reseat the replacement disk, nothing gets logged. When i then ask the kernel to rescan the scsi bus on host4, the kernel logs an error:

| # echo '- - -' > /sys/class/scsi_host/host4/scan | scsi target4:0:4: target allocation failed, error -6

The replacement drive will not be available to the OS until the system is rebooted after which the drive works like a charm.

The error message is produced in drivers/scsi/scsi_scan.c but i believe the target_alloc() call comes from the drivers/scsi/mtpsas/mptsas.c driver. Unfortunately my kernelhack-fu is lacking to look into this further. As stated, Google has no information about this either.

Anyone on this list with clues as to why this happens or how to circumvent it from happening with the other three disks?

Thanks,
With regards,
-Sander.

Signature · 2 lines
| How do you write zero in Roman numerals?
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2
#1 lore raw

Request you to provide the response of "modinfo mptsas". Also please capture the logs with the scsi logging set to 0x180000DB. "echo 0x180000db > /proc/sys/dev/scsi/logging_level".

And mptsas debug level set to 0x3f8
"echo 3f8 > /sys/module/mptbase/parameters/mpt_debug_level"

Regards,
Nagalakshmi

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sander Smeenk
Sent: Wednesday, January 18, 2012 3:37 PM
To: [email protected]
Subject: scsi_scan.c reports 'target allocation failed, error -6' w/ mptsas

Hi,

i'm experiencing issues while hot(re)plugging SAS-drives in a server running 2.6.32-37 (stock Ubuntu Lucid). The disks are connected to an LSI Logic / Symbios Logic SAS1064 PCI-X Fusion-MPT SAS HBA (1000:0500 r2) Google has no information at all on this specific errormessage.

Situation:
The server is running on 4xSAS drives with the mptsas module, disks are JBODed to the OS, the OS has them in mdadm software raid.

Each disk needs to be replaced so i unconfigure one in mdadm, ask the kernel to 'delete' the device node:
| # echo 1 > /sys/block/sdN/device/delete

And then i pull the disk after which the kernel logs:

| scsi: killing requests for dead queue
| scsi target4:0:1: mptsas: ioc0: delete device: fw_channel 0, fw_id 1,
|                   phy 1, sas_addr 0x500000e019670902

When i reseat the replacement disk, nothing gets logged. When i then ask the kernel to rescan the scsi bus on host4, the kernel logs an error:

| # echo '- - -' > /sys/class/scsi_host/host4/scan | scsi target4:0:4: target allocation failed, error -6

The replacement drive will not be available to the OS until the system is rebooted after which the drive works like a charm.

The error message is produced in drivers/scsi/scsi_scan.c but i believe the target_alloc() call comes from the drivers/scsi/mtpsas/mptsas.c driver. Unfortunately my kernelhack-fu is lacking to look into this further. As stated, Google has no information about this either.

Anyone on this list with clues as to why this happens or how to circumvent it from happening with the other three disks?

Thanks,
With regards,
-Sander.

Signature · 6 lines
| How do you write zero in Roman numerals?
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

Quoting Nandigama, Nagalakshmi ([email protected]):

Sorry for the delay. We're all busy. :-)

Quoted 5 lines

request you to provide the response of "modinfo mptsas". Also please capture the logs with the scsi logging set to 0x180000DB. "echo 0x180000db > /proc/sys/dev/scsi/logging_level".
And mptsas debug level set to 0x3f8
"echo 3f8 > /sys/module/mptbase/parameters/mpt_debug_level"

This generated a lot of output, please find it in this paste:
http://8n1.org/raw/8314/8fd6

With this disk i did *NOT* do:

| echo 1 >/sys/block/sdN/deviCe/delete

before pulling the old drive from the system. This might well be related as the new disk was detected properly after inserting and scanning this time.

Thanks for your time!

With regards,
-Sander.

Signature · 2 lines
| Do people in Australia call the rest of the world "up over"?
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2
Acked-by Desai, Kashyap
#3 lore raw
In reply to Sander Smeenk

Sander, can you apply the attached patch and redo the test.

Regards,
Nagalakshmi

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sander Smeenk
Sent: Wednesday, January 18, 2012 3:37 PM
To: [email protected]
Subject: scsi_scan.c reports 'target allocation failed, error -6' w/ mptsas

Hi,

i'm experiencing issues while hot(re)plugging SAS-drives in a server running 2.6.32-37 (stock Ubuntu Lucid). The disks are connected to an LSI Logic / Symbios Logic SAS1064 PCI-X Fusion-MPT SAS HBA (1000:0500 r2) Google has no information at all on this specific errormessage.

Situation:
The server is running on 4xSAS drives with the mptsas module, disks are JBODed to the OS, the OS has them in mdadm software raid.

Each disk needs to be replaced so i unconfigure one in mdadm, ask the kernel to 'delete' the device node:
| # echo 1 > /sys/block/sdN/device/delete

And then i pull the disk after which the kernel logs:

| scsi: killing requests for dead queue
| scsi target4:0:1: mptsas: ioc0: delete device: fw_channel 0, fw_id 1,
|                   phy 1, sas_addr 0x500000e019670902

When i reseat the replacement disk, nothing gets logged. When i then ask the kernel to rescan the scsi bus on host4, the kernel logs an error:

| # echo '- - -' > /sys/class/scsi_host/host4/scan | scsi target4:0:4: target allocation failed, error -6

The replacement drive will not be available to the OS until the system is rebooted after which the drive works like a charm.

The error message is produced in drivers/scsi/scsi_scan.c but i believe the target_alloc() call comes from the drivers/scsi/mtpsas/mptsas.c driver. Unfortunately my kernelhack-fu is lacking to look into this further. As stated, Google has no information about this either.

Anyone on this list with clues as to why this happens or how to circumvent it from happening with the other three disks?

Thanks,
With regards,
-Sander.

Signature · 6 lines
| How do you write zero in Roman numerals?
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

From 3e84beba608dee5a7c7711a3503eb2f335c78fca Mon Sep 17 00:00:00 2001
From: Kei Tokunaga <[email protected]>
Date: Wed, 7 Apr 2010 19:17:24 +0900
Subject: [PATCH] [SCSI] mptsas: fixed hot-removal processing

This patch fixes mptsas disk hot-removal processing. The hot-removal processing doesn't complete because of this condition.

drivers/message/fusion/mptsas.c:
mptsas_taskmgmt_complete()

  if ((mptsas_find_vtarget(ioc, channel, id)) && !ioc->fw_events_off)
    mptsas_queue_device_delete(...);

mptsas_queue_device_delete(), which must be called for hot-removal, never gets called because mptsas_find_vtarget() always returns 0 here. At that time, the vtarget has already been freed in mptsas_target_destroy(), and also the scsi_device has been marked as SDEV_DEL.

As a result of the issue, port deletion functions won't get called and the device ends up being in an incomplete state. (Some data structures and sysfs entries, which should be removed in hot-removal, remain.) One side effect of this is that a hot-addition of the device (bringing the device back on) fails.

This patch just removes mptsas_find_vtarget() from the if-state condition.

---
 drivers/message/fusion/mptsas.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/message/fusion/mptsas.c +1 -1
index f42781b..46cc90c 100644
@@ -1261,7 +1261,7 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
 	 * enable work queue to remove device from upper layers
 	 */
 	list_del(&target_reset_list->list);
-	if ((mptsas_find_vtarget(ioc, channel, id)) && !ioc->fw_events_off)
+	if (!ioc->fw_events_off)
 		mptsas_queue_device_delete(ioc,
 			&target_reset_list->sas_event_data);
 
Signature · 1 line
1.7.6.5
#4 lore raw
Quoted 1 line · Nandigama, Nagalakshmi

Sander, can you apply the attached patch and redo the test.

Thanks a bundle. I had to test this on a different machine but i could reproduce the problem there too. This patch fixes the issues. The drive can now be removed an replaced withouth the 'target allocation failed' messages appearing.

Thanks a lot!

With regards,
-Sander.

Signature · 2 lines
| Man who scratches ass should not bite fingernail.
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2