Commit graph

321880 commits

Author SHA1 Message Date
Mike Miller fe0c9610bb [SCSI] hpsa: gen8plus Smart Array IDs
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:52:50 +04:00
Vikas Chaudhary 65a17da82a [SCSI] qla4xxx: Update driver version to 5.03.00-k1
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:49:47 +04:00
Tej Parkash 546fef27c3 [SCSI] qla4xxx: Disable generating pause frames for ISP83XX
In case of FW hung ISP83XX generates continuous pause frames
which causes switch to disable port.
Added fix to disable generating pause frames in case of
FW hung

Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:49:00 +04:00
Manish Dusane 48a859d29f [SCSI] qla4xxx: Fix double clearing of risc_intr for ISP83XX
Issue:
For ISP83XX risc_intr getting clear two times in case of polling mode.
risc_intr getting clear from interrupt_service_routine() as well
from process_mbox_intr() because of this driver may clear risc_intr
without processing interrupt.

Fix:
Do not clear risc_intr from process_mbox_intr().

Signed-off-by: Manish Dusane <manish.dusane@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:45:31 +04:00
Nilesh Javali 320a61de9d [SCSI] qla4xxx: IDC implementation for Loopback
Handle IDC Request Notify AEN and post IDC Acknowledgement
while participating in Loopback IDC.

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:41:53 +04:00
Vikas Chaudhary a9b0347f4d [SCSI] qla4xxx: update copyrights in LICENSE.qla4xxx
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:41:34 +04:00
Vikas Chaudhary f8b0751de6 [SCSI] qla4xxx: Fix panic while rmmod
Issue:
System panic on rmmod if probe_adapter had failed during driver load.

Call Trace:
 [<ffffffffa071aa5a>] qla4xxx_abort_active_cmds+0x4a/0xa0 [qla4xxx]
 [<ffffffffa07224db>] qla4xxx_free_adapter+0x1b/0x1b0 [qla4xxx]
 [<ffffffffa073991f>] qla4xxx_remove_adapter+0x294/0x2c7 [qla4xxx]
 [<ffffffff812930b7>] pci_device_remove+0x37/0x70
 [<ffffffff8135006f>] __device_release_driver+0x6f/0xe0
 [<ffffffff813501a8>] driver_detach+0xc8/0xd0
 [<ffffffff8134ef0e>] bus_remove_driver+0x8e/0x110
 [<ffffffff81350972>] driver_unregister+0x62/0xa0
 [<ffffffff812933c4>] pci_unregister_driver+0x44/0xb0
 [<ffffffffa0739659>] qla4xxx_module_exit+0x15/0x47 [qla4xxx]
 [<ffffffff810addd4>] sys_delete_module+0x194/0x260
 [<ffffffff8150326e>] ? do_page_fault+0x3e/0xa0
 [<ffffffff8100b0f2>] system_call_fastpath+0x16/0x1b

Fix:
Do not cleanup resources on remove_adapter as they are cleaned up during
probe_adapter exit.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:40:47 +04:00
Poornima Vonti 7977f825a0 [SCSI] qla4xxx: Fail probe_adapter if IRQ allocation fails
If IRQ allocation fails, it means system has run out of interrupt
vectors, so fail probe_adapter in case of IRQ allocation failure
and dont retry adapter initialization.

Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:39:52 +04:00
Vikas Chaudhary 109a008bfe [SCSI] qla4xxx: Prevent MSI/MSI-X falling back to INTx for ISP82XX
For ISP82xx mixed interrupt mode is not supported.
Hence prevent MSI/MSI-x from falling back to INTx mode.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:38:55 +04:00
Vikas Chaudhary 39c9582601 [SCSI] qla4xxx: Update idc reg in case of PCI AER
Camram is reset by FW to default values after reboot/cold boot/pci reset.
In case of AER, PCI may need to reset so we need to set correct idc reg value
after PCIE error.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:37:48 +04:00
Poornima Vonti 8276190725 [SCSI] qla4xxx: Fix double IDC locking in qla4_8xxx_error_recovery
Issue:
In qla4_8xxx_error_recovery() IDC lock recovery is initiated as
IDC lock is held while enabling the interrupts

