Skip to content

Commit

Permalink
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/jejb/scsi

Pull first round of SCSI updates from James Bottomley:
 "The patch set is mostly driver updates (bnx2fc, ipr, lpfc, qla4) and a
  few bug fixes"

Pull delayed because google hates James, and sneakily considers his pull
requests spam. Why, google, why?

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (60 commits)
  [SCSI] aacraid: 1024 max outstanding command support for Series 7 and above
  [SCSI] bnx2fc: adjust duplicate test
  [SCSI] qla4xxx: Update driver version to 5.03.00-k4
  [SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param.
  [SCSI] qla4xxx: wait for boot target login response during probe.
  [SCSI] qla4xxx: Added support for force firmware dump
  [SCSI] qla4xxx: Re-register IRQ handler while retrying initialize of adapter
  [SCSI] qla4xxx: Throttle active IOCBs to firmware limits
  [SCSI] qla4xxx: Remove unnecessary code from qla4xxx_init_local_data
  [SCSI] qla4xxx: Quiesce driver activities while loopback
  [SCSI] qla4xxx: Rename MBOX_ASTS_IDC_NOTIFY to MBOX_ASTS_IDC_REQUEST_NOTIFICATION
  [SCSI] qla4xxx: Add spurious interrupt messages under debug level 2
  [SCSI] cxgb4i: Remove the scsi host device when removing device
  [SCSI] bfa: fix strncpy() limiter in bfad_start_ops()
  [SCSI] qla4xxx: Update driver version to 5.03.00-k3
  [SCSI] qla4xxx: Correct the validation to check in get_sys_info mailbox
  [SCSI] qla4xxx: Pass correct function param to qla4_8xxx_rd_direct
  [SCSI] lpfc 8.3.37: Update lpfc version for 8.3.37 driver release
  [SCSI] lpfc 8.3.37: Fixed infinite loop in lpfc_sli4_fcf_rr_next_index_get.
  [SCSI] lpfc 8.3.37: Fixed crash due to SLI Port invalid resource count
  ...
  • Loading branch information
torvalds committed Feb 28, 2013
2 parents 2a7d2b9 + 2b4df6e commit 21f3b24
Show file tree
Hide file tree
Showing 50 changed files with 2,169 additions and 926 deletions.
7 changes: 4 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,8 @@ F: drivers/bcma/
F: include/linux/bcma/

BROCADE BFA FC SCSI DRIVER
M: Krishna C Gudipati <kgudipat@brocade.com>
M: Anil Gurumurthy <agurumur@brocade.com>
M: Vijaya Mohan Guvva <vmohan@brocade.com>
L: linux-scsi@vger.kernel.org
S: Supported
F: drivers/scsi/bfa/
Expand Down Expand Up @@ -2074,8 +2075,8 @@ S: Maintained
F: include/linux/clk.h

CISCO FCOE HBA DRIVER
M: Abhijeet Joglekar <abjoglek@cisco.com>
M: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
M: Hiral Patel <hiralpat@cisco.com>
M: Suma Ramars <sramars@cisco.com>
M: Brian Uchino <buchino@cisco.com>
L: linux-scsi@vger.kernel.org
S: Supported
Expand Down
8 changes: 6 additions & 2 deletions drivers/scsi/aacraid/aacraid.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
*----------------------------------------------------------------------------*/

#ifndef AAC_DRIVER_BUILD
# define AAC_DRIVER_BUILD 29801
# define AAC_DRIVER_BUILD 30000
# define AAC_DRIVER_BRANCH "-ms"
#endif
#define MAXIMUM_NUM_CONTAINERS 32

#define AAC_NUM_MGT_FIB 8
#define AAC_NUM_IO_FIB (512 - AAC_NUM_MGT_FIB)
#define AAC_NUM_IO_FIB (1024 - AAC_NUM_MGT_FIB)
#define AAC_NUM_FIB (AAC_NUM_IO_FIB + AAC_NUM_MGT_FIB)

#define AAC_MAX_LUN (8)
Expand All @@ -36,6 +36,10 @@
#define CONTAINER_TO_ID(cont) (cont)
#define CONTAINER_TO_LUN(cont) (0)

#define PMC_DEVICE_S7 0x28c
#define PMC_DEVICE_S8 0x28d
#define PMC_DEVICE_S9 0x28f

#define aac_phys_to_logical(x) ((x)+1)
#define aac_logical_to_phys(x) ((x)?(x)-1:0)

Expand Down
11 changes: 10 additions & 1 deletion drivers/scsi/aacraid/comminit.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,13 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
dev->max_fib_size = status[1] & 0xFFE0;
host->sg_tablesize = status[2] >> 16;
dev->sg_tablesize = status[2] & 0xFFFF;
host->can_queue = (status[3] & 0xFFFF) - AAC_NUM_MGT_FIB;
if (dev->pdev->device == PMC_DEVICE_S7 ||
dev->pdev->device == PMC_DEVICE_S8 ||
dev->pdev->device == PMC_DEVICE_S9)
host->can_queue = ((status[3] >> 16) ? (status[3] >> 16) :
(status[3] & 0xFFFF)) - AAC_NUM_MGT_FIB;
else
host->can_queue = (status[3] & 0xFFFF) - AAC_NUM_MGT_FIB;
dev->max_num_aif = status[4] & 0xFFFF;
/*
* NOTE:
Expand Down Expand Up @@ -452,6 +458,9 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
}
}

if (host->can_queue > AAC_NUM_IO_FIB)
host->can_queue = AAC_NUM_IO_FIB;

/*
* Ok now init the communication subsystem
*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/bfa/bfad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ bfad_start_ops(struct bfad_s *bfad) {
sizeof(driver_info.host_os_patch) - 1);

strncpy(driver_info.os_device_name, bfad->pci_name,
sizeof(driver_info.os_device_name - 1));
sizeof(driver_info.os_device_name) - 1);

/* FCS driver info init */
spin_lock_irqsave(&bfad->bfad_lock, flags);
Expand Down
27 changes: 26 additions & 1 deletion drivers/scsi/bnx2fc/bnx2fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#include "bnx2fc_constants.h"

#define BNX2FC_NAME "bnx2fc"
#define BNX2FC_VERSION "1.0.12"
#define BNX2FC_VERSION "1.0.13"

#define PFX "bnx2fc: "

Expand Down Expand Up @@ -156,6 +156,18 @@
#define BNX2FC_RELOGIN_WAIT_TIME 200
#define BNX2FC_RELOGIN_WAIT_CNT 10

#define BNX2FC_STATS(hba, stat, cnt) \
do { \
u32 val; \
\
val = fw_stats->stat.cnt; \
if (hba->prev_stats.stat.cnt <= val) \
val -= hba->prev_stats.stat.cnt; \
else \
val += (0xfffffff - hba->prev_stats.stat.cnt); \
hba->bfw_stats.cnt += val; \
} while (0)

/* bnx2fc driver uses only one instance of fcoe_percpu_s */
extern struct fcoe_percpu_s bnx2fc_global;

Expand All @@ -167,6 +179,14 @@ struct bnx2fc_percpu_s {
spinlock_t fp_work_lock;
};

struct bnx2fc_fw_stats {
u64 fc_crc_cnt;
u64 fcoe_tx_pkt_cnt;
u64 fcoe_rx_pkt_cnt;
u64 fcoe_tx_byte_cnt;
u64 fcoe_rx_byte_cnt;
};

struct bnx2fc_hba {
struct list_head list;
struct cnic_dev *cnic;
Expand Down Expand Up @@ -207,6 +227,8 @@ struct bnx2fc_hba {
struct bnx2fc_rport **tgt_ofld_list;

/* statistics */
struct bnx2fc_fw_stats bfw_stats;
struct fcoe_statistics_params prev_stats;
struct fcoe_statistics_params *stats_buffer;
dma_addr_t stats_buf_dma;
struct completion stat_req_done;
Expand Down Expand Up @@ -280,6 +302,7 @@ struct bnx2fc_rport {
#define BNX2FC_FLAG_UPLD_REQ_COMPL 0x7
#define BNX2FC_FLAG_EXPL_LOGO 0x8
#define BNX2FC_FLAG_DISABLE_FAILED 0x9
#define BNX2FC_FLAG_ENABLED 0xa

u8 src_addr[ETH_ALEN];
u32 max_sqes;
Expand Down Expand Up @@ -468,6 +491,8 @@ int bnx2fc_send_fw_fcoe_init_msg(struct bnx2fc_hba *hba);
int bnx2fc_send_fw_fcoe_destroy_msg(struct bnx2fc_hba *hba);
int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
struct bnx2fc_rport *tgt);
int bnx2fc_send_session_enable_req(struct fcoe_port *port,
struct bnx2fc_rport *tgt);
int bnx2fc_send_session_disable_req(struct fcoe_port *port,
struct bnx2fc_rport *tgt);
int bnx2fc_send_session_destroy_req(struct bnx2fc_hba *hba,
Expand Down
21 changes: 14 additions & 7 deletions drivers/scsi/bnx2fc/bnx2fc_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu);

#define DRV_MODULE_NAME "bnx2fc"
#define DRV_MODULE_VERSION BNX2FC_VERSION
#define DRV_MODULE_RELDATE "Jun 04, 2012"
#define DRV_MODULE_RELDATE "Dec 21, 2012"


static char version[] =
Expand Down Expand Up @@ -687,11 +687,16 @@ static struct fc_host_statistics *bnx2fc_get_host_stats(struct Scsi_Host *shost)
BNX2FC_HBA_DBG(lport, "FW stat req timed out\n");
return bnx2fc_stats;
}
bnx2fc_stats->invalid_crc_count += fw_stats->rx_stat2.fc_crc_cnt;
bnx2fc_stats->tx_frames += fw_stats->tx_stat.fcoe_tx_pkt_cnt;
bnx2fc_stats->tx_words += (fw_stats->tx_stat.fcoe_tx_byte_cnt) / 4;
bnx2fc_stats->rx_frames += fw_stats->rx_stat0.fcoe_rx_pkt_cnt;
bnx2fc_stats->rx_words += (fw_stats->rx_stat0.fcoe_rx_byte_cnt) / 4;
BNX2FC_STATS(hba, rx_stat2, fc_crc_cnt);
bnx2fc_stats->invalid_crc_count += hba->bfw_stats.fc_crc_cnt;
BNX2FC_STATS(hba, tx_stat, fcoe_tx_pkt_cnt);
bnx2fc_stats->tx_frames += hba->bfw_stats.fcoe_tx_pkt_cnt;
BNX2FC_STATS(hba, tx_stat, fcoe_tx_byte_cnt);
bnx2fc_stats->tx_words += ((hba->bfw_stats.fcoe_tx_byte_cnt) / 4);
BNX2FC_STATS(hba, rx_stat0, fcoe_rx_pkt_cnt);
bnx2fc_stats->rx_frames += hba->bfw_stats.fcoe_rx_pkt_cnt;
BNX2FC_STATS(hba, rx_stat0, fcoe_rx_byte_cnt);
bnx2fc_stats->rx_words += ((hba->bfw_stats.fcoe_rx_byte_cnt) / 4);

bnx2fc_stats->dumped_frames = 0;
bnx2fc_stats->lip_count = 0;
Expand All @@ -700,6 +705,8 @@ static struct fc_host_statistics *bnx2fc_get_host_stats(struct Scsi_Host *shost)
bnx2fc_stats->loss_of_signal_count = 0;
bnx2fc_stats->prim_seq_protocol_err_count = 0;

memcpy(&hba->prev_stats, hba->stats_buffer,
sizeof(struct fcoe_statistics_params));
return bnx2fc_stats;
}

Expand Down Expand Up @@ -2660,7 +2667,7 @@ static struct scsi_host_template bnx2fc_shost_template = {
.can_queue = BNX2FC_CAN_QUEUE,
.use_clustering = ENABLE_CLUSTERING,
.sg_tablesize = BNX2FC_MAX_BDS_PER_CMD,
.max_sectors = 512,
.max_sectors = 1024,
};

static struct libfc_function_template bnx2fc_libfc_fcn_templ = {
Expand Down
29 changes: 6 additions & 23 deletions drivers/scsi/bnx2fc/bnx2fc_hwi.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
* @port: port structure pointer
* @tgt: bnx2fc_rport structure pointer
*/
static int bnx2fc_send_session_enable_req(struct fcoe_port *port,
int bnx2fc_send_session_enable_req(struct fcoe_port *port,
struct bnx2fc_rport *tgt)
{
struct kwqe *kwqe_arr[2];
Expand Down Expand Up @@ -759,8 +759,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
case FCOE_ERROR_CODE_DATA_SOFN_SEQ_ACTIVE_RESET:
BNX2FC_TGT_DBG(tgt, "REC TOV popped for xid - 0x%x\n",
xid);
memset(&io_req->err_entry, 0,
sizeof(struct fcoe_err_report_entry));
memcpy(&io_req->err_entry, err_entry,
sizeof(struct fcoe_err_report_entry));
if (!test_bit(BNX2FC_FLAG_SRR_SENT,
Expand Down Expand Up @@ -847,8 +845,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
goto ret_warn_rqe;
}

memset(&io_req->err_entry, 0,
sizeof(struct fcoe_err_report_entry));
memcpy(&io_req->err_entry, err_entry,
sizeof(struct fcoe_err_report_entry));

Expand Down Expand Up @@ -1124,7 +1120,6 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba,
struct bnx2fc_interface *interface;
u32 conn_id;
u32 context_id;
int rc;

conn_id = ofld_kcqe->fcoe_conn_id;
context_id = ofld_kcqe->fcoe_conn_context_id;
Expand Down Expand Up @@ -1153,17 +1148,10 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba,
"resources\n");
set_bit(BNX2FC_FLAG_CTX_ALLOC_FAILURE, &tgt->flags);
}
goto ofld_cmpl_err;
} else {

/* now enable the session */
rc = bnx2fc_send_session_enable_req(port, tgt);
if (rc) {
printk(KERN_ERR PFX "enable session failed\n");
goto ofld_cmpl_err;
}
/* FW offload request successfully completed */
set_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
}
return;
ofld_cmpl_err:
set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags);
wake_up_interruptible(&tgt->ofld_wait);
Expand Down Expand Up @@ -1210,15 +1198,9 @@ static void bnx2fc_process_enable_conn_cmpl(struct bnx2fc_hba *hba,
printk(KERN_ERR PFX "bnx2fc-enbl_cmpl: HBA mis-match\n");
goto enbl_cmpl_err;
}
if (ofld_kcqe->completion_status)
goto enbl_cmpl_err;
else {
if (!ofld_kcqe->completion_status)
/* enable successful - rport ready for issuing IOs */
set_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags);
wake_up_interruptible(&tgt->ofld_wait);
}
return;
set_bit(BNX2FC_FLAG_ENABLED, &tgt->flags);

