profile/ivi/kernel-adaptation-intel-automotive.git
13 years ago[SCSI] zfcp: Remove redundant unlikely()
Tobias Klauser [Tue, 22 Feb 2011 18:54:38 +0000 (19:54 +0100)]
[SCSI] zfcp: Remove redundant unlikely()

IS_ERR() already implies unlikely(), so it can be omitted here.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] be2iscsi: fix null ptr ref in conn get param
Mike Christie [Wed, 16 Feb 2011 21:04:41 +0000 (15:04 -0600)]
[SCSI] be2iscsi: fix null ptr ref in conn get param

The ep_disconnect function could be freeing the ep
while beiscsi_conn_get_param is running. This has
the driver use the get ep param callback instead
of the get conn param to fix this.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] iser: export addr and port
Mike Christie [Wed, 16 Feb 2011 21:04:40 +0000 (15:04 -0600)]
[SCSI] iser: export addr and port

This pactch has iser export the address and port
of the endpoint.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: fix null ptr ref in conn get param
Mike Christie [Wed, 16 Feb 2011 21:04:39 +0000 (15:04 -0600)]
[SCSI] bnx2i: fix null ptr ref in conn get param

bnx2i has some checks to try and make sure the ep
is not destroyed while the addr/port is getting
read. However, if after this check:

if (!(bnx2i_conn && bnx2i_conn->ep && bnx2i_conn->ep->hba))
goto out;

bnx2i_conn->ep is cleared by ep_disconnect then we will
oops.

This patches fixes the problem by having the driver
use the get_ep_param callback instead of get_conn_param.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] cxgbi: convert to use iscsi_conn_get_addr_param
Mike Christie [Wed, 16 Feb 2011 21:04:38 +0000 (15:04 -0600)]
[SCSI] cxgbi: convert to use iscsi_conn_get_addr_param

This has cxgbi use the iscsi_conn_get_addr_param helper
and the get ep callback.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] iscsi class: add callout to get iscsi_endpoint values
Mike Christie [Wed, 16 Feb 2011 21:04:37 +0000 (15:04 -0600)]
[SCSI] iscsi class: add callout to get iscsi_endpoint values

For drivers using the ep callbacks the addr and port
are attached to the endpoint instead of the conn.
This adds a callout to the iscsi_transport to get
ep values. It also adds locking around the get
param call to make sure that ep_disconnect does
not free the LLD's ep interconnect structs from
under us (the ep has a refcount so it will not
go away but the LLD may have structs from other
subsystems that are not allocated in the ep so
we need to protect them from getting freed).

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] iscsi_tcp: use iscsi_conn_get_addr_param libiscsi function
Mike Christie [Wed, 16 Feb 2011 21:04:36 +0000 (15:04 -0600)]
[SCSI] iscsi_tcp: use iscsi_conn_get_addr_param libiscsi function

This has iscsi_tcp use the iscsi_conn_get_addr_param
libiscsi function. It also drops the use of the libiscsi
session portal buffers, so they can be removed in
the next patches. Instead of copying the values
at bind time we get them during get() time. If we are
not connected userspace will now get -ENOTCONN,
so it knows that connection is disconnected instead
of a possible stale value.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libiscsi: add helper to convert addr to string
Mike Christie [Wed, 16 Feb 2011 21:04:35 +0000 (15:04 -0600)]
[SCSI] libiscsi: add helper to convert addr to string

This adds a helper to convert a addr struct to
a string. This will be used by the drivers in
the next patches.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] iscsi class: remove unused active variable
Mike Christie [Wed, 16 Feb 2011 21:04:34 +0000 (15:04 -0600)]
[SCSI] iscsi class: remove unused active variable

The active variable on the iscsi_cls_conn is not used
so this patch removes it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] iscsi: fix iscsi_endpoint leak
Mike Christie [Wed, 16 Feb 2011 21:04:33 +0000 (15:04 -0600)]
[SCSI] iscsi: fix iscsi_endpoint leak

When iscsid restarts it does not know the connection's
endpoint, so it is getting leaked. This fixes the problem
by having the iscsi class force a disconnect before a
new connection is bound.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] cxgbi: enable TEXT PDU support
Mike Christie [Wed, 16 Feb 2011 21:04:32 +0000 (15:04 -0600)]
[SCSI] cxgbi: enable TEXT PDU support

cxgb3i and cxgb4i support TEXT PDU offloading, so set
the bits to enable it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: Updated to version 2.6.2.3
Eddie Wai [Wed, 16 Feb 2011 21:04:31 +0000 (15:04 -0600)]
[SCSI] bnx2i: Updated to version 2.6.2.3

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: Added iSCSI text pdu support for iSCSI offload
Eddie Wai [Wed, 16 Feb 2011 21:04:30 +0000 (15:04 -0600)]
[SCSI] bnx2i: Added iSCSI text pdu support for iSCSI offload

This is part of an effort to support send target discovery via
the iSCSI offload path.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: Added jumbo MTU support for the no shost case
Eddie Wai [Wed, 16 Feb 2011 21:04:29 +0000 (15:04 -0600)]
[SCSI] bnx2i: Added jumbo MTU support for the no shost case

For scenarios where the shost is not being passed to bnx2i for the
iSCSI offload connection request, the code would consult the routing
table to select the CNIC device.
This code path will erroneously error out if the corresponding L2
interface's MTU has been setup to > 1500.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: Added support for the 57712(E) devices
Eddie Wai [Wed, 16 Feb 2011 21:04:28 +0000 (15:04 -0600)]
[SCSI] bnx2i: Added support for the 57712(E) devices

Moved all PCI_DEVICE_ID_NX2_57712(E) definitions to pci_ids.h

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: Added handling for unsupported iSCSI offload hba
Eddie Wai [Wed, 16 Feb 2011 21:04:27 +0000 (15:04 -0600)]
[SCSI] bnx2i: Added handling for unsupported iSCSI offload hba

The hba will now be unregistered and freed when iSCSI offload
is not supported by the NIC.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: Fixed the 32-bit swapping of the LUN field for nopouts for 5771X
Eddie Wai [Wed, 16 Feb 2011 21:04:26 +0000 (15:04 -0600)]
[SCSI] bnx2i: Fixed the 32-bit swapping of the LUN field for nopouts for 5771X

Fixed a bug where the 64-bit LUN field for nopouts were 32-bit swapped.
This only pertains to 5771X devices.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: Allow ep CONNECT_FAILED condition to go through proper cleanup
Eddie Wai [Wed, 16 Feb 2011 21:04:25 +0000 (15:04 -0600)]
[SCSI] bnx2i: Allow ep CONNECT_FAILED condition to go through proper cleanup