Fix:
Correctly handle IDC locking mechanism in qla4_8xxx_error_recovery().

Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:36:39 +04:00
Vikas Chaudhary fbd8107cc9 [SCSI] qla4xxx: Clear interrupt while unloading driver for ISP83XX
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:27:46 +04:00
Vikas Chaudhary ecca51203b [SCSI] qla4xxx: Print correct IDC version
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:26:35 +04:00
Manish Dusane cfb27874ca [SCSI] qla4xxx: Added new mbox cmd to pass driver version to FW
Signed-off-by: Manish Dusane <manish.dusane@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:25:13 +04:00
Bart Van Assche e47f8976d8 [SCSI] scsi_dh_alua: Enable STPG for unavailable ports
A quote from SPC-4: "While in the unavailable primary target port
asymmetric access state, the device server shall support those of
the following commands that it supports while in the active/optimized
state: [ ... ] d) SET TARGET PORT GROUPS; [ ... ]". Hence enable
sending STPG to a target port group that is in the unavailable state.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Hannes Reinecke <hare@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:21:56 +04:00
Dan Williams bc3f02a795 [SCSI] scsi_remove_target: fix softlockup regression on hot remove
John reports:
 BUG: soft lockup - CPU#2 stuck for 23s! [kworker/u:8:2202]
 [..]
 Call Trace:
  [<ffffffff8141782a>] scsi_remove_target+0xda/0x1f0
  [<ffffffff81421de5>] sas_rphy_remove+0x55/0x60
  [<ffffffff81421e01>] sas_rphy_delete+0x11/0x20
  [<ffffffff81421e35>] sas_port_delete+0x25/0x160
  [<ffffffff814549a3>] mptsas_del_end_device+0x183/0x270

...introduced by commit 3b661a9 "[SCSI] fix hot unplug vs async scan race".

Don't restart lookup of more stargets in the multi-target case, just
arrange to traverse the list once, on the assumption that new targets
are always added at the end.  There is no guarantee that the target will
change state in scsi_target_reap() so we can end up spinning if we
restart.

Cc: <stable@vger.kernel.org>
Acked-by: Jack Wang <jack_wang@usish.com>
LKML-Reference: <CAEhu1-6wq1YsNiscGMwP4ud0Q+MrViRzv=kcWCQSBNc8c68N5Q@mail.gmail.com>
Reported-by: John Drescher <drescherjm@gmail.com>
Tested-by: John Drescher <drescherjm@gmail.com>
Signed-off-by: Dan Williams <djbw@fb.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:17:49 +04:00
Benjamin Herrenschmidt 225c56960f [SCSI] ibmvscsi: Fix host config length field overflow
The length field in the host config packet is only 16-bit long, so
passing it 0x10000 (64K which is our standard PAGE_SIZE) doesn't
work and result in an empty config from the server.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: <stable@vger.kernel.org>
Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:09 +04:00
Benjamin Herrenschmidt 9965c2f19b [SCSI] ibmvscsi: Remove backend abstraction
Now that the iSeries code is gone the backend abstraction
in this driver is no longer necessary, which allows us to
consolidate the driver in one file.

The side effect is that the module name is now ibmvscsi.ko
which matches the driver hotplug name and fixes auto-load
issues.

[jejb:fix up checkpatch.pl errors]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:09 +04:00
Vikas Chaudhary 56163c233d [SCSI] qla4xxx: Update driver version to 5.03.00-k0
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:08 +04:00
Vikas Chaudhary c68cdbf045 [SCSI] qla4xxx: Update Copyright header
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:08 +04:00
Vikas Chaudhary 6e7b429259 [SCSI] qla4xxx: Added support for ISP83XX
Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:08 +04:00
Vikas Chaudhary aec07caedb [SCSI] qla4xxx: Added new function qla4_8xxx_get_minidump
Move minidump code from qla4_8xxx_device_bootstrap() to
new function qla4_8xxx_get_minidump() to make code more
modular.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:07 +04:00
Vikas Chaudhary 83dbdf6f52 [SCSI] qla4xxx: Set IDC version in correct way
Issue:
   Device can go to READY state from COLD and skip INITIALIZATION,
   In this case driver will never set IDC version from function
   qla4_8xxx_device_bootstrap().

Fix:
1. Set IDC version at start of function qla4_82xx_need_reset_handler().
2. Set IDC version only if we are 1st driver to load.
3. Added new function qla4_8xxx_update_idc_reg() to set all idc reg at one
   place.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:07 +04:00
