Commit Graph

84281 Commits (21351013402ab4556d1ef62aed6cbe8dfb809f77)

Author SHA1 Message Date
James Smart c749593703 [SCSI] lpfc 8.3.12: BSG Fixes and enhancements
- Add memcpy to mailbox completion to transfer reply correctly.
- Add support for BSG mailbox commands (dump, update_cfg, and
   event_log_status).
- Add warning message and refuse mailbox command while mgmt is blocked.
- Add checks for memory allocation failure.
- Add check for sli4 dump zero BDE size.
- Only copy data if mailbox commands succeed.
- Add support for Read Event Log mailbox command.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:45:38 -05:00
James Smart 49198b371e [SCSI] lpfc 8.3.12: Critical fixes
- Move the code to increase the sg seg count for LP21000 adapters.
- Check pcmd on command completion before dereferencing it.
- Clear queue memory when creating firmware queues to prevent stale entries.
- Replace the use of PAGE_SIZE in many areas that assumed it was always 4k.
- Add an else clause to a conditional that needed to unlock the hba_lock.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:45:24 -05:00
James Smart 6c8eea54ec [SCSI] lpfc 8.3.12: T10-PI/DIF changes
Update driver for change in T10-PI interface on adapter
- Remove Profiles.
- Add new SLI Opcodes.
- Add new PDE structures used for BlockGuard.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:45:09 -05:00
James Smart 15672319e3 [SCSI] lpfc 8.3.12: Miscellaneous Changes
- Prevent log message 1801 during vport delete.
- Enable NPIV by default.
- Display correct value for max Vports on SLI4 HBAs.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:44:55 -05:00
James Smart b19a061a78 [SCSI] lpfc 8.3.12: Emulex SLI enhancements
- Add the new Logical Link speed event support.
- Add RATOV and EDTOV to the REG_VFI mailbox command.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:44:44 -05:00
Kashyap, Desai 40364a40b6 [SCSI] mpt2sas: Upgrade version 05.100.00.01
Upgraded version string.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:42:48 -05:00
Kashyap, Desai 66a6793657 [SCSI] mpt2sas: Check for NULL pointer before free_pages is added.
Added check before free_pages just to make sure ioc->scsi_lookup is not NULL.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:42:46 -05:00
Kashyap, Desai ef7c80c1f1 [SCSI] mpt2sas: Added support for PCIe Advanced Error Recovery.
Added support in the driver to support EEH and
PCIe Advanced Error Recovery. This involves adding new
pci_error_handler interface for recovering the controller from PCI Bus
errors, such as SERR and PERR. Some tools are available for simulating
PCI errors in order to validate this interface:
http://www.kernel.org/pub/linux/utils/pci/aer-inject

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:42:41 -05:00
Kashyap, Desai ebda4d38df [SCSI] mpt2sas: Send default descriptor for RAID pass through in mpt2ctl
RAID_SCSI_IO_PASSTHROUGH: Driver needs to be sending the default
descriptor for RAID Passthru, currently its sending SCSI_IO descriptor.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:41:51 -05:00
Kashyap, Desai 38c2911449 [SCSI] mpt2sas: sanity added to remove duplicate port from topology
There are few special cases which needs to be handled deleting old port.

CASE1: In topology you need cascaded expanders. Through sysfs just make sure
topology is up. Erase the manufacturing image of the cascaded expander and
reset the board. In some cases Adapter will receive Exapnder Add event
before expander delete. In such a case, driver needs to delete duplicate
port before adding new port.

CASE2: Enable Device Missing delay of HBA through lsiutils. If expander or
end device is hotswapped with different device before DMD timer expires,
driver will get device add for new device first and then device deletion
event for the original devices will arrive later at DMD timer expires. In
this case also driver need to delete duplicate port before adding port for
new device.

Added new function which will make sure when new port is
added, that its not claiming the same phy resources already in use by
another port. If it does, then it will delete the other port before adding
the new port.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:41:50 -05:00
Douglas Gilbert 78d4e5a07d [SCSI] scsi_debug: add max_queue + no_uld parameters
While testing the midlevel q_at_head and q_at_tail
patch for sg and the block SG_IO ioctl I found it
useful to reduce the queuing within the scsi_debug
driver. The reason is that the midlevel queue only
comes into play when the corresponding LLD queue
is full.

It is also useful when testing to be confident that
your program is the only thing issuing commands
to the (virtual) scsi_debug device. The no_uld=1
parameter will stop a scsi_debug virtual disk
appearing as /dev/sd* .