Allow CNIC to go through the proper cleanup procedure for an endpoint
which failed to connect.  Proper cleanup is necessary for the chip
to reset back to the initial state for the offloaded endpoint.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] lpfc 8.3.21: Change lpfc driver version to 8.3.21
James Smart [Wed, 16 Feb 2011 17:40:15 +0000 (12:40 -0500)]
[SCSI] lpfc 8.3.21: Change lpfc driver version to 8.3.21

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>
13 years ago[SCSI] lpfc 8.3.21: Debugfs additions
James Smart [Wed, 16 Feb 2011 17:40:06 +0000 (12:40 -0500)]
[SCSI] lpfc 8.3.21: Debugfs additions

- Add the driver debugfs framework for supporting debugfs read and write
  operations, and iDiag command structure.
- Add read and write to SLI4 device PCI config space registers.
- Add the driver support of debugfs PCI config space register bits set/clear
  methods to the provided bitmask.
- Add iDiag driver support for SLI4 device queue diagnostic.

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>
13 years ago[SCSI] lpfc 8.3.21: Initialization and user interface changes
James Smart [Wed, 16 Feb 2011 17:39:57 +0000 (12:39 -0500)]
[SCSI] lpfc 8.3.21: Initialization and user interface changes

- Make link speed not supported by port message an error message.
- Add support for new SLI failure codes add sysfs parameter to reflect the
  security setting and current state.
- Add all lpfc module parameters to the /sys/modules/lpfc/parameters directory.

[jejb: fix up compile failure]
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>
13 years ago[SCSI] lpfc 8.3.21: FC Discovery changes
James Smart [Wed, 16 Feb 2011 17:39:44 +0000 (12:39 -0500)]
[SCSI] lpfc 8.3.21: FC Discovery changes

FC Discovery changes

- Treat received PLOGI while logged in as a relogin (unregister and reregister).
- Added a timer to delay Nport discovery when clean bit is cleared and Fabric
  portname/nodename/FCID is changed.
- Invalidate Port's DID when receiving PLOGI from p2p port with CONFIG_PORT
  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>
13 years ago[SCSI] lpfc 8.3.21: RRQ Implementation fixes
James Smart [Wed, 16 Feb 2011 17:39:35 +0000 (12:39 -0500)]
[SCSI] lpfc 8.3.21: RRQ Implementation fixes

RRQ Implementation fixes

- Added checks to prevent a call to findnode_did in clr_active_rrq
- Added the del_sync_timer call for the rrq_tmr to the stop_hba_timers routine.
- Added a check in __lpfc_set_active_rrq for the driver unloading to prevent
  adding an rrq when the driver is being removed.
- Add code to scsi_iocb_cmpl to check for the remote stop and add the rrq.
- Added the same check to els retry.
- Added code to compare the source did in the els rrq to the vports did and
  chose the right exchange ID.
- Initialize the start_cmd pointer to indicate when we have looped through
  all of the scsi buffers.
- Remove the need for the lock around the clearing of the active bit in the
  rrq.
- Added code to clean the els and fcp xri aborted list and remove the all of
  the RRQs for a deleted vport.

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>
13 years ago[SCSI] lpfc 8.3.21: Critical Errors and Bug Fixes
James Smart [Wed, 16 Feb 2011 17:39:24 +0000 (12:39 -0500)]
[SCSI] lpfc 8.3.21: Critical Errors and Bug Fixes

Critical Errors:
- Correctly handle non-zero return lpfc_workq_post_event and return ENOMEM
- Save the irq level when locking the host_lock in lpfc_findnode_did

Bug Fixes:
- Adjust payload_length and request_length for sli4_config mailbox commands.
- Add the freed sgl/XRI to the tail of the list rather than to the head.
- Set the FC_VPORT_NEEDS_INIT_VPI on vport deletes and check it before
  issuing a fdisc on an els retry.
- Only call lpfc_hba_init_link() if phba->cfg_suppress_link_up
  is LPFC_INITIALIZE_LINK.
- Add support for SLI-4 Performance Hints

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>
13 years ago[SCSI] hpsa: fix bad comparison
Dan Carpenter [Tue, 15 Feb 2011 21:33:13 +0000 (15:33 -0600)]
[SCSI] hpsa: fix bad comparison

'!' has higher precedence than '&'.  CFGTBL_ChangeReq is 0x1 so the
original code is equivelent to if (!doorbell_value) {...

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: Do not attempt kdump if we detect resetting controller failed.
Stephen M. Cameron [Tue, 15 Feb 2011 21:33:08 +0000 (15:33 -0600)]
[SCSI] hpsa: Do not attempt kdump if we detect resetting controller failed.

We can get completions left over from before the attempted reset which
will interfere with the kdump.  Better to just not make the attempt in
that case.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: Inform controller we are using 32-bit tags.
Stephen M. Cameron [Tue, 15 Feb 2011 21:33:03 +0000 (15:33 -0600)]
[SCSI] hpsa: Inform controller we are using 32-bit tags.

Controller will transfer only 32-bits on completion if it
knows we are only using 32-bit tags.  Also, some newer controllers
apparently (and erroneously) require that we only use 32-bit tags,
and that we inform the controller of this.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: Add transport_mode host attribute in /sys
Stephen M. Cameron [Tue, 15 Feb 2011 21:32:58 +0000 (15:32 -0600)]
[SCSI] hpsa: Add transport_mode host attribute in /sys

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: make hpsa.hpsa_simple_mode=1 module parameter actually work
Stephen M. Cameron [Tue, 15 Feb 2011 21:32:53 +0000 (15:32 -0600)]
[SCSI] hpsa: make hpsa.hpsa_simple_mode=1 module parameter actually work

It's not enough to simple avoid putting the board into performant
mode, as we have to set up the interrupts differently, etc.  When
I originally tested this module parameter, I tested it incorrectly
without realizing it, and the driver was running in performant mode
the whole time unbeknownst to me.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: do not re-order commands in internal queues
Stephen M. Cameron [Tue, 15 Feb 2011 21:32:48 +0000 (15:32 -0600)]
[SCSI] hpsa: do not re-order commands in internal queues

Driver's internal queues should be FIFO, not LIFO.
This is a port of an almost identical patch from cciss by Jens Axboe.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] ipr: Fix a race on multiple configuration changes
Kleber Sacilotto de Souza [Mon, 14 Feb 2011 22:19:31 +0000 (20:19 -0200)]
[SCSI] ipr: Fix a race on multiple configuration changes