Vikas Chaudhary ee996a6917 [SCSI] qla4xxx: Replace all !is_qla8022() with is_qla40XX()
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:07 +04:00
Vikas Chaudhary 33693c7aab [SCSI] qla4xxx: Added new functions in isp_ops
Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:07 +04:00
Vikas Chaudhary c38fa3abea [SCSI] qla4xxx: Clean-up and optimize macros
Remove following unused define:-

QLA82XX_MINIDUMP_OCM0_SIZE
QLA82XX_MINIDUMP_L1C_SIZE
QLA82XX_MINIDUMP_L2C_SIZE
QLA82XX_MINIDUMP_COMMON_STR_SIZE
QLA82XX_MINIDUMP_FCOE_STR_SIZE
QLA82XX_MINIDUMP_MEM_SIZE
QLA82XX_MAX_ENTRY_HDR

Added following new define to optimize code:-

MIU_TA_CTL_WRITE_ENABLE
MIU_TA_CTL_WRITE_START
MIU_TA_CTL_START_ENABLE

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:07 +04:00
Vikas Chaudhary de8c72daa0 [SCSI] qla4xxx: Rename 82XX macros
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:06 +04:00
Vikas Chaudhary 5e9bcec792 [SCSI] qla4xxx: Update func name from ql4_ to qla4_
ql4_8xxx_mark_entry_skipped to qla4_8xxx_mark_entry_skipped
ql4_attr_is_visible to qla4_attr_is_visible

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:06 +04:00
Vikas Chaudhary 7664a1fd76 [SCSI] qla4xxx: Update structure and variable names
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:05 +04:00
Vikas Chaudhary f8086f4fd4 [SCSI] qla4xxx: Update function name from 8xxx to 82xx
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:05 +04:00
Martin Pitt d986788b26 [SCSI] scsi_debug: Add "removable" parameter
Add "removable" module parameter to set the "removable" attribute of any
subsequently created debug block device. It is a writable driver option, so
that you can switch between removable and "fixed" media block devices in
between the add_host calls.

This is useful for being able to test the different behaviour/required
privileges in e. g. the udisks test suite.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:05 +04:00
Vikas Chaudhary eafcde2103 [SCSI] qla4xxx: Update driver version to 5.02.00-k20
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:05 +04:00
Vikas Chaudhary da106212cb [SCSI] qla4xxx: Wait for cmd to complete before chip reset for ISP40XX
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:04 +04:00
Vikas Chaudhary d9e62e5130 [SCSI] qla4xxx: Clear interrupt while unloading driver.
while processing the stop firmware mailbox command on driver unload,
a interrupt is processed which causes kernel panic as the response
queue is not valid.