Changelog:
   - add max_queue parameter to reduce the number
     of queued commands the driver will accept.
     This parameter can be changed after the driver
     is loaded.
   - add no_uld parameter that restricts scsi_debug's
     virtual devices to the sg and bsg drivers
   - correct stale url

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:40:38 -05:00
James Bottomley 3233ac1981 [SCSI] sd: retry read_capacity on UNIT_ATTENTION
Hazard testing uncovered yet another bug in sd. Under heavy reset
activity the retry counter might be exhausted and the command will be
returned with sense UNIT_ATTENTION/0x29/00 (POWER ON, RESET, OR BUS
DEVICE RESET OCCURRED). In those cases we should just increase the
retry counter again, retrying one more to clear up this Unit Attention
state.

[jejb: update to work with RC16 devices and not to loop endlessly]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:36:26 -05:00
Kashyap, Desai 1469585309 [SCSI] mpt2sas : IOs needs to be pause until handles are refreshed for all device after recovery
After Host Reset firmware will have new list of device handles for the target.
Device handle refresh in driver is part of Rescan topology logic.
(See functions like *_search_responding_*). This needs to be done from Host
Reset context before making shost_recovery to 0. Currently it is done in
Firwmare event context, which may leads IO to a wrong device.

Now handler refresh is moved to HBA reset context.
Apart from this, Now driver will stop IOs for all device setting deleted
flag to 1 at the time of HBA Reset through _scsih_prep_device_scan.
It will only unblock devices, if devices has been found as part of RESCAN.
This way it will make more safe IO blocking at the time of HBA reset at
mpt2sas driver layer.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:27:01 -05:00
Hannes Reinecke f87146bba5 [SCSI] sd: quiet spurious error messages in READ_CAPACITY(16)
sd always tries to submit a READ_CAPACITY(16) CDB,
regardless whether the host actually supports it.
queuecommand() will then return DID_ABORT, which is
not qualified enough to detect the true cause here.
So better check in sd_try_rc16 first if the cdblen
is supported.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 13:25:06 -05:00
Anil Veerabhadrappa 457549da73 [SCSI] bnx2i: Update version and module description
missing 10G drivers added to description

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:54:29 -05:00
Anil Veerabhadrappa ce2d763a2c [SCSI] bnx2i: link bnx2i hba and cnic device before registering the device
When bnx2/cnic/bnx2i drivers are loaded in certain order, bnx2i will
will not initialize the device correctly because 'hba->cnic' will be
NULL when bnx2i_start() is called from register_device() context.
Under this condition 'ifdown' and 'ifup' of associated network
interface is required to bring iscsi adapter state to ready state so
that it will accept iscsi connection setup within the chip

Initializing 'hba->cnic' before calling register_device() will fix
this issue

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:53:18 -05:00
Anil Veerabhadrappa 2e15efc7e1 [SCSI] bnx2i: make firmware use statsn field when constructing header
instruct firmware to use driver/iscsid provided expected statsn field
while constructing login pdu header.

Initialize 'flags' to instruct chip to use driver/iscsid provided
ExpStatSN value while constructing iSCSI login PDU header

Signed-off-by: Eddie Wai <waie@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:52:23 -05:00
Christof Schmitt a1dbfddd02 [SCSI] zfcp: Pass return code from fc_block_scsi_eh to scsi eh
The return code FAST_IO_FAIL from fc_block_scsi_eh indicates that the
pending I/O requests have been terminated as a result of the
fast_io_fail_tmo. Pass this return code back to the scsi eh to stop
the scsi eh in this case.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:49:35 -05:00
Christof Schmitt 2f2eb58762 [SCSI] Allow FC LLD to fast-fail scsi eh by introducing new eh return
If the scsi eh is running and then a FC LLD calls
fc_remote_port_delete, the SCSI commands sent from the eh will fail.
To prevent this, a FC LLD can call fc_block_scsi_eh from the eh
callback, blocking the eh thread until the dev_loss_tmo fires or the
remote port is available again.

If (e.g. for a multipathing setup) the dev_loss_tmo is set to a very
large value, thus preventing the scsi device removal , the scsi eh can
block for a long time. For multipathing, the fast_io_fail_tmo is then
set to a low value to detect path problems sooner.

This patch introduces a new return code FAST_IO_FAIL. The function
fc_block_scsi_eh now returns FAST_IO_FAIL when the fast_io_fail_tmo
fires. This indicates that the LLD terminated all pending I/O requests
and there are no more pending SCSI commands for the scsi eh to wait
for. This return code can be passed back to the scsi eh to stop the
escalation and finish the recovery process for this device.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:49:33 -05:00
Ferenc Wagner 7794a5af67 [SCSI] qla2xxx: Fix documentation of ql2xfdmienable module parameter
The default is enabled since 7e47e5ca18.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:54 -05:00
Andrew Vasquez 6c452a45e5 [SCSI] qla2xxx: General checkpatch corrections.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:53 -05:00
Sarang Radke bfdaa761d3 [SCSI] qla2xxx: Fix to make conditional decision based on port number.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:52 -05:00
Harish Zunjarrao d5459083af [SCSI] qla2xxx: Free DMA memory only if it is allocated in vendor specific BSG command
The qla84xx_mgmt_cmd function supports multiple subcommands.
Some subcommands require DMA memory and some do not.
Therefore check before freeing DMA memory whether it is allocated or not.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:50 -05:00
Sarang Radke 09ff701a17 [SCSI] qla2xxx: Add APEX support.
Allows priority setting for FCP_CMNDs.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:50 -05:00
Giridhar Malavali 6e98016ca0 [SCSI] qla2xxx: Re-organized BSG interface specific code.
1. Segregate BSG interface specific code to new files.
2. Handle multiple vendor specific commands indepedently.
3. Reorganised support for reset, management and update FCoE firmware commands.
4. Fixed memory leak issue in Loopback.
5. Added new vendor command to support iiDMA using BSG interface.
6. Proper cleanup of dma mapped and dma allocated buffers for BSG request.