enbl_cmpl_err:
set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags);
Expand Down Expand Up @@ -1251,6 +1233,7 @@ static void bnx2fc_process_conn_disable_cmpl(struct bnx2fc_hba *hba,
/* disable successful */
BNX2FC_TGT_DBG(tgt, "disable successful\n");
clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags);
set_bit(BNX2FC_FLAG_DISABLED, &tgt->flags);
set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags);
wake_up_interruptible(&tgt->upld_wait);
Expand Down
8 changes: 5 additions & 3 deletions drivers/scsi/bnx2fc/bnx2fc_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ int bnx2fc_init_mp_req(struct bnx2fc_cmd *io_req)
mp_req->mp_resp_bd = dma_alloc_coherent(&hba->pcidev->dev, sz,
&mp_req->mp_resp_bd_dma,
GFP_ATOMIC);
if (!mp_req->mp_req_bd) {
if (!mp_req->mp_resp_bd) {
printk(KERN_ERR PFX "unable to alloc MP resp bd\n");
bnx2fc_free_mp_resc(io_req);
return FAILED;
Expand Down Expand Up @@ -685,8 +685,8 @@ int bnx2fc_init_mp_req(struct bnx2fc_cmd *io_req)
static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
{
struct fc_lport *lport;
struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
struct fc_rport_libfc_priv *rp = rport->dd_data;
struct fc_rport *rport;
struct fc_rport_libfc_priv *rp;
struct fcoe_port *port;
struct bnx2fc_interface *interface;
struct bnx2fc_rport *tgt;
Expand All @@ -704,6 +704,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
unsigned long start = jiffies;

lport = shost_priv(host);
rport = starget_to_rport(scsi_target(sc_cmd->device));
port = lport_priv(lport);
interface = port->priv;

Expand All @@ -712,6 +713,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
rc = FAILED;
goto tmf_err;
}
rp = rport->dd_data;

rc = fc_block_scsi_eh(sc_cmd);
if (rc)
Expand Down
Loading

0 comments on commit 21f3b24

Please sign in to comment.