In a multiple configuration change scenario a remove notification can be
followed by an immediate add notification for the same device, which
will cause the device to be removed but never added back. This patch
fixes the problem by ensuring that in such situations the device will be
added back.

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libsas: convert to libata new error handler
James Bottomley [Sun, 23 Jan 2011 15:44:12 +0000 (09:44 -0600)]
[SCSI] libsas: convert to libata new error handler

The conversion is quite complex given that the libata new error
handler has to be hooked into the current libsas timeout and error
handling.  The way this is done is to process all the failed commands
via libsas first, but if they have no underlying sas task (and they're
on a sata device) assume they are destined for the libata error
handler and send them accordingly.

Finally, activate the port recovery of the libata error handler for
each port known to the host.  This is somewhat suboptimal, since that
port may not need recovering, but given the current architecture of
the libata error handler, it's the only way; and the spurious
activation is harmless.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libata: separate error handler into usable components
James Bottomley [Sun, 23 Jan 2011 15:42:50 +0000 (09:42 -0600)]
[SCSI] libata: separate error handler into usable components

Right at the moment, the libata error handler is incredibly
monolithic.  This makes it impossible to use from composite drivers
like libsas and ipr which have to handle error themselves in the first
instance.

The essence of the change is to split the monolithic error handler
into two components: one which handles a queue of ata commands for
processing and the other which handles the back end of readying a
port.  This allows the upper error handler fine grained control in
calling libsas functions (and making sure they only get called for ATA
commands whose lower errors have been fixed up).

Cc: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libata: fix eh locking
James Bottomley [Sun, 23 Jan 2011 14:31:14 +0000 (08:31 -0600)]
[SCSI] libata: fix eh locking

The SCSI host eh_cmd_q should be protected by the host lock (not the
port lock).  This probably doesn't matter that much at the moment,
since we try to serialise the add and eh pieces, but it might matter
in future for more convenient error handling.  Plus this switches
libata to the standard eh pattern where you lock, remove from the cmd
queue to a local list and unlock and then operate on the local list.

Cc: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libata: fix locking for sas paths
James Bottomley [Sun, 23 Jan 2011 14:30:00 +0000 (08:30 -0600)]
[SCSI] libata: fix locking for sas paths

For historical reasons, libsas uses the scsi host lock as the ata port
lock, and libata always uses the ata host.  For the old eh, this was
largely irrelevant since the two locks were never mixed inside the
code.  However, the new eh has a case where it nests acquisition of
the host lock inside the port lock (this does look rather deadlock
prone).  Obviously this would be an instant deadlock if the port lock
were the host lock, so switch the libsas paths to use the ata host
lock as well.

Cc: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libata: plumb sas port scan into standard libata paths
James Bottomley [Sun, 23 Jan 2011 14:28:33 +0000 (08:28 -0600)]
[SCSI] libata: plumb sas port scan into standard libata paths

The function ata_sas_port_init() has always really done its own thing.
However, as a precursor to moving to the libata new eh, it has to be
properly using the standard libata scan paths.  This means separating
the current libata scan paths into pieces which can be shared with
libsas and pieces which cant (really just the async call and the host
scan).

Cc: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] scsi_dh_rdac : Adding MODULE VERSION for rdac device handler
Moger, Babu [Fri, 11 Feb 2011 23:12:44 +0000 (16:12 -0700)]
[SCSI] scsi_dh_rdac : Adding MODULE VERSION for rdac device handler

Adding MODULE_VERSION for scsi_dh_rdac. This will be helpful sometimes
to get the code level without looking at the code.

Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] scsi_dh: cosmetic change to sizeof()
Hillf Danton [Fri, 11 Feb 2011 22:17:33 +0000 (15:17 -0700)]
[SCSI] scsi_dh: cosmetic change to sizeof()

instead of doing sizeof(struct X) it's better to do sizeof(*v) where v
is the variable pointing to struct X.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] scsi_dh_rdac: fix for lun_table update for rdac device handler
Moger, Babu [Fri, 11 Feb 2011 22:14:08 +0000 (15:14 -0700)]
[SCSI] scsi_dh_rdac: fix for lun_table update for rdac device handler

During one of our testing, we noticed that mode select command sent
from the host did not have the lun_table updated.

Problem is root caused to the way lun table is updated. Lun table
update was done after the call to blk_rq_map_kern is made. This was
causing problem because kernel uses bounce buffer(bio_copy_kern) if
the address is not aligned.  The command buffer updated after the
call(blk_rq_map_kern) was not going on the wire. Moved the code to
update the lun_table before the call to fix the problem.

Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Signed-off-by: Yanling Qi <Yanling.Qi@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] mptfusion: Remove bus reset for mptsas module
Kashyap, Desai [Thu, 10 Feb 2011 06:21:24 +0000 (11:51 +0530)]
[SCSI] mptfusion: Remove bus reset for mptsas module

Bus reset is not required for SAS Controller. It is valid for mptspi
and mptfc, but for mptsas it is not required. It is an extra work for
Error handling escallation for mptsas.  Removing bus reset from error
handling will eventually speedup Error handling for SAS controller.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] mptfusion: Support SAS2.0 Devices with SAS1.0 Controllers
Kashyap, Desai [Thu, 10 Feb 2011 06:20:39 +0000 (11:50 +0530)]
[SCSI] mptfusion: Support SAS2.0 Devices with SAS1.0 Controllers

SAS1.0 Controller was not able to detect SAS2.0 Expanders due to Link
RATE detection was limited to 1.5 Gbps and 3.0 Gbps for SAS1
controllers. Added detection for 6.0 Gbps link.  Now, user can mix-up
6.0 Gpbs links with SAS1.0 controller.

e.g SAS1.0 HBA <----> SAS2.0 Expander <------> SAS2.0 Expander <--------> SAS1.0 Drive.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfcoe: Move common code from fcoe to libfcoe module
Bhanu Prakash Gollapudi [Sat, 29 Jan 2011 00:05:37 +0000 (16:05 -0800)]
[SCSI] libfcoe: Move common code from fcoe to libfcoe module

To facilitate LLDDs to reuse the code, skb queue related functions are moved to
libfcoe, so that both fcoe and bnx2fc drivers can use them. The common structures
fcoe_port, fcoe_percpu_s are moved to libfcoe. fcoe_port will now have an
opaque pointer that points to corresponding driver's interface structure.
Also, fcoe_start_io and fcoe_fc_crc are moved to libfcoe.