[jejb: fix up conflict and merge in Jiri Slaby lock imbalance patch]
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:44:10 -05:00
Jing Huang 077424e2e2 [SCSI] bfa: sg addr big endian fix
sg address in IO request is not set up correctly for big endian platform.
add new macros to properly swap the address.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:23 -05:00
Jing Huang 42b426ecb4 [SCSI] bfa: protect idr using bfad_mutex
idr is a global resource, protect it with global bfad_mutex.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:20 -05:00
Jing Huang b3522f08ec [SCSI] bfa: use pci_iomap() and pci_iounmap()
Use pci_iomap() and pci_iounmap() to simplify the code. Remove uncessary #ifdef
check for ia64 (it was added as a workaound for some RHEL 5.x release which
doesn't export iounmap function)

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:19 -05:00
Jing Huang 2eba0d4c00 [SCSI] bfa: fix the issue of not handling scsi_cmnd sg chaining case
Currently the driver doesn't take into consideraion of possible sg chaining
when it walks through the sg list. This is fixed by using the sg_next()
which automatically handles the chaining case. Obosolete code is removed
as a result of this change.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:17 -05:00
Jing Huang b504293fe9 [SCSI] bfa: add fc transport class based vport create/delete
Use duplicate fc transport template for physical and vitual port. Add
vport create/delete/disalbe functions in the transport template of physical
port. Changes to make the vport create/delete function to work under this
framework.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:16 -05:00
Alan Stern 12fb8c1574 [SCSI] don't kfree an initialized struct device
This patch (as1359) fixes a bug in scsi_alloc_target().  After a
device structure has been initialized (and especially after its name
has been set), it must not be freed directly.  One has to call
put_device() instead.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:15 -05:00
Alan Stern 1821438a9b [SCSI] don't reap targets upon device_add failure
This patch (as1358) fixes a bug in the error pathway of
scsi_target_add().  If registration fails, the target should not be
reaped.  The reaping occurs later, when scanning is finished and all
the child devices are removed.  The current code leaves an unbalanced
value in starget->reap_ref.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:15 -05:00
Kashyap, Desai 4f581b9731 [SCSI] mptfusion: Bump version 03.04.15
Upgrade version from 3.04.14 to 3.04.15

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:14 -05:00
Kashyap, Desai 0cf0f23c28 [SCSI] mptfusion: Proper error handling is added after mpt_config timeout
Added proper error handling after mpt_config.
Now check of MPI_IOCSTATUS_CONFIG_INVALID_PAGE is added.
If error is MPI_IOCSTATUS_CONFIG_INVALID_PAGE, driver will return -ENODEV.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:13 -05:00
Kashyap, Desai f18a8927f6 [SCSI] mptfusion: Event data alignment with 4 byte.
event_data needs to be 4 byte aligned to makes sure there is no unaligned
memory access take place.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:12 -05:00
Kashyap, Desai 568da76929 [SCSI] mptfusion: Check for command status is added after completion.
1) Corrected name string as "MPT SAS HOST"
2) Added proper check conditions for MPT_MGMT_STATUS_COMMAND_GOOD.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:12 -05:00
Kashyap, Desai 69b2e9b443 [SCSI] mptfusion: Task abort is not supported for Volumes
1) corrected return value as SUCCESS instead of 0.
2) Added check in mptscsih_abort.
mptfusion do not support task abort for Volumes.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:11 -05:00
Kashyap, Desai 08f5c5c23d [SCSI] mptfusion: sanity check for vdevice pointer is added
Added sanity checks before accessing vdevice and added vdevice->deleted
setting for mptfc.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:10 -05:00
Kashyap, Desai f8c23bde85 [SCSI] mptfusion: Setting period,offset and width for SPI driver
Set factor, offset and width while target negotiation.