Fix is to clear the interrupt in free_adapter call just after
disabling the interrupts.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:04 +04:00
Vikas Chaudhary 8e9157c832 [SCSI] qla4xxx: Fix lockdep warning in qla4xxx_post_work()
Fix following lockdep warning:-

 INFO: trying to register non-static key.
 the code is fine but needs lockdep annotation.
 turning off the locking correctness validator.
 Pid: 298, comm: modprobe Not tainted 3.6.0-rc1+ #13
 Call Trace:
 [<c049f5c6>] register_lock_class+0x186/0x360
 [<c06e2e39>] ? __dev_printk+0x139/0x280
 [<c04a288a>] __lock_acquire+0x6a/0x450
 [<c04a2cf4>] lock_acquire+0x84/0xf0
 [<f98bb0d0>] ? qla4xxx_post_work+0x20/0x60 [qla4xxx]
 [<c089a05b>] _raw_spin_lock_irqsave+0x4b/0x60
 [<f98bb0d0>] ? qla4xxx_post_work+0x20/0x60 [qla4xxx]
 [<f98bb0d0>] qla4xxx_post_work+0x20/0x60 [qla4xxx]
 [<f98bb1c9>] qla4xxx_post_aen_work+0x49/0x60 [qla4xxx]
 [<f98c6cf2>] qla4xxx_isr_decode_mailbox+0x3f2/0x780 [qla4xxx]
 [<f98c8493>] qla4_83xx_interrupt_service_routine+0x33/0x50 [qla4xxx]
 [<f98d0e49>] qla4_83xx_process_mbox_intr+0x29/0x40 [qla4xxx]
 [<f98c2031>] qla4xxx_mailbox_command+0x361/0x5d0 [qla4xxx]
 [<c08983c8>] ? mutex_unlock+0x8/0x10
 [<f98c3e86>] qla4xxx_get_ifcb+0x66/0xb0 [qla4xxx]
 [<f98c3ef7>] qla4xxx_update_local_ifcb+0x27/0x100 [qla4xxx]
 [<f98c56af>] qla4xxx_initialize_fw_cb+0x2ff/0x3b0 [qla4xxx]
 [<c04150d0>] ? dma_generic_free_coherent+0x30/0x30
 [<f98c0f70>] qla4xxx_init_firmware+0x40/0xf0 [qla4xxx]
 [<f98c10b6>] qla4xxx_initialize_adapter+0x96/0x120 [qla4xxx]
 [<f98d35cd>] qla4xxx_probe_adapter+0x378/0x855 [qla4xxx]
 [<c04a1a04>] ? trace_hardirqs_on_caller+0xf4/0x180
 [<c04a1a9b>] ? trace_hardirqs_on+0xb/0x10
 [<c06ef403>] ? pm_runtime_enable+0x43/0x70
 [<c062f042>] local_pci_probe+0x42/0xb0
 [<c06300c0>] pci_device_probe+0x60/0x80
 [<c06e6bb6>] really_probe+0x56/0x2e0
 [<c089a5f2>] ? _raw_spin_unlock_irq+0x22/0x30
 [<c06f0b02>] ? pm_runtime_barrier+0x52/0xb0
 [<c06e6e77>] driver_probe_device+0x37/0x90
 [<c0898281>] ? mutex_lock_nested+0x31/0x40
 [<c06e6f51>] __driver_attach+0x81/0x90
 [<c06e51e8>] bus_for_each_dev+0x48/0x70
 [<c06e68e9>] driver_attach+0x19/0x20
 [<c06e6ed0>] ? driver_probe_device+0x90/0x90
 [<c06e637f>] bus_add_driver+0x18f/0x280
 [<c062ff40>] ? pci_dev_put+0x20/0x20
 [<c062ff40>] ? pci_dev_put+0x20/0x20
 [<c06e7435>] driver_register+0x65/0x120
 [<c061a3a2>] ? __raw_spin_lock_init+0x32/0x60
 [<c06302f4>] __pci_register_driver+0x54/0xc0
 [<f98e809e>] qla4xxx_module_init+0x9e/0xcd [qla4xxx]
 [<c040302f>] do_one_initcall+0x2f/0x170
 [<f98e8000>] ? 0xf98e7fff
 [<c04ae025>] sys_init_module+0x75/0x1c0
 [<c04a1a04>] ? trace_hardirqs_on_caller+0xf4/0x180
 [<c0609514>] ? trace_hardirqs_on_thunk+0xc/0x10
 [<c08a141f>] sysenter_do_call+0x12/0x38

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:04 +04:00
Dave Jiang 44ef2bf72d [SCSI] isci: Fix interrupt coalescing assumption of active TCs
We always assign a dummy task context to a port in order to address a
silicon issue. We have 4 ports per controller. So when idle, there are always
exactly 4 TCs "active". The adaptive interrupt coalescing code uses number of
active TCs to figure out the coalescing values. However, we never hit "0" TCs
because of the 4 dummy TCs. Putting in fix so that we calculate this correctly.

Reported-by: Dan Melnic <dan@seamicro.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:04 +04:00
Jeff Skirvin 54b4667775 [SCSI] isci: Allow SSP tasks into the task management path.
This commit fixes a driver bug for SSP tasks that require task management
in the target after they complete in the SCU hardware.  The problem was
manifested in the function "isci_task_abort_task", which tests
to see if the sas_task.lldd_task is non-NULL before allowing task
management; this bug would always NULL lldd_task in the SCU I/O completion
path even if target management was required, which would prevent
task / target manangement from happening.

Note that in the case of SATA/STP targets, error recovery is provided by
the libata error handler which is why SATA/STP device recovery worked
correctly even though SSP handling did not.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:04 +04:00
Robert Love 2c8bd81010 [SCSI] fc-transport: Remove unnecessary include
This header file is included in user space applications
that are doing "FC Passthrough." This include causes
them to also include scsi/scsi.h. Since this header
file doesn't actually need scsi/scsi.h, remove the
include line.