As part of this change, fixed fcoe_start_io to return ENOMEM if
skb_clone fails.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] fcoe: use dedicated workqueue instead of system_wq
Tejun Heo [Sat, 29 Jan 2011 00:05:32 +0000 (16:05 -0800)]
[SCSI] fcoe: use dedicated workqueue instead of system_wq

fcoe uses the system_wq to destroy ports and the work items need to be
flushed before the driver is unloaded.  As the work items free the
containing data structure, they can't be flushed directly.  The
workqueue should be flushed instead.

Also, the destruction works can be chained - ie. destruction of a port
may lead to destruction of another port where the work item for the
former queues the work for the latter.  Currently, the depth of chain
can be at most two and fcoe_exit() makes sure everything is complete
by calling flush_scheduled_work() twice.

With commit c8efcc25 (workqueue: allow chained queueing during
destruction), destroy_workqueue() can take care of chained works on
workqueue destruction.  Add and use fcoe_wq instead.  Simply
destroying fcoe_wq on driver unload takes care of flushing.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: introduce LLD event callback
Bhanu Prakash Gollapudi [Sat, 29 Jan 2011 00:05:27 +0000 (16:05 -0800)]
[SCSI] libfc: introduce LLD event callback

This patch enables LLD to listen to rport events and perform LLD
specific operations based on the rport event. This patch also stores
sp_features and spp_type in rdata for further reference by LLD.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: Extending lport's roles for target if there is a registered target.
Kiran Patil [Sat, 29 Jan 2011 00:05:22 +0000 (16:05 -0800)]
[SCSI] libfc: Extending lport's roles for target if there is a registered target.

Problem:

From initaitor machine, when queried role of target (other end of connection),
it is "initiator", hence SCSI-ml doesn't send any LUN Inquiry commands.

Fix:

If there is a registered target for FC_TYPE_FCP, extend lport's params
(capability) to be target as well, By default lport params are
INITIATOR only. Having this fix, caused initiator to send SCSI LUN
inquiry command to target.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] fcoe: convert fcoe.ko to become an fcoe transport provider driver
Yi Zou [Sat, 29 Jan 2011 00:05:16 +0000 (16:05 -0800)]
[SCSI] fcoe: convert fcoe.ko to become an fcoe transport provider driver

Remove the existing sysfs entry points of the fcoe.ko module parameters that
are used to create/destroy/enable/disable an FCoE instance, rather, use the
newly added fcoe transport code to attach itself as an FCoE transport provider
when fcoe.ko gets loaded. There is no functionality change on the logic of
fcoe interacts with upper libfc and lower netdev. The fcoe transport only acts
as thin layer to provide a unified interface for all fcoe transport providers
so all FCoE instances on any network interfaces from all vendors can be
managed through the same Open-FCoE.org's user space tool package, which also
has full DCB support.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] fcoe: prepare fcoe for using fcoe transport
Yi Zou [Sat, 29 Jan 2011 00:05:11 +0000 (16:05 -0800)]
[SCSI] fcoe: prepare fcoe for using fcoe transport

Prepare the fcoe to convert it to use the newly added fcoe transport, making
it as the default fcoe transport provider for libfcoe. This patch is to rename
some of the variables to avoid any confusing names later as now there are
several transports in the same file.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfcoe: include fcoe_transport.c into kernel libfcoe module
Yi Zou [Sat, 29 Jan 2011 00:05:06 +0000 (16:05 -0800)]
[SCSI] libfcoe: include fcoe_transport.c into kernel libfcoe module

Now we can include the fcoe_transport.c to the build of the kernel libfcoe
module. Move the module information to fcoe_transport, and it will have
all the module parameters later for the create/destroy/enable/disable of an
FCoE instance.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfcoe: rename libfcoe.c to fcoe_cltr.c for the coming fcoe_transport.c
Yi Zou [Sat, 29 Jan 2011 00:05:00 +0000 (16:05 -0800)]
[SCSI] libfcoe: rename libfcoe.c to fcoe_cltr.c for the coming fcoe_transport.c

The existing libfcoe.c is mostly for FIP support, rename it to reflect that
fact and so we can add fcoe_transport.c to the make file to include both
into the libfcoe kernel module.

[ Minor modifications by Robert Love converting a few
  "__attribute__((packed))" modifiers to "__packed" to remove new
  checkpatch.pl WARNINGS ]

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfcoe: add implementation to support fcoe transport
Yi Zou [Sat, 29 Jan 2011 00:04:55 +0000 (16:04 -0800)]
[SCSI] libfcoe: add implementation to support fcoe transport

Add the new fcoe_transport.c file that implements basic fcoe transport
interface. Eventually, the sysfs entries to create/destroy/enable/disable
an FCoE instance will be coming to the fcoe transport layer, who does a
look-up to find the corresponding transport provide and pass the corresponding
action over to the identified provider.

The fcoe.ko will become the default fcoe transport provider that can support
FCoE on any given netdev interfaces, as the Open-FCoE.org's default software
FCoE HBA solution. Any vendor specific FCoE HBA driver that is built on top
of Open-FCoE's kernel stack of libfc & libfcoe as well as the user land tool
of fcoe-utils can easily plug-in and start running FCoE on their network
interfaces. The fcoe.ko will be converted to act as the default provider if
no vendor specific transport provider is found, as it is always added to the
very end of the list of attached transports.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfcoe: add fcoe_transport structure defines to include/scsi/libfcoe.h
Yi Zou [Sat, 29 Jan 2011 00:04:50 +0000 (16:04 -0800)]
[SCSI] libfcoe: add fcoe_transport structure defines to include/scsi/libfcoe.h

add the fcoe_transport struct to the common libfcoe.h header so all fcoe
transport provides can use it to attach itself as an fcoe transport. This
is the header part, and the next patch will be the transport code itself.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfcoe: move logging macros into the local libfcoe.h header file
Yi Zou [Sat, 29 Jan 2011 00:04:45 +0000 (16:04 -0800)]
[SCSI] libfcoe: move logging macros into the local libfcoe.h header file

libfcoe kernel module debug macros will used by the fcoe transport code
as well when later it gets added.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: Enhanced exchange ID selection mechanism and fix related EMA selection...
Kiran Patil [Sat, 29 Jan 2011 00:04:39 +0000 (16:04 -0800)]
[SCSI] libfc: Enhanced exchange ID selection mechanism and fix related EMA selection logic.

Problem:

In case of exchange responder case, EMA selection was defaulted to the
last EMA from EMA list (lport.ema_list).  If exchange ID is selected
from offload pool and not setup DDP, resulting into incorrect
selection of EMA, and eventually dropping the packet because unable to
find exchange.

Fix:

Enhanced the exchange ID selection (depending upon request type and
exchange responder) Made necessary enhancement in EMA selection
algorithm.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: export seq_release() for users of seq_assign()
Joe Eykholt [Sat, 29 Jan 2011 00:04:34 +0000 (16:04 -0800)]
[SCSI] libfc: export seq_release() for users of seq_assign()

Target modules using lport->tt.seq_assign() get a hold on the
exchange but have no way of releasing it.  Add that.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: Remove usage of the Scsi_Host's host_lock
Robert Love [Sat, 29 Jan 2011 00:04:29 +0000 (16:04 -0800)]
[SCSI] libfc: Remove usage of the Scsi_Host's host_lock

This patch removes the use of the Scsi_Host's host_lock
within fc_queuecommand. It also removes the DEF_SCSI_QCMD
usage so that libfc has fully moved on to the new
queuecommand interface.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Reviewed-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: use PRLI hook to get parameters when sending outgoing PRLI
Joe Eykholt [Sat, 29 Jan 2011 00:04:23 +0000 (16:04 -0800)]
[SCSI] libfc: use PRLI hook to get parameters when sending outgoing PRLI

When sending an outgoing PRLI as an initiator, get the parameters
from registered providers so that they all get a chance to decide
on roles.

The passive provider is called last, and could override the
initiator role.

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>
13 years ago[SCSI] libfc: add hook to notify providers of local port changes
Joe Eykholt [Sat, 29 Jan 2011 00:04:18 +0000 (16:04 -0800)]
[SCSI] libfc: add hook to notify providers of local port changes

When an SCST provider is registered, it needs to know what
local ports are available for configuration as targets.

Add a notifier chain that is invoked when any local port
that is added or deleted.

Maintain a global list of local ports and add an
interator function that calls a given function for
every existing local port.  This is used when first
loading a provider.

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>
13 years ago[SCSI] libfc: add local port hook for provider session lookup
Joe Eykholt [Sat, 29 Jan 2011 00:04:13 +0000 (16:04 -0800)]
[SCSI] libfc: add local port hook for provider session lookup

The target provider needs a per-instance lookup table
or other way to lookup sessions quickly without going through
a linear list or serializing too much.

Add a simple void * array indexed by FC-4 type to the fc_lport.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Committed-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: add method for setting handler for incoming exchange
Joe Eykholt [Sat, 29 Jan 2011 00:04:08 +0000 (16:04 -0800)]
[SCSI] libfc: add method for setting handler for incoming exchange

Add a method for setting handler for incoming exchange.
For multi-sequence exchanges, this allows the target driver
to add a response handler for handling subsequent sequences,
and exchange manager resets.

The new function is called fc_seq_set_resp().

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>
13 years ago[SCSI] libfc: add hook for FC-4 provider registration
Joe Eykholt [Sat, 29 Jan 2011 00:04:02 +0000 (16:04 -0800)]
[SCSI] libfc: add hook for FC-4 provider registration

Allow FC-4 provider modules to hook into libfc, mostly for targets.
This should allow any FC-4 module to handle PRLI requests and maintain
process-association states.

Each provider registers its ops with libfc and then will be called for
any incoming PRLI for that FC-4 type on any instance.   The provider
can decide whether to handle that particular instance using any method
it likes, such as ACLs or other configuration information.

A count is kept of the number of successful PRLIs from the remote port.
Providers are called back with an implicit PRLO when the remote port
is about to be deleted or has been reset.

fc_lport_recv_req() now sends incoming FC-4 requests to FC-4 providers,
and there is a built-in provider always registered for handling
incoming ELS requests.

The call to provider recv() routines uses rcu_read_lock()
so that providers aren't removed during the call.  That lock is very
cheap and shouldn't affect any performance on ELS requests.
Providers can rely on the RCU lock to protect a session lookup as well.

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>
13 years ago[SCSI] libfc: fix sparse static and non-ANSI warnings
Randy Dunlap [Sat, 29 Jan 2011 00:03:57 +0000 (16:03 -0800)]
[SCSI] libfc: fix sparse static and non-ANSI warnings

Fix sparse warning for non-ANSI function declaration.
Declare workqueue structs as static.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Robert Love <robert.w.love@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] fcoe: drop FCoE LOGO in FIP mode
Vasu Dev [Sat, 29 Jan 2011 00:03:52 +0000 (16:03 -0800)]
[SCSI] fcoe: drop FCoE LOGO in FIP mode

Allowing FCoE LOGO followed by CVL in this case prevents
FIP login back to the FCF and then keeps lport offline,
only FIP LOGO and CLV needs to be processed while in
FIP mode, therefore this patch drops FCoE LOGO in FIP mode.

Added fcoe_filter_frames() to filter out above mentioned LOGO
in fcoe rx path along with other existing filtering in code
for bad CRC frames. Adding separate fcoe_filter_frames function
helped with better code indentations and if needed then same
will allow adding more filters at one place in future.

This LOGO drop is added after FCP frames passed up to avoid
any additional checks on fast path for this.

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>
13 years ago[SCSI] fcoe: Fix module reference count for vports
Robert Love [Sat, 29 Jan 2011 00:03:47 +0000 (16:03 -0800)]
[SCSI] fcoe: Fix module reference count for vports

vports are not grabbing module references but are
releasing them. This causes the module reference count
to decrement too many times and it wraps around past 0.

The solution is to do a module_put() in
fcoe_interface_release() so that the reference is only
released when the fcoe_interface is released. There is a
one-to-one relationship between the N_Port and the
fcoe_interface, so the module reference will only be
dropped when the N_Port is destroyed

To create symetry in the code this patch moves the
try_module_get() call into fcoe_interface_create(). This
means that only the N_Port will grab a reference to the
module when its corresponding fcoe_interface is created.

This patch also makes it so that the fcoe_interface_create()
routine encodes any error codes in the fcoe_interface
pointer returned. This way its caller, fcoe_create(), can
return an accurate error code.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] fnic: Bumping up fnic version from 1.4.0.145 to 1.5.0.1.
Venkata Siva Vijayendra Bhamidipati [Sat, 29 Jan 2011 00:03:42 +0000 (16:03 -0800)]
[SCSI] fnic: Bumping up fnic version from 1.4.0.145 to 1.5.0.1.

Signed-off-by: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] fnic: fix memory leak
Venkata Siva Vijayendra Bhamidipati [Sat, 29 Jan 2011 00:03:36 +0000 (16:03 -0800)]
[SCSI] fnic: fix memory leak