Added config timeout 60 seconds. It was missing for only
mptspi_read_spi_device_pg0

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:09 -05:00
Kashyap, Desai ffb7fef32b [SCSI] mptfusion: Proper bus_type check is added
Added proper bus_type check before processing event/ reset handler.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:09 -05:00
Kashyap, Desai 48959f1eae [SCSI] mptfusion: mpt_detach is called properly at the time of rmmod
Current design of mptsas is as follow.
MPTSAS will do probe() if pci id matches for available card in
system, irrespective of mode of controller. If controller is I/T mode
or I mode, things are fine. If controller is only in T mode, mptsas is
not doing complete process of mptsas_probe(). It will only make
sure IOC structure is created and IOC reference is available for
mptstm driver. Now While removing module we should take care
case of Target mode only mptsas. If we are removing IOC which is
only in Target mode, We should only detach IOC instead of
following rest of the cleanup process which is only required for T
mode controller. Now For T mode controller, only part clean up is
done instead of complete cleanup. mpt_detach will call early in case
of Target mode only controller.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:07 -05:00
Kashyap, Desai b3b97316d5 [SCSI] mptfusion: mpt config will do Hard Reset based upon retry counts
mpt_config would only attempt a MUR before retrying the command. The
driver will now retry a second time with a hard reset before leaving
the function.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:06 -05:00
Kashyap, Desai 7d757f1855 [SCSI] mptfusion: Updated SCSI IO IOCTL error handling.
Behavior changes only for IOCTLs that time out.  Current behavior of
Bus Reset remains the same for RAID Passthru Timeouts Current behavior
of Diagnostic reset for any other type of IOCTL remains the same

CHANGE: For IOCTL SCSI IOs that timeout, a Target Reset TM is sent,
instead of Bus Reset. All error handing from that point is the same as
what the driver currently does, which is to say that if the Device
Reset TM fails it escalates do diagnostic reset.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:04 -05:00
Kashyap, Desai d0f698c461 [SCSI] mptfusion: Added new less expensive RESET (Message Unit Reset)
Message Unit Reset - instructs the IOC to reset the Reply Post and
Free FIFO's. All the Message Frames on Reply Free FIFO are
discarded. All posted buffers are freed, and event notification is
turned off.  IOC doesnt reply to any outstanding request. This will
transfer IOC to READY state.  Message unit ready is less expensive
operations than Hard Reset.  soft reset will not force Firmware to
reload again, it only do clean up of Message units.

mpt_Soft_Hard_ResetHandler will first try for Soft Reset,if
it fails then go for big hammer reset which is Hard Reset.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:04 -05:00
Kashyap, Desai 1a7d7eac6f [SCSI] mpt2sas: Bump version 05.100.00.00
Upgraded version string.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:03 -05:00
Kashyap, Desai 31b7f2e25d [SCSI] mpt2sas: Copyright 2010.
Copyright changes for year 2010.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:02 -05:00
Kashyap, Desai 58287fd59c [SCSI] mpt2sas: Default descriptor for RAID Passthru command.
RAID_SCSI_IO_PASSTHROUGH: Driver needs to be send the default
descriptor for RAID Passthru, currently its sending SCSI_IO descriptor.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:01 -05:00
Kashyap, Desai f6aee7b9ae [SCSI] mpt2sas: return -ENOMEM if memory allocation failed.
Added proper return type values in case memory allocation failed.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:01 -05:00
Kashyap, Desai 8ed9a03ad4 [SCSI] mpt2sas: removed use of tm_cmds.mutex in IOCTL branch.
Removed all the mutex's for ioc->tm_cmds.mutex, then created one
single mutex inside the function mpt2sas_scsih_issue_tm. This is the
single function used when sending task management. Also the sanity
checks required for scsi mid layer escalation were moved to inside the
same function because these checks need to be done while the mutex is
held. The ioc->tm_cmds.mutex inside the IOCTL branch is really not
required since there is another mutex in this code called for ctl_cmds
handling this sync.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:00 -05:00
Kashyap, Desai e94f674721 [SCSI] mpt2sas: Fix for little endian
1. Fixes for little endian issues.
2. Now Debug info for Discovery event is more readable.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:59 -05:00
Kashyap, Desai b4344276f7 [SCSI] mpt2sas: Driver will not treat NEEDS_INIT as failure.
Now Driver will not treat NEEDS_INIT as failure. In addition to this,
the driver will now display message to describe the the access flags
when bits are set, so the end user can better understand failures.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:58 -05:00
Kashyap, Desai 6558bbb145 [SCSI] mpt2sas: Early return from function if shost is in recovery.
Aded checks for shost_recovery flag for early return from function.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:57 -05:00
Kashyap, Desai 89009fbb7d [SCSI] mpt2sas: Use of get_free_pages for huge memorary allocation.
use the get_free_pages API for larger contigious physical memory chunk.
Also, the ioc->chain_depth need to be changed from
a 16bit to 32bit variable because the number of chains will exceed 64k
when the queue depth is large.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:56 -05:00
Kashyap, Desai f891dcfdc1 [SCSI] mpt2sas: Corrected conditional checks for Internal device Reset
bug fix in the handling of the internal device reset event
The reason code check in scsih_sas_device_status_change_event never
evaluates as true for internal device reset, hence driver never quiesce s IO
when firmware is sending a device reset. The fix is to change the
evaluate to:
if (event_data->ReasonCode !=
    MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET &&
   event_data->ReasonCode !=
    MPI2_EVENT_SAS_DEV_STAT_RC_CMP_INTERNAL_DEV_RESET)
        return;

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:54 -05:00
Kashyap, Desai 7921b35c5f [SCSI] mpt2sas: Corrected time stamp
incorrect timestamp on 32 bit platforms: The upper 32 bit of
the timestamp was getting truncated when converting seconds to
milliseconds, which was due to the variable being long. To fix the problem,
the variable needs to be u64. Also the microseconds conversion to
milliseconds was incorrect; it should be divide by 1000 instead of divide by
8.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:54 -05:00
Kashyap, Desai 31cef6bcb8 [SCSI] mpt2sas : Do not reset handle before calling _scsih_remove_device in RESCAN task after HBA RESET
Setting handle to zero is not required before _scsih_remove_device.
Driver uses sas_device->handle reference in _scsih_remove_device.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:53 -05:00
James Smart b620debb06 [SCSI] lpfc 8.3.11: Update Driver version to 8.3.11
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:52 -05:00
James Smart 4b40c59ece [SCSI] lpfc 8.3.11: NPIV changes
- Enable NPIV by default.
- Added code to handle unsolicited LOGO on physical port.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:51 -05:00
James Smart e2af0d2ed8 [SCSI] lpfc 8.3.11: Fix AER uncorrectable non-fatal error handling
Only abort outstanding I/O to force the OS to retry failed I/Os for AER
uncorrectable non-fatal errors instead of reseting the adapter.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:50 -05:00
James Smart 7a47027743 [SCSI] lpfc 8.3.11: Driver management improvements via BSG
- Add BSG support for PCI loopback testing.
- Add BSG support for extended mailbox commands.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:50 -05:00
James Smart cb5172eafd [SCSI] lpfc 8.3.11: SLI4 Improvements
- Correct all SLI4 code to work on big endian systems.
- Move read of sli4 params earlier so returned values are used correctly.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:48 -05:00
James Smart 999d813f22 [SCSI] lpfc 8.3.11: FCF failover improvements
FCF failover improvements