This patch was tested with 'make allyesconfig'.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:03 +04:00
Moger, Babu 1315da30da [SCSI] scsi_dh_rdac : minor return fix for rdac
Signed-off-by: Babu Moger <babu.moger@netapp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:03 +04:00
Moger, Babu 35204772ea [SCSI] scsi_dh_rdac : Consolidate rdac strings together
This patch consolidates the strings together. Purpose is to remove minor product strings extensions.
That way the future products with similar strings should not require change  here.

Signed-off-by: Babu Moger <babu.moger@netapp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:03 +04:00
Moger, Babu e7ba29d633 [SCSI] scsi_dh_rdac: Add a new netapp vendor/product string
This patch adds a new vendor/product strings for netapp E series  product.
Also consolidated the strings together with similar names.

Signed-off-by: Babu Moger <babu.moger@netapp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:03 +04:00
Martin Peschke d436de8ce2 [SCSI] zfcp: only access zfcp_scsi_dev for valid scsi_device
__scsi_remove_device (e.g. due to dev_loss_tmo) calls
zfcp_scsi_slave_destroy which in turn sends a close LUN FSF request to
the adapter. After 30 seconds without response,
zfcp_erp_timeout_handler kicks the ERP thread failing the close LUN
ERP action. zfcp_erp_wait in zfcp_erp_lun_shutdown_wait and thus
zfcp_scsi_slave_destroy returns and then scsi_device is no longer
valid. Sometime later the response to the close LUN FSF request may
finally come in. However, commit
b62a8d9b45
"[SCSI] zfcp: Use SCSI device data zfcp_scsi_dev instead of zfcp_unit"
introduced a number of attempts to unconditionally access struct
zfcp_scsi_dev through struct scsi_device causing a use-after-free.
This leads to an Oops due to kernel page fault in one of:
zfcp_fsf_abort_fcp_command_handler, zfcp_fsf_open_lun_handler,
zfcp_fsf_close_lun_handler, zfcp_fsf_req_trace,
zfcp_fsf_fcp_handler_common.
Move dereferencing of zfcp private data zfcp_scsi_dev allocated in
scsi_device via scsi_transport_reserve_device after the check for
potentially aborted FSF request and thus no longer valid scsi_device.
Only then assign sdev_to_zfcp(sdev) to the local auto variable struct
zfcp_scsi_dev *zfcp_sdev.

Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #2.6.37+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:02 +04:00
Steffen Maier 43f60cbd56 [SCSI] zfcp: No automatic port_rescan on events
In FC fabrics with large zones, the automatic port_rescan on incoming ELS
and any adapter recovery can cause quite some traffic at the very same
time, especially if lots of Linux images share an HBA, which is common on
s390. This can cause trouble and failures. Fix this by making such port
rescans dependent on a user configurable module parameter.

The following unconditional automatic port rescans remain as is:
On setting an adapter online and
on manual user-triggered writes to the sysfs attribute port_rescan.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:02 +04:00
Steffen Maier d99b601b63 [SCSI] zfcp: restore refcount check on port_remove
Upstream commit f3450c7b91
"[SCSI] zfcp: Replace local reference counting with common kref"
accidentally dropped a reference count check before tearing down
zfcp_ports that are potentially in use by zfcp_units.
Even remote ports in use can be removed causing
unreachable garbage objects zfcp_ports with zfcp_units.
Thus units won't come back even after a manual port_rescan.
The kref of zfcp_port->dev.kobj is already used by the driver core.
We cannot re-use it to track the number of zfcp_units.
Re-introduce our own counter for units per port
and check on port_remove.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: <stable@vger.kernel.org> #2.6.33+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:02 +04:00
Julia Lawall ca579c9f13 [SCSI] zfcp: remove invalid reference to list iterator variable
If list_for_each_entry, etc complete a traversal of the list, the iterator
variable ends up pointing to an address at an offset from the list head,
and not a meaningful structure.  Thus this value should not be used after
the end of the iterator.  Replace port->adapter->scsi_host by
adapter->scsi_host.

This problem was found using Coccinelle (http://coccinelle.lip6.fr/).

Oversight in upsteam commit of v2.6.37
a1ca48319a
"[SCSI] zfcp: Move ACL/CFDC code to zfcp_cfdc.c"
which merged the content of zfcp_erp_port_access_changed().

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #2.6.37+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:02 +04:00
Steffen Maier cb45214960 [SCSI] zfcp: Do not wakeup while suspended
If the mapping of FCP device bus ID and corresponding subchannel
is modified while the Linux image is suspended, the resume of FCP
devices can fail. During resume, zfcp gets callbacks from cio regarding
the modified subchannels but they can be arbitrarily mixed with the
restore/resume callback. Since the cio callbacks would trigger
adapter recovery, zfcp could wakeup before the resume callback.
Therefore, ignore the cio callbacks regarding subchannels while
being suspended. We can safely do so, since zfcp does not deal itself
with subchannels. For problem determination purposes, we still trace the
ignored callback events.

The following kernel messages could be seen on resume:

kernel: <WWPN>: parent <FCP device bus ID> should not be sleeping

As part of adapter reopen recovery, zfcp performs auto port scanning
which can erroneously try to register new remote ports with
scsi_transport_fc and the device core code complains about the parent
(adapter) still sleeping.

kernel: zfcp.3dff9c: <FCP device bus ID>:\
 Setting up the QDIO connection to the FCP adapter failed
<last kernel message repeated 3 more times>
kernel: zfcp.574d43: <FCP device bus ID>:\
 ERP cannot recover an error on the FCP device

In such cases, the adapter gave up recovery and remained blocked along
with its child objects: remote ports and LUNs/scsi devices. Even the
adapter shutdown as part of giving up recovery failed because the ccw
device state remained disconnected. Later, the corresponding remote
ports ran into dev_loss_tmo. As a result, the LUNs were erroneously
not available again after resume.

Even a manually triggered adapter recovery (e.g. sysfs attribute
failed, or device offline/online via sysfs) could not recover the
adapter due to the remaining disconnected state of the corresponding
ccw device.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #2.6.32+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:01 +04:00
Steffen Maier 01e60527f0 [SCSI] zfcp: Bounds checking for deferred error trace
The pl vector has scount elements, i.e. pl[scount-1] is the last valid
element. For maximum sized requests, payload->counter == scount after
the last loop iteration. Therefore, do bounds checking first (with
boolean shortcut) to not access the invalid element pl[scount].

Do not trust the maximum sbale->scount value from the HBA
but ensure we won't access the pl vector out of our allocated bounds.
While at it, clean up scoping and prevent unnecessary memset.

Minor fix for 86a9668a8d
"[SCSI] zfcp: support for hardware data router"

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #3.2+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:01 +04:00
Steffen Maier 0100998dbf [SCSI] zfcp: Make trace record tags unique
Duplicate fssrh_2 from a54ca0f62f
"[SCSI] zfcp: Redesign of the debug tracing for HBA records."
complicates distinction of generic status read response from
local link up.
Duplicate fsscth1 from 2c55b750a8
"[SCSI] zfcp: Redesign of the debug tracing for SAN records."
complicates distinction of good common transport response from
invalid port handle.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #2.6.38+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:01 +04:00
Steffen Maier d22019778c [SCSI] zfcp: Adapt to new FC_PORTSPEED semantics
Commit a9277e7783
"[SCSI] scsi_transport_fc: Getting FC Port Speed in sync with FC-GS"
changed the semantics of FC_PORTSPEED defines to
FDMI port attributes of FC-HBA/SM-HBA
which is different from the previous bit reversed
Report Port Speed Capabilities (RPSC) ELS of FC-GS/FC-LS.

Zfcp showed "10 Gbit" instead of "4 Gbit" for supported_speeds.
It now uses explicit bit conversion as the other LLDs already
do, in order to be independent of the kernel bit semantics.
See also http://marc.info/?l=linux-scsi&m=134452926830730&w=2

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #3.4+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:01 +04:00
Andi Kleen 16da05b115 [SCSI] Fix incorrect memset in bnx2fc_parse_fcp_rsp
gcc 4.8 warns because the memset only clears sizeof(char *) bytes, not
the whole buffer. Use the correct buffer size and clear the whole sense
buffer.

/backup/lsrc/git/linux-lto-2.6/drivers/scsi/bnx2fc/bnx2fc_io.c: In
function 'bnx2fc_parse_fcp_rsp':
/backup/lsrc/git/linux-lto-2.6/drivers/scsi/bnx2fc/bnx2fc_io.c:1810:41:
warning: argument to 'sizeof' in 'memset' call is the same expression as
the destination; did you mean to provide an explicit length?
[-Wsizeof-pointer-memaccess]
   memset(sc_cmd->sense_buffer, 0, sizeof(sc_cmd->sense_buffer));
                                         ^

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24 12:11:00 +04:00