* mpt2sas regression: can not add disk...
@ 2011-11-22 3:12 Yinghai Lu
0 siblings, 0 replies; 8+ messages in thread
From: Yinghai Lu @ 2011-11-22 3:12 UTC (permalink / raw)
To: Nagalakshmi Nandigama, James Bottomley, Linux-Scsi
[ 42.047744] calling _scsih_init+0x0/0x175 @ 1
[ 42.052184] mpt2sas version 10.100.00.00 loaded
[ 42.057154] scsi0 : Fusion MPT SAS Host
[ 42.062299] mpt2sas 0000:40:00.0: PCI INT A -> GSI 40 (level, low) -> IRQ 40
[ 42.069351] mpt2sas 0000:40:00.0: setting latency timer to 64
[ 42.075094] mpt2sas0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED, total mem (8120880 kB)
[ 42.083052] alloc irq_desc for 100 on node 0
[ 42.087502] msi_compose_msg: mpt2sas 0000:40:00.0 irq 100 Set *IRTE* entry (P:1 FPD:0 Dst_Mode:1 Redir_hint:1 Trig_Mode:0 Dlvry_Mode:1 Avail:0 Vector:6A Dest:00000001 SID:4000 SQ:0 SVT:1)
[ 42.104342] mpt2sas 0000:40:00.0: irq 100 for MSI-X
[ 42.109238] ir_irq_set_affinity: mpt2sas 0000:40:00.0 irq 100 IRTE entry (P:1 FPD:0 Dst_Mode:1 Redir_hint:1 Trig_Mode:0 Dlvry_Mode:1 Avail:0 *Vector*:6A *Dest*:00000001 SID:4000 SQ:0 SVT:1)
[ 42.126264] mpt2sas0-msix0: PCI-MSI-X enabled: IRQ 100
[ 42.131397] mpt2sas0: iomem(0x00000000df500000), mapped(0xffffc90000c60000), size(16384)
[ 42.139480] mpt2sas0: ioport(0x0000000000007000), size(256)
[ 42.433031] mpt2sas0: sending diag reset !!
[ 43.564513] mpt2sas0: diag reset: SUCCESS
[ 43.712491] mpt2sas 0000:40:00.0: with iommu 1 : domain 3
[ 43.724243] mpt2sas0: Allocated physical memory: size(2255 kB)
[ 43.730069] mpt2sas0: Current Controller Queue Depth(1001), Max Controller Queue Depth(1024)
[ 43.738499] mpt2sas0: Scatter Gather Elements per IO(128)
[ 43.976988] mpt2sas0: LSISAS2008: FWVersion(11.00.02.00), ChipRevision(0x02), BiosVersion(07.21.03.00)
[ 43.986283] mpt2sas0: Protocol=(Initiator), Capabilities=(Raid,TLR,EEDP,Snapshot Buffer,Diag Trace Buffer,Task Set Full,NCQ)
[ 43.997760] mpt2sas0: sending port enable !!
[ 45.606943] mpt2sas0: host_add: handle(0x0001), sas_addr(0x500605b000fa9460), phys(8)
[ 51.724793] mpt2sas0: port enable: SUCCESS
[ 51.731423] scsi 0:0:0:0: Direct-Access SEAGATE ST930003SSUN300G 0768 PQ: 0 ANSI: 5
[ 51.739509] scsi 0:0:0:0: SSP: handle(0x0009), sas_addr(0x5000c5001364dfe1), phy(0), device_name(0x5000c5001364dfe0)
[ 51.750108] scsi 0:0:0:0: SSP: enclosure_logical_id(0x500605b000fa9460), slot(0)
[ 51.757496] scsi 0:0:0:0: qdepth(254), tagged(1), simple(0), ordered(0), scsi_level(6), cmd_que(1)
[ 51.768474] port-0:0: remove: sas_addr(0x5000c5001364dfe1)
[ 51.774051] port-0:0: remove: sas_addr(0x5000c5001364dfe1), phy(0)
[ 51.782940] mpt2sas0: removing handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 51.789895] mpt2sas0: failure at drivers/scsi/mpt2sas/mpt2sas_transport.c:705/mpt2sas_transport_port_add()!
[ 51.799920] initcall _scsih_init+0x0/0x175 returned 0 after 9523612 usecs
bisected to:
921cd8024b908f8f49f772c8d3a02381b4db2ed2 is the first bad commit
commit 921cd8024b908f8f49f772c8d3a02381b4db2ed2
Author: nagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>
Date: Wed Oct 19 15:36:26 2011 +0530
[SCSI] mpt2sas: New feature - Fast Load Support
New feature Fast Load Support.
(1)Asynchronous SCSI scanning: This will allow the drivers to scan
for devices in parallel while other device drivers are loading at
the same time. This will improve the amount of time it takes for the
OS to load.
(2) Reporting Devices while port enable is active: This feature will
allow devices to be reported to OS immediately while port enable is
active. The previous implementation waits for port enable to complete,
and then report devices. This feature is only enabled on IT firmware
configurations when there are no boot device configured in BIOS
Configuration
Utility, else the driver will wait till port enable completes reporting
devices. For IR firmware, this feature is turned off. This feature
is to
address large SAS topologies (>100 drives) when the boot OS is
using onboard
SATA device, in other words, the boot devices is not
connected to our controller.
(3) Scanning for devices after diagnostic reset completes: A new
routine
_scsih_scan_start is added. This will scan the expander pages, IR
pages,
and sas device pages, then reporting new devices to SCSI Mid layer. It
seems the driver is not supporting adding devices while diagnostic
reset
is active. Apparently this is due to the sanity checks on
ioc->shost_recovery flag throughout the context of kernel work
thread FIFO,
and the mpt2sas_fw_work.
Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
:040000 040000 1677fb01f359d74e0cca33f81d47a66906e91969
78cbc450d0224573f1bbf0d7427bbbbaeecb93d6 M drivers
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: mpt2sas regression: can not add disk...
[not found] <7863850E8C98C748980632D9D3B7C19911968B8AE5@inbmail02.lsi.com>
@ 2011-11-28 6:09 ` Nandigama, Nagalakshmi
2011-11-28 20:00 ` Yinghai Lu
0 siblings, 1 reply; 8+ messages in thread
From: Nandigama, Nagalakshmi @ 2011-11-28 6:09 UTC (permalink / raw)
To: linux-scsi-owner@vger.kernel.org
Cc: James Bottomley, linux-scsi@vger.kernel.org
Yinghai Lu,
Please set the driver logging level to 0x421F8 (echo 0x421F8 > /sys/module/mpt2sas/parameters/logging_level) and the scsi logging level to 0x180000F1 (echo 0x180000F1 > /proc/sys/dev/scsi/logging_level) and recreate the issue and provide the var/log/message
Regards,
Nagalakshmi
-----Original Message-----
From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Yinghai Lu
Sent: Tuesday, November 22, 2011 8:42 AM
To: Nandigama, Nagalakshmi; James Bottomley; Linux-Scsi
Subject: mpt2sas regression: can not add disk...
[ 42.047744] calling _scsih_init+0x0/0x175 @ 1
[ 42.052184] mpt2sas version 10.100.00.00 loaded
[ 42.057154] scsi0 : Fusion MPT SAS Host
[ 42.062299] mpt2sas 0000:40:00.0: PCI INT A -> GSI 40 (level, low) -> IRQ 40
[ 42.069351] mpt2sas 0000:40:00.0: setting latency timer to 64
[ 42.075094] mpt2sas0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED, total mem (8120880 kB)
[ 42.083052] alloc irq_desc for 100 on node 0
[ 42.087502] msi_compose_msg: mpt2sas 0000:40:00.0 irq 100 Set *IRTE* entry (P:1 FPD:0 Dst_Mode:1 Redir_hint:1 Trig_Mode:0 Dlvry_Mode:1 Avail:0 Vector:6A Dest:00000001 SID:4000 SQ:0 SVT:1)
[ 42.104342] mpt2sas 0000:40:00.0: irq 100 for MSI-X
[ 42.109238] ir_irq_set_affinity: mpt2sas 0000:40:00.0 irq 100 IRTE entry (P:1 FPD:0 Dst_Mode:1 Redir_hint:1 Trig_Mode:0 Dlvry_Mode:1 Avail:0 *Vector*:6A *Dest*:00000001 SID:4000 SQ:0 SVT:1)
[ 42.126264] mpt2sas0-msix0: PCI-MSI-X enabled: IRQ 100
[ 42.131397] mpt2sas0: iomem(0x00000000df500000), mapped(0xffffc90000c60000), size(16384)
[ 42.139480] mpt2sas0: ioport(0x0000000000007000), size(256)
[ 42.433031] mpt2sas0: sending diag reset !!
[ 43.564513] mpt2sas0: diag reset: SUCCESS
[ 43.712491] mpt2sas 0000:40:00.0: with iommu 1 : domain 3
[ 43.724243] mpt2sas0: Allocated physical memory: size(2255 kB)
[ 43.730069] mpt2sas0: Current Controller Queue Depth(1001), Max Controller Queue Depth(1024)
[ 43.738499] mpt2sas0: Scatter Gather Elements per IO(128)
[ 43.976988] mpt2sas0: LSISAS2008: FWVersion(11.00.02.00), ChipRevision(0x02), BiosVersion(07.21.03.00)
[ 43.986283] mpt2sas0: Protocol=(Initiator), Capabilities=(Raid,TLR,EEDP,Snapshot Buffer,Diag Trace Buffer,Task Set Full,NCQ)
[ 43.997760] mpt2sas0: sending port enable !!
[ 45.606943] mpt2sas0: host_add: handle(0x0001), sas_addr(0x500605b000fa9460), phys(8)
[ 51.724793] mpt2sas0: port enable: SUCCESS
[ 51.731423] scsi 0:0:0:0: Direct-Access SEAGATE ST930003SSUN300G 0768 PQ: 0 ANSI: 5
[ 51.739509] scsi 0:0:0:0: SSP: handle(0x0009), sas_addr(0x5000c5001364dfe1), phy(0), device_name(0x5000c5001364dfe0)
[ 51.750108] scsi 0:0:0:0: SSP: enclosure_logical_id(0x500605b000fa9460), slot(0)
[ 51.757496] scsi 0:0:0:0: qdepth(254), tagged(1), simple(0), ordered(0), scsi_level(6), cmd_que(1)
[ 51.768474] port-0:0: remove: sas_addr(0x5000c5001364dfe1)
[ 51.774051] port-0:0: remove: sas_addr(0x5000c5001364dfe1), phy(0)
[ 51.782940] mpt2sas0: removing handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 51.789895] mpt2sas0: failure at drivers/scsi/mpt2sas/mpt2sas_transport.c:705/mpt2sas_transport_port_add()!
[ 51.799920] initcall _scsih_init+0x0/0x175 returned 0 after 9523612 usecs
bisected to:
921cd8024b908f8f49f772c8d3a02381b4db2ed2 is the first bad commit
commit 921cd8024b908f8f49f772c8d3a02381b4db2ed2
Author: nagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>
Date: Wed Oct 19 15:36:26 2011 +0530
[SCSI] mpt2sas: New feature - Fast Load Support
New feature Fast Load Support.
(1)Asynchronous SCSI scanning: This will allow the drivers to scan
for devices in parallel while other device drivers are loading at
the same time. This will improve the amount of time it takes for the
OS to load.
(2) Reporting Devices while port enable is active: This feature will
allow devices to be reported to OS immediately while port enable is
active. The previous implementation waits for port enable to complete,
and then report devices. This feature is only enabled on IT firmware
configurations when there are no boot device configured in BIOS
Configuration
Utility, else the driver will wait till port enable completes reporting
devices. For IR firmware, this feature is turned off. This feature
is to
address large SAS topologies (>100 drives) when the boot OS is
using onboard
SATA device, in other words, the boot devices is not
connected to our controller.
(3) Scanning for devices after diagnostic reset completes: A new
routine
_scsih_scan_start is added. This will scan the expander pages, IR
pages,
and sas device pages, then reporting new devices to SCSI Mid layer. It
seems the driver is not supporting adding devices while diagnostic
reset
is active. Apparently this is due to the sanity checks on
ioc->shost_recovery flag throughout the context of kernel work
thread FIFO,
and the mpt2sas_fw_work.
Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
:040000 040000 1677fb01f359d74e0cca33f81d47a66906e91969
78cbc450d0224573f1bbf0d7427bbbbaeecb93d6 M drivers
--
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] 8+ messages in thread
* Re: mpt2sas regression: can not add disk...
2011-11-28 6:09 ` mpt2sas regression: can not add disk Nandigama, Nagalakshmi
@ 2011-11-28 20:00 ` Yinghai Lu
2011-12-07 0:15 ` Yinghai Lu
0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2011-11-28 20:00 UTC (permalink / raw)
To: Nandigama, Nagalakshmi
Cc: linux-scsi-owner@vger.kernel.org, James Bottomley,
linux-scsi@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
On Sun, Nov 27, 2011 at 10:09 PM, Nandigama, Nagalakshmi
<Nagalakshmi.Nandigama@lsi.com> wrote:
> Yinghai Lu,
>
> Please set the driver logging level to 0x421F8 (echo 0x421F8 > /sys/module/mpt2sas/parameters/logging_level) and the scsi logging level to 0x180000F1 (echo 0x180000F1 > /proc/sys/dev/scsi/logging_level) and recreate the issue and provide the var/log/message
>
please check two print out...
Yinghai
[-- Attachment #2: mpt2sas_fail_to_add_device.txt --]
[-- Type: text/plain, Size: 12444 bytes --]
[ 40.286612] calling _scsih_init+0x0/0x175 @ 1
[ 40.291054] mpt2sas version 10.100.00.00 loaded
[ 40.296017] scsi0 : Fusion MPT SAS Host
[ 40.301170] mpt2sas0: mpt2sas_base_attach
[ 40.305177] mpt2sas0: mpt2sas_base_map_resources
[ 40.309805] mpt2sas 0000:40:00.0: PCI INT A -> GSI 40 (level, low) -> IRQ 40
[ 40.316855] mpt2sas 0000:40:00.0: setting latency timer to 64
[ 40.322600] mpt2sas0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED, total mem (8120872 kB)
[ 40.330499] mpt2sas0: msix is supported, vector_count(1)
[ 40.335882] alloc irq_desc for 100 on node 0
[ 40.340333] mpt2sas 0000:40:00.0: irq 100 for MSI-X
[ 40.345265] mpt2sas0-msix0: PCI-MSI-X enabled: IRQ 100
[ 40.350405] mpt2sas0: iomem(0x00000000df500000), mapped(0xffffc90000c60000), size(16384)
[ 40.358485] mpt2sas0: ioport(0x0000000000007000), size(256)
[ 40.364102] mpt2sas0: _base_get_ioc_facts
[ 40.656411] offset:data
[ 40.658946] [0x00]:03100200
[ 40.661826] [0x04]:00001500
[ 40.664708] [0x08]:00000000
[ 40.667583] [0x0c]:00000000
[ 40.670461] [0x10]:00000000
[ 40.673338] [0x14]:00010280
[ 40.676219] [0x18]:27130400
[ 40.679097] [0x1c]:0000185c
[ 40.681975] [0x20]:0b000200
[ 40.684859] [0x24]:00000020
[ 40.687731] [0x28]:03400004
[ 40.690610] [0x2c]:00200020
[ 40.693486] [0x30]:00080002
[ 40.696358] [0x34]:0220ffe0
[ 40.699239] [0x38]:00800376
[ 40.702122] [0x3c]:00000009
[ 40.704999] mpt2sas0: hba queue depth(1024), max chains per io(128)
[ 40.711255] mpt2sas0: request frame size(128), reply frame size(128)
[ 40.717605] mpt2sas0: _base_make_ioc_ready
[ 40.721702] mpt2sas0: sending diag reset !!
[ 40.725885] mpt2sas0: clear interrupts
[ 40.729626] mpt2sas0: write magic sequence
[ 40.836346] mpt2sas0: wrote magic sequence: count(1), host_diagnostic(0x000000a0)
[ 40.843821] mpt2sas0: diag reset: issued
[ 40.900301] mpt2sas0: restart the adapter
[ 40.904310] mpt2sas0: disable writes to the diagnostic register
[ 40.910219] mpt2sas0: Wait for FW to go to the READY state
[ 41.871857] mpt2sas0: diag reset: SUCCESS
[ 41.875865] mpt2sas0: _base_get_port_facts
[ 42.023788] offset:data
[ 42.026322] [0x00]:05070000
[ 42.029204] [0x04]:00000000
[ 42.032088] [0x08]:00000000
[ 42.034968] [0x0c]:00000000
[ 42.037848] [0x10]:00000000
[ 42.040733] [0x14]:00003000
[ 42.043604] [0x18]:00000020
[ 42.046485] mpt2sas0: _base_allocate_memory_pools
[ 42.051189] mpt2sas0: scatter gather: sge_in_main_msg(1), sge_per_chain(9), sge_per_io(128), chains_per_io(15)
[ 42.061177] mpt2sas0: scsi host: can_queue depth (1001)
[ 42.066425] mpt2sas 0000:40:00.0: with iommu 1 : domain 3
[ 42.071862] mpt2sas0: request pool(0xffff880175e80000): depth(1024), frame_size(128), pool_size(128 kB)
[ 42.081240] mpt2sas0: request pool: dma(0xfffc0000)
[ 42.086119] mpt2sas0: scsiio(0xffff880175e80000): depth(1003)
[ 42.098073] mpt2sas0: chain pool depth(15045), frame_size(128), pool_size(1880 kB)
[ 42.105637] mpt2sas0: hi_priority(0xffff880175e9f600): depth(8), start smid(1004)
[ 42.113111] mpt2sas0: internal(0xffff880175e9fa00): depth(13), start smid(1012)
[ 42.120428] mpt2sas0: sense pool(0xffff8801763a0000): depth(1003), element_size(96), pool_size(94 kB)
[ 42.129631] mpt2sas0: sense_dma(0xffda0000)
[ 42.133838] mpt2sas0: reply pool(0xffff880175b40000): depth(1056), frame_size(128), pool_size(132 kB)
[ 42.143040] mpt2sas0: reply_dma(0xffd40000)
[ 42.147229] mpt2sas0: reply_free pool(0xffff880176388000): depth(1056), element_size(4), pool_size(4 kB)
[ 42.156694] mpt2sas0: reply_free_dma(0xffd3e000)
[ 42.161316] mpt2sas0: reply post free pool(0xffff880178b90000): depth(2080), element_size(8), pool_size(16 kB)
[ 42.171296] mpt2sas0: reply_post_free_dma = (0xffd30000)
[ 42.176601] mpt2sas0: config page(0xffff880175c0c000): size(512)
[ 42.182601] mpt2sas0: config_page_dma(0xffd2f000)
[ 42.187296] mpt2sas0: Allocated physical memory: size(2255 kB)
[ 42.193119] mpt2sas0: Current Controller Queue Depth(1001), Max Controller Queue Depth(1024)
[ 42.201546] mpt2sas0: Scatter Gather Elements per IO(128)
[ 42.206938] mpt2sas0: _base_make_ioc_operational
[ 42.211673] mpt2sas0: _base_send_ioc_init
[ 42.215677] offset:data
[ 42.218213] [0x00]:02000004
[ 42.221094] [0x04]:00000000
[ 42.223976] [0x08]:00000000
[ 42.226855] [0x0c]:14000200
[ 42.229736] [0x10]:00000000
[ 42.232621] [0x14]:00000000
[ 42.235499] [0x18]:00200000
[ 42.238383] [0x1c]:04200820
[ 42.241267] [0x20]:00000000
[ 42.244151] [0x24]:00000000
[ 42.247031] [0x28]:fffc0000
[ 42.249911] [0x2c]:00000000
[ 42.252797] [0x30]:ffd30000
[ 42.255682] [0x34]:00000000
[ 42.258561] [0x38]:ffd3e000
[ 42.261444] [0x3c]:00000000
[ 42.264326] [0x40]:ef1de7bc
[ 42.267206] [0x44]:00000133
[ 42.499571] offset:data
[ 42.502102] [0x00]:02050004
[ 42.504984] [0x04]:00000000
[ 42.507867] [0x08]:00000000
[ 42.510740] [0x0c]:00000000
[ 42.513620] [0x10]:00000000
[ 42.516505] mpt2sas0: _base_event_notification
[ 42.521004] mpt2sas0: _base_event_notification: complete
[ 42.526921] mpt2sas0: LSISAS2008: FWVersion(11.00.02.00), ChipRevision(0x02), BiosVersion(07.21.03.00)
[ 42.536213] mpt2sas0: Protocol=(Initiator), Capabilities=(Raid,TLR,EEDP,Snapshot Buffer,Diag Trace Buffer,Task Set Full,NCQ)
[ 42.547693] mpt2sas0: sending port enable !!
[ 44.158767] mpt2sas0: Discovery: (start)
[ 44.162740] mpt2sas0: SAS Enclosure Device Status Change
[ 44.168040] mpt2sas0: Discovery: (stop)
[ 44.171888] mpt2sas0: SAS Topology Change List
[ 44.176365] mpt2sas0: discovery event: (start)
[ 44.181866] phy-0:0: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 44.181867] attached_handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 44.195144] phy-0:1: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 44.195145] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.208421] phy-0:2: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 44.208422] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.221693] phy-0:3: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 44.221694] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.234968] phy-0:4: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 44.234969] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.248217] phy-0:5: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 44.248217] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.261489] phy-0:6: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 44.261490] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.274777] phy-0:7: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 44.274778] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.287675] mpt2sas0: host_add: handle(0x0001), sas_addr(0x500605b000fa9460), phys(8)
[ 44.295618] mpt2sas0: enclosure status change: (enclosure add)
[ 44.295618] handle(0x0001), enclosure logical id(0x500605b000fa9460) number slots(0)
[ 44.309259] mpt2sas0: discovery event: (stop)
[ 44.313635] mpt2sas0: sas topology change: (responding)
[ 44.318852] handle(0x0000), enclosure_handle(0x0001) start_phy(00), count(1)
[ 44.325985] phy(00), attached_handle(0x0009): target add: link rate: new(0x09), old(0x00)
[ 44.334238] mpt2sas0: updating handles for sas_host(0x500605b000fa9460)
[ 44.341093] phy-0:0: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.341094] link_rate(0x09), phy(0)
[ 44.341096] attached_handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 44.357103] phy-0:1: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.357104] link_rate(0x00), phy(1)
[ 44.357105] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.373098] phy-0:2: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.373099] link_rate(0x00), phy(2)
[ 44.373099] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.389099] phy-0:3: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.389100] link_rate(0x00), phy(3)
[ 44.389101] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.405100] phy-0:4: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.405101] link_rate(0x00), phy(4)
[ 44.405102] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.421103] phy-0:5: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.421104] link_rate(0x00), phy(5)
[ 44.421104] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.437100] phy-0:6: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.437101] link_rate(0x00), phy(6)
[ 44.437102] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.453100] phy-0:7: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.453100] link_rate(0x00), phy(7)
[ 44.453101] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 44.469217] phy-0:0: refresh: parent sas_addr(0x500605b000fa9460),
[ 44.469219] link_rate(0x09), phy(0)
[ 44.469220] attached_handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 44.485475] mpt2sas0: _scsih_sas_device_init_add: handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 44.494076] mpt2sas0: _scsih_determine_boot_device: current_boot_device(0x5000c5001364dfe1)
[ 45.158312] mpt2sas0: Discovery: (start)
[ 45.162249] mpt2sas0: SAS Topology Change List
[ 45.166690] mpt2sas0: discovery event: (start)
[ 45.171153] mpt2sas0: sas topology change: (responding)
[ 45.176371] handle(0x0000), enclosure_handle(0x0001) start_phy(01), count(7)
[ 45.183504] mpt2sas0: updating handles for sas_host(0x500605b000fa9460)
[ 45.190362] phy-0:0: refresh: parent sas_addr(0x500605b000fa9460),
[ 45.190363] link_rate(0x09), phy(0)
[ 45.190364] attached_handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 45.206367] phy-0:1: refresh: parent sas_addr(0x500605b000fa9460),
[ 45.206368] link_rate(0x00), phy(1)
[ 45.206368] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 45.222363] phy-0:2: refresh: parent sas_addr(0x500605b000fa9460),
[ 45.222364] link_rate(0x00), phy(2)
[ 45.222364] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 45.238364] phy-0:3: refresh: parent sas_addr(0x500605b000fa9460),
[ 45.238365] link_rate(0x00), phy(3)
[ 45.238365] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 45.254365] phy-0:4: refresh: parent sas_addr(0x500605b000fa9460),
[ 45.254365] link_rate(0x00), phy(4)
[ 45.254366] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 45.270367] phy-0:5: refresh: parent sas_addr(0x500605b000fa9460),
[ 45.270367] link_rate(0x00), phy(5)
[ 45.270368] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 45.286366] phy-0:6: refresh: parent sas_addr(0x500605b000fa9460),
[ 45.286367] link_rate(0x00), phy(6)
[ 45.286367] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 45.302363] phy-0:7: refresh: parent sas_addr(0x500605b000fa9460),
[ 45.302364] link_rate(0x00), phy(7)
[ 45.302364] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 45.408220] mpt2sas0: Discovery: (stop)
[ 45.412078] mpt2sas0: discovery event: (stop)
[ 50.280964] mpt2sas0: port enable: complete from worker thread
[ 50.292017] mpt2sas0: port enable: SUCCESS
[ 50.296458] port-0:0: add: handle(0x0009), sas_addr(0x5000c5001364dfe1), phy(0)
[ 50.306025] scsi 0:0:0:0: Direct-Access SEAGATE ST930003SSUN300G 0768 PQ: 0 ANSI: 5
[ 50.314109] scsi 0:0:0:0: SSP: handle(0x0009), sas_addr(0x5000c5001364dfe1), phy(0), device_name(0x5000c5001364dfe0)
[ 50.324707] scsi 0:0:0:0: SSP: enclosure_logical_id(0x500605b000fa9460), slot(0)
[ 50.332097] scsi 0:0:0:0: qdepth(254), tagged(1), simple(0), ordered(0), scsi_level(6), cmd_que(1)
[ 50.342880] end_device-0:0: add: handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 50.350309] port-0:0: remove: sas_addr(0x5000c5001364dfe1)
[ 50.355889] mpt2sas0: _scsih_remove_device: enter: handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 50.364582] port-0:0: remove: sas_addr(0x5000c5001364dfe1), phy(0)
[ 50.373437] mpt2sas0: removing handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 50.380389] mpt2sas0: _scsih_remove_device: exit: handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 50.388991] mpt2sas0: failure at drivers/scsi/mpt2sas/mpt2sas_transport.c:705/mpt2sas_transport_port_add()!
[ 50.399008] initcall _scsih_init+0x0/0x175 returned 0 after 9875546 usecs
[-- Attachment #3: mpt2sas_after_reverting.txt --]
[-- Type: text/plain, Size: 11915 bytes --]
[ 43.821477] calling _scsih_init+0x0/0x163 @ 1
[ 43.825917] mpt2sas version 09.100.00.01 loaded
[ 43.830864] scsi0 : Fusion MPT SAS Host
[ 43.835919] mpt2sas0: mpt2sas_base_attach
[ 43.839927] mpt2sas0: mpt2sas_base_map_resources
[ 43.844555] mpt2sas 0000:40:00.0: PCI INT A -> GSI 40 (level, low) -> IRQ 40
[ 43.851605] mpt2sas 0000:40:00.0: setting latency timer to 64
[ 43.857351] mpt2sas0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED, total mem (8120880 kB)
[ 43.865248] mpt2sas0: msix is supported, vector_count(1)
[ 43.870629] alloc irq_desc for 100 on node 0
[ 43.875083] mpt2sas 0000:40:00.0: irq 100 for MSI-X
[ 43.880009] mpt2sas0-msix0: PCI-MSI-X enabled: IRQ 100
[ 43.885148] mpt2sas0: iomem(0x00000000df500000), mapped(0xffffc90000c60000), size(16384)
[ 43.893228] mpt2sas0: ioport(0x0000000000007000), size(256)
[ 43.898845] mpt2sas0: _base_get_ioc_facts
[ 44.190620] offset:data
[ 44.193150] [0x00]:03100200
[ 44.196032] [0x04]:00001500
[ 44.198914] [0x08]:00000000
[ 44.201788] [0x0c]:00000000
[ 44.204668] [0x10]:00000000
[ 44.207544] [0x14]:00010280
[ 44.210425] [0x18]:27130400
[ 44.213304] [0x1c]:0000185c
[ 44.216189] [0x20]:0b000200
[ 44.219075] [0x24]:00000020
[ 44.221953] [0x28]:03400004
[ 44.224833] [0x2c]:00200020
[ 44.227710] [0x30]:00080002
[ 44.230585] [0x34]:0220ffe0
[ 44.233458] [0x38]:00800376
[ 44.236337] [0x3c]:00000009
[ 44.239215] mpt2sas0: hba queue depth(1024), max chains per io(128)
[ 44.245477] mpt2sas0: request frame size(128), reply frame size(128)
[ 44.251827] mpt2sas0: _base_make_ioc_ready
[ 44.255923] mpt2sas0: sending diag reset !!
[ 44.260100] mpt2sas0: clear interrupts
[ 44.263852] mpt2sas0: write magic sequence
[ 44.370555] mpt2sas0: wrote magic sequence: count(1), host_diagnostic(0x000000a0)
[ 44.378025] mpt2sas0: diag reset: issued
[ 44.434506] mpt2sas0: restart the adapter
[ 44.438518] mpt2sas0: disable writes to the diagnostic register
[ 44.444435] mpt2sas0: Wait for FW to go to the READY state
[ 45.406067] mpt2sas0: diag reset: SUCCESS
[ 45.410080] mpt2sas0: _base_get_port_facts
[ 45.557997] offset:data
[ 45.560528] [0x00]:05070000
[ 45.563409] [0x04]:00000000
[ 45.566294] [0x08]:00000000
[ 45.569172] [0x0c]:00000000
[ 45.572052] [0x10]:00000000
[ 45.574929] [0x14]:00003000
[ 45.577802] [0x18]:00000020
[ 45.580682] mpt2sas0: _base_allocate_memory_pools
[ 45.585387] mpt2sas0: scatter gather: sge_in_main_msg(1), sge_per_chain(9), sge_per_io(128), chains_per_io(15)
[ 45.595374] mpt2sas0: scsi host: can_queue depth (1001)
[ 45.600619] mpt2sas 0000:40:00.0: with iommu 1 : domain 3
[ 45.606059] mpt2sas0: request pool(0xffff880175640000): depth(1024), frame_size(128), pool_size(128 kB)
[ 45.615437] mpt2sas0: request pool: dma(0xfffc0000)
[ 45.620314] mpt2sas0: scsiio(0xffff880175640000): depth(1003)
[ 45.632293] mpt2sas0: chain pool depth(15045), frame_size(128), pool_size(1880 kB)
[ 45.639851] mpt2sas0: hi_priority(0xffff88017565f600): depth(8), start smid(1004)
[ 45.647330] mpt2sas0: internal(0xffff88017565fa00): depth(13), start smid(1012)
[ 45.654646] mpt2sas0: sense pool(0xffff880175260000): depth(1003), element_size(96), pool_size(94 kB)
[ 45.663852] mpt2sas0: sense_dma(0xffda0000)
[ 45.668052] mpt2sas0: reply pool(0xffff880175140000): depth(1056), frame_size(128), pool_size(132 kB)
[ 45.677253] mpt2sas0: reply_dma(0xffd40000)
[ 45.681443] mpt2sas0: reply_free pool(0xffff880175850000): depth(1056), element_size(4), pool_size(4 kB)
[ 45.690908] mpt2sas0: reply_free_dma(0xffd3e000)
[ 45.695531] mpt2sas0: reply post free pool(0xffff880175180000): depth(2080), element_size(8), pool_size(16 kB)
[ 45.705519] mpt2sas0: reply_post_free_dma = (0xffd30000)
[ 45.710823] mpt2sas0: config page(0xffff880175894000): size(512)
[ 45.716823] mpt2sas0: config_page_dma(0xffd2f000)
[ 45.721519] mpt2sas0: Allocated physical memory: size(2255 kB)
[ 45.727342] mpt2sas0: Current Controller Queue Depth(1001), Max Controller Queue Depth(1024)
[ 45.735769] mpt2sas0: Scatter Gather Elements per IO(128)
[ 45.741165] mpt2sas0: _base_make_ioc_operational
[ 45.745901] mpt2sas0: _base_send_ioc_init
[ 45.749909] offset:data
[ 45.752440] [0x00]:02000004
[ 45.755320] [0x04]:00000000
[ 45.758198] [0x08]:00000000
[ 45.761078] [0x0c]:14000200
[ 45.763958] [0x10]:00000000
[ 45.766844] [0x14]:00000000
[ 45.769722] [0x18]:00200000
[ 45.772605] [0x1c]:04200820
[ 45.775487] [0x20]:00000000
[ 45.778365] [0x24]:00000000
[ 45.781243] [0x28]:fffc0000
[ 45.784126] [0x2c]:00000000
[ 45.787011] [0x30]:ffd30000
[ 45.789893] [0x34]:00000000
[ 45.792766] [0x38]:ffd3e000
[ 45.795646] [0x3c]:00000000
[ 45.798521] [0x40]:ef10b700
[ 45.801393] [0x44]:00000133
[ 46.033780] offset:data
[ 46.036308] [0x00]:02050004
[ 46.039190] [0x04]:00000000
[ 46.042072] [0x08]:00000000
[ 46.044945] [0x0c]:00000000
[ 46.047825] [0x10]:00000000
[ 46.050702] mpt2sas0: _base_event_notification
[ 46.055198] mpt2sas0: _base_event_notification: complete
[ 46.061099] mpt2sas0: LSISAS2008: FWVersion(11.00.02.00), ChipRevision(0x02), BiosVersion(07.21.03.00)
[ 46.070392] mpt2sas0: Protocol=(Initiator), Capabilities=(Raid,TLR,EEDP,Snapshot Buffer,Diag Trace Buffer,Task Set Full,NCQ)
[ 46.081858] mpt2sas0: sending port enable !!
[ 47.692320] mpt2sas0: Discovery: (start)
[ 47.696295] mpt2sas0: SAS Enclosure Device Status Change
[ 47.701597] mpt2sas0: Discovery: (stop)
[ 47.705442] mpt2sas0: SAS Topology Change List
[ 47.709907] mpt2sas0: discovery event: (start)
[ 47.715409] phy-0:0: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 47.715410] attached_handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 47.728675] phy-0:1: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 47.728676] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.741941] phy-0:2: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 47.741941] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.755201] phy-0:3: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 47.755201] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.768479] phy-0:4: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 47.768479] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.781743] phy-0:5: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 47.781743] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.795001] phy-0:6: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 47.795002] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.808267] phy-0:7: add: handle(0x0001), sas_addr(0x500605b000fa9460)
[ 47.808267] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.821155] mpt2sas0: host_add: handle(0x0001), sas_addr(0x500605b000fa9460), phys(8)
[ 47.829109] mpt2sas0: enclosure status change: (enclosure add)
[ 47.829110] handle(0x0001), enclosure logical id(0x500605b000fa9460) number slots(0)
[ 47.842752] mpt2sas0: discovery event: (stop)
[ 47.847121] mpt2sas0: sas topology change: (responding)
[ 47.852338] handle(0x0000), enclosure_handle(0x0001) start_phy(00), count(1)
[ 47.859461] phy(00), attached_handle(0x0009): target add: link rate: new(0x09), old(0x00)
[ 47.867714] mpt2sas0: updating handles for sas_host(0x500605b000fa9460)
[ 47.874546] phy-0:0: refresh: parent sas_addr(0x500605b000fa9460),
[ 47.874546] link_rate(0x09), phy(0)
[ 47.874547] attached_handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 47.890543] phy-0:1: refresh: parent sas_addr(0x500605b000fa9460),
[ 47.890544] link_rate(0x00), phy(1)
[ 47.890544] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.906541] phy-0:2: refresh: parent sas_addr(0x500605b000fa9460),
[ 47.906542] link_rate(0x00), phy(2)
[ 47.906542] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.922544] phy-0:3: refresh: parent sas_addr(0x500605b000fa9460),
[ 47.922545] link_rate(0x00), phy(3)
[ 47.922545] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.938543] phy-0:4: refresh: parent sas_addr(0x500605b000fa9460),
[ 47.938544] link_rate(0x00), phy(4)
[ 47.938544] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.954542] phy-0:5: refresh: parent sas_addr(0x500605b000fa9460),
[ 47.954543] link_rate(0x00), phy(5)
[ 47.954543] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.970543] phy-0:6: refresh: parent sas_addr(0x500605b000fa9460),
[ 47.970543] link_rate(0x00), phy(6)
[ 47.970544] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 47.986542] phy-0:7: refresh: parent sas_addr(0x500605b000fa9460),
[ 47.986543] link_rate(0x00), phy(7)
[ 47.986543] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 48.002651] phy-0:0: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.002652] link_rate(0x09), phy(0)
[ 48.002652] attached_handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 48.018890] mpt2sas0: _scsih_sas_device_init_add: handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 48.027492] mpt2sas0: _scsih_determine_boot_device: current_boot_device(0x5000c5001364dfe1)
[ 48.691867] mpt2sas0: Discovery: (start)
[ 48.695808] mpt2sas0: SAS Topology Change List
[ 48.700255] mpt2sas0: discovery event: (start)
[ 48.704752] mpt2sas0: sas topology change: (responding)
[ 48.709980] handle(0x0000), enclosure_handle(0x0001) start_phy(01), count(7)
[ 48.717109] mpt2sas0: updating handles for sas_host(0x500605b000fa9460)
[ 48.723938] phy-0:0: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.723940] link_rate(0x09), phy(0)
[ 48.723942] attached_handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 48.739946] phy-0:1: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.739946] link_rate(0x00), phy(1)
[ 48.739947] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 48.755944] phy-0:2: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.755945] link_rate(0x00), phy(2)
[ 48.755945] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 48.771943] phy-0:3: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.771944] link_rate(0x00), phy(3)
[ 48.771944] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 48.787944] phy-0:4: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.787945] link_rate(0x00), phy(4)
[ 48.787945] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 48.803947] phy-0:5: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.803947] link_rate(0x00), phy(5)
[ 48.803948] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 48.819943] phy-0:6: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.819944] link_rate(0x00), phy(6)
[ 48.819944] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 48.835947] phy-0:7: refresh: parent sas_addr(0x500605b000fa9460),
[ 48.835947] link_rate(0x00), phy(7)
[ 48.835948] attached_handle(0x0000), sas_addr(0x0000000000000000)
[ 48.941774] mpt2sas0: Discovery: (stop)
[ 48.945634] mpt2sas0: discovery event: (stop)
[ 53.814514] mpt2sas0: _base_send_port_enable: complete
[ 53.819653] mpt2sas0: port enable: SUCCESS
[ 53.824172] port-0:0: add: handle(0x0009), sas_addr(0x5000c5001364dfe1), phy(0)
[ 53.833674] scsi 0:0:0:0: Direct-Access SEAGATE ST930003SSUN300G 0768 PQ: 0 ANSI: 5
[ 53.841764] scsi 0:0:0:0: SSP: handle(0x0009), sas_addr(0x5000c5001364dfe1), phy(0), device_name(0x5000c5001364dfe0)
[ 53.852350] scsi 0:0:0:0: SSP: enclosure_logical_id(0x500605b000fa9460), slot(0)
[ 53.859736] scsi 0:0:0:0: qdepth(254), tagged(1), simple(0), ordered(0), scsi_level(6), cmd_que(1)
[ 53.870519] end_device-0:0: add: handle(0x0009), sas_addr(0x5000c5001364dfe1)
[ 53.878029] initcall _scsih_init+0x0/0x163 returned 0 after 9820990 usecs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: mpt2sas regression: can not add disk...
2011-11-28 20:00 ` Yinghai Lu
@ 2011-12-07 0:15 ` Yinghai Lu
2011-12-07 17:54 ` Desai, Kashyap
0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2011-12-07 0:15 UTC (permalink / raw)
To: Nandigama, Nagalakshmi, James Bottomley, Rafael J. Wysocki
Cc: linux-scsi-owner@vger.kernel.org, James Bottomley,
linux-scsi@vger.kernel.org, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 788 bytes --]
On Mon, Nov 28, 2011 at 12:00 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Sun, Nov 27, 2011 at 10:09 PM, Nandigama, Nagalakshmi
> <Nagalakshmi.Nandigama@lsi.com> wrote:
>> Yinghai Lu,
>>
>> Please set the driver logging level to 0x421F8 (echo 0x421F8 > /sys/module/mpt2sas/parameters/logging_level) and the scsi logging level to 0x180000F1 (echo 0x180000F1 > /proc/sys/dev/scsi/logging_level) and recreate the issue and provide the var/log/message
>>
>
> please check two print out...
James,
one week passed, did not hear anything from the original author.
Can you revert offending commit ?
it is 921cd8024b908f8f49f772c8d3a02381b4db2ed2
and several related commits after that.
please check attached reverting patch that i used locally.
Thanks
Yinghai
[-- Attachment #2: revert_mpt2sas_fast_load.patch --]
[-- Type: text/x-patch, Size: 59063 bytes --]
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index beda04a..81209ca 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -81,15 +81,6 @@ static int missing_delay[2] = {-1, -1};
module_param_array(missing_delay, int, NULL, 0);
MODULE_PARM_DESC(missing_delay, " device missing delay , io missing delay");
-static int mpt2sas_fwfault_debug;
-MODULE_PARM_DESC(mpt2sas_fwfault_debug, " enable detection of firmware fault "
- "and halt firmware - (default=0)");
-
-static int disable_discovery = -1;
-module_param(disable_discovery, int, 0);
-MODULE_PARM_DESC(disable_discovery, " disable discovery ");
-
-
/* diag_buffer_enable is bitwise
* bit 0 set = TRACE
* bit 1 set = SNAPSHOT
@@ -102,6 +93,14 @@ module_param(diag_buffer_enable, int, 0);
MODULE_PARM_DESC(diag_buffer_enable, " post diag buffers "
"(TRACE=1/SNAPSHOT=2/EXTENDED=4/default=0)");
+static int mpt2sas_fwfault_debug;
+MODULE_PARM_DESC(mpt2sas_fwfault_debug, " enable detection of firmware fault "
+ "and halt firmware - (default=0)");
+
+static int disable_discovery = -1;
+module_param(disable_discovery, int, 0);
+MODULE_PARM_DESC(disable_discovery, " disable discovery ");
+
/**
* _scsih_set_fwfault_debug - global setting of ioc->fwfault_debug.
*
@@ -692,7 +691,6 @@ mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
memcpy(ioc->base_cmds.reply, mpi_reply, mpi_reply->MsgLength*4);
}
ioc->base_cmds.status &= ~MPT2_CMD_PENDING;
-
complete(&ioc->base_cmds.done);
return 1;
}
@@ -3472,58 +3470,6 @@ _base_send_ioc_init(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
}
/**
- * mpt2sas_port_enable_done - command completion routine for port enable
- * @ioc: per adapter object
- * @smid: system request message index
- * @msix_index: MSIX table index supplied by the OS
- * @reply: reply message frame(lower 32bit addr)
- *
- * Return 1 meaning mf should be freed from _base_interrupt
- * 0 means the mf is freed from this function.
- */
-u8
-mpt2sas_port_enable_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
- u32 reply)
-{
- MPI2DefaultReply_t *mpi_reply;
- u16 ioc_status;
-
- mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply);
- if (mpi_reply && mpi_reply->Function == MPI2_FUNCTION_EVENT_ACK)
- return 1;
-
- if (ioc->port_enable_cmds.status == MPT2_CMD_NOT_USED)
- return 1;
-
- ioc->port_enable_cmds.status |= MPT2_CMD_COMPLETE;
- if (mpi_reply) {
- ioc->port_enable_cmds.status |= MPT2_CMD_REPLY_VALID;
- memcpy(ioc->port_enable_cmds.reply, mpi_reply,
- mpi_reply->MsgLength*4);
- }
- ioc->port_enable_cmds.status &= ~MPT2_CMD_PENDING;
-
- ioc_status = le16_to_cpu(mpi_reply->IOCStatus) & MPI2_IOCSTATUS_MASK;
-
- if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
- ioc->port_enable_failed = 1;
-
- if (ioc->is_driver_loading) {
- if (ioc_status == MPI2_IOCSTATUS_SUCCESS) {
- mpt2sas_port_enable_complete(ioc);
- return 1;
- } else {
- ioc->start_scan_failed = ioc_status;
- ioc->start_scan = 0;
- return 1;
- }
- }
- complete(&ioc->port_enable_cmds.done);
- return 1;
-}
-
-
-/**
* _base_send_port_enable - send port_enable(discovery stuff) to firmware
* @ioc: per adapter object
* @sleep_flag: CAN_SLEEP or NO_SLEEP
@@ -3534,151 +3480,67 @@ static int
_base_send_port_enable(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
{
Mpi2PortEnableRequest_t *mpi_request;
- Mpi2PortEnableReply_t *mpi_reply;
+ u32 ioc_state;
unsigned long timeleft;
int r = 0;
u16 smid;
- u16 ioc_status;
printk(MPT2SAS_INFO_FMT "sending port enable !!\n", ioc->name);
- if (ioc->port_enable_cmds.status & MPT2_CMD_PENDING) {
+ if (ioc->base_cmds.status & MPT2_CMD_PENDING) {
printk(MPT2SAS_ERR_FMT "%s: internal command already in use\n",
ioc->name, __func__);
return -EAGAIN;
}
- smid = mpt2sas_base_get_smid(ioc, ioc->port_enable_cb_idx);
+ smid = mpt2sas_base_get_smid(ioc, ioc->base_cb_idx);
if (!smid) {
printk(MPT2SAS_ERR_FMT "%s: failed obtaining a smid\n",
ioc->name, __func__);
return -EAGAIN;
}
- ioc->port_enable_cmds.status = MPT2_CMD_PENDING;
+ ioc->base_cmds.status = MPT2_CMD_PENDING;
mpi_request = mpt2sas_base_get_msg_frame(ioc, smid);
- ioc->port_enable_cmds.smid = smid;
+ ioc->base_cmds.smid = smid;
memset(mpi_request, 0, sizeof(Mpi2PortEnableRequest_t));
mpi_request->Function = MPI2_FUNCTION_PORT_ENABLE;
+ mpi_request->VF_ID = 0; /* TODO */
+ mpi_request->VP_ID = 0;
- init_completion(&ioc->port_enable_cmds.done);
mpt2sas_base_put_smid_default(ioc, smid);
- timeleft = wait_for_completion_timeout(&ioc->port_enable_cmds.done,
+ init_completion(&ioc->base_cmds.done);
+ timeleft = wait_for_completion_timeout(&ioc->base_cmds.done,
300*HZ);
- if (!(ioc->port_enable_cmds.status & MPT2_CMD_COMPLETE)) {
+ if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) {
printk(MPT2SAS_ERR_FMT "%s: timeout\n",
ioc->name, __func__);
_debug_dump_mf(mpi_request,
sizeof(Mpi2PortEnableRequest_t)/4);
- if (ioc->port_enable_cmds.status & MPT2_CMD_RESET)
+ if (ioc->base_cmds.status & MPT2_CMD_RESET)
r = -EFAULT;
else
r = -ETIME;
goto out;
- }
- mpi_reply = ioc->port_enable_cmds.reply;
+ } else
+ dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: complete\n",
+ ioc->name, __func__));
- ioc_status = le16_to_cpu(mpi_reply->IOCStatus) & MPI2_IOCSTATUS_MASK;
- if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
- printk(MPT2SAS_ERR_FMT "%s: failed with (ioc_status=0x%08x)\n",
- ioc->name, __func__, ioc_status);
+ ioc_state = _base_wait_on_iocstate(ioc, MPI2_IOC_STATE_OPERATIONAL,
+ 60, sleep_flag);
+ if (ioc_state) {
+ printk(MPT2SAS_ERR_FMT "%s: failed going to operational state "
+ " (ioc_state=0x%x)\n", ioc->name, __func__, ioc_state);
r = -EFAULT;
- goto out;
}
out:
- ioc->port_enable_cmds.status = MPT2_CMD_NOT_USED;
- printk(MPT2SAS_INFO_FMT "port enable: %s\n", ioc->name, ((r == 0) ?
- "SUCCESS" : "FAILED"));
+ ioc->base_cmds.status = MPT2_CMD_NOT_USED;
+ printk(MPT2SAS_INFO_FMT "port enable: %s\n",
+ ioc->name, ((r == 0) ? "SUCCESS" : "FAILED"));
return r;
}
/**
- * mpt2sas_port_enable - initiate firmware discovery (don't wait for reply)
- * @ioc: per adapter object
- *
- * Returns 0 for success, non-zero for failure.
- */
-int
-mpt2sas_port_enable(struct MPT2SAS_ADAPTER *ioc)
-{
- Mpi2PortEnableRequest_t *mpi_request;
- u16 smid;
-
- printk(MPT2SAS_INFO_FMT "sending port enable !!\n", ioc->name);
-
- if (ioc->port_enable_cmds.status & MPT2_CMD_PENDING) {
- printk(MPT2SAS_ERR_FMT "%s: internal command already in use\n",
- ioc->name, __func__);
- return -EAGAIN;
- }
-
- smid = mpt2sas_base_get_smid(ioc, ioc->port_enable_cb_idx);
- if (!smid) {
- printk(MPT2SAS_ERR_FMT "%s: failed obtaining a smid\n",
- ioc->name, __func__);
- return -EAGAIN;
- }
-
- ioc->port_enable_cmds.status = MPT2_CMD_PENDING;
- mpi_request = mpt2sas_base_get_msg_frame(ioc, smid);
- ioc->port_enable_cmds.smid = smid;
- memset(mpi_request, 0, sizeof(Mpi2PortEnableRequest_t));
- mpi_request->Function = MPI2_FUNCTION_PORT_ENABLE;
-
- mpt2sas_base_put_smid_default(ioc, smid);
- return 0;
-}
-
-/**
- * _base_determine_wait_on_discovery - desposition
- * @ioc: per adapter object
- *
- * Decide whether to wait on discovery to complete. Used to either
- * locate boot device, or report volumes ahead of physical devices.
- *
- * Returns 1 for wait, 0 for don't wait
- */
-static int
-_base_determine_wait_on_discovery(struct MPT2SAS_ADAPTER *ioc)
-{
- /* We wait for discovery to complete if IR firmware is loaded.
- * The sas topology events arrive before PD events, so we need time to
- * turn on the bit in ioc->pd_handles to indicate PD
- * Also, it maybe required to report Volumes ahead of physical
- * devices when MPI2_IOCPAGE8_IRFLAGS_LOW_VOLUME_MAPPING is set.
- */
- if (ioc->ir_firmware)
- return 1;
-
- /* if no Bios, then we don't need to wait */
- if (!ioc->bios_pg3.BiosVersion)
- return 0;
-
- /* Bios is present, then we drop down here.
- *
- * If there any entries in the Bios Page 2, then we wait
- * for discovery to complete.
- */
-
- /* Current Boot Device */
- if ((ioc->bios_pg2.CurrentBootDeviceForm &
- MPI2_BIOSPAGE2_FORM_MASK) ==
- MPI2_BIOSPAGE2_FORM_NO_DEVICE_SPECIFIED &&
- /* Request Boot Device */
- (ioc->bios_pg2.ReqBootDeviceForm &
- MPI2_BIOSPAGE2_FORM_MASK) ==
- MPI2_BIOSPAGE2_FORM_NO_DEVICE_SPECIFIED &&
- /* Alternate Request Boot Device */
- (ioc->bios_pg2.ReqAltBootDeviceForm &
- MPI2_BIOSPAGE2_FORM_MASK) ==
- MPI2_BIOSPAGE2_FORM_NO_DEVICE_SPECIFIED)
- return 0;
-
- return 1;
-}
-
-
-/**
* _base_unmask_events - turn on notification for this event
* @ioc: per adapter object
* @event: firmware event
@@ -4100,7 +3962,6 @@ _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
skip_init_reply_post_host_index:
_base_unmask_interrupts(ioc);
-
r = _base_event_notification(ioc, sleep_flag);
if (r)
return r;
@@ -4108,18 +3969,7 @@ _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
if (sleep_flag == CAN_SLEEP)
_base_static_config_pages(ioc);
-
- if (ioc->is_driver_loading) {
-
-
-
- ioc->wait_for_discovery_to_complete =
- _base_determine_wait_on_discovery(ioc);
- return r; /* scan_start and scan_finished support */
- }
-
-
- if (ioc->wait_for_discovery_to_complete && ioc->is_warpdrive) {
+ if (ioc->wait_for_port_enable_to_complete && ioc->is_warpdrive) {
if (ioc->manu_pg10.OEMIdentifier == 0x80) {
hide_flag = (u8) (ioc->manu_pg10.OEMSpecificFlags0 &
MFG_PAGE10_HIDE_SSDS_MASK);
@@ -4128,6 +3978,13 @@ _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
}
}
+ if (ioc->wait_for_port_enable_to_complete) {
+ if (diag_buffer_enable != 0)
+ mpt2sas_enable_diag_buffer(ioc, diag_buffer_enable);
+ if (disable_discovery > 0)
+ return r;
+ }
+
r = _base_send_port_enable(ioc, sleep_flag);
if (r)
return r;
@@ -4264,10 +4121,6 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
ioc->base_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL);
ioc->base_cmds.status = MPT2_CMD_NOT_USED;
- /* port_enable command bits */
- ioc->port_enable_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL);
- ioc->port_enable_cmds.status = MPT2_CMD_NOT_USED;
-
/* transport internal command bits */
ioc->transport_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL);
ioc->transport_cmds.status = MPT2_CMD_NOT_USED;
@@ -4309,6 +4162,8 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
goto out_free_resources;
}
+ init_completion(&ioc->shost_recovery_done);
+
for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++)
ioc->event_masks[i] = -1;
@@ -4331,6 +4186,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
_base_update_missing_delay(ioc, missing_delay[0],
missing_delay[1]);
+ mpt2sas_base_start_watchdog(ioc);
return 0;
out_free_resources:
@@ -4348,7 +4204,6 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
kfree(ioc->scsih_cmds.reply);
kfree(ioc->config_cmds.reply);
kfree(ioc->base_cmds.reply);
- kfree(ioc->port_enable_cmds.reply);
kfree(ioc->ctl_cmds.reply);
kfree(ioc->ctl_cmds.sense);
kfree(ioc->pfacts);
@@ -4388,7 +4243,6 @@ mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc)
kfree(ioc->ctl_cmds.reply);
kfree(ioc->ctl_cmds.sense);
kfree(ioc->base_cmds.reply);
- kfree(ioc->port_enable_cmds.reply);
kfree(ioc->tm_cmds.reply);
kfree(ioc->transport_cmds.reply);
kfree(ioc->scsih_cmds.reply);
@@ -4430,20 +4284,6 @@ _base_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase)
mpt2sas_base_free_smid(ioc, ioc->base_cmds.smid);
complete(&ioc->base_cmds.done);
}
- if (ioc->port_enable_cmds.status & MPT2_CMD_PENDING) {
- ioc->port_enable_failed = 1;
- ioc->port_enable_cmds.status |= MPT2_CMD_RESET;
- mpt2sas_base_free_smid(ioc, ioc->port_enable_cmds.smid);
- if (ioc->is_driver_loading) {
- ioc->start_scan_failed =
- MPI2_IOCSTATUS_INTERNAL_ERROR;
- ioc->start_scan = 0;
- ioc->port_enable_cmds.status =
- MPT2_CMD_NOT_USED;
- } else
- complete(&ioc->port_enable_cmds.done);
-
- }
if (ioc->config_cmds.status & MPT2_CMD_PENDING) {
ioc->config_cmds.status |= MPT2_CMD_RESET;
mpt2sas_base_free_smid(ioc, ioc->config_cmds.smid);
@@ -4509,6 +4349,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
{
int r;
unsigned long flags;
+ u8 pe_complete = ioc->wait_for_port_enable_to_complete;
dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name,
__func__));
@@ -4555,8 +4396,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
/* If this hard reset is called while port enable is active, then
* there is no reason to call make_ioc_operational
*/
- if (ioc->is_driver_loading && ioc->port_enable_failed) {
- ioc->remove_host = 1;
+ if (pe_complete) {
r = -EFAULT;
goto out;
}
@@ -4570,6 +4410,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
ioc->ioc_reset_in_progress_status = r;
ioc->shost_recovery = 0;
+ complete(&ioc->shost_recovery_done);
spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
mutex_unlock(&ioc->reset_in_progress_mutex);
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 3c3babc..59354db 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -69,11 +69,11 @@
#define MPT2SAS_DRIVER_NAME "mpt2sas"
#define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>"
#define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver"
-#define MPT2SAS_DRIVER_VERSION "10.100.00.00"
-#define MPT2SAS_MAJOR_VERSION 10
+#define MPT2SAS_DRIVER_VERSION "09.100.00.01"
+#define MPT2SAS_MAJOR_VERSION 09
#define MPT2SAS_MINOR_VERSION 100
#define MPT2SAS_BUILD_VERSION 00
-#define MPT2SAS_RELEASE_VERSION 00
+#define MPT2SAS_RELEASE_VERSION 01
/*
* Set MPT2SAS_SG_DEPTH value based on user input.
@@ -655,12 +655,7 @@ enum mutex_type {
* @ignore_loginfos: ignore loginfos during task management
* @remove_host: flag for when driver unloads, to avoid sending dev resets
* @pci_error_recovery: flag to prevent ioc access until slot reset completes
- * @wait_for_discovery_to_complete: flag set at driver load time when
- * waiting on reporting devices
- * @is_driver_loading: flag set at driver load time
- * @port_enable_failed: flag set when port enable has failed
- * @start_scan: flag set from scan_start callback, cleared from _mpt2sas_fw_work
- * @start_scan_failed: means port enable failed, return's the ioc_status
+ * @wait_for_port_enable_to_complete:
* @msix_enable: flag indicating msix is enabled
* @msix_vector_count: number msix vectors
* @cpu_msix_table: table for mapping cpus to msix index
@@ -795,20 +790,15 @@ struct MPT2SAS_ADAPTER {
u8 shost_recovery;
struct mutex reset_in_progress_mutex;
+ struct completion shost_recovery_done;
spinlock_t ioc_reset_in_progress_lock;
u8 ioc_link_reset_in_progress;
- u8 ioc_reset_in_progress_status;
+ int ioc_reset_in_progress_status;
u8 ignore_loginfos;
u8 remove_host;
u8 pci_error_recovery;
- u8 wait_for_discovery_to_complete;
- struct completion port_enable_done;
- u8 is_driver_loading;
- u8 port_enable_failed;
-
- u8 start_scan;
- u16 start_scan_failed;
+ u8 wait_for_port_enable_to_complete;
u8 msix_enable;
u16 msix_vector_count;
@@ -824,13 +814,11 @@ struct MPT2SAS_ADAPTER {
u8 scsih_cb_idx;
u8 ctl_cb_idx;
u8 base_cb_idx;
- u8 port_enable_cb_idx;
u8 config_cb_idx;
u8 tm_tr_cb_idx;
u8 tm_tr_volume_cb_idx;
u8 tm_sas_control_cb_idx;
struct _internal_cmd base_cmds;
- struct _internal_cmd port_enable_cmds;
struct _internal_cmd transport_cmds;
struct _internal_cmd scsih_cmds;
struct _internal_cmd tm_cmds;
@@ -1013,8 +1001,6 @@ void mpt2sas_base_release_callback_handler(u8 cb_idx);
u8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
u32 reply);
-u8 mpt2sas_port_enable_done(struct MPT2SAS_ADAPTER *ioc, u16 smid,
- u8 msix_index, u32 reply);
void *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr);
u32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked);
@@ -1029,8 +1015,6 @@ void mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_ty
void mpt2sas_halt_firmware(struct MPT2SAS_ADAPTER *ioc);
-int mpt2sas_port_enable(struct MPT2SAS_ADAPTER *ioc);
-
/* scsih shared API */
u8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
u32 reply);
@@ -1048,8 +1032,6 @@ struct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAP
struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address(
struct MPT2SAS_ADAPTER *ioc, u64 sas_address);
-void mpt2sas_port_enable_complete(struct MPT2SAS_ADAPTER *ioc);
-
void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase);
/* config shared API */
diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c
index 36ea0b2..2b11010 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_config.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_config.c
@@ -1356,9 +1356,6 @@ mpt2sas_config_get_volume_handle(struct MPT2SAS_ADAPTER *ioc, u16 pd_handle,
Mpi2ConfigReply_t mpi_reply;
int r, i, config_page_sz;
u16 ioc_status;
- int config_num;
- u16 element_type;
- u16 phys_disk_dev_handle;
*volume_handle = 0;
memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
@@ -1374,53 +1371,35 @@ mpt2sas_config_get_volume_handle(struct MPT2SAS_ADAPTER *ioc, u16 pd_handle,
if (r)
goto out;
+ mpi_request.PageAddress =
+ cpu_to_le32(MPI2_RAID_PGAD_FORM_ACTIVE_CONFIG);
mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
config_page_sz = (le16_to_cpu(mpi_reply.ExtPageLength) * 4);
config_page = kmalloc(config_page_sz, GFP_KERNEL);
- if (!config_page) {
- r = -1;
+ if (!config_page)
goto out;
- }
- config_num = 0xff;
- while (1) {
- mpi_request.PageAddress = cpu_to_le32(config_num +
- MPI2_RAID_PGAD_FORM_GET_NEXT_CONFIGNUM);
- r = _config_request(ioc, &mpi_request, &mpi_reply,
- MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
- config_page_sz);
- if (r)
- goto out;
- r = -1;
- ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
- MPI2_IOCSTATUS_MASK;
- if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
+ r = _config_request(ioc, &mpi_request, &mpi_reply,
+ MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+ config_page_sz);
+ if (r)
+ goto out;
+
+ r = -1;
+ ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & MPI2_IOCSTATUS_MASK;
+ if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
+ goto out;
+ for (i = 0; i < config_page->NumElements; i++) {
+ if ((le16_to_cpu(config_page->ConfigElement[i].ElementFlags) &
+ MPI2_RAIDCONFIG0_EFLAGS_MASK_ELEMENT_TYPE) !=
+ MPI2_RAIDCONFIG0_EFLAGS_VOL_PHYS_DISK_ELEMENT)
+ continue;
+ if (le16_to_cpu(config_page->ConfigElement[i].
+ PhysDiskDevHandle) == pd_handle) {
+ *volume_handle = le16_to_cpu(config_page->
+ ConfigElement[i].VolDevHandle);
+ r = 0;
goto out;
- for (i = 0; i < config_page->NumElements; i++) {
- element_type = le16_to_cpu(config_page->
- ConfigElement[i].ElementFlags) &
- MPI2_RAIDCONFIG0_EFLAGS_MASK_ELEMENT_TYPE;
- if (element_type ==
- MPI2_RAIDCONFIG0_EFLAGS_VOL_PHYS_DISK_ELEMENT ||
- element_type ==
- MPI2_RAIDCONFIG0_EFLAGS_OCE_ELEMENT) {
- phys_disk_dev_handle =
- le16_to_cpu(config_page->ConfigElement[i].
- PhysDiskDevHandle);
- if (phys_disk_dev_handle == pd_handle) {
- *volume_handle =
- le16_to_cpu(config_page->
- ConfigElement[i].VolDevHandle);
- r = 0;
- goto out;
- }
- } else if (element_type ==
- MPI2_RAIDCONFIG0_EFLAGS_HOT_SPARE_ELEMENT) {
- *volume_handle = 0;
- r = 0;
- goto out;
- }
}
- config_num = config_page->ConfigNum;
}
out:
kfree(config_page);
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
index aabcb91..9adb013 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -1207,9 +1207,6 @@ _ctl_do_reset(void __user *arg)
if (_ctl_verify_adapter(karg.hdr.ioc_number, &ioc) == -1 || !ioc)
return -ENODEV;
- if (ioc->shost_recovery || ioc->pci_error_recovery ||
- ioc->is_driver_loading)
- return -EAGAIN;
dctlprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name,
__func__));
@@ -2181,8 +2178,7 @@ _ctl_ioctl_main(struct file *file, unsigned int cmd, void __user *arg)
!ioc)
return -ENODEV;
- if (ioc->shost_recovery || ioc->pci_error_recovery ||
- ioc->is_driver_loading)
+ if (ioc->shost_recovery || ioc->pci_error_recovery)
return -EAGAIN;
if (_IOC_SIZE(cmd) == sizeof(struct mpt2_ioctl_command)) {
@@ -2301,8 +2297,7 @@ _ctl_compat_mpt_command(struct file *file, unsigned cmd, unsigned long arg)
if (_ctl_verify_adapter(karg32.hdr.ioc_number, &ioc) == -1 || !ioc)
return -ENODEV;
- if (ioc->shost_recovery || ioc->pci_error_recovery ||
- ioc->is_driver_loading)
+ if (ioc->shost_recovery || ioc->pci_error_recovery)
return -EAGAIN;
memset(&karg, 0, sizeof(struct mpt2_ioctl_command));
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 4e041f6..1da1aa1 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -71,9 +71,6 @@ static void _firmware_event_work(struct work_struct *work);
static u8 _scsih_check_for_pending_tm(struct MPT2SAS_ADAPTER *ioc, u16 smid);
-static void _scsih_scan_start(struct Scsi_Host *shost);
-static int _scsih_scan_finished(struct Scsi_Host *shost, unsigned long time);
-
/* global parameters */
LIST_HEAD(mpt2sas_ioc_list);
@@ -82,7 +79,6 @@ static u8 scsi_io_cb_idx = -1;
static u8 tm_cb_idx = -1;
static u8 ctl_cb_idx = -1;
static u8 base_cb_idx = -1;
-static u8 port_enable_cb_idx = -1;
static u8 transport_cb_idx = -1;
static u8 scsih_cb_idx = -1;
static u8 config_cb_idx = -1;
@@ -107,18 +103,6 @@ static int max_lun = MPT2SAS_MAX_LUN;
module_param(max_lun, int, 0);
MODULE_PARM_DESC(max_lun, " max lun, default=16895 ");
-/* diag_buffer_enable is bitwise
- * bit 0 set = TRACE
- * bit 1 set = SNAPSHOT
- * bit 2 set = EXTENDED
- *
- * Either bit can be set, or both
- */
-static int diag_buffer_enable = -1;
-module_param(diag_buffer_enable, int, 0);
-MODULE_PARM_DESC(diag_buffer_enable, " post diag buffers "
- "(TRACE=1/SNAPSHOT=2/EXTENDED=4/default=0)");
-
/**
* struct sense_info - common structure for obtaining sense keys
* @skey: sense key
@@ -133,8 +117,8 @@ struct sense_info {
#define MPT2SAS_TURN_ON_FAULT_LED (0xFFFC)
-#define MPT2SAS_PORT_ENABLE_COMPLETE (0xFFFD)
-#define MPT2SAS_REMOVE_UNRESPONDING_DEVICES (0xFFFF)
+#define MPT2SAS_RESCAN_AFTER_HOST_RESET (0xFFFF)
+
/**
* struct fw_event_work - firmware event struct
* @list: link list framework
@@ -388,34 +372,31 @@ _scsih_get_sas_address(struct MPT2SAS_ADAPTER *ioc, u16 handle,
Mpi2SasDevicePage0_t sas_device_pg0;
Mpi2ConfigReply_t mpi_reply;
u32 ioc_status;
- *sas_address = 0;
if (handle <= ioc->sas_hba.num_phys) {
*sas_address = ioc->sas_hba.sas_address;
return 0;
- }
+ } else
+ *sas_address = 0;
if ((mpt2sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0,
MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) {
- printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", ioc->name,
- __FILE__, __LINE__, __func__);
+ printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
+ ioc->name, __FILE__, __LINE__, __func__);
return -ENXIO;
}
- ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & MPI2_IOCSTATUS_MASK;
- if (ioc_status == MPI2_IOCSTATUS_SUCCESS) {
- *sas_address = le64_to_cpu(sas_device_pg0.SASAddress);
- return 0;
+ ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+ MPI2_IOCSTATUS_MASK;
+ if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+ printk(MPT2SAS_ERR_FMT "handle(0x%04x), ioc_status(0x%04x)"
+ "\nfailure at %s:%d/%s()!\n", ioc->name, handle, ioc_status,
+ __FILE__, __LINE__, __func__);
+ return -EIO;
}
- /* we hit this becuase the given parent handle doesn't exist */
- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
- return -ENXIO;
- /* else error case */
- printk(MPT2SAS_ERR_FMT "handle(0x%04x), ioc_status(0x%04x), "
- "failure at %s:%d/%s()!\n", ioc->name, handle, ioc_status,
- __FILE__, __LINE__, __func__);
- return -EIO;
+ *sas_address = le64_to_cpu(sas_device_pg0.SASAddress);
+ return 0;
}
/**
@@ -443,11 +424,7 @@ _scsih_determine_boot_device(struct MPT2SAS_ADAPTER *ioc,
u16 slot;
/* only process this function when driver loads */
- if (!ioc->is_driver_loading)
- return;
-
- /* no Bios, return immediately */
- if (!ioc->bios_pg3.BiosVersion)
+ if (!ioc->wait_for_port_enable_to_complete)
return;
if (!is_raid) {
@@ -610,15 +587,8 @@ _scsih_sas_device_add(struct MPT2SAS_ADAPTER *ioc,
spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
if (!mpt2sas_transport_port_add(ioc, sas_device->handle,
- sas_device->sas_address_parent)) {
+ sas_device->sas_address_parent))
_scsih_sas_device_remove(ioc, sas_device);
- } else if (!sas_device->starget) {
- if (!ioc->is_driver_loading)
- mpt2sas_transport_port_remove(ioc,
- sas_device->sas_address,
- sas_device->sas_address_parent);
- _scsih_sas_device_remove(ioc, sas_device);
- }
}
/**
@@ -1430,10 +1400,6 @@ _scsih_slave_destroy(struct scsi_device *sdev)
{
struct MPT2SAS_TARGET *sas_target_priv_data;
struct scsi_target *starget;
- struct Scsi_Host *shost;
- struct MPT2SAS_ADAPTER *ioc;
- struct _sas_device *sas_device;
- unsigned long flags;
if (!sdev->hostdata)
return;
@@ -1441,19 +1407,6 @@ _scsih_slave_destroy(struct scsi_device *sdev)
starget = scsi_target(sdev);
sas_target_priv_data = starget->hostdata;
sas_target_priv_data->num_luns--;
-
- shost = dev_to_shost(&starget->dev);
- ioc = shost_priv(shost);
-
- if (!(sas_target_priv_data->flags & MPT_TARGET_FLAGS_VOLUME)) {
- spin_lock_irqsave(&ioc->sas_device_lock, flags);
- sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
- sas_target_priv_data->sas_address);
- if (sas_device)
- sas_device->starget = NULL;
- spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
- }
-
kfree(sdev->hostdata);
sdev->hostdata = NULL;
}
@@ -1645,10 +1598,8 @@ _scsih_set_level(struct scsi_device *sdev, struct _raid_device *raid_device)
* _scsih_get_volume_capabilities - volume capabilities
* @ioc: per adapter object
* @sas_device: the raid_device object
- *
- * Returns 0 for success, else 1
*/
-static int
+static void
_scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc,
struct _raid_device *raid_device)
{
@@ -1661,10 +1612,9 @@ _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc,
if ((mpt2sas_config_get_number_pds(ioc, raid_device->handle,
&num_pds)) || !num_pds) {
- dfailprintk(ioc, printk(MPT2SAS_WARN_FMT
- "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__,
- __func__));
- return 1;
+ printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
+ ioc->name, __FILE__, __LINE__, __func__);
+ return;
}
raid_device->num_pds = num_pds;
@@ -1672,19 +1622,17 @@ _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc,
sizeof(Mpi2RaidVol0PhysDisk_t));
vol_pg0 = kzalloc(sz, GFP_KERNEL);
if (!vol_pg0) {
- dfailprintk(ioc, printk(MPT2SAS_WARN_FMT
- "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__,
- __func__));
- return 1;
+ printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
+ ioc->name, __FILE__, __LINE__, __func__);
+ return;
}
if ((mpt2sas_config_get_raid_volume_pg0(ioc, &mpi_reply, vol_pg0,
MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) {
- dfailprintk(ioc, printk(MPT2SAS_WARN_FMT
- "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__,
- __func__));
+ printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
+ ioc->name, __FILE__, __LINE__, __func__);
kfree(vol_pg0);
- return 1;
+ return;
}
raid_device->volume_type = vol_pg0->VolumeType;
@@ -1704,7 +1652,6 @@ _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc,
}
kfree(vol_pg0);
- return 0;
}
/**
* _scsih_disable_ddio - Disable direct I/O for all the volumes
@@ -1975,20 +1922,13 @@ _scsih_slave_configure(struct scsi_device *sdev)
sas_target_priv_data->handle);
spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
if (!raid_device) {
- dfailprintk(ioc, printk(MPT2SAS_WARN_FMT
- "failure at %s:%d/%s()!\n", ioc->name, __FILE__,
- __LINE__, __func__));
- return 1;
+ printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
+ ioc->name, __FILE__, __LINE__, __func__);
+ return 0;
}
_scsih_get_volume_capabilities(ioc, raid_device);
- if (_scsih_get_volume_capabilities(ioc, raid_device)) {
- dfailprintk(ioc, printk(MPT2SAS_WARN_FMT
- "failure at %s:%d/%s()!\n", ioc->name, __FILE__,
- __LINE__, __func__));
- return 1;
- }
/*
* WARPDRIVE: Initialize the required data for Direct IO
*/
@@ -2062,22 +2002,11 @@ _scsih_slave_configure(struct scsi_device *sdev)
if (sas_device) {
if (sas_target_priv_data->flags &
MPT_TARGET_FLAGS_RAID_COMPONENT) {
- if (mpt2sas_config_get_volume_handle(ioc,
- sas_device->handle, &sas_device->volume_handle)) {
- dfailprintk(ioc, printk(MPT2SAS_WARN_FMT
- "failure at %s:%d/%s()!\n", ioc->name,
- __FILE__, __LINE__, __func__));
- return 1;
- }
- if (sas_device->volume_handle &&
- mpt2sas_config_get_volume_wwid(ioc,
+ mpt2sas_config_get_volume_handle(ioc,
+ sas_device->handle, &sas_device->volume_handle);
+ mpt2sas_config_get_volume_wwid(ioc,
sas_device->volume_handle,
- &sas_device->volume_wwid)) {
- dfailprintk(ioc, printk(MPT2SAS_WARN_FMT
- "failure at %s:%d/%s()!\n", ioc->name,
- __FILE__, __LINE__, __func__));
- return 1;
- }
+ &sas_device->volume_wwid);
}
if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET) {
qdepth = MPT2SAS_SAS_QUEUE_DEPTH;
@@ -2106,11 +2035,6 @@ _scsih_slave_configure(struct scsi_device *sdev)
if (!ssp_target)
_scsih_display_sata_capabilities(ioc, sas_device, sdev);
- } else {
- dfailprintk(ioc, printk(MPT2SAS_WARN_FMT
- "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__,
- __func__));
- return 1;
}
_scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT);
@@ -2790,43 +2714,22 @@ _scsih_fw_event_free(struct MPT2SAS_ADAPTER *ioc, struct fw_event_work
/**
- * _scsih_error_recovery_delete_devices - remove devices not responding
+ * _scsih_queue_rescan - queue a topology rescan from user context
* @ioc: per adapter object
*
* Return nothing.
*/
static void
-_scsih_error_recovery_delete_devices(struct MPT2SAS_ADAPTER *ioc)
+_scsih_queue_rescan(struct MPT2SAS_ADAPTER *ioc)
{
struct fw_event_work *fw_event;
- if (ioc->is_driver_loading)
- return;
-
- fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
- if (!fw_event)
+ if (ioc->wait_for_port_enable_to_complete)
return;
-
- fw_event->event = MPT2SAS_REMOVE_UNRESPONDING_DEVICES;
- fw_event->ioc = ioc;
- _scsih_fw_event_add(ioc, fw_event);
-}
-
-/**
- * mpt2sas_port_enable_complete - port enable completed (fake event)
- * @ioc: per adapter object
- *
- * Return nothing.
- */
-void
-mpt2sas_port_enable_complete(struct MPT2SAS_ADAPTER *ioc)
-{
- struct fw_event_work *fw_event;
-
fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
if (!fw_event)
return;
- fw_event->event = MPT2SAS_PORT_ENABLE_COMPLETE;
+ fw_event->event = MPT2SAS_RESCAN_AFTER_HOST_RESET;
fw_event->ioc = ioc;
_scsih_fw_event_add(ioc, fw_event);
}
@@ -3074,27 +2977,14 @@ _scsih_tm_tr_send(struct MPT2SAS_ADAPTER *ioc, u16 handle)
Mpi2SCSITaskManagementRequest_t *mpi_request;
u16 smid;
struct _sas_device *sas_device;
- struct MPT2SAS_TARGET *sas_target_priv_data = NULL;
- u64 sas_address = 0;
+ struct MPT2SAS_TARGET *sas_target_priv_data;
unsigned long flags;
struct _tr_list *delayed_tr;
- u32 ioc_state;
- if (ioc->remove_host) {
- dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: host has been "
- "removed: handle(0x%04x)\n", __func__, ioc->name, handle));
- return;
- } else if (ioc->pci_error_recovery) {
- dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: host in pci "
- "error recovery: handle(0x%04x)\n", __func__, ioc->name,
- handle));
- return;
- }
- ioc_state = mpt2sas_base_get_iocstate(ioc, 1);
- if (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
- dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: host is not "
- "operational: handle(0x%04x)\n", __func__, ioc->name,
- handle));
+ if (ioc->shost_recovery || ioc->remove_host ||
+ ioc->pci_error_recovery) {
+ dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: host reset in "
+ "progress!\n", __func__, ioc->name));
return;
}
@@ -3108,18 +2998,13 @@ _scsih_tm_tr_send(struct MPT2SAS_ADAPTER *ioc, u16 handle)
sas_device->starget->hostdata) {
sas_target_priv_data = sas_device->starget->hostdata;
sas_target_priv_data->deleted = 1;
- sas_address = sas_device->sas_address;
+ dewtprintk(ioc, printk(MPT2SAS_INFO_FMT
+ "setting delete flag: handle(0x%04x), "
+ "sas_addr(0x%016llx)\n", ioc->name, handle,
+ (unsigned long long) sas_device->sas_address));
}
spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
- if (sas_target_priv_data) {
- dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "setting delete flag: "
- "handle(0x%04x), sas_addr(0x%016llx)\n", ioc->name, handle,
- (unsigned long long)sas_address));
- _scsih_ublock_io_device(ioc, handle);
- sas_target_priv_data->handle = MPT2SAS_INVALID_DEVICE_HANDLE;
- }
-
smid = mpt2sas_base_get_smid_hpr(ioc, ioc->tm_tr_cb_idx);
if (!smid) {
delayed_tr = kzalloc(sizeof(*delayed_tr), GFP_ATOMIC);
@@ -3300,21 +3185,11 @@ _scsih_tm_tr_complete(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
mpt2sas_base_get_reply_virt_addr(ioc, reply);
Mpi2SasIoUnitControlRequest_t *mpi_request;
u16 smid_sas_ctrl;
- u32 ioc_state;
- if (ioc->remove_host) {
- dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: host has been "
- "removed\n", __func__, ioc->name));
- return 1;
- } else if (ioc->pci_error_recovery) {
- dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: host in pci "
- "error recovery\n", __func__, ioc->name));
- return 1;
- }
- ioc_state = mpt2sas_base_get_iocstate(ioc, 1);
- if (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
- dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: host is not "
- "operational\n", __func__, ioc->name));
+ if (ioc->shost_recovery || ioc->remove_host ||
+ ioc->pci_error_recovery) {
+ dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: host reset in "
+ "progress!\n", __func__, ioc->name));
return 1;
}
@@ -5224,7 +5099,7 @@ _scsih_add_device(struct MPT2SAS_ADAPTER *ioc, u16 handle, u8 phy_num, u8 is_pd)
/* get device name */
sas_device->device_name = le64_to_cpu(sas_device_pg0.DeviceName);
- if (ioc->wait_for_discovery_to_complete)
+ if (ioc->wait_for_port_enable_to_complete)
_scsih_sas_device_init_add(ioc, sas_device);
else
_scsih_sas_device_add(ioc, sas_device);
@@ -5260,9 +5135,6 @@ _scsih_remove_device(struct MPT2SAS_ADAPTER *ioc,
if (sas_device_backup.starget && sas_device_backup.starget->hostdata) {
sas_target_priv_data = sas_device_backup.starget->hostdata;
sas_target_priv_data->deleted = 1;
- _scsih_ublock_io_device(ioc, sas_device_backup.handle);
- sas_target_priv_data->handle =
- MPT2SAS_INVALID_DEVICE_HANDLE;
}
_scsih_ublock_io_device(ioc, sas_device_backup.handle);
@@ -5416,7 +5288,7 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
_scsih_sas_topology_change_event_debug(ioc, event_data);
#endif
- if (ioc->remove_host || ioc->pci_error_recovery)
+ if (ioc->shost_recovery || ioc->remove_host || ioc->pci_error_recovery)
return;
if (!ioc->sas_hba.num_phys)
@@ -5477,9 +5349,6 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
switch (reason_code) {
case MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED:
- if (ioc->shost_recovery)
- break;
-
if (link_rate == prev_link_rate)
break;
@@ -5493,9 +5362,6 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
break;
case MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED:
- if (ioc->shost_recovery)
- break;
-
mpt2sas_transport_update_links(ioc, sas_address,
handle, phy_number, link_rate);
@@ -5756,7 +5622,7 @@ broadcast_aen_retry:
termination_count = 0;
query_count = 0;
for (smid = 1; smid <= ioc->scsiio_depth; smid++) {
- if (ioc->shost_recovery)
+ if (ioc->ioc_reset_in_progress_status)
goto out;
scmd = _scsih_scsi_lookup_get(ioc, smid);
if (!scmd)
@@ -5778,7 +5644,7 @@ broadcast_aen_retry:
lun = sas_device_priv_data->lun;
query_count++;
- if (ioc->shost_recovery)
+ if (ioc->ioc_reset_in_progress_status)
goto out;
spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
@@ -5820,7 +5686,7 @@ broadcast_aen_retry:
goto broadcast_aen_retry;
}
- if (ioc->shost_recovery)
+ if (ioc->ioc_reset_in_progress_status)
goto out_no_lock;
r = mpt2sas_scsih_issue_tm(ioc, handle, sdev->channel, sdev->id,
@@ -5859,7 +5725,7 @@ broadcast_aen_retry:
ioc->name, __func__, query_count, termination_count));
ioc->broadcast_aen_busy = 0;
- if (!ioc->shost_recovery)
+ if (!ioc->ioc_reset_in_progress_status)
_scsih_ublock_io_all_device(ioc);
mutex_unlock(&ioc->tm_cmds.mutex);
}
@@ -5923,11 +5789,8 @@ _scsih_reprobe_lun(struct scsi_device *sdev, void *no_uld_attach)
static void
_scsih_reprobe_target(struct scsi_target *starget, int no_uld_attach)
{
- struct MPT2SAS_TARGET *sas_target_priv_data;
+ struct MPT2SAS_TARGET *sas_target_priv_data = starget->hostdata;
- if (starget == NULL)
- return;
- sas_target_priv_data = starget->hostdata;
if (no_uld_attach)
sas_target_priv_data->flags |= MPT_TARGET_FLAGS_RAID_COMPONENT;
else
@@ -5982,7 +5845,7 @@ _scsih_sas_volume_add(struct MPT2SAS_ADAPTER *ioc,
raid_device->handle = handle;
raid_device->wwid = wwid;
_scsih_raid_device_add(ioc, raid_device);
- if (!ioc->wait_for_discovery_to_complete) {
+ if (!ioc->wait_for_port_enable_to_complete) {
rc = scsi_add_device(ioc->shost, RAID_CHANNEL,
raid_device->id, 0);
if (rc)
@@ -6264,10 +6127,6 @@ _scsih_sas_ir_config_change_event(struct MPT2SAS_ADAPTER *ioc,
_scsih_sas_ir_config_change_event_debug(ioc, event_data);
#endif
-
- if (ioc->shost_recovery)
- return;
-
foreign_config = (le32_to_cpu(event_data->Flags) &
MPI2_EVENT_IR_CHANGE_FLAGS_FOREIGN_CONFIG) ? 1 : 0;
@@ -6326,9 +6185,6 @@ _scsih_sas_ir_volume_event(struct MPT2SAS_ADAPTER *ioc,
int rc;
Mpi2EventDataIrVolume_t *event_data = fw_event->event_data;
- if (ioc->shost_recovery)
- return;
-
if (event_data->ReasonCode != MPI2_EVENT_IR_VOLUME_RC_STATE_CHANGED)
return;
@@ -6411,9 +6267,6 @@ _scsih_sas_ir_physical_disk_event(struct MPT2SAS_ADAPTER *ioc,
Mpi2EventDataIrPhysicalDisk_t *event_data = fw_event->event_data;
u64 sas_address;
- if (ioc->shost_recovery)
- return;
-
if (event_data->ReasonCode != MPI2_EVENT_IR_PHYSDISK_RC_STATE_CHANGED)
return;
@@ -6657,10 +6510,10 @@ _scsih_search_responding_sas_devices(struct MPT2SAS_ADAPTER *ioc)
u32 device_info;
u16 slot;
- printk(MPT2SAS_INFO_FMT "search for end-devices: start\n", ioc->name);
+ printk(MPT2SAS_INFO_FMT "%s\n", ioc->name, __func__);
if (list_empty(&ioc->sas_device_list))
- goto out;
+ return;
handle = 0xFFFF;
while (!(mpt2sas_config_get_sas_device_pg0(ioc, &mpi_reply,
@@ -6679,9 +6532,6 @@ _scsih_search_responding_sas_devices(struct MPT2SAS_ADAPTER *ioc)
_scsih_mark_responding_sas_device(ioc, sas_address, slot,
handle);
}
-out:
- printk(MPT2SAS_INFO_FMT "search for end-devices: complete\n",
- ioc->name);
}
/**
@@ -6757,14 +6607,10 @@ _scsih_search_responding_raid_devices(struct MPT2SAS_ADAPTER *ioc)
u16 handle;
u8 phys_disk_num;
- if (!ioc->ir_firmware)
- return;
-
- printk(MPT2SAS_INFO_FMT "search for raid volumes: start\n",
- ioc->name);
+ printk(MPT2SAS_INFO_FMT "%s\n", ioc->name, __func__);
if (list_empty(&ioc->raid_device_list))
- goto out;
+ return;
handle = 0xFFFF;
while (!(mpt2sas_config_get_raid_volume_pg1(ioc, &mpi_reply,
@@ -6803,9 +6649,6 @@ _scsih_search_responding_raid_devices(struct MPT2SAS_ADAPTER *ioc)
set_bit(handle, ioc->pd_handles);
}
}
-out:
- printk(MPT2SAS_INFO_FMT "search for responding raid volumes: "
- "complete\n", ioc->name);
}
/**
@@ -6865,10 +6708,10 @@ _scsih_search_responding_expanders(struct MPT2SAS_ADAPTER *ioc)
u64 sas_address;
u16 handle;
- printk(MPT2SAS_INFO_FMT "search for expanders: start\n", ioc->name);
+ printk(MPT2SAS_INFO_FMT "%s\n", ioc->name, __func__);
if (list_empty(&ioc->sas_expander_list))
- goto out;
+ return;
handle = 0xFFFF;
while (!(mpt2sas_config_get_expander_pg0(ioc, &mpi_reply, &expander_pg0,
@@ -6887,8 +6730,6 @@ _scsih_search_responding_expanders(struct MPT2SAS_ADAPTER *ioc)
_scsih_mark_responding_expander(ioc, sas_address, handle);
}
- out:
- printk(MPT2SAS_INFO_FMT "search for expanders: complete\n", ioc->name);
}
/**
@@ -6904,8 +6745,6 @@ _scsih_remove_unresponding_sas_devices(struct MPT2SAS_ADAPTER *ioc)
struct _sas_node *sas_expander;
struct _raid_device *raid_device, *raid_device_next;
- printk(MPT2SAS_INFO_FMT "removing unresponding devices: start\n",
- ioc->name);
list_for_each_entry_safe(sas_device, sas_device_next,
&ioc->sas_device_list, list) {
@@ -6925,9 +6764,6 @@ _scsih_remove_unresponding_sas_devices(struct MPT2SAS_ADAPTER *ioc)
_scsih_remove_device(ioc, sas_device);
}
- if (!ioc->ir_firmware)
- goto retry_expander_search;
-
list_for_each_entry_safe(raid_device, raid_device_next,
&ioc->raid_device_list, list) {
if (raid_device->responding) {
@@ -6954,170 +6790,52 @@ _scsih_remove_unresponding_sas_devices(struct MPT2SAS_ADAPTER *ioc)
mpt2sas_expander_remove(ioc, sas_expander->sas_address);
goto retry_expander_search;
}
- printk(MPT2SAS_INFO_FMT "removing unresponding devices: complete\n",
- ioc->name);
- /* unblock devices */
- _scsih_ublock_io_all_device(ioc);
-}
-
-static void
-_scsih_refresh_expander_links(struct MPT2SAS_ADAPTER *ioc,
- struct _sas_node *sas_expander, u16 handle)
-{
- Mpi2ExpanderPage1_t expander_pg1;
- Mpi2ConfigReply_t mpi_reply;
- int i;
-
- for (i = 0 ; i < sas_expander->num_phys ; i++) {
- if ((mpt2sas_config_get_expander_pg1(ioc, &mpi_reply,
- &expander_pg1, i, handle))) {
- printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
- ioc->name, __FILE__, __LINE__, __func__);
- return;
- }
-
- mpt2sas_transport_update_links(ioc, sas_expander->sas_address,
- le16_to_cpu(expander_pg1.AttachedDevHandle), i,
- expander_pg1.NegotiatedLinkRate >> 4);
- }
}
/**
- * _scsih_scan_for_devices_after_reset - scan for devices after host reset
+ * _scsih_hide_unhide_sas_devices - add/remove device to/from OS
* @ioc: per adapter object
*
* Return nothing.
*/
static void
-_scsih_scan_for_devices_after_reset(struct MPT2SAS_ADAPTER *ioc)
+_scsih_hide_unhide_sas_devices(struct MPT2SAS_ADAPTER *ioc)
{
- Mpi2ExpanderPage0_t expander_pg0;
- Mpi2SasDevicePage0_t sas_device_pg0;
- Mpi2RaidVolPage1_t volume_pg1;
- Mpi2RaidVolPage0_t volume_pg0;
- Mpi2RaidPhysDiskPage0_t pd_pg0;
- Mpi2EventIrConfigElement_t element;
- Mpi2ConfigReply_t mpi_reply;
- u8 phys_disk_num;
- u16 ioc_status;
- u16 handle, parent_handle;
- u64 sas_address;
- struct _sas_device *sas_device;
- struct _sas_node *expander_device;
- static struct _raid_device *raid_device;
-
- printk(MPT2SAS_INFO_FMT "scan devices: start\n", ioc->name);
-
- _scsih_sas_host_refresh(ioc);
-
- /* expanders */
- handle = 0xFFFF;
- while (!(mpt2sas_config_get_expander_pg0(ioc, &mpi_reply, &expander_pg0,
- MPI2_SAS_EXPAND_PGAD_FORM_GET_NEXT_HNDL, handle))) {
- ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
- MPI2_IOCSTATUS_MASK;
- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
- break;
- handle = le16_to_cpu(expander_pg0.DevHandle);
- expander_device = mpt2sas_scsih_expander_find_by_sas_address(
- ioc, le64_to_cpu(expander_pg0.SASAddress));
- if (expander_device)
- _scsih_refresh_expander_links(ioc, expander_device,
- handle);
- else
- _scsih_expander_add(ioc, handle);
- }
-
- if (!ioc->ir_firmware)
- goto skip_to_sas;
+ struct _sas_device *sas_device, *sas_device_next;
- /* phys disk */
- phys_disk_num = 0xFF;
- while (!(mpt2sas_config_get_phys_disk_pg0(ioc, &mpi_reply,
- &pd_pg0, MPI2_PHYSDISK_PGAD_FORM_GET_NEXT_PHYSDISKNUM,
- phys_disk_num))) {
- ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
- MPI2_IOCSTATUS_MASK;
- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
- break;
- phys_disk_num = pd_pg0.PhysDiskNum;
- handle = le16_to_cpu(pd_pg0.DevHandle);
- sas_device = _scsih_sas_device_find_by_handle(ioc, handle);
- if (sas_device)
- continue;
- if (mpt2sas_config_get_sas_device_pg0(ioc, &mpi_reply,
- &sas_device_pg0, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE,
- handle) != 0)
- continue;
- parent_handle = le16_to_cpu(sas_device_pg0.ParentDevHandle);
- if (!_scsih_get_sas_address(ioc, parent_handle,
- &sas_address)) {
- mpt2sas_transport_update_links(ioc, sas_address,
- handle, sas_device_pg0.PhyNum,
- MPI2_SAS_NEG_LINK_RATE_1_5);
- set_bit(handle, ioc->pd_handles);
- _scsih_add_device(ioc, handle, 0, 1);
- }
- }
+ if (!ioc->is_warpdrive || ioc->mfg_pg10_hide_flag !=
+ MFG_PAGE10_HIDE_IF_VOL_PRESENT)
+ return;
- /* volumes */
- handle = 0xFFFF;
- while (!(mpt2sas_config_get_raid_volume_pg1(ioc, &mpi_reply,
- &volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
- ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
- MPI2_IOCSTATUS_MASK;
- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
- break;
- handle = le16_to_cpu(volume_pg1.DevHandle);
- raid_device = _scsih_raid_device_find_by_wwid(ioc,
- le64_to_cpu(volume_pg1.WWID));
- if (raid_device)
- continue;
- if (mpt2sas_config_get_raid_volume_pg0(ioc, &mpi_reply,
- &volume_pg0, MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle,
- sizeof(Mpi2RaidVolPage0_t)))
- continue;
- if (volume_pg0.VolumeState == MPI2_RAID_VOL_STATE_OPTIMAL ||
- volume_pg0.VolumeState == MPI2_RAID_VOL_STATE_ONLINE ||
- volume_pg0.VolumeState == MPI2_RAID_VOL_STATE_DEGRADED) {
- memset(&element, 0, sizeof(Mpi2EventIrConfigElement_t));
- element.ReasonCode = MPI2_EVENT_IR_CHANGE_RC_ADDED;
- element.VolDevHandle = volume_pg1.DevHandle;
- _scsih_sas_volume_add(ioc, &element);
+ if (ioc->hide_drives) {
+ if (_scsih_get_num_volumes(ioc))
+ return;
+ ioc->hide_drives = 0;
+ list_for_each_entry_safe(sas_device, sas_device_next,
+ &ioc->sas_device_list, list) {
+ if (!mpt2sas_transport_port_add(ioc, sas_device->handle,
+ sas_device->sas_address_parent)) {
+ _scsih_sas_device_remove(ioc, sas_device);
+ } else if (!sas_device->starget) {
+ mpt2sas_transport_port_remove(ioc,
+ sas_device->sas_address,
+ sas_device->sas_address_parent);
+ _scsih_sas_device_remove(ioc, sas_device);
+ }
}
- }
-
- skip_to_sas:
-
- /* sas devices */
- handle = 0xFFFF;
- while (!(mpt2sas_config_get_sas_device_pg0(ioc, &mpi_reply,
- &sas_device_pg0, MPI2_SAS_DEVICE_PGAD_FORM_GET_NEXT_HANDLE,
- handle))) {
- ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
- MPI2_IOCSTATUS_MASK;
- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
- break;
- handle = le16_to_cpu(sas_device_pg0.DevHandle);
- if (!(_scsih_is_end_device(
- le32_to_cpu(sas_device_pg0.DeviceInfo))))
- continue;
- sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
- le64_to_cpu(sas_device_pg0.SASAddress));
- if (sas_device)
- continue;
- parent_handle = le16_to_cpu(sas_device_pg0.ParentDevHandle);
- if (!_scsih_get_sas_address(ioc, parent_handle, &sas_address)) {
- mpt2sas_transport_update_links(ioc, sas_address, handle,
- sas_device_pg0.PhyNum, MPI2_SAS_NEG_LINK_RATE_1_5);
- _scsih_add_device(ioc, handle, 0, 0);
+ } else {
+ if (!_scsih_get_num_volumes(ioc))
+ return;
+ ioc->hide_drives = 1;
+ list_for_each_entry_safe(sas_device, sas_device_next,
+ &ioc->sas_device_list, list) {
+ mpt2sas_transport_port_remove(ioc,
+ sas_device->sas_address,
+ sas_device->sas_address_parent);
}
}
-
- printk(MPT2SAS_INFO_FMT "scan devices: complete\n", ioc->name);
}
-
/**
* mpt2sas_scsih_reset_handler - reset callback handler (for scsih)
* @ioc: per adapter object
@@ -7153,6 +6871,7 @@ mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase)
}
_scsih_fw_event_cleanup_queue(ioc);
_scsih_flush_running_cmds(ioc);
+ _scsih_queue_rescan(ioc);
break;
case MPT2_IOC_DONE_RESET:
dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: "
@@ -7162,13 +6881,6 @@ mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase)
_scsih_search_responding_sas_devices(ioc);
_scsih_search_responding_raid_devices(ioc);
_scsih_search_responding_expanders(ioc);
- if (!ioc->is_driver_loading) {
- _scsih_prep_device_scan(ioc);
- _scsih_search_responding_sas_devices(ioc);
- _scsih_search_responding_raid_devices(ioc);
- _scsih_search_responding_expanders(ioc);
- _scsih_error_recovery_delete_devices(ioc);
- }
break;
}
}
@@ -7186,6 +6898,7 @@ _firmware_event_work(struct work_struct *work)
{
struct fw_event_work *fw_event = container_of(work,
struct fw_event_work, delayed_work.work);
+ unsigned long flags;
struct MPT2SAS_ADAPTER *ioc = fw_event->ioc;
/* the queue is being flushed so ignore this event */
@@ -7195,21 +6908,23 @@ _firmware_event_work(struct work_struct *work)
return;
}
- switch (fw_event->event) {
- case MPT2SAS_REMOVE_UNRESPONDING_DEVICES:
- while (scsi_host_in_recovery(ioc->shost))
- ssleep(1);
+ if (fw_event->event == MPT2SAS_RESCAN_AFTER_HOST_RESET) {
+ _scsih_fw_event_free(ioc, fw_event);
+ spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
+ if (ioc->shost_recovery) {
+ init_completion(&ioc->shost_recovery_done);
+ spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock,
+ flags);
+ wait_for_completion(&ioc->shost_recovery_done);
+ } else
+ spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock,
+ flags);
_scsih_remove_unresponding_sas_devices(ioc);
- _scsih_scan_for_devices_after_reset(ioc);
- break;
- case MPT2SAS_PORT_ENABLE_COMPLETE:
- ioc->start_scan = 0;
-
-
+ _scsih_hide_unhide_sas_devices(ioc);
+ return;
+ }
- dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "port enable: complete "
- "from worker thread\n", ioc->name));
- break;
+ switch (fw_event->event) {
case MPT2SAS_TURN_ON_FAULT_LED:
_scsih_turn_on_fault_led(ioc, fw_event->device_handle);
break;
@@ -7406,8 +7121,6 @@ static struct scsi_host_template scsih_driver_template = {
.slave_configure = _scsih_slave_configure,
.target_destroy = _scsih_target_destroy,
.slave_destroy = _scsih_slave_destroy,
- .scan_finished = _scsih_scan_finished,
- .scan_start = _scsih_scan_start,
.change_queue_depth = _scsih_change_queue_depth,
.change_queue_type = _scsih_change_queue_type,
.eh_abort_handler = _scsih_abort,
@@ -7668,12 +7381,7 @@ _scsih_probe_boot_devices(struct MPT2SAS_ADAPTER *ioc)
unsigned long flags;
int rc;
- /* no Bios, return immediately */
- if (!ioc->bios_pg3.BiosVersion)
- return;
-
device = NULL;
- is_raid = 0;
if (ioc->req_boot_device.device) {
device = ioc->req_boot_device.device;
is_raid = ioc->req_boot_device.is_raid;
@@ -7709,9 +7417,8 @@ _scsih_probe_boot_devices(struct MPT2SAS_ADAPTER *ioc)
sas_device->sas_address_parent)) {
_scsih_sas_device_remove(ioc, sas_device);
} else if (!sas_device->starget) {
- if (!ioc->is_driver_loading)
- mpt2sas_transport_port_remove(ioc, sas_address,
- sas_address_parent);
+ mpt2sas_transport_port_remove(ioc, sas_address,
+ sas_address_parent);
_scsih_sas_device_remove(ioc, sas_device);
}
}
@@ -7755,28 +7462,22 @@ _scsih_probe_sas(struct MPT2SAS_ADAPTER *ioc)
/* SAS Device List */
list_for_each_entry_safe(sas_device, next, &ioc->sas_device_init_list,
list) {
+ spin_lock_irqsave(&ioc->sas_device_lock, flags);
+ list_move_tail(&sas_device->list, &ioc->sas_device_list);
+ spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
if (ioc->hide_drives)
continue;
if (!mpt2sas_transport_port_add(ioc, sas_device->handle,
sas_device->sas_address_parent)) {
- list_del(&sas_device->list);
- kfree(sas_device);
- continue;
+ _scsih_sas_device_remove(ioc, sas_device);
} else if (!sas_device->starget) {
- if (!ioc->is_driver_loading)
- mpt2sas_transport_port_remove(ioc,
- sas_device->sas_address,
- sas_device->sas_address_parent);
- list_del(&sas_device->list);
- kfree(sas_device);
- continue;
-
+ mpt2sas_transport_port_remove(ioc,
+ sas_device->sas_address,
+ sas_device->sas_address_parent);
+ _scsih_sas_device_remove(ioc, sas_device);
}
- spin_lock_irqsave(&ioc->sas_device_lock, flags);
- list_move_tail(&sas_device->list, &ioc->sas_device_list);
- spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
}
}
@@ -7789,7 +7490,9 @@ _scsih_probe_sas(struct MPT2SAS_ADAPTER *ioc)
static void
_scsih_probe_devices(struct MPT2SAS_ADAPTER *ioc)
{
- u16 volume_mapping_flags;
+ u16 volume_mapping_flags =
+ le16_to_cpu(ioc->ioc_pg8.IRVolumeMappingFlags) &
+ MPI2_IOCPAGE8_IRFLAGS_MASK_VOLUME_MAPPING_MODE;
if (!(ioc->facts.ProtocolFlags & MPI2_IOCFACTS_PROTOCOL_SCSI_INITIATOR))
return; /* return when IOC doesn't support initiator mode */
@@ -7797,93 +7500,18 @@ _scsih_probe_devices(struct MPT2SAS_ADAPTER *ioc)
_scsih_probe_boot_devices(ioc);
if (ioc->ir_firmware) {
- volume_mapping_flags =
- le16_to_cpu(ioc->ioc_pg8.IRVolumeMappingFlags) &
- MPI2_IOCPAGE8_IRFLAGS_MASK_VOLUME_MAPPING_MODE;
- if (volume_mapping_flags ==
- MPI2_IOCPAGE8_IRFLAGS_LOW_VOLUME_MAPPING) {
- _scsih_probe_raid(ioc);
+ if ((volume_mapping_flags &
+ MPI2_IOCPAGE8_IRFLAGS_HIGH_VOLUME_MAPPING)) {
_scsih_probe_sas(ioc);
+ _scsih_probe_raid(ioc);
} else {
- _scsih_probe_sas(ioc);
_scsih_probe_raid(ioc);
+ _scsih_probe_sas(ioc);
}
} else
_scsih_probe_sas(ioc);
}
-
-/**
- * _scsih_scan_start - scsi lld callback for .scan_start
- * @shost: SCSI host pointer
- *
- * The shost has the ability to discover targets on its own instead
- * of scanning the entire bus. In our implemention, we will kick off
- * firmware discovery.
- */
-static void
-_scsih_scan_start(struct Scsi_Host *shost)
-{
- struct MPT2SAS_ADAPTER *ioc = shost_priv(shost);
- int rc;
-
- if (diag_buffer_enable != -1 && diag_buffer_enable != 0)
- mpt2sas_enable_diag_buffer(ioc, diag_buffer_enable);
-
- ioc->start_scan = 1;
- rc = mpt2sas_port_enable(ioc);
-
- if (rc != 0)
- printk(MPT2SAS_INFO_FMT "port enable: FAILED\n", ioc->name);
-}
-
-/**
- * _scsih_scan_finished - scsi lld callback for .scan_finished
- * @shost: SCSI host pointer
- * @time: elapsed time of the scan in jiffies
- *
- * This function will be called periodically until it returns 1 with the
- * scsi_host and the elapsed time of the scan in jiffies. In our implemention,
- * we wait for firmware discovery to complete, then return 1.
- */
-static int
-_scsih_scan_finished(struct Scsi_Host *shost, unsigned long time)
-{
- struct MPT2SAS_ADAPTER *ioc = shost_priv(shost);
-
- if (time >= (300 * HZ)) {
- ioc->base_cmds.status = MPT2_CMD_NOT_USED;
- printk(MPT2SAS_INFO_FMT "port enable: FAILED with timeout "
- "(timeout=300s)\n", ioc->name);
- ioc->is_driver_loading = 0;
- return 1;
- }
-
- if (ioc->start_scan)
- return 0;
-
- if (ioc->start_scan_failed) {
- printk(MPT2SAS_INFO_FMT "port enable: FAILED with "
- "(ioc_status=0x%08x)\n", ioc->name, ioc->start_scan_failed);
- ioc->is_driver_loading = 0;
- ioc->wait_for_discovery_to_complete = 0;
- ioc->remove_host = 1;
- return 1;
- }
-
- printk(MPT2SAS_INFO_FMT "port enable: SUCCESS\n", ioc->name);
- ioc->base_cmds.status = MPT2_CMD_NOT_USED;
-
- if (ioc->wait_for_discovery_to_complete) {
- ioc->wait_for_discovery_to_complete = 0;
- _scsih_probe_devices(ioc);
- }
- mpt2sas_base_start_watchdog(ioc);
- ioc->is_driver_loading = 0;
- return 1;
-}
-
-
/**
* _scsih_probe - attach and add scsi host
* @pdev: PCI device struct
@@ -7920,7 +7548,6 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ioc->tm_cb_idx = tm_cb_idx;
ioc->ctl_cb_idx = ctl_cb_idx;
ioc->base_cb_idx = base_cb_idx;
- ioc->port_enable_cb_idx = port_enable_cb_idx;
ioc->transport_cb_idx = transport_cb_idx;
ioc->scsih_cb_idx = scsih_cb_idx;
ioc->config_cb_idx = config_cb_idx;
@@ -7993,14 +7620,14 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto out_thread_fail;
}
- ioc->is_driver_loading = 1;
+ ioc->wait_for_port_enable_to_complete = 1;
if ((mpt2sas_base_attach(ioc))) {
printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
ioc->name, __FILE__, __LINE__, __func__);
goto out_attach_fail;
}
- scsi_scan_host(shost);
+ ioc->wait_for_port_enable_to_complete = 0;
if (ioc->is_warpdrive) {
if (ioc->mfg_pg10_hide_flag == MFG_PAGE10_EXPOSE_ALL_DISKS)
ioc->hide_drives = 0;
@@ -8023,7 +7650,6 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
out_thread_fail:
list_del(&ioc->list);
scsi_remove_host(shost);
- scsi_host_put(shost);
out_add_shost_fail:
return -ENODEV;
}
@@ -8270,8 +7896,6 @@ _scsih_init(void)
/* base internal commands callback handler */
base_cb_idx = mpt2sas_base_register_callback_handler(mpt2sas_base_done);
- port_enable_cb_idx = mpt2sas_base_register_callback_handler(
- mpt2sas_port_enable_done);
/* transport internal commands callback handler */
transport_cb_idx = mpt2sas_base_register_callback_handler(
@@ -8326,7 +7950,6 @@ _scsih_exit(void)
mpt2sas_base_release_callback_handler(scsi_io_cb_idx);
mpt2sas_base_release_callback_handler(tm_cb_idx);
mpt2sas_base_release_callback_handler(base_cb_idx);
- mpt2sas_base_release_callback_handler(port_enable_cb_idx);
mpt2sas_base_release_callback_handler(transport_cb_idx);
mpt2sas_base_release_callback_handler(scsih_cb_idx);
mpt2sas_base_release_callback_handler(config_cb_idx);
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: mpt2sas regression: can not add disk...
2011-12-07 0:15 ` Yinghai Lu
@ 2011-12-07 17:54 ` Desai, Kashyap
2011-12-08 13:30 ` Desai, Kashyap
0 siblings, 1 reply; 8+ messages in thread
From: Desai, Kashyap @ 2011-12-07 17:54 UTC (permalink / raw)
To: Yinghai Lu, Nandigama, Nagalakshmi, James Bottomley,
Rafael J. Wysocki
Cc: linux-scsi-owner@vger.kernel.org, James Bottomley,
linux-scsi@vger.kernel.org, Linux Kernel Mailing List
Yinghai,
I am trying to reproduce this issue locally and get back to you with my findings.
Thanks, Kashyap
> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Yinghai Lu
> Sent: Wednesday, December 07, 2011 5:45 AM
> To: Nandigama, Nagalakshmi; James Bottomley; Rafael J. Wysocki
> Cc: linux-scsi-owner@vger.kernel.org; James Bottomley; linux-
> scsi@vger.kernel.org; Linux Kernel Mailing List
> Subject: Re: mpt2sas regression: can not add disk...
>
> On Mon, Nov 28, 2011 at 12:00 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> > On Sun, Nov 27, 2011 at 10:09 PM, Nandigama, Nagalakshmi
> > <Nagalakshmi.Nandigama@lsi.com> wrote:
> >> Yinghai Lu,
> >>
> >> Please set the driver logging level to 0x421F8 (echo 0x421F8 >
> >> /sys/module/mpt2sas/parameters/logging_level) and the scsi logging
> >> level to 0x180000F1 (echo 0x180000F1 >
> >> /proc/sys/dev/scsi/logging_level) and recreate the issue and provide
> >> the var/log/message
> >>
> >
> > please check two print out...
>
> James,
>
> one week passed, did not hear anything from the original author.
>
> Can you revert offending commit ?
>
> it is 921cd8024b908f8f49f772c8d3a02381b4db2ed2
> and several related commits after that.
>
> please check attached reverting patch that i used locally.
>
> Thanks
>
> Yinghai
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: mpt2sas regression: can not add disk...
2011-12-07 17:54 ` Desai, Kashyap
@ 2011-12-08 13:30 ` Desai, Kashyap
2011-12-08 21:09 ` Yinghai Lu
0 siblings, 1 reply; 8+ messages in thread
From: Desai, Kashyap @ 2011-12-08 13:30 UTC (permalink / raw)
To: Yinghai Lu, Nandigama, Nagalakshmi, James Bottomley,
Rafael J. Wysocki
Cc: linux-scsi-owner@vger.kernel.org, James Bottomley,
linux-scsi@vger.kernel.org, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 2646 bytes --]
Yinghai,
Please try attached patch. This must be on top of latest upstream code.
When we have introduced fast load, scan of devices are happening from thread context.
But currently we have not removed " _scsih_probe_devices(ioc);" call from actual probe and it is getting called from multiple places.
As a result, we end-up into this issue.
Please try the attached patch and provide your feedback. Based upon your result, we will post this patch to upstream.
Thanks, Kashyap
> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Desai, Kashyap
> Sent: Wednesday, December 07, 2011 11:25 PM
> To: Yinghai Lu; Nandigama, Nagalakshmi; James Bottomley; Rafael J.
> Wysocki
> Cc: linux-scsi-owner@vger.kernel.org; James Bottomley; linux-
> scsi@vger.kernel.org; Linux Kernel Mailing List
> Subject: RE: mpt2sas regression: can not add disk...
>
> Yinghai,
>
> I am trying to reproduce this issue locally and get back to you with my
> findings.
>
>
> Thanks, Kashyap
>
> > -----Original Message-----
> > From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> > owner@vger.kernel.org] On Behalf Of Yinghai Lu
> > Sent: Wednesday, December 07, 2011 5:45 AM
> > To: Nandigama, Nagalakshmi; James Bottomley; Rafael J. Wysocki
> > Cc: linux-scsi-owner@vger.kernel.org; James Bottomley; linux-
> > scsi@vger.kernel.org; Linux Kernel Mailing List
> > Subject: Re: mpt2sas regression: can not add disk...
> >
> > On Mon, Nov 28, 2011 at 12:00 PM, Yinghai Lu <yinghai@kernel.org>
> wrote:
> > > On Sun, Nov 27, 2011 at 10:09 PM, Nandigama, Nagalakshmi
> > > <Nagalakshmi.Nandigama@lsi.com> wrote:
> > >> Yinghai Lu,
> > >>
> > >> Please set the driver logging level to 0x421F8 (echo 0x421F8 >
> > >> /sys/module/mpt2sas/parameters/logging_level) and the scsi logging
> > >> level to 0x180000F1 (echo 0x180000F1 >
> > >> /proc/sys/dev/scsi/logging_level) and recreate the issue and
> provide
> > >> the var/log/message
> > >>
> > >
> > > please check two print out...
> >
> > James,
> >
> > one week passed, did not hear anything from the original author.
> >
> > Can you revert offending commit ?
> >
> > it is 921cd8024b908f8f49f772c8d3a02381b4db2ed2
> > and several related commits after that.
> >
> > please check attached reverting patch that i used locally.
> >
> > Thanks
> >
> > Yinghai
> --
> 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
[-- Attachment #2: fast_load_probe_devices.patch --]
[-- Type: application/octet-stream, Size: 392 bytes --]
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 4e041f6..74366cb 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -8015,7 +8015,6 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
} else
ioc->hide_drives = 0;
- _scsih_probe_devices(ioc);
return 0;
out_attach_fail:
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: mpt2sas regression: can not add disk...
2011-12-08 13:30 ` Desai, Kashyap
@ 2011-12-08 21:09 ` Yinghai Lu
2011-12-09 14:56 ` Desai, Kashyap
0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2011-12-08 21:09 UTC (permalink / raw)
To: Desai, Kashyap
Cc: Nandigama, Nagalakshmi, James Bottomley, Rafael J. Wysocki,
linux-scsi-owner@vger.kernel.org, James Bottomley,
linux-scsi@vger.kernel.org, Linux Kernel Mailing List
On Thu, Dec 8, 2011 at 5:30 AM, Desai, Kashyap <Kashyap.Desai@lsi.com> wrote:
> Yinghai,
>
> Please try attached patch. This must be on top of latest upstream code.
> When we have introduced fast load, scan of devices are happening from thread context.
>
> But currently we have not removed " _scsih_probe_devices(ioc);" call from actual probe and it is getting called from multiple places.
> As a result, we end-up into this issue.
>
> Please try the attached patch and provide your feedback. Based upon your result, we will post this patch to upstream.
Yes. The attaced patch fix the problem. the disk that is attached to
the mpt2sas card is showing up in OS.
Thanks
Yinghai Lu
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: mpt2sas regression: can not add disk...
2011-12-08 21:09 ` Yinghai Lu
@ 2011-12-09 14:56 ` Desai, Kashyap
0 siblings, 0 replies; 8+ messages in thread
From: Desai, Kashyap @ 2011-12-09 14:56 UTC (permalink / raw)
To: Yinghai Lu
Cc: Nandigama, Nagalakshmi, James Bottomley, Rafael J. Wysocki,
linux-scsi-owner@vger.kernel.org, James Bottomley,
linux-scsi@vger.kernel.org, Linux Kernel Mailing List
> -----Original Message-----
> From: yhlu.kernel@gmail.com [mailto:yhlu.kernel@gmail.com] On Behalf Of
> Yinghai Lu
> Sent: Friday, December 09, 2011 2:40 AM
> To: Desai, Kashyap
> Cc: Nandigama, Nagalakshmi; James Bottomley; Rafael J. Wysocki; linux-
> scsi-owner@vger.kernel.org; James Bottomley; linux-scsi@vger.kernel.org;
> Linux Kernel Mailing List
> Subject: Re: mpt2sas regression: can not add disk...
>
> On Thu, Dec 8, 2011 at 5:30 AM, Desai, Kashyap <Kashyap.Desai@lsi.com>
> wrote:
> > Yinghai,
> >
> > Please try attached patch. This must be on top of latest upstream
> code.
> > When we have introduced fast load, scan of devices are happening from
> thread context.
> >
> > But currently we have not removed " _scsih_probe_devices(ioc);" call
> from actual probe and it is getting called from multiple places.
> > As a result, we end-up into this issue.
> >
> > Please try the attached patch and provide your feedback. Based upon
> your result, we will post this patch to upstream.
>
> Yes. The attaced patch fix the problem. the disk that is attached to
> the mpt2sas card is showing up in OS.
Thanks for the test report. LSI will post this patch to upstream.
` Kashyap
>
> Thanks
>
> Yinghai Lu
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-12-09 14:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <7863850E8C98C748980632D9D3B7C19911968B8AE5@inbmail02.lsi.com>
2011-11-28 6:09 ` mpt2sas regression: can not add disk Nandigama, Nagalakshmi
2011-11-28 20:00 ` Yinghai Lu
2011-12-07 0:15 ` Yinghai Lu
2011-12-07 17:54 ` Desai, Kashyap
2011-12-08 13:30 ` Desai, Kashyap
2011-12-08 21:09 ` Yinghai Lu
2011-12-09 14:56 ` Desai, Kashyap
2011-11-22 3:12 Yinghai Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).