- Add random FCF failover when there are multiple FCFs available.
- Prevent FCF log messages from being displayed for FC adapters.
- Separate the New FCF and Modified FCF log messages.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:47 -05:00
Kei Tokunaga 65c054f235 [SCSI] mpt: modify mptctl_exit() to call proper deregister functions
This patch fixes some issues of mptctl_exit().

  1) It doesn't call mpt_deregister() for mptctl_taskmgmt_id
     => Insmoding/rmmoding mptctl.ko repeadtedly (up to
        MPT_MAX_PROTOCOL_DRIVERS-1 at most) can eat up all cb_idx,
        and that would cause a lack of MptCallbacks[], MptDriverClass[],
        and MptEvHandlers[].

  2) It doesn't call mpt_event_deregister() for mptctl_id
     => Need to call it.

  3) It calls mpt_reset_deregister() for mptctl_taskmgmt_id
     => This could accidentally deregister an innocent reset handler
        that you don't want to.

This patch also adds a check for mptctl_taskmgmt_id.

Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:45 -05:00
Joe Eykholt f018b73af6 [SCSI] libfc, libfcoe, fcoe: use smp_processor_id() only when preempt disabled
When the kernel is configured for preemption, using smp_processor_id()
when preemption is enabled causes a warning backtrace and is wrong
since we could move off of that CPU as soon as we get the ID,
and we would be referencing the wrong CPU, and possibly an invalid one
if it could be hotswapped out.

Remove the fc_lport_get_stats() function and explicitly use per_cpu_ptr()
to get the statistics.  Where preemption has been disabled by holding
a _bh lock continue to use smp_processor_id(), but otherwise use
get_cpu()/put_cpu().

In fcoe_recv_frame() also changed the cases where we return in the
middle to do a goto to the code which bumps ErrorFrames and does
a put_cpu().  Two of these cases didn't bump ErrorFrames before, but
doing so is harmless because they "can't happen", due to prior length
checks.

Also rearranged code in fcoe_recv_frame() to have only one call to
fc_exch_recv().  It's just as efficient and saves a call to put_cpu().

In fc_fcp.c, adjusted a FIXME comment for code which doesn't need fixing.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:44 -05:00
Robert Love b3ef990c15 [SCSI] libfc: Add debug statements when fc_fcp returns DID_ERROR to scsi-ml
DID_ERROR cases can be ambigouos. Debugging FCP error cases
will be much easier if we have debug statements when we hit
these error conditions.