Fix memory leak arising due to incorrect freeing of allocated memory
for vnic stats when unregistering a vnic.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc:prevent dereferencing ERR_PTR in fc_tm_done()
Dan Carpenter [Sat, 29 Jan 2011 00:03:31 +0000 (16:03 -0800)]
[SCSI] libfc:prevent  dereferencing ERR_PTR in fc_tm_done()

If we goto out, then it tries to call kfree_skb() on an ERR_PTR which
will oops.  Just return directly.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: Cleanup return paths in fc_rport_error_retry
Hillf Danton [Sat, 29 Jan 2011 00:03:26 +0000 (16:03 -0800)]
[SCSI] libfc: Cleanup return paths in fc_rport_error_retry

This patch makes it so that we only have one call to
fc_rport_error. This patch does not completely
consolidate return statements, there is still one return
used when not calling fc_rport_error, but alternative
solutions made the code more confusing.

[ Patch modified by Robert Love ]
[ Patch title and commit message edited by Robert Love
  to make it more relevant ]

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: Return a valid return code in fc_fcp_pkt_abort()
Hillf Danton [Sat, 29 Jan 2011 00:03:21 +0000 (16:03 -0800)]
[SCSI] libfc: Return a valid return code in fc_fcp_pkt_abort()

Here ticks_left is added to record the result of
wait_for_completion_timeout().

[ Patch title and description edited by Robert Love
  to make it more descriptive  ]

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libfc: always initialize the FCoE DDP exchange id for fsp as FC_XID_UNKNOWN
Yi Zou [Sat, 29 Jan 2011 00:03:15 +0000 (16:03 -0800)]
[SCSI] libfc: always initialize the FCoE DDP exchange id for fsp as FC_XID_UNKNOWN

The fsp's xfer_ddp is used as indication of the exchange id for the DDPed
I/O. We should always initialize it as FC_XID_UNKNOWN for a newly allocated
fsp, otherwise the fsp allocated in fc_fcp, i.e., not from queuecommand like
LUN RESET that is not doing DDP may still think DDP is setup for it since xid
0 is valid and goes on to call fc_fcp_ddp_done() in fc_fcp_resp() from
fc_tm_done(). So, set xfer_ddp as FC_XID_UNKNOWN in fc_fcp_pkt_alloc() now.

Also removes the setting of fsp->lp as it's already done when fsp is allocated.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] block: improve detail in I/O error messages
Hannes Reinecke [Tue, 18 Jan 2011 09:13:13 +0000 (10:13 +0100)]
[SCSI] block: improve detail in I/O error messages

Classify severity of I/O errors for target, nexus, and
transport errors.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] dm mpath: propagate target errors immediately
Hannes Reinecke [Tue, 18 Jan 2011 09:13:12 +0000 (10:13 +0100)]
[SCSI] dm mpath: propagate target errors immediately

DM now has more information about the nature of the underlying storage
failure.  Path failure is avoided if a request failed due to a target
error.  Instead the target error is immediately passed up the stack.

Discard requests that fail due to non-target errors may now be retried.

Errors restricted to the path will be retried or returned if no
paths are available, irregarding the no_path_retry setting.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] Add detailed SCSI I/O errors
Hannes Reinecke [Tue, 18 Jan 2011 09:13:11 +0000 (10:13 +0100)]
[SCSI] Add detailed SCSI I/O errors

Instead of just passing 'EIO' for any I/O error we should be
notifying the upper layers with more details about the cause
of this error.

Update the possible I/O errors to:

- ENOLINK: Link failure between host and target
- EIO: Retryable I/O error
- EREMOTEIO: Non-retryable I/O error
- EBADE: I/O error restricted to the I_T_L nexus

'Retryable' in this context means that an I/O error _might_ be
restricted to the I_T_L nexus (vulgo: path), so retrying on another
nexus / path might succeed.

'Non-retryable' in general refers to a target failure, so this
error will always be generated regardless of the I_T_L nexus
it was send on.

I/O errors restricted to the I_T_L nexus might be retried
on another nexus / path, but they should _not_ be queued
if no paths are available.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] scsi_dh_hp_sw: fix deadlock in start_stop_endio
Mike Snitzer [Tue, 25 Jan 2011 16:52:17 +0000 (11:52 -0500)]
[SCSI] scsi_dh_hp_sw: fix deadlock in start_stop_endio

The use of blk_execute_rq_nowait() implies __blk_put_request() is needed
in start_stop_endio() rather than blk_put_request() --
blk_finish_request() is called with queue lock already held.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] megaraid_sas: Sanity check user supplied length before passing it to dma_alloc...
Bjørn Mork [Wed, 19 Jan 2011 09:01:14 +0000 (10:01 +0100)]
[SCSI] megaraid_sas: Sanity check user supplied length before passing it to dma_alloc_coherent()

The ioc->sgl[i].iov_len value is supplied by the ioctl caller, and can be
zero in some cases.  Assume that's valid and continue without error.

Fixes (multiple individual reports of the same problem for quite a while):

http://marc.info/?l=linux-ide&m=128941801715301
http://bugs.debian.org/604627
http://www.mail-archive.com/linux-poweredge@dell.com/msg02575.html

megasas: Failed to alloc kernel SGL buffer for IOCTL

and

[   69.162538] ------------[ cut here ]------------
[   69.162806] kernel BUG at /build/buildd/linux-2.6.32/lib/swiotlb.c:368!
[   69.163134] invalid opcode: 0000 [#1] SMP
[   69.163570] last sysfs file: /sys/devices/system/cpu/cpu3/cache/index2/shared_cpu_map
[   69.163975] CPU 0
[   69.164227] Modules linked in: fbcon tileblit font bitblit softcursor vga16fb vgastate ioatdma radeon ttm drm_kms_helper shpchp drm i2c_algo_bit lp parport floppy pata_jmicron megaraid_sas igb dca
[   69.167419] Pid: 1206, comm: smartctl Tainted: G        W  2.6.32-25-server #45-Ubuntu X8DTN
[   69.167843] RIP: 0010:[<ffffffff812c4dc5>]  [<ffffffff812c4dc5>] map_single+0x255/0x260
[   69.168370] RSP: 0018:ffff88081c0ebc58  EFLAGS: 00010246
[   69.168655] RAX: 000000000003bffc RBX: 00000000ffffffff RCX: 0000000000000002
[   69.169000] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88001dffe000
[   69.169346] RBP: ffff88081c0ebcb8 R08: 0000000000000000 R09: ffff880000030840
[   69.169691] R10: 0000000000100000 R11: 0000000000000000 R12: 0000000000000000
[   69.170036] R13: 00000000ffffffff R14: 0000000000000001 R15: 0000000000200000
[   69.170382] FS:  00007fb8de189720(0000) GS:ffff88001de00000(0000) knlGS:0000000000000000
[   69.170794] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   69.171094] CR2: 00007fb8dd59237c CR3: 000000081a790000 CR4: 00000000000006f0
[   69.171439] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   69.171784] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   69.172130] Process smartctl (pid: 1206, threadinfo ffff88081c0ea000, task ffff88081a760000)
[   69.194513] Stack:
[   69.205788]  0000000000000034 00000002817e3390 0000000000000000 ffff88081c0ebe00
[   69.217739] <0> 0000000000000000 000000000003bffc 0000000000000000 0000000000000000
[   69.241250] <0> 0000000000000000 00000000ffffffff ffff88081c5b4080 ffff88081c0ebe00
[   69.277310] Call Trace:
[   69.289278]  [<ffffffff812c52ac>] swiotlb_alloc_coherent+0xec/0x130
[   69.301118]  [<ffffffff81038b31>] x86_swiotlb_alloc_coherent+0x61/0x70
[   69.313045]  [<ffffffffa002d0ce>] megasas_mgmt_fw_ioctl+0x1ae/0x690 [megaraid_sas]
[   69.336399]  [<ffffffffa002d748>] megasas_mgmt_ioctl_fw+0x198/0x240 [megaraid_sas]
[   69.359346]  [<ffffffffa002f695>] megasas_mgmt_ioctl+0x35/0x50 [megaraid_sas]
[   69.370902]  [<ffffffff81153b12>] vfs_ioctl+0x22/0xa0
[   69.382322]  [<ffffffff8115da2a>] ? alloc_fd+0x10a/0x150
[   69.393622]  [<ffffffff81153cb1>] do_vfs_ioctl+0x81/0x410
[   69.404696]  [<ffffffff8155cc13>] ? do_page_fault+0x153/0x3b0
[   69.415761]  [<ffffffff811540c1>] sys_ioctl+0x81/0xa0
[   69.426640]  [<ffffffff810121b2>] system_call_fastpath+0x16/0x1b
[   69.437491] Code: fe ff ff 48 8b 3d 74 38 76 00 41 bf 00 00 20 00 e8 51 f5 d7 ff 83 e0 ff 48 05 ff 07 00 00 48 c1 e8 0b 48 89 45 c8 e9 13 fe ff ff <0f> 0b eb fe 0f 1f 80 00 00 00 00 55 48 89 e5 48 83 ec 20 4c 89
[   69.478216] RIP  [<ffffffff812c4dc5>] map_single+0x255/0x260
[   69.489668]  RSP <ffff88081c0ebc58>
[   69.500975] ---[ end trace 6a2181b634e2abc7 ]---

Reported-by: Bokhan Artem <aptem@ngs.ru>
Reported by: Marc-Christian Petersen <m.c.p@gmx.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: "Benz, Michael" <Michael.Benz@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] pm8001: simplify workqueue usage
Tejun Heo [Mon, 24 Jan 2011 13:57:29 +0000 (14:57 +0100)]
[SCSI] pm8001: simplify workqueue usage

pm8001 manages its own list of pending works and cancel them on device
free.  It is unnecessarily complex and has a race condition - the
works are canceled but not synced, so the work could still be running
during and after the data structures are freed.

This patch simplifies workqueue usage.

* A driver specific workqueue pm8001_wq is created to serve these
  work items.

* To avoid confusion, the "queue" suffixes are dropped from work items
  and functions.

* Delayed queueing was never used.  pm8001_work now uses work_struct
  instead.

* The driver no longer keeps track of pending works.  All pm8001_works
  are queued to pm8001_wq and the workqueue is flushed as necessary.

flush_scheduled_work() usage is removed during conversion.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] remove flush_scheduled_work() usages
Tejun Heo [Mon, 24 Jan 2011 13:57:28 +0000 (14:57 +0100)]
[SCSI] remove flush_scheduled_work() usages

Simple conversions to drop flush_scheduled_work() usages in
drivers/scsi.  More involved ones will be done in separate patches.

* NCR5380, megaraid_sas: cancel_delayed_work() +
  flush_scheduled_work() -> cancel_delayed_work_sync().

* mpt2sas_scsih: drop unnecessary flush_scheduled_work().

* arcmsr_hba, ipr, pmcraid: flush the used work explicitly instead of
  using flush_scheduled_work().

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] scsi_mid_low_api.txt recommend resid usage
Douglas Gilbert [Fri, 24 Dec 2010 02:40:37 +0000 (21:40 -0500)]
[SCSI] scsi_mid_low_api.txt recommend resid usage

As discussed in a thread on this list titled:
    "RFC: short reads on block devices"
this patch adds recommendations for LLDs to set resid
when there might be uncertainty about how much data
has been returned by a device.

This patch inline and attached] is against scsi-misc-2.6.git

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libosd: osd_req_read_sg, optimize the single entry case
Boaz Harrosh [Sun, 23 Jan 2011 15:53:24 +0000 (17:53 +0200)]
[SCSI] libosd: osd_req_read_sg, optimize the single entry case

Since sg-read is a bidi operation, it is a gain to convert
a single sg entry into a regular read. Better do this in the
generic layer then force each caller to do so.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libsas: remove spurious sata control register read/write
James Bottomley [Sun, 23 Jan 2011 14:34:25 +0000 (08:34 -0600)]
[SCSI] libsas: remove spurious sata control register read/write

Originally, libata required the illusion that it could access the sata
control register.  Now, however, it can run perfectly well without
them, so remove the dummy routines from libsas which tried to emulate
them (but only ended up causing confusion).

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libsas: convert to standard kernel debugging
James Bottomley [Sun, 23 Jan 2011 14:19:00 +0000 (08:19 -0600)]
[SCSI] libsas: convert to standard kernel debugging

Instead of using a config option for debugging, just dump the
messages with KERN_DEBUG.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] libsas: fix ATAPI check condition termination
James Bottomley [Sun, 23 Jan 2011 14:16:24 +0000 (08:16 -0600)]
[SCSI] libsas: fix ATAPI check condition termination

ATAPI check condition needs to be treated the same as a success or
protocol return.  The register returns from the PACKET command are all
correctly positioned in the device to host register FIS and so we
should collect them properly.  Right at the moment this doesn't matter
because libata sends a request sense always for ATAPI errors, but if
it ever checked the registers, we should have the correct contents
just in case.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] scsi_dh: Use scsi_devinfo functions to do matching of device_handler tables.
Peter Jones [Thu, 6 Jan 2011 20:38:24 +0000 (15:38 -0500)]
[SCSI] scsi_dh: Use scsi_devinfo functions to do matching of device_handler tables.

Previously we were using strncmp in order to avoid having to include
whitespace in the devlist, but this means "HSV1000" matches a device
list entry that says "HSV100", which is wrong.  This patch changes
scsi_dh.c to use scsi_devinfo's matching functions instead, since they
handle these cases correctly.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] Add scsi_dev_info_list_del_keyed()
Peter Jones [Thu, 6 Jan 2011 20:31:29 +0000 (15:31 -0500)]
[SCSI] Add scsi_dev_info_list_del_keyed()

For scsi_dh.c to use devinfo lists, we have to be able to remove entries
before rmmod.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] cxgb3i: fixed connection problem with iscsi private ip
kxie@chelsio.com [Tue, 11 Jan 2011 00:45:07 +0000 (16:45 -0800)]
[SCSI] cxgb3i: fixed connection problem with iscsi private ip

fixed the connection problem when the private iscsi ipv4 address is
provisioned on the interface.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] MAINTAINERS: Update zfcp entry
Christof Schmitt [Mon, 10 Jan 2011 10:12:40 +0000 (11:12 +0100)]
[SCSI] MAINTAINERS: Update zfcp entry

Steffen will take over the zfcp maintainer work. Update the
MAINTAINERS entry accordingly.

Acked-by: Steffen Maier <maier@linux.vnet.ibm.com>
Acked-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] mptfusion: Fix memory leak in mptctl_getiocinfo()
Jesper Juhl [Sun, 26 Dec 2010 21:14:01 +0000 (22:14 +0100)]
[SCSI] mptfusion: Fix memory leak in mptctl_getiocinfo()

A 'kfree(karg)' is missing in a failure path in
mptctl.c::mptctl_getiocinfo() which can cause a memory leak.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] bnx2i: Added reconnect fix connecting against Lefthand targets
Eddie Wai [Sun, 9 Jan 2011 02:00:24 +0000 (18:00 -0800)]
[SCSI] bnx2i: Added reconnect fix connecting against Lefthand targets

The nopout's reserved field was not being initialized to zero
before being reused.  Stale CDB values from previous SCSI cmds
of the same BHS offset was the cause of the disconnection
initiated by the Lefthand target.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] cxgbi: get rid of gl_skb in cxgbi_ddp_info
kxie@chelsio.com [Fri, 7 Jan 2011 22:45:39 +0000 (14:45 -0800)]
[SCSI] cxgbi: get rid of gl_skb in cxgbi_ddp_info

Remove gl_skb from cxgbi_ddp_info as it is only used by cxgb3i.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] cxgbi: set ulpmode only if digest is on
kxie@chelsio.com [Fri, 7 Jan 2011 22:45:39 +0000 (14:45 -0800)]
[SCSI] cxgbi: set ulpmode only if digest is on

There is no need to set ulpmode on the tx skbs if no digest is enabled.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: avoid leaking stack contents to userland
Vasiliy Kulikov [Fri, 7 Jan 2011 16:55:53 +0000 (10:55 -0600)]
[SCSI] hpsa: avoid leaking stack contents to userland

memset arg64 to zero in the passthrough ioctls to avoid leaking contents
of kernel stack memory to userland via uninitialized padding fields
inserted by the compiler for alignment reasons.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: Fix problem that CMD_UNABORTABLE command status was treated as unknown
Stephen M. Cameron [Fri, 7 Jan 2011 16:55:48 +0000 (10:55 -0600)]
[SCSI] hpsa: Fix problem that CMD_UNABORTABLE command status was treated as unknown

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: fix use of uninitialized variable in hpsa_add_msa2xxx_enclosure_device()
Stephen M. Cameron [Fri, 7 Jan 2011 16:55:43 +0000 (10:55 -0600)]
[SCSI] hpsa: fix use of uninitialized variable in hpsa_add_msa2xxx_enclosure_device()

Thanks to Scott Teel for noticing this.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: Add a per controller commands_outstanding entry in /sys
Stephen M. Cameron [Thu, 6 Jan 2011 20:48:39 +0000 (14:48 -0600)]
[SCSI] hpsa: Add a per controller commands_outstanding entry in /sys

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: use usleep_range not msleep for small sleeps
Stephen M. Cameron [Thu, 6 Jan 2011 20:48:34 +0000 (14:48 -0600)]
[SCSI] hpsa: use usleep_range not msleep for small sleeps

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: allow driver to put controller in either simple or performant mode
Stephen M. Cameron [Thu, 6 Jan 2011 20:48:29 +0000 (14:48 -0600)]
[SCSI] hpsa: allow driver to put controller in either simple or performant mode

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: take the adapter lock in hpsa_wait_for_mode_change_ack
Stephen M. Cameron [Thu, 6 Jan 2011 20:48:24 +0000 (14:48 -0600)]
[SCSI] hpsa: take the adapter lock in hpsa_wait_for_mode_change_ack

Need to take the lock while accessing the register to check to
see if config table changes have taken effect.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: do not reset unknown boards on reset_devices
Stephen M. Cameron [Thu, 6 Jan 2011 20:48:18 +0000 (14:48 -0600)]
[SCSI] hpsa: do not reset unknown boards on reset_devices

This is to prevent hpsa from resetting older boards
which the cciss driver may be controlling.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: limit commands allocated on reset_devices
Stephen M. Cameron [Thu, 6 Jan 2011 20:48:13 +0000 (14:48 -0600)]
[SCSI] hpsa: limit commands allocated on reset_devices

This is to conserve memory in a memory-limited kdump scenario

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: Use kernel provided PCI state save and restore functions
Stephen M. Cameron [Thu, 6 Jan 2011 20:48:08 +0000 (14:48 -0600)]
[SCSI] hpsa: Use kernel provided PCI state save and restore functions

and use the doorbell reset method if available (which doesn't
lock up the controller if you properly save and restore all
the PCI registers that you're supposed to.)

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
13 years ago[SCSI] hpsa: fix board status waiting code
Stephen M. Cameron [Thu, 6 Jan 2011 20:48:03 +0000 (14:48 -0600)]
[SCSI] hpsa: fix board status waiting code

After a reset, we should first wait for the board to become "not ready",
and then wait for it to become "ready", instead of immediately
waiting for it to become "ready", and do this waiting *after*
restoring PCI config space registers.  Also, only wait 10 secs
for board to become "not ready" after a reset (it should quickly
become not ready.)

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>