This patch simply adds debug messages using the FC_FCP_DBG
macro when we return DID_ERROR to SCSI. This way if a DID_ERROR
is reproducible turning on debug_logging will give a clue
to developers as to what the problem might be.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:44 -05:00
Vasu Dev 5c12c418e9 [SCSI] libfc: fix fcp pkt recovery in fc_fcp_recv_data
Currently fc_fcp_recv_data calls fc_fcp_retry_cmd to
retry failed IO but in this case tgt is still sending
data frames, therefore exchange needs to be aborted
first before initiating retry. So this patch fixes
this by aborting exchange first then have retry.

Renames fc_timeout_error to fc_fcp_recovery since
fc_timeout_error is already called from several other
places beside from fcp timeout handler and then
used fc_fcp_recovery for abort & retry from
fc_fcp_recv_data, this rename also required renaming
FC_CMD_TIME_OUT status to FC_CMD_RECOVERY to be
consistent with new fc_fcp_recovery.

Data frames are not expected for an DDPed exchange and
potentially it could be tampered data frame, so does
recovery in this case by calling fc_fcp_recovery.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:42 -05:00
Vasu Dev 3e22760d4d [SCSI] libfc: use offload EM instance again instead jumping to next EM
Since use of offloads is more efficient than switching
to non-offload EM. However kept logic same to call em_match
if it is provided in the list of EMs.

Converted fc_exch_alloc to inline being now tiny a function
and already not an exported libfc API any more.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:41 -05:00
Vasu Dev a104c84457 [SCSI] libfc: fixes unnecessary seq id jump
In some cases seq is incremented twice causing unnecessary
seq jump, for instance fc_exch_recv_seq_resp increments
seq id when fc_sof_is_init is true and that is true for
each incoming xfer ready but then fc_fcp_send_data does
another seq increment to send data for xfer ready.

This patch removes all such seq id jumps, at least it
eliminates few calls to fc_seq_start_next using ex_lock.

Also removes seq id update with incoming frame's seq id
as this is not needed since each end (I or T) just need
to send incremented their own seq id on each TSI from
other end & before sending new sequence within a
exchange.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:41 -05:00
Joe Eykholt cc3593d388 [SCSI] libfc: fix sequence-initiative WARN in fc_seq_start_next
When starting a new response sequence in a multi-sequence
exchange, a warning was issued that sequence initiative
wasn't held.

The bug was that sequence initiative was cleared by the previous
sequence due to the END_SEQ flag being on.  The intent may have
been to check LAST_SEQ.  Change just to check SEQ_INIT.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:40 -05:00
Joe Eykholt 4291365784 [SCSI] libfcoe: eliminate unused link and last_link fields
The link and last_link fields in the fcoe_ctlr struct are no
longer useful, since they are always set to the same value,
and FIP always calls libfc to pass link information to the lport.

Eliminate those fields and rename link_work to timer_work, since
it no longer has any link change work to do.

Thanks to Brian Uchino for discovering this issue.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:38 -05:00
Joe Eykholt 50036bbae0 [SCSI] fcoe: remove an unused variable in fcoe_recv_frame()
Remove an unused variable, mac, in fcoe_recv_frame().

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:38 -05:00
Joe Eykholt ccfc309802 [SCSI] libfc: send point-to-poin FLOGI LS_ACC to assigned D_DID
The method we've been using for point-to-point mode requires
that the LS_ACC for the FLOGI uses the D_ID and S_ID assigned
to the remote port and local port, not those in the exchange.

This is not the correct method, but for now, it's what works
with the old target, as well as with new targets based on libfc.

This patch changes the addresses used accordingly.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:37 -05:00
Joe Eykholt f4568b8b97 [SCSI] libfc: recognize incoming FLOGI for point-to-point mode
When receiving a FLOGI request from a point-to-point peer,
the D_ID of 0xfffffe was not recognized as belonging to one
of the lports, so it was dropped.

Change fc_vport_id_lookup() to treat d_id 0xfffffe as a match.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:37 -05:00
Joe Eykholt 7d65b0df6c [SCSI] fcoe: save gateway address when receiving FLOGI request
In point-to-point mode, we need to save the source MAC
from received FLOGI requests to use as the destination MAC
for all outgoing frames.  We stopped doing that at some point.

Use the lport_set_port_id method to catch incoming FLOGI frames
and pass them to fcoe_ctlr_recv_flogi() so it can save the source MAC.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:36 -05:00
Joe Eykholt e49bf6145f [SCSI] libfcoe: fix debug message entering non-FIP mode
The debug message that indicated we are using non-FIP mode was
being printed only if we were already in non-FIP mode.
Also changed the message text to make it more clear the mode
is being set, not that the message is indicating how FLOGI
was received.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:35 -05:00
Joe Eykholt 9860eeb497 [SCSI] fcoe: call fcoe_ctlr_els_send even for ELS responses
In point-to-point mode, the destination MAC address for
the FLOGI response was zero because the LS_ACC for the FLOGI
wasn't getting intercepted by FIP.

Change to call fcoe_ctlr_els_send when sending any ELS,
not just requests.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:35 -05:00
Joe Eykholt 2f2ac4a0df [SCSI] libfc: fix oops in point-to-point mode
In point-to-point mode, if the PLOGI to the remote port times
out, it can get deleted by the remote port module.  Since there's
no reference by the local port, lport->ptp_data points to a freed
rport, and when the local port is reset and tries to logout again,
an oops occurs in mutex_lock_nested().

Hold a reference count on the point-to-point rdata.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:34 -05:00
Joe Eykholt a2f6a024e1 [SCSI] libfc: recode incoming PRLI handling
Reduce indentation in fc_rport_recv_prli_req() using gotos.
Also add payload length checks.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:33 -05:00
Richard A Lary fc193172e6 [SCSI] mpt2sas: use correct pci_resource_flag for comparison
This patch replaces incorrect base address space flag with correct IO
resource flag.  Also, performs check of memory resource to validate
resource before using.

Signed-off-by: Richard A Lary <rlary@linux.vnet.ibm.com>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:33 -05:00
Julia Lawall 4644efabde [SCSI] bfa: eliminate useless code
The variable bfa_itnim is initialized twice to the same (side effect-free)
expression.  Drop one initialization.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@forall@
idexpression *x;
identifier f!=ERR_PTR;
@@

x = f(...)
... when != x
(
x = f(...,<+...x...+>,...)
|
* x = f(...)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Jing Huang <huangj@brocade.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:32 -05:00
Roel Kluin f3d6e1dcd2 [SCSI] pmcraid: redundant check in pmcraid_check_ioctl_buffer()
struct pmcraid_ioctl_header member buffer_length is unsigned, so this
check appears redundant.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:32 -05:00
Roel Kluin 6ce00cae68 [SCSI] gdth: fix buffer overflow
This allows i == MAXHA, which is out of range

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:31 -05:00
Julia Lawall e05a9e7b18 [SCSI] pm8001: drop redundant memset
The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,e3,e4;
@@

- memset(e1,e2,e3);
  memcpy(e1,e4,e3);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:30 -05:00
Kashyap, Desai 1278b11f46 [SCSI] mpt2sas : Device removal algorithm in interrupt context only
external host not connecting after controller reboot: The
problem is : devices are not coming back after having the cable
disconnected then reconnected. The problem is because the
driver/firmware device removal handshake is failing. Due to this failure,
the controller firmware is not sending out device add events when the target
is reconnected. This is root caused to a race in the driver/firmware device
removal algorithm. There is duplicate code in both interrupt and user
context; where target reset is being issue from user context path while
sas_iounit_control(OP_REMOVE) is being sent from interrupt context. An
active target_reset will fail the OP_REMOVE. To fix this problem, the
duplicate code has been removed from user context path.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:29 -05:00
Kashyap, Desai 40956059fb [SCSI] mpt2sas: Upgrading version to 04.100.01.02
Upgraded version string.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:29 -05:00
Kashyap, Desai cd9843f8af [SCSI] mpt2sas: modified _scsih_sas_device_find_by_handle/sas_address
modified _scsih_sas_device_find_by_handle
so to handle the search on both list(device list and device_init_list)
Also, we moved the priority of the
search so the ioc->sas_device_list is done first.  The
"sas_device_init_list" is only used during the 1st port enable, so its
unlikely there’s devices on it.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:28 -05:00
Kashyap, Desai f1c35e6aea [SCSI] mpt2sas: RESCAN Barrier work is added in case of HBA reset.
Add the cancel_pending_work flag from the fw_event_work structure, and then to
set the flag during host reset, check the flag later from work threads
context and if cancel_pending_work_flag is set ingore those events.

Now Rescan after host reset is changed.
Added special task MPT2SAS_RESCAN_AFTER_HOST_RESET. This task will be queued
at the time of HBA reset. this task is treated as barrier. All work after
MPT2SAS_RESCAN_AFTER_HOST_RESET will be treated as new work and will be
server by callback handle. If host_recovery is going on while running RESCAN
task, it will wait for shos_recovery_done completion which will be called
from HBA reset DONE context.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:27 -05:00
Hannes Reinecke 36dd288f0f [SCSI] scsi_transport_fc: Protect against overflow in dev_loss_tmo
The rport structure defines dev_loss_tmo as u32, which is
later multiplied with HZ to get the actual timeout value.
This might overflow for large dev_loss_tmo values. So we
should be better using u64 as intermediate variables here
to protect against overflow.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:27 -05:00
FUJITA Tomonori bb789d0162 [SCSI] mpt2sas: fix the incorrect scsi_dma_map error checking
scsi_dma_map() returns -1 if an error occurred (zero means that the
command has no data). So the following current code can't catch an
error:

sges_left = scsi_dma_map(scmd);
if (!sges_left) {
	sdev_printk(KERN_ERR, scmd->device, "pci_map_sg"
	" failed: request for %d bytes!\n", scsi_bufflen(scmd));
	return -ENOMEM;
}

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:26 -05:00
adam radford 4deedd845a [SCSI] 3w-xxxx, 3w-9xxx: force 60 second timeout
This small patch forces 60 second timeouts for the older 3w-xxxx &
3w-9xxx drivers for systems that don't contain the udev rule for
setting scsi timeouts to 60 seconds.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:25 -05:00
Jiri Slaby bc0beb44f2 [SCSI] qla2xxx: fix lock imbalance
Stanse found that one error path in qla24xx_bsg_timeout omits to
unlock ha->hardware_lock. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-08 18:42:41 -04:00
Jiri Slaby 67221a4226 [SCSI] lpfc: fix lock imbalances
Stanse found that two error paths in lpfc_bsg_rport_els_cmp and
lpfc_issue_ct_rsp_cmp omits to unlock phba->ct_ev_lock. It is
because they wrongly unlock phba->hbalock instead. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-08 18:42:10 -04:00
Jiri Slaby 4ec3fdbef1 [SCSI] be2iscsi: fix lock imbalance
Stanse found that one error path in mgmt_invalidate_icds omits to unlock
ctrl->mbox_lock. Fix that.

Added in 756d29c8c7 (Enable async mode for mcc rings)
where the spinlock was moved.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-08 18:41:50 -04:00
Dan Carpenter 229bab6bac [SCSI] dpt_i2o: several use after free issues
adpt_i2o_delete_hba() calls kfree() so we have to save "pHba->next"
before calling it.  Also inside adpt_i2o_delete_hba() itself, there
was another use after free bug which I fixed by moving the kfree()
down a line.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-08 18:26:15 -04:00
Linus Torvalds cf90bfe2eb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
  ide: Fix IDE taskfile with cfq scheduler
  ide: Must hold queue lock when requeueing
  ide: Requeue request after DMA timeout
2010-04-08 07:45:36 -07:00
Linus Torvalds 0a2851b9a8 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI / PM: Move ACPI video resume to a PM notifier
  ACPI: Reduce ACPI resource conflict message to KERN_WARNING, printk cleanup
  ACPI: battery drivers should call power_supply_changed()
  ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n
  PNPACPI: truncate _CRS windows with _LEN > _MAX - _MIN + 1
  ACPI: Don't send KEY_UNKNOWN for random video notifications
  ACPI: NUMA: map pxms to low node ids
  ACPI: use _HID when supplied by root-level devices
  ACPI / ACPICA: Do not check reference counters in acpi_ev_enable_gpe()
  ACPI: fixes a false alarm from lockdep
  ACPI dock: support multiple ACPI dock devices
  ACPI: EC: Allow multibyte access to EC
2010-04-08 07:44:53 -07:00
Anton Blanchard 320718ee07 hvc_console: Fix race between hvc_close and hvc_remove
I don't claim to understand the tty layer, but it seems like hvc_open and
hvc_close should be balanced in their kref reference counting.

Right now we get a kref every call to hvc_open:

        if (hp->count++ > 0) {
                tty_kref_get(tty); <----- here
                spin_unlock_irqrestore(&hp->lock, flags);
                hvc_kick();
                return 0;
        } /* else count == 0 */

        tty->driver_data = hp;

        hp->tty = tty_kref_get(tty); <------ or here if hp->count was 0

But hvc_close has:

        tty_kref_get(tty);

        if (--hp->count == 0) {
...
                /* Put the ref obtained in hvc_open() */
                tty_kref_put(tty);
...
        }

        tty_kref_put(tty);

Since the outside kref get/put balance we only do a single kref_put when
count reaches 0.

The patch below changes things to call tty_kref_put once for every
hvc_close call, and with that my machine boots fine.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-04-08 09:46:20 +09:30
Michael S. Tsirkin b7a413015d virtio: disable multiport console support.
Move MULTIPORT feature and related config changes
out of exported headers, and disable the feature
at runtime.

At this point, it seems less risky to keep code around
until we can enable it than rip it out completely.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-04-08 09:46:19 +09:30
Rusty Russell 9ff4cfab82 virtio: console makes incorrect assumption about virtio API
The get_buf() API sets the second arg to the number of bytes *written*
by the other side; in this case it should be zero as these are output buffers.

lguest gets this right (obviously kvm's console doesn't), resulting in
continual buildup of console writes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Amit Shah <amit.shah@redhat.com>
2010-04-08 09:46:17 +09:30
François Diakhaté 162a689a13 virtio: console: Fix early_put_chars usage
Currently early_put_chars is not used by virtio_console because it can
only be used once a port has been found, at which point it's too late
because it is no longer needed. This patch should fix it.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-04-08 09:46:15 +09:30