提交 9a50aaef 编写于 作者: L Linus Torvalds

Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI updates from James Bottomley:
 "This patch set consists of the usual driver updates (megaraid_sas,
  arcmsr, be2iscsi, lpfc, mpt2sas, mpt3sas, qla2xxx, ufs) plus several
  assorted fixes and miscellaneous updates (including the
  pci_msix_enable_range() changes that have been pending for a while)"

* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (202 commits)
  scsi: add a CONFIG_SCSI_MQ_DEFAULT option
  ufs: definitions for phy interface
  ufs: tune bkops while power managment events
  ufs: Add support for clock scaling using devfreq framework
  ufs: Add freq-table-hz property for UFS device
  ufs: Add support for clock gating
  ufs: refactor configuring power mode
  ufs: add UFS power management support
  ufs: introduce well known logical unit in ufs
  ufs: manually add well known logical units
  ufs: Active Power Mode - configuring bActiveICCLevel
  ufs: improve init sequence
  ufs: refactor query descriptor API support
  ufs: add voting support for host controller power
  ufs: Add clock initialization support
  ufs: Add regulator enable support
  ufs: Allow vendor specific initialization
  scsi: don't add scsi_device if its already visible
  scsi: fix the type for well known LUs
  scsi: fix comment in struct Scsi_Host definition
  ...
...@@ -8,9 +8,50 @@ Required properties: ...@@ -8,9 +8,50 @@ Required properties:
- interrupts : <interrupt mapping for UFS host controller IRQ> - interrupts : <interrupt mapping for UFS host controller IRQ>
- reg : <registers mapping> - reg : <registers mapping>
Optional properties:
- vdd-hba-supply : phandle to UFS host controller supply regulator node
- vcc-supply : phandle to VCC supply regulator node
- vccq-supply : phandle to VCCQ supply regulator node
- vccq2-supply : phandle to VCCQ2 supply regulator node
- vcc-supply-1p8 : For embedded UFS devices, valid VCC range is 1.7-1.95V
or 2.7-3.6V. This boolean property when set, specifies
to use low voltage range of 1.7-1.95V. Note for external
UFS cards this property is invalid and valid VCC range is
always 2.7-3.6V.
- vcc-max-microamp : specifies max. load that can be drawn from vcc supply
- vccq-max-microamp : specifies max. load that can be drawn from vccq supply
- vccq2-max-microamp : specifies max. load that can be drawn from vccq2 supply
- <name>-fixed-regulator : boolean property specifying that <name>-supply is a fixed regulator
- clocks : List of phandle and clock specifier pairs
- clock-names : List of clock input name strings sorted in the same
order as the clocks property.
- freq-table-hz : Array of <min max> operating frequencies stored in the same
order as the clocks property. If this property is not
defined or a value in the array is "0" then it is assumed
that the frequency is set by the parent clock or a
fixed rate clock source.
Note: If above properties are not defined it can be assumed that the supply
regulators or clocks are always on.
Example: Example:
ufshc@0xfc598000 { ufshc@0xfc598000 {
compatible = "jedec,ufs-1.1"; compatible = "jedec,ufs-1.1";
reg = <0xfc598000 0x800>; reg = <0xfc598000 0x800>;
interrupts = <0 28 0>; interrupts = <0 28 0>;
vdd-hba-supply = <&xxx_reg0>;
vdd-hba-fixed-regulator;
vcc-supply = <&xxx_reg1>;
vcc-supply-1p8;
vccq-supply = <&xxx_reg2>;
vccq2-supply = <&xxx_reg3>;
vcc-max-microamp = 500000;
vccq-max-microamp = 200000;
vccq2-max-microamp = 200000;
clocks = <&core 0>, <&ref 0>, <&iface 0>;
clock-names = "core_clk", "ref_clk", "iface_clk";
freq-table-hz = <100000000 200000000>, <0 0>, <0 0>;
}; };
Release Date : Thu. Jun 19, 2014 17:00:00 PST 2014 -
(emaild-id:megaraidlinux@lsi.com)
Adam Radford
Kashyap Desai
Sumit Saxena
Uday Lingala
Current Version : 06.803.02.00-rc1
Old Version : 06.803.01.00-rc1
1. Fix reset_mutex leak in megasas_reset_fusion().
2. Remove unused variables in megasas_instance.
3. Fix LD/VF affiliation parsing.
4. Add missing initial call to megasas_get_ld_vf_affiliation().
5. Version and Changelog update.
-------------------------------------------------------------------------------
Release Date : Mon. Mar 10, 2014 17:00:00 PST 2014 - Release Date : Mon. Mar 10, 2014 17:00:00 PST 2014 -
(emaild-id:megaraidlinux@lsi.com) (emaild-id:megaraidlinux@lsi.com)
Adam Radford Adam Radford
......
...@@ -1400,7 +1400,6 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp) ...@@ -1400,7 +1400,6 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
* @vendor: pci vendor id * @vendor: pci vendor id
* @device: pci device id * @device: pci device id
* @revision: pci revision id * @revision: pci revision id
* @prod_name: string returned
* *
* Returns product string displayed when driver loads, * Returns product string displayed when driver loads,
* in /proc/mpt/summary and /sysfs/class/scsi_host/host<X>/version_product * in /proc/mpt/summary and /sysfs/class/scsi_host/host<X>/version_product
...@@ -3172,12 +3171,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) ...@@ -3172,12 +3171,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
facts->FWImageSize = le32_to_cpu(facts->FWImageSize); facts->FWImageSize = le32_to_cpu(facts->FWImageSize);
} }
sz = facts->FWImageSize; facts->FWImageSize = ALIGN(facts->FWImageSize, 4);
if ( sz & 0x01 )
sz += 1;
if ( sz & 0x02 )
sz += 2;
facts->FWImageSize = sz;
if (!facts->RequestFrameSize) { if (!facts->RequestFrameSize) {
/* Something is wrong! */ /* Something is wrong! */
......
...@@ -1741,12 +1741,7 @@ mptctl_replace_fw (unsigned long arg) ...@@ -1741,12 +1741,7 @@ mptctl_replace_fw (unsigned long arg)
/* Allocate memory for the new FW image /* Allocate memory for the new FW image
*/ */
newFwSize = karg.newImageSize; newFwSize = ALIGN(karg.newImageSize, 4);
if (newFwSize & 0x01)
newFwSize += 1;
if (newFwSize & 0x02)
newFwSize += 2;
mpt_alloc_fw_memory(ioc, newFwSize); mpt_alloc_fw_memory(ioc, newFwSize);
if (ioc->cached_fw == NULL) if (ioc->cached_fw == NULL)
......
...@@ -1419,6 +1419,11 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1419,6 +1419,11 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto out_mptspi_probe; goto out_mptspi_probe;
} }
/* VMWare emulation doesn't properly implement WRITE_SAME
*/
if (pdev->subsystem_vendor == 0x15AD)
sh->no_write_same = 1;
spin_lock_irqsave(&ioc->FreeQlock, flags); spin_lock_irqsave(&ioc->FreeQlock, flags);
/* Attach the SCSI Host to the IOC structure /* Attach the SCSI Host to the IOC structure
......
...@@ -45,6 +45,17 @@ config SCSI_NETLINK ...@@ -45,6 +45,17 @@ config SCSI_NETLINK
default n default n
depends on NET depends on NET
config SCSI_MQ_DEFAULT
bool "SCSI: use blk-mq I/O path by default"
depends on SCSI
---help---
This option enables the new blk-mq based I/O path for SCSI
devices by default. With the option the scsi_mod.use_blk_mq
module/boot option defaults to Y, without it to N, but it can
still be overriden either way.
If unsure say N.
config SCSI_PROC_FS config SCSI_PROC_FS
bool "legacy /proc/scsi/ support" bool "legacy /proc/scsi/ support"
depends on SCSI && PROC_FS depends on SCSI && PROC_FS
......
...@@ -1152,6 +1152,7 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1152,6 +1152,7 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
shost->irq = pdev->irq; shost->irq = pdev->irq;
shost->unique_id = unique_id; shost->unique_id = unique_id;
shost->max_cmd_len = 16; shost->max_cmd_len = 16;
shost->use_cmd_list = 1;
aac = (struct aac_dev *)shost->hostdata; aac = (struct aac_dev *)shost->hostdata;
aac->base_start = pci_resource_start(pdev, 0); aac->base_start = pci_resource_start(pdev, 0);
......
...@@ -45,13 +45,14 @@ ...@@ -45,13 +45,14 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
struct device_attribute; struct device_attribute;
/*The limit of outstanding scsi command that firmware can handle*/ /*The limit of outstanding scsi command that firmware can handle*/
#define ARCMSR_MAX_OUTSTANDING_CMD 256
#ifdef CONFIG_XEN #ifdef CONFIG_XEN
#define ARCMSR_MAX_FREECCB_NUM 160 #define ARCMSR_MAX_FREECCB_NUM 160
#define ARCMSR_MAX_OUTSTANDING_CMD 155
#else #else
#define ARCMSR_MAX_FREECCB_NUM 320 #define ARCMSR_MAX_FREECCB_NUM 320
#define ARCMSR_MAX_OUTSTANDING_CMD 255
#endif #endif
#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2010/08/05" #define ARCMSR_DRIVER_VERSION "v1.30.00.04-20140919"
#define ARCMSR_SCSI_INITIATOR_ID 255 #define ARCMSR_SCSI_INITIATOR_ID 255
#define ARCMSR_MAX_XFER_SECTORS 512 #define ARCMSR_MAX_XFER_SECTORS 512
#define ARCMSR_MAX_XFER_SECTORS_B 4096 #define ARCMSR_MAX_XFER_SECTORS_B 4096
...@@ -62,11 +63,17 @@ struct device_attribute; ...@@ -62,11 +63,17 @@ struct device_attribute;
#define ARCMSR_MAX_QBUFFER 4096 #define ARCMSR_MAX_QBUFFER 4096
#define ARCMSR_DEFAULT_SG_ENTRIES 38 #define ARCMSR_DEFAULT_SG_ENTRIES 38
#define ARCMSR_MAX_HBB_POSTQUEUE 264 #define ARCMSR_MAX_HBB_POSTQUEUE 264
#define ARCMSR_MAX_ARC1214_POSTQUEUE 256
#define ARCMSR_MAX_ARC1214_DONEQUEUE 257
#define ARCMSR_MAX_XFER_LEN 0x26000 /* 152K */ #define ARCMSR_MAX_XFER_LEN 0x26000 /* 152K */
#define ARCMSR_CDB_SG_PAGE_LENGTH 256 #define ARCMSR_CDB_SG_PAGE_LENGTH 256
#define ARCMST_NUM_MSIX_VECTORS 4
#ifndef PCI_DEVICE_ID_ARECA_1880 #ifndef PCI_DEVICE_ID_ARECA_1880
#define PCI_DEVICE_ID_ARECA_1880 0x1880 #define PCI_DEVICE_ID_ARECA_1880 0x1880
#endif #endif
#ifndef PCI_DEVICE_ID_ARECA_1214
#define PCI_DEVICE_ID_ARECA_1214 0x1214
#endif
/* /*
********************************************************************************** **********************************************************************************
** **
...@@ -100,10 +107,11 @@ struct CMD_MESSAGE ...@@ -100,10 +107,11 @@ struct CMD_MESSAGE
** IOP Message Transfer Data for user space ** IOP Message Transfer Data for user space
******************************************************************************* *******************************************************************************
*/ */
#define ARCMSR_API_DATA_BUFLEN 1032
struct CMD_MESSAGE_FIELD struct CMD_MESSAGE_FIELD
{ {
struct CMD_MESSAGE cmdmessage; struct CMD_MESSAGE cmdmessage;
uint8_t messagedatabuffer[1032]; uint8_t messagedatabuffer[ARCMSR_API_DATA_BUFLEN];
}; };
/* IOP message transfer */ /* IOP message transfer */
#define ARCMSR_MESSAGE_FAIL 0x0001 #define ARCMSR_MESSAGE_FAIL 0x0001
...@@ -337,6 +345,56 @@ struct FIRMWARE_INFO ...@@ -337,6 +345,56 @@ struct FIRMWARE_INFO
#define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000 #define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000
/* /*
******************************************************************************* *******************************************************************************
** SPEC. for Areca Type D adapter
*******************************************************************************
*/
#define ARCMSR_ARC1214_CHIP_ID 0x00004
#define ARCMSR_ARC1214_CPU_MEMORY_CONFIGURATION 0x00008
#define ARCMSR_ARC1214_I2_HOST_INTERRUPT_MASK 0x00034
#define ARCMSR_ARC1214_SAMPLE_RESET 0x00100
#define ARCMSR_ARC1214_RESET_REQUEST 0x00108
#define ARCMSR_ARC1214_MAIN_INTERRUPT_STATUS 0x00200
#define ARCMSR_ARC1214_PCIE_F0_INTERRUPT_ENABLE 0x0020C
#define ARCMSR_ARC1214_INBOUND_MESSAGE0 0x00400
#define ARCMSR_ARC1214_INBOUND_MESSAGE1 0x00404
#define ARCMSR_ARC1214_OUTBOUND_MESSAGE0 0x00420
#define ARCMSR_ARC1214_OUTBOUND_MESSAGE1 0x00424
#define ARCMSR_ARC1214_INBOUND_DOORBELL 0x00460
#define ARCMSR_ARC1214_OUTBOUND_DOORBELL 0x00480
#define ARCMSR_ARC1214_OUTBOUND_DOORBELL_ENABLE 0x00484
#define ARCMSR_ARC1214_INBOUND_LIST_BASE_LOW 0x01000
#define ARCMSR_ARC1214_INBOUND_LIST_BASE_HIGH 0x01004
#define ARCMSR_ARC1214_INBOUND_LIST_WRITE_POINTER 0x01018
#define ARCMSR_ARC1214_OUTBOUND_LIST_BASE_LOW 0x01060
#define ARCMSR_ARC1214_OUTBOUND_LIST_BASE_HIGH 0x01064
#define ARCMSR_ARC1214_OUTBOUND_LIST_COPY_POINTER 0x0106C
#define ARCMSR_ARC1214_OUTBOUND_LIST_READ_POINTER 0x01070
#define ARCMSR_ARC1214_OUTBOUND_INTERRUPT_CAUSE 0x01088
#define ARCMSR_ARC1214_OUTBOUND_INTERRUPT_ENABLE 0x0108C
#define ARCMSR_ARC1214_MESSAGE_WBUFFER 0x02000
#define ARCMSR_ARC1214_MESSAGE_RBUFFER 0x02100
#define ARCMSR_ARC1214_MESSAGE_RWBUFFER 0x02200
/* Host Interrupt Mask */
#define ARCMSR_ARC1214_ALL_INT_ENABLE 0x00001010
#define ARCMSR_ARC1214_ALL_INT_DISABLE 0x00000000
/* Host Interrupt Status */
#define ARCMSR_ARC1214_OUTBOUND_DOORBELL_ISR 0x00001000
#define ARCMSR_ARC1214_OUTBOUND_POSTQUEUE_ISR 0x00000010
/* DoorBell*/
#define ARCMSR_ARC1214_DRV2IOP_DATA_IN_READY 0x00000001
#define ARCMSR_ARC1214_DRV2IOP_DATA_OUT_READ 0x00000002
/*inbound message 0 ready*/
#define ARCMSR_ARC1214_IOP2DRV_DATA_WRITE_OK 0x00000001
/*outbound DATA WRITE isr door bell clear*/
#define ARCMSR_ARC1214_IOP2DRV_DATA_READ_OK 0x00000002
/*outbound message 0 ready*/
#define ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE 0x02000000
/*outbound message cmd isr door bell clear*/
/*ARCMSR_HBAMU_MESSAGE_FIRMWARE_OK*/
#define ARCMSR_ARC1214_MESSAGE_FIRMWARE_OK 0x80000000
#define ARCMSR_ARC1214_OUTBOUND_LIST_INTERRUPT_CLEAR 0x00000001
/*
*******************************************************************************
** ARECA SCSI COMMAND DESCRIPTOR BLOCK size 0x1F8 (504) ** ARECA SCSI COMMAND DESCRIPTOR BLOCK size 0x1F8 (504)
******************************************************************************* *******************************************************************************
*/ */
...@@ -357,7 +415,7 @@ struct ARCMSR_CDB ...@@ -357,7 +415,7 @@ struct ARCMSR_CDB
#define ARCMSR_CDB_FLAG_ORDEREDQ 0x10 #define ARCMSR_CDB_FLAG_ORDEREDQ 0x10
uint8_t msgPages; uint8_t msgPages;
uint32_t Context; uint32_t msgContext;
uint32_t DataLength; uint32_t DataLength;
uint8_t Cdb[16]; uint8_t Cdb[16];
uint8_t DeviceStatus; uint8_t DeviceStatus;
...@@ -494,6 +552,56 @@ struct MessageUnit_C{ ...@@ -494,6 +552,56 @@ struct MessageUnit_C{
uint32_t msgcode_rwbuffer[256]; /*2200 23FF*/ uint32_t msgcode_rwbuffer[256]; /*2200 23FF*/
}; };
/* /*
*********************************************************************
** Messaging Unit (MU) of Type D processor
*********************************************************************
*/
struct InBound_SRB {
uint32_t addressLow; /* pointer to SRB block */
uint32_t addressHigh;
uint32_t length; /* in DWORDs */
uint32_t reserved0;
};
struct OutBound_SRB {
uint32_t addressLow; /* pointer to SRB block */
uint32_t addressHigh;
};
struct MessageUnit_D {
struct InBound_SRB post_qbuffer[ARCMSR_MAX_ARC1214_POSTQUEUE];
volatile struct OutBound_SRB
done_qbuffer[ARCMSR_MAX_ARC1214_DONEQUEUE];
u16 postq_index;
volatile u16 doneq_index;
u32 __iomem *chip_id; /* 0x00004 */
u32 __iomem *cpu_mem_config; /* 0x00008 */
u32 __iomem *i2o_host_interrupt_mask; /* 0x00034 */
u32 __iomem *sample_at_reset; /* 0x00100 */
u32 __iomem *reset_request; /* 0x00108 */
u32 __iomem *host_int_status; /* 0x00200 */
u32 __iomem *pcief0_int_enable; /* 0x0020C */
u32 __iomem *inbound_msgaddr0; /* 0x00400 */
u32 __iomem *inbound_msgaddr1; /* 0x00404 */
u32 __iomem *outbound_msgaddr0; /* 0x00420 */
u32 __iomem *outbound_msgaddr1; /* 0x00424 */
u32 __iomem *inbound_doorbell; /* 0x00460 */
u32 __iomem *outbound_doorbell; /* 0x00480 */
u32 __iomem *outbound_doorbell_enable; /* 0x00484 */
u32 __iomem *inboundlist_base_low; /* 0x01000 */
u32 __iomem *inboundlist_base_high; /* 0x01004 */
u32 __iomem *inboundlist_write_pointer; /* 0x01018 */
u32 __iomem *outboundlist_base_low; /* 0x01060 */
u32 __iomem *outboundlist_base_high; /* 0x01064 */
u32 __iomem *outboundlist_copy_pointer; /* 0x0106C */
u32 __iomem *outboundlist_read_pointer; /* 0x01070 0x01072 */
u32 __iomem *outboundlist_interrupt_cause; /* 0x1088 */
u32 __iomem *outboundlist_interrupt_enable; /* 0x108C */
u32 __iomem *message_wbuffer; /* 0x2000 */
u32 __iomem *message_rbuffer; /* 0x2100 */
u32 __iomem *msgcode_rwbuffer; /* 0x2200 */
};
/*
******************************************************************************* *******************************************************************************
** Adapter Control Block ** Adapter Control Block
******************************************************************************* *******************************************************************************
...@@ -505,19 +613,26 @@ struct AdapterControlBlock ...@@ -505,19 +613,26 @@ struct AdapterControlBlock
#define ACB_ADAPTER_TYPE_B 0x00000002 /* hbb M IOP */ #define ACB_ADAPTER_TYPE_B 0x00000002 /* hbb M IOP */
#define ACB_ADAPTER_TYPE_C 0x00000004 /* hbc P IOP */ #define ACB_ADAPTER_TYPE_C 0x00000004 /* hbc P IOP */
#define ACB_ADAPTER_TYPE_D 0x00000008 /* hbd A IOP */ #define ACB_ADAPTER_TYPE_D 0x00000008 /* hbd A IOP */
u32 roundup_ccbsize;
struct pci_dev * pdev; struct pci_dev * pdev;
struct Scsi_Host * host; struct Scsi_Host * host;
unsigned long vir2phy_offset; unsigned long vir2phy_offset;
struct msix_entry entries[ARCMST_NUM_MSIX_VECTORS];
/* Offset is used in making arc cdb physical to virtual calculations */ /* Offset is used in making arc cdb physical to virtual calculations */
uint32_t outbound_int_enable; uint32_t outbound_int_enable;
uint32_t cdb_phyaddr_hi32; uint32_t cdb_phyaddr_hi32;
uint32_t reg_mu_acc_handle0; uint32_t reg_mu_acc_handle0;
spinlock_t eh_lock; spinlock_t eh_lock;
spinlock_t ccblist_lock; spinlock_t ccblist_lock;
spinlock_t postq_lock;
spinlock_t doneq_lock;
spinlock_t rqbuffer_lock;
spinlock_t wqbuffer_lock;
union { union {
struct MessageUnit_A __iomem *pmuA; struct MessageUnit_A __iomem *pmuA;
struct MessageUnit_B *pmuB; struct MessageUnit_B *pmuB;
struct MessageUnit_C __iomem *pmuC; struct MessageUnit_C __iomem *pmuC;
struct MessageUnit_D *pmuD;
}; };
/* message unit ATU inbound base address0 */ /* message unit ATU inbound base address0 */
void __iomem *mem_base0; void __iomem *mem_base0;
...@@ -544,6 +659,8 @@ struct AdapterControlBlock ...@@ -544,6 +659,8 @@ struct AdapterControlBlock
/* iop init */ /* iop init */
#define ACB_F_ABORT 0x0200 #define ACB_F_ABORT 0x0200
#define ACB_F_FIRMWARE_TRAP 0x0400 #define ACB_F_FIRMWARE_TRAP 0x0400
#define ACB_F_MSI_ENABLED 0x1000
#define ACB_F_MSIX_ENABLED 0x2000
struct CommandControlBlock * pccb_pool[ARCMSR_MAX_FREECCB_NUM]; struct CommandControlBlock * pccb_pool[ARCMSR_MAX_FREECCB_NUM];
/* used for memory free */ /* used for memory free */
struct list_head ccb_free_list; struct list_head ccb_free_list;
...@@ -557,19 +674,20 @@ struct AdapterControlBlock ...@@ -557,19 +674,20 @@ struct AdapterControlBlock
/* dma_coherent used for memory free */ /* dma_coherent used for memory free */
dma_addr_t dma_coherent_handle; dma_addr_t dma_coherent_handle;
/* dma_coherent_handle used for memory free */ /* dma_coherent_handle used for memory free */
dma_addr_t dma_coherent_handle_hbb_mu; dma_addr_t dma_coherent_handle2;
void *dma_coherent2;
unsigned int uncache_size; unsigned int uncache_size;
uint8_t rqbuffer[ARCMSR_MAX_QBUFFER]; uint8_t rqbuffer[ARCMSR_MAX_QBUFFER];
/* data collection buffer for read from 80331 */ /* data collection buffer for read from 80331 */
int32_t rqbuf_firstindex; int32_t rqbuf_getIndex;
/* first of read buffer */ /* first of read buffer */
int32_t rqbuf_lastindex; int32_t rqbuf_putIndex;
/* last of read buffer */ /* last of read buffer */
uint8_t wqbuffer[ARCMSR_MAX_QBUFFER]; uint8_t wqbuffer[ARCMSR_MAX_QBUFFER];
/* data collection buffer for write to 80331 */ /* data collection buffer for write to 80331 */
int32_t wqbuf_firstindex; int32_t wqbuf_getIndex;
/* first of write buffer */ /* first of write buffer */
int32_t wqbuf_lastindex; int32_t wqbuf_putIndex;
/* last of write buffer */ /* last of write buffer */
uint8_t devstate[ARCMSR_MAX_TARGETID][ARCMSR_MAX_TARGETLUN]; uint8_t devstate[ARCMSR_MAX_TARGETID][ARCMSR_MAX_TARGETLUN];
/* id0 ..... id15, lun0...lun7 */ /* id0 ..... id15, lun0...lun7 */
...@@ -594,6 +712,8 @@ struct AdapterControlBlock ...@@ -594,6 +712,8 @@ struct AdapterControlBlock
#define FW_DEADLOCK 0x0010 #define FW_DEADLOCK 0x0010
atomic_t rq_map_token; atomic_t rq_map_token;
atomic_t ante_token_value; atomic_t ante_token_value;
uint32_t maxOutstanding;
int msix_vector_count;
};/* HW_DEVICE_EXTENSION */ };/* HW_DEVICE_EXTENSION */
/* /*
******************************************************************************* *******************************************************************************
...@@ -606,7 +726,7 @@ struct CommandControlBlock{ ...@@ -606,7 +726,7 @@ struct CommandControlBlock{
struct list_head list; /*x32: 8byte, x64: 16byte*/ struct list_head list; /*x32: 8byte, x64: 16byte*/
struct scsi_cmnd *pcmd; /*8 bytes pointer of linux scsi command */ struct scsi_cmnd *pcmd; /*8 bytes pointer of linux scsi command */
struct AdapterControlBlock *acb; /*x32: 4byte, x64: 8byte*/ struct AdapterControlBlock *acb; /*x32: 4byte, x64: 8byte*/
uint32_t cdb_phyaddr_pattern; /*x32: 4byte, x64: 4byte*/ uint32_t cdb_phyaddr; /*x32: 4byte, x64: 4byte*/
uint32_t arc_cdb_size; /*x32:4byte,x64:4byte*/ uint32_t arc_cdb_size; /*x32:4byte,x64:4byte*/
uint16_t ccb_flags; /*x32: 2byte, x64: 2byte*/ uint16_t ccb_flags; /*x32: 2byte, x64: 2byte*/
#define CCB_FLAG_READ 0x0000 #define CCB_FLAG_READ 0x0000
...@@ -684,8 +804,10 @@ struct SENSE_DATA ...@@ -684,8 +804,10 @@ struct SENSE_DATA
#define ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE 0x01 #define ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE 0x01
#define ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE 0x1F #define ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE 0x1F
extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *); extern void arcmsr_write_ioctldata2iop(struct AdapterControlBlock *);
extern void arcmsr_iop_message_read(struct AdapterControlBlock *); extern uint32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *,
struct QBUFFER __iomem *);
extern void arcmsr_clear_iop2drv_rqueue_buffer(struct AdapterControlBlock *);
extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *); extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *);
extern struct device_attribute *arcmsr_host_attrs[]; extern struct device_attribute *arcmsr_host_attrs[];
extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *); extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *);
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/circ_buf.h>
#include <scsi/scsi_cmnd.h> #include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h> #include <scsi/scsi_device.h>
...@@ -68,42 +69,42 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct file *filp, ...@@ -68,42 +69,42 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct file *filp,
struct device *dev = container_of(kobj,struct device,kobj); struct device *dev = container_of(kobj,struct device,kobj);
struct Scsi_Host *host = class_to_shost(dev); struct Scsi_Host *host = class_to_shost(dev);
struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
uint8_t *pQbuffer,*ptmpQbuffer; uint8_t *ptmpQbuffer;
int32_t allxfer_len = 0; int32_t allxfer_len = 0;
unsigned long flags;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
/* do message unit read. */ /* do message unit read. */
ptmpQbuffer = (uint8_t *)buf; ptmpQbuffer = (uint8_t *)buf;
while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex) spin_lock_irqsave(&acb->rqbuffer_lock, flags);
&& (allxfer_len < 1031)) { if (acb->rqbuf_getIndex != acb->rqbuf_putIndex) {
pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex]; unsigned int tail = acb->rqbuf_getIndex;
memcpy(ptmpQbuffer, pQbuffer, 1); unsigned int head = acb->rqbuf_putIndex;
acb->rqbuf_firstindex++; unsigned int cnt_to_end = CIRC_CNT_TO_END(head, tail, ARCMSR_MAX_QBUFFER);
acb->rqbuf_firstindex %= ARCMSR_MAX_QBUFFER;
ptmpQbuffer++; allxfer_len = CIRC_CNT(head, tail, ARCMSR_MAX_QBUFFER);
allxfer_len++; if (allxfer_len > ARCMSR_API_DATA_BUFLEN)
allxfer_len = ARCMSR_API_DATA_BUFLEN;
if (allxfer_len <= cnt_to_end)
memcpy(ptmpQbuffer, acb->rqbuffer + tail, allxfer_len);
else {
memcpy(ptmpQbuffer, acb->rqbuffer + tail, cnt_to_end);
memcpy(ptmpQbuffer + cnt_to_end, acb->rqbuffer, allxfer_len - cnt_to_end);
}
acb->rqbuf_getIndex = (acb->rqbuf_getIndex + allxfer_len) % ARCMSR_MAX_QBUFFER;
} }
if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
struct QBUFFER __iomem *prbuffer; struct QBUFFER __iomem *prbuffer;
uint8_t __iomem *iop_data;
int32_t iop_len;
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
prbuffer = arcmsr_get_iop_rqbuffer(acb); prbuffer = arcmsr_get_iop_rqbuffer(acb);
iop_data = prbuffer->data; if (arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0)
iop_len = readl(&prbuffer->data_len); acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW;
while (iop_len > 0) {
acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data);
acb->rqbuf_lastindex++;
acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER;
iop_data++;
iop_len--;
}
arcmsr_iop_message_read(acb);
} }
return (allxfer_len); spin_unlock_irqrestore(&acb->rqbuffer_lock, flags);
return allxfer_len;
} }
static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp, static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp,
...@@ -115,43 +116,42 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp, ...@@ -115,43 +116,42 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp,
struct device *dev = container_of(kobj,struct device,kobj); struct device *dev = container_of(kobj,struct device,kobj);
struct Scsi_Host *host = class_to_shost(dev); struct Scsi_Host *host = class_to_shost(dev);
struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex; int32_t user_len, cnt2end;
uint8_t *pQbuffer, *ptmpuserbuffer; uint8_t *pQbuffer, *ptmpuserbuffer;
unsigned long flags;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
if (count > 1032) if (count > ARCMSR_API_DATA_BUFLEN)
return -EINVAL; return -EINVAL;
/* do message unit write. */ /* do message unit write. */
ptmpuserbuffer = (uint8_t *)buf; ptmpuserbuffer = (uint8_t *)buf;
user_len = (int32_t)count; user_len = (int32_t)count;
wqbuf_lastindex = acb->wqbuf_lastindex; spin_lock_irqsave(&acb->wqbuffer_lock, flags);
wqbuf_firstindex = acb->wqbuf_firstindex; if (acb->wqbuf_putIndex != acb->wqbuf_getIndex) {
if (wqbuf_lastindex != wqbuf_firstindex) { arcmsr_write_ioctldata2iop(acb);
arcmsr_post_ioctldata2iop(acb); spin_unlock_irqrestore(&acb->wqbuffer_lock, flags);
return 0; /*need retry*/ return 0; /*need retry*/
} else { } else {
my_empty_len = (wqbuf_firstindex-wqbuf_lastindex - 1) pQbuffer = &acb->wqbuffer[acb->wqbuf_putIndex];
&(ARCMSR_MAX_QBUFFER - 1); cnt2end = ARCMSR_MAX_QBUFFER - acb->wqbuf_putIndex;
if (my_empty_len >= user_len) { if (user_len > cnt2end) {
while (user_len > 0) { memcpy(pQbuffer, ptmpuserbuffer, cnt2end);
pQbuffer = ptmpuserbuffer += cnt2end;
&acb->wqbuffer[acb->wqbuf_lastindex]; user_len -= cnt2end;
memcpy(pQbuffer, ptmpuserbuffer, 1); acb->wqbuf_putIndex = 0;
acb->wqbuf_lastindex++; pQbuffer = acb->wqbuffer;
acb->wqbuf_lastindex %= ARCMSR_MAX_QBUFFER; }
ptmpuserbuffer++; memcpy(pQbuffer, ptmpuserbuffer, user_len);
user_len--; acb->wqbuf_putIndex += user_len;
} acb->wqbuf_putIndex %= ARCMSR_MAX_QBUFFER;
if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) { if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) {
acb->acb_flags &= acb->acb_flags &=
~ACB_F_MESSAGE_WQBUFFER_CLEARED; ~ACB_F_MESSAGE_WQBUFFER_CLEARED;
arcmsr_post_ioctldata2iop(acb); arcmsr_write_ioctldata2iop(acb);
}
return count;
} else {
return 0; /*need retry*/
} }
spin_unlock_irqrestore(&acb->wqbuffer_lock, flags);
return count;
} }
} }
...@@ -165,22 +165,24 @@ static ssize_t arcmsr_sysfs_iop_message_clear(struct file *filp, ...@@ -165,22 +165,24 @@ static ssize_t arcmsr_sysfs_iop_message_clear(struct file *filp,
struct Scsi_Host *host = class_to_shost(dev); struct Scsi_Host *host = class_to_shost(dev);
struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
uint8_t *pQbuffer; uint8_t *pQbuffer;
unsigned long flags;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { arcmsr_clear_iop2drv_rqueue_buffer(acb);
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
arcmsr_iop_message_read(acb);
}
acb->acb_flags |= acb->acb_flags |=
(ACB_F_MESSAGE_WQBUFFER_CLEARED (ACB_F_MESSAGE_WQBUFFER_CLEARED
| ACB_F_MESSAGE_RQBUFFER_CLEARED | ACB_F_MESSAGE_RQBUFFER_CLEARED
| ACB_F_MESSAGE_WQBUFFER_READED); | ACB_F_MESSAGE_WQBUFFER_READED);
acb->rqbuf_firstindex = 0; spin_lock_irqsave(&acb->rqbuffer_lock, flags);
acb->rqbuf_lastindex = 0; acb->rqbuf_getIndex = 0;
acb->wqbuf_firstindex = 0; acb->rqbuf_putIndex = 0;
acb->wqbuf_lastindex = 0; spin_unlock_irqrestore(&acb->rqbuffer_lock, flags);
spin_lock_irqsave(&acb->wqbuffer_lock, flags);
acb->wqbuf_getIndex = 0;
acb->wqbuf_putIndex = 0;
spin_unlock_irqrestore(&acb->wqbuffer_lock, flags);
pQbuffer = acb->rqbuffer; pQbuffer = acb->rqbuffer;
memset(pQbuffer, 0, sizeof (struct QBUFFER)); memset(pQbuffer, 0, sizeof (struct QBUFFER));
pQbuffer = acb->wqbuffer; pQbuffer = acb->wqbuffer;
...@@ -193,7 +195,7 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = { ...@@ -193,7 +195,7 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = {
.name = "mu_read", .name = "mu_read",
.mode = S_IRUSR , .mode = S_IRUSR ,
}, },
.size = 1032, .size = ARCMSR_API_DATA_BUFLEN,
.read = arcmsr_sysfs_iop_message_read, .read = arcmsr_sysfs_iop_message_read,
}; };
...@@ -202,7 +204,7 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = { ...@@ -202,7 +204,7 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = {
.name = "mu_write", .name = "mu_write",
.mode = S_IWUSR, .mode = S_IWUSR,
}, },
.size = 1032, .size = ARCMSR_API_DATA_BUFLEN,
.write = arcmsr_sysfs_iop_message_write, .write = arcmsr_sysfs_iop_message_write,
}; };
......
此差异已折叠。
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
......
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -275,6 +275,19 @@ bool is_link_state_evt(u32 trailer) ...@@ -275,6 +275,19 @@ bool is_link_state_evt(u32 trailer)
ASYNC_EVENT_CODE_LINK_STATE); ASYNC_EVENT_CODE_LINK_STATE);
} }
static bool is_iscsi_evt(u32 trailer)
{
return ((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) &
ASYNC_TRAILER_EVENT_CODE_MASK) ==
ASYNC_EVENT_CODE_ISCSI;
}
static int iscsi_evt_type(u32 trailer)
{
return (trailer >> ASYNC_TRAILER_EVENT_TYPE_SHIFT) &
ASYNC_TRAILER_EVENT_TYPE_MASK;
}
static inline bool be_mcc_compl_is_new(struct be_mcc_compl *compl) static inline bool be_mcc_compl_is_new(struct be_mcc_compl *compl)
{ {
if (compl->flags != 0) { if (compl->flags != 0) {
...@@ -438,7 +451,7 @@ void beiscsi_async_link_state_process(struct beiscsi_hba *phba, ...@@ -438,7 +451,7 @@ void beiscsi_async_link_state_process(struct beiscsi_hba *phba,
} else if ((evt->port_link_status & ASYNC_EVENT_LINK_UP) || } else if ((evt->port_link_status & ASYNC_EVENT_LINK_UP) ||
((evt->port_link_status & ASYNC_EVENT_LOGICAL) && ((evt->port_link_status & ASYNC_EVENT_LOGICAL) &&
(evt->port_fault == BEISCSI_PHY_LINK_FAULT_NONE))) { (evt->port_fault == BEISCSI_PHY_LINK_FAULT_NONE))) {
phba->state = BE_ADAPTER_LINK_UP; phba->state = BE_ADAPTER_LINK_UP | BE_ADAPTER_CHECK_BOOT;
beiscsi_log(phba, KERN_ERR, beiscsi_log(phba, KERN_ERR,
BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT,
...@@ -461,7 +474,28 @@ int beiscsi_process_mcc(struct beiscsi_hba *phba) ...@@ -461,7 +474,28 @@ int beiscsi_process_mcc(struct beiscsi_hba *phba)
/* Interpret compl as a async link evt */ /* Interpret compl as a async link evt */
beiscsi_async_link_state_process(phba, beiscsi_async_link_state_process(phba,
(struct be_async_event_link_state *) compl); (struct be_async_event_link_state *) compl);
else else if (is_iscsi_evt(compl->flags)) {
switch (iscsi_evt_type(compl->flags)) {
case ASYNC_EVENT_NEW_ISCSI_TGT_DISC:
case ASYNC_EVENT_NEW_ISCSI_CONN:
case ASYNC_EVENT_NEW_TCP_CONN:
phba->state |= BE_ADAPTER_CHECK_BOOT;
beiscsi_log(phba, KERN_ERR,
BEISCSI_LOG_CONFIG |
BEISCSI_LOG_MBOX,
"BC_%d : Async iscsi Event,"
" flags handled = 0x%08x\n",
compl->flags);
break;
default:
beiscsi_log(phba, KERN_ERR,
BEISCSI_LOG_CONFIG |
BEISCSI_LOG_MBOX,
"BC_%d : Unsupported Async"
" Event, flags = 0x%08x\n",
compl->flags);
}
} else
beiscsi_log(phba, KERN_ERR, beiscsi_log(phba, KERN_ERR,
BEISCSI_LOG_CONFIG | BEISCSI_LOG_CONFIG |
BEISCSI_LOG_MBOX, BEISCSI_LOG_MBOX,
......
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
* The commands are serviced by the ARM processor in the OneConnect's MPU. * The commands are serviced by the ARM processor in the OneConnect's MPU.
*/ */
struct be_sge { struct be_sge {
u32 pa_lo; __le32 pa_lo;
u32 pa_hi; __le32 pa_hi;
u32 len; __le32 len;
}; };
#define MCC_WRB_SGE_CNT_SHIFT 3 /* bits 3 - 7 of dword 0 */ #define MCC_WRB_SGE_CNT_SHIFT 3 /* bits 3 - 7 of dword 0 */
...@@ -118,6 +118,14 @@ struct be_mcc_compl { ...@@ -118,6 +118,14 @@ struct be_mcc_compl {
#define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */ #define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
#define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF #define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
#define ASYNC_EVENT_CODE_LINK_STATE 0x1 #define ASYNC_EVENT_CODE_LINK_STATE 0x1
#define ASYNC_EVENT_CODE_ISCSI 0x4
#define ASYNC_TRAILER_EVENT_TYPE_SHIFT 16 /* bits 16 - 23 */
#define ASYNC_TRAILER_EVENT_TYPE_MASK 0xF
#define ASYNC_EVENT_NEW_ISCSI_TGT_DISC 0x4
#define ASYNC_EVENT_NEW_ISCSI_CONN 0x5
#define ASYNC_EVENT_NEW_TCP_CONN 0x7
struct be_async_event_trailer { struct be_async_event_trailer {
u32 code; u32 code;
}; };
...@@ -624,11 +632,11 @@ static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb) ...@@ -624,11 +632,11 @@ static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb)
/******************** Modify EQ Delay *******************/ /******************** Modify EQ Delay *******************/
struct be_cmd_req_modify_eq_delay { struct be_cmd_req_modify_eq_delay {
struct be_cmd_req_hdr hdr; struct be_cmd_req_hdr hdr;
u32 num_eq; __le32 num_eq;
struct { struct {
u32 eq_id; __le32 eq_id;
u32 phase; __le32 phase;
u32 delay_multiplier; __le32 delay_multiplier;
} delay[MAX_CPUS]; } delay[MAX_CPUS];
} __packed; } __packed;
......
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -1273,6 +1273,31 @@ int beiscsi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) ...@@ -1273,6 +1273,31 @@ int beiscsi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
return 0; return 0;
} }
/**
* beiscsi_flush_cq()- Flush the CQ created.
* @phba: ptr device priv structure.
*
* Before the connection resource are freed flush
* all the CQ enteries
**/
static void beiscsi_flush_cq(struct beiscsi_hba *phba)
{
uint16_t i;
struct be_eq_obj *pbe_eq;
struct hwi_controller *phwi_ctrlr;
struct hwi_context_memory *phwi_context;
phwi_ctrlr = phba->phwi_ctrlr;
phwi_context = phwi_ctrlr->phwi_ctxt;
for (i = 0; i < phba->num_cpus; i++) {
pbe_eq = &phwi_context->be_eq[i];
blk_iopoll_disable(&pbe_eq->iopoll);
beiscsi_process_cq(pbe_eq);
blk_iopoll_enable(&pbe_eq->iopoll);
}
}
/** /**
* beiscsi_close_conn - Upload the connection * beiscsi_close_conn - Upload the connection
* @ep: The iscsi endpoint * @ep: The iscsi endpoint
...@@ -1294,6 +1319,10 @@ static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag) ...@@ -1294,6 +1319,10 @@ static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag)
} }
ret = beiscsi_mccq_compl(phba, tag, NULL, NULL); ret = beiscsi_mccq_compl(phba, tag, NULL, NULL);
/* Flush the CQ entries */
beiscsi_flush_cq(phba);
return ret; return ret;
} }
......
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
......
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -2068,7 +2068,7 @@ static void beiscsi_process_mcc_isr(struct beiscsi_hba *phba) ...@@ -2068,7 +2068,7 @@ static void beiscsi_process_mcc_isr(struct beiscsi_hba *phba)
* return * return
* Number of Completion Entries processed. * Number of Completion Entries processed.
**/ **/
static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
{ {
struct be_queue_info *cq; struct be_queue_info *cq;
struct sol_cqe *sol; struct sol_cqe *sol;
...@@ -2110,6 +2110,18 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) ...@@ -2110,6 +2110,18 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
cri_index = BE_GET_CRI_FROM_CID(cid); cri_index = BE_GET_CRI_FROM_CID(cid);
ep = phba->ep_array[cri_index]; ep = phba->ep_array[cri_index];
if (ep == NULL) {
/* connection has already been freed
* just move on to next one
*/
beiscsi_log(phba, KERN_WARNING,
BEISCSI_LOG_INIT,
"BM_%d : proc cqe of disconn ep: cid %d\n",
cid);
goto proc_next_cqe;
}
beiscsi_ep = ep->dd_data; beiscsi_ep = ep->dd_data;
beiscsi_conn = beiscsi_ep->conn; beiscsi_conn = beiscsi_ep->conn;
...@@ -2219,6 +2231,7 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) ...@@ -2219,6 +2231,7 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
break; break;
} }
proc_next_cqe:
AMAP_SET_BITS(struct amap_sol_cqe, valid, sol, 0); AMAP_SET_BITS(struct amap_sol_cqe, valid, sol, 0);
queue_tail_inc(cq); queue_tail_inc(cq);
sol = queue_tail_node(cq); sol = queue_tail_node(cq);
...@@ -4377,6 +4390,10 @@ static int beiscsi_setup_boot_info(struct beiscsi_hba *phba) ...@@ -4377,6 +4390,10 @@ static int beiscsi_setup_boot_info(struct beiscsi_hba *phba)
{ {
struct iscsi_boot_kobj *boot_kobj; struct iscsi_boot_kobj *boot_kobj;
/* it has been created previously */
if (phba->boot_kset)
return 0;
/* get boot info using mgmt cmd */ /* get boot info using mgmt cmd */
if (beiscsi_get_boot_info(phba)) if (beiscsi_get_boot_info(phba))
/* Try to see if we can carry on without this */ /* Try to see if we can carry on without this */
...@@ -5206,6 +5223,7 @@ static void beiscsi_quiesce(struct beiscsi_hba *phba, ...@@ -5206,6 +5223,7 @@ static void beiscsi_quiesce(struct beiscsi_hba *phba,
free_irq(phba->pcidev->irq, phba); free_irq(phba->pcidev->irq, phba);
} }
pci_disable_msix(phba->pcidev); pci_disable_msix(phba->pcidev);
cancel_delayed_work_sync(&phba->beiscsi_hw_check_task);
for (i = 0; i < phba->num_cpus; i++) { for (i = 0; i < phba->num_cpus; i++) {
pbe_eq = &phwi_context->be_eq[i]; pbe_eq = &phwi_context->be_eq[i];
...@@ -5227,7 +5245,6 @@ static void beiscsi_quiesce(struct beiscsi_hba *phba, ...@@ -5227,7 +5245,6 @@ static void beiscsi_quiesce(struct beiscsi_hba *phba,
hwi_cleanup(phba); hwi_cleanup(phba);
} }
cancel_delayed_work_sync(&phba->beiscsi_hw_check_task);
} }
static void beiscsi_remove(struct pci_dev *pcidev) static void beiscsi_remove(struct pci_dev *pcidev)
...@@ -5276,9 +5293,9 @@ static void beiscsi_msix_enable(struct beiscsi_hba *phba) ...@@ -5276,9 +5293,9 @@ static void beiscsi_msix_enable(struct beiscsi_hba *phba)
for (i = 0; i <= phba->num_cpus; i++) for (i = 0; i <= phba->num_cpus; i++)
phba->msix_entries[i].entry = i; phba->msix_entries[i].entry = i;
status = pci_enable_msix(phba->pcidev, phba->msix_entries, status = pci_enable_msix_range(phba->pcidev, phba->msix_entries,
(phba->num_cpus + 1)); phba->num_cpus + 1, phba->num_cpus + 1);
if (!status) if (status > 0)
phba->msix_enabled = true; phba->msix_enabled = true;
return; return;
...@@ -5335,6 +5352,14 @@ static void be_eqd_update(struct beiscsi_hba *phba) ...@@ -5335,6 +5352,14 @@ static void be_eqd_update(struct beiscsi_hba *phba)
} }
} }
static void be_check_boot_session(struct beiscsi_hba *phba)
{
if (beiscsi_setup_boot_info(phba))
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : Could not set up "
"iSCSI boot info on async event.\n");
}
/* /*
* beiscsi_hw_health_check()- Check adapter health * beiscsi_hw_health_check()- Check adapter health
* @work: work item to check HW health * @work: work item to check HW health
...@@ -5350,6 +5375,11 @@ beiscsi_hw_health_check(struct work_struct *work) ...@@ -5350,6 +5375,11 @@ beiscsi_hw_health_check(struct work_struct *work)
be_eqd_update(phba); be_eqd_update(phba);
if (phba->state & BE_ADAPTER_CHECK_BOOT) {
phba->state &= ~BE_ADAPTER_CHECK_BOOT;
be_check_boot_session(phba);
}
beiscsi_ue_detect(phba); beiscsi_ue_detect(phba);
schedule_delayed_work(&phba->beiscsi_hw_check_task, schedule_delayed_work(&phba->beiscsi_hw_check_task,
......
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <scsi/scsi_transport_iscsi.h> #include <scsi/scsi_transport_iscsi.h>
#define DRV_NAME "be2iscsi" #define DRV_NAME "be2iscsi"
#define BUILD_STR "10.2.273.0" #define BUILD_STR "10.4.114.0"
#define BE_NAME "Emulex OneConnect" \ #define BE_NAME "Emulex OneConnect" \
"Open-iSCSI Driver version" BUILD_STR "Open-iSCSI Driver version" BUILD_STR
#define DRV_DESC BE_NAME " " "Driver" #define DRV_DESC BE_NAME " " "Driver"
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
#define BE_ADAPTER_LINK_DOWN 0x002 #define BE_ADAPTER_LINK_DOWN 0x002
#define BE_ADAPTER_PCI_ERR 0x004 #define BE_ADAPTER_PCI_ERR 0x004
#define BE_ADAPTER_STATE_SHUTDOWN 0x008 #define BE_ADAPTER_STATE_SHUTDOWN 0x008
#define BE_ADAPTER_CHECK_BOOT 0x010
#define BEISCSI_CLEAN_UNLOAD 0x01 #define BEISCSI_CLEAN_UNLOAD 0x01
...@@ -839,6 +840,9 @@ void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn, ...@@ -839,6 +840,9 @@ void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
void hwi_ring_cq_db(struct beiscsi_hba *phba, void hwi_ring_cq_db(struct beiscsi_hba *phba,
unsigned int id, unsigned int num_processed, unsigned int id, unsigned int num_processed,
unsigned char rearm, unsigned char event); unsigned char rearm, unsigned char event);
unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq);
static inline bool beiscsi_error(struct beiscsi_hba *phba) static inline bool beiscsi_error(struct beiscsi_hba *phba)
{ {
return phba->ue_detected || phba->fw_timeout; return phba->ue_detected || phba->fw_timeout;
......
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -943,17 +943,20 @@ mgmt_static_ip_modify(struct beiscsi_hba *phba, ...@@ -943,17 +943,20 @@ mgmt_static_ip_modify(struct beiscsi_hba *phba,
if (ip_action == IP_ACTION_ADD) { if (ip_action == IP_ACTION_ADD) {
memcpy(req->ip_params.ip_record.ip_addr.addr, ip_param->value, memcpy(req->ip_params.ip_record.ip_addr.addr, ip_param->value,
ip_param->len); sizeof(req->ip_params.ip_record.ip_addr.addr));
if (subnet_param) if (subnet_param)
memcpy(req->ip_params.ip_record.ip_addr.subnet_mask, memcpy(req->ip_params.ip_record.ip_addr.subnet_mask,
subnet_param->value, subnet_param->len); subnet_param->value,
sizeof(req->ip_params.ip_record.ip_addr.subnet_mask));
} else { } else {
memcpy(req->ip_params.ip_record.ip_addr.addr, memcpy(req->ip_params.ip_record.ip_addr.addr,
if_info->ip_addr.addr, ip_param->len); if_info->ip_addr.addr,
sizeof(req->ip_params.ip_record.ip_addr.addr));
memcpy(req->ip_params.ip_record.ip_addr.subnet_mask, memcpy(req->ip_params.ip_record.ip_addr.subnet_mask,
if_info->ip_addr.subnet_mask, ip_param->len); if_info->ip_addr.subnet_mask,
sizeof(req->ip_params.ip_record.ip_addr.subnet_mask));
} }
rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0); rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
...@@ -981,7 +984,7 @@ static int mgmt_modify_gateway(struct beiscsi_hba *phba, uint8_t *gt_addr, ...@@ -981,7 +984,7 @@ static int mgmt_modify_gateway(struct beiscsi_hba *phba, uint8_t *gt_addr,
req->action = gtway_action; req->action = gtway_action;
req->ip_addr.ip_type = BE2_IPV4; req->ip_addr.ip_type = BE2_IPV4;
memcpy(req->ip_addr.addr, gt_addr, param_len); memcpy(req->ip_addr.addr, gt_addr, sizeof(req->ip_addr.addr));
return mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0); return mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
} }
......
/** /**
* Copyright (C) 2005 - 2013 Emulex * Copyright (C) 2005 - 2014 Emulex
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
......
...@@ -1654,6 +1654,10 @@ static int bnx2fc_map_sg(struct bnx2fc_cmd *io_req) ...@@ -1654,6 +1654,10 @@ static int bnx2fc_map_sg(struct bnx2fc_cmd *io_req)
u64 addr; u64 addr;
int i; int i;
/*
* Use dma_map_sg directly to ensure we're using the correct
* dev struct off of pcidev.
*/
sg_count = dma_map_sg(&hba->pcidev->dev, scsi_sglist(sc), sg_count = dma_map_sg(&hba->pcidev->dev, scsi_sglist(sc),
scsi_sg_count(sc), sc->sc_data_direction); scsi_sg_count(sc), sc->sc_data_direction);
scsi_for_each_sg(sc, sg, sg_count, i) { scsi_for_each_sg(sc, sg, sg_count, i) {
...@@ -1703,9 +1707,16 @@ static int bnx2fc_build_bd_list_from_sg(struct bnx2fc_cmd *io_req) ...@@ -1703,9 +1707,16 @@ static int bnx2fc_build_bd_list_from_sg(struct bnx2fc_cmd *io_req)
static void bnx2fc_unmap_sg_list(struct bnx2fc_cmd *io_req) static void bnx2fc_unmap_sg_list(struct bnx2fc_cmd *io_req)
{ {
struct scsi_cmnd *sc = io_req->sc_cmd; struct scsi_cmnd *sc = io_req->sc_cmd;
struct bnx2fc_interface *interface = io_req->port->priv;
struct bnx2fc_hba *hba = interface->hba;
if (io_req->bd_tbl->bd_valid && sc) { /*
scsi_dma_unmap(sc); * Use dma_unmap_sg directly to ensure we're using the correct
* dev struct off of pcidev.
*/
if (io_req->bd_tbl->bd_valid && sc && scsi_sg_count(sc)) {
dma_unmap_sg(&hba->pcidev->dev, scsi_sglist(sc),
scsi_sg_count(sc), sc->sc_data_direction);
io_req->bd_tbl->bd_valid = 0; io_req->bd_tbl->bd_valid = 0;
} }
} }
......
...@@ -2235,6 +2235,9 @@ static umode_t bnx2i_attr_is_visible(int param_type, int param) ...@@ -2235,6 +2235,9 @@ static umode_t bnx2i_attr_is_visible(int param_type, int param)
case ISCSI_PARAM_TGT_RESET_TMO: case ISCSI_PARAM_TGT_RESET_TMO:
case ISCSI_PARAM_IFACE_NAME: case ISCSI_PARAM_IFACE_NAME:
case ISCSI_PARAM_INITIATOR_NAME: case ISCSI_PARAM_INITIATOR_NAME:
case ISCSI_PARAM_BOOT_ROOT:
case ISCSI_PARAM_BOOT_NIC:
case ISCSI_PARAM_BOOT_TARGET:
return S_IRUGO; return S_IRUGO;
default: default:
return 0; return 0;
......
...@@ -94,7 +94,7 @@ enum { ...@@ -94,7 +94,7 @@ enum {
}; };
struct csio_msix_entries { struct csio_msix_entries {
unsigned short vector; /* Vector assigned by pci_enable_msix */ unsigned short vector; /* Assigned MSI-X vector */
void *dev_id; /* Priv object associated w/ this msix*/ void *dev_id; /* Priv object associated w/ this msix*/
char desc[24]; /* Description of this vector */ char desc[24]; /* Description of this vector */
}; };
......
...@@ -499,7 +499,7 @@ csio_reduce_sqsets(struct csio_hw *hw, int cnt) ...@@ -499,7 +499,7 @@ csio_reduce_sqsets(struct csio_hw *hw, int cnt)
static int static int
csio_enable_msix(struct csio_hw *hw) csio_enable_msix(struct csio_hw *hw)
{ {
int rv, i, j, k, n, min, cnt; int i, j, k, n, min, cnt;
struct csio_msix_entries *entryp; struct csio_msix_entries *entryp;
struct msix_entry *entries; struct msix_entry *entries;
int extra = CSIO_EXTRA_VECS; int extra = CSIO_EXTRA_VECS;
...@@ -521,21 +521,15 @@ csio_enable_msix(struct csio_hw *hw) ...@@ -521,21 +521,15 @@ csio_enable_msix(struct csio_hw *hw)
csio_dbg(hw, "FW supp #niq:%d, trying %d msix's\n", hw->cfg_niq, cnt); csio_dbg(hw, "FW supp #niq:%d, trying %d msix's\n", hw->cfg_niq, cnt);
while ((rv = pci_enable_msix(hw->pdev, entries, cnt)) >= min) cnt = pci_enable_msix_range(hw->pdev, entries, min, cnt);
cnt = rv; if (cnt < 0) {
if (!rv) {
if (cnt < (hw->num_sqsets + extra)) {
csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra);
csio_reduce_sqsets(hw, cnt - extra);
}
} else {
if (rv > 0) {
pci_disable_msix(hw->pdev);
csio_info(hw, "Not using MSI-X, remainder:%d\n", rv);
}
kfree(entries); kfree(entries);
return -ENOMEM; return cnt;
}
if (cnt < (hw->num_sqsets + extra)) {
csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra);
csio_reduce_sqsets(hw, cnt - extra);
} }
/* Save off vectors */ /* Save off vectors */
......
...@@ -1852,7 +1852,7 @@ static void csk_return_rx_credits(struct cxgbi_sock *csk, int copied) ...@@ -1852,7 +1852,7 @@ static void csk_return_rx_credits(struct cxgbi_sock *csk, int copied)
u32 credits; u32 credits;
log_debug(1 << CXGBI_DBG_PDU_RX, log_debug(1 << CXGBI_DBG_PDU_RX,
"csk 0x%p,%u,0x%lu,%u, seq %u, wup %u, thre %u, %u.\n", "csk 0x%p,%u,0x%lx,%u, seq %u, wup %u, thre %u, %u.\n",
csk, csk->state, csk->flags, csk->tid, csk->copied_seq, csk, csk->state, csk->flags, csk->tid, csk->copied_seq,
csk->rcv_wup, cdev->rx_credit_thres, csk->rcv_wup, cdev->rx_credit_thres,
cdev->rcv_win); cdev->rcv_win);
......
...@@ -2363,6 +2363,7 @@ static s32 adpt_scsi_host_alloc(adpt_hba* pHba, struct scsi_host_template *sht) ...@@ -2363,6 +2363,7 @@ static s32 adpt_scsi_host_alloc(adpt_hba* pHba, struct scsi_host_template *sht)
host->unique_id = (u32)sys_tbl_pa + pHba->unit; host->unique_id = (u32)sys_tbl_pa + pHba->unit;
host->sg_tablesize = pHba->sg_tablesize; host->sg_tablesize = pHba->sg_tablesize;
host->can_queue = pHba->post_fifo_size; host->can_queue = pHba->post_fifo_size;
host->use_cmd_list = 1;
return 0; return 0;
} }
......
...@@ -837,7 +837,6 @@ struct hostdata { ...@@ -837,7 +837,6 @@ struct hostdata {
static struct Scsi_Host *sh[MAX_BOARDS]; static struct Scsi_Host *sh[MAX_BOARDS];
static const char *driver_name = "EATA"; static const char *driver_name = "EATA";
static char sha[MAX_BOARDS]; static char sha[MAX_BOARDS];
static DEFINE_SPINLOCK(driver_lock);
/* Initialize num_boards so that ihdlr can work while detect is in progress */ /* Initialize num_boards so that ihdlr can work while detect is in progress */
static unsigned int num_boards = MAX_BOARDS; static unsigned int num_boards = MAX_BOARDS;
...@@ -1097,8 +1096,6 @@ static int port_detect(unsigned long port_base, unsigned int j, ...@@ -1097,8 +1096,6 @@ static int port_detect(unsigned long port_base, unsigned int j,
goto fail; goto fail;
} }
spin_lock_irq(&driver_lock);
if (do_dma(port_base, 0, READ_CONFIG_PIO)) { if (do_dma(port_base, 0, READ_CONFIG_PIO)) {
#if defined(DEBUG_DETECT) #if defined(DEBUG_DETECT)
printk("%s: detect, do_dma failed at 0x%03lx.\n", name, printk("%s: detect, do_dma failed at 0x%03lx.\n", name,
...@@ -1264,10 +1261,7 @@ static int port_detect(unsigned long port_base, unsigned int j, ...@@ -1264,10 +1261,7 @@ static int port_detect(unsigned long port_base, unsigned int j,
} }
#endif #endif
spin_unlock_irq(&driver_lock);
sh[j] = shost = scsi_register(tpnt, sizeof(struct hostdata)); sh[j] = shost = scsi_register(tpnt, sizeof(struct hostdata));
spin_lock_irq(&driver_lock);
if (shost == NULL) { if (shost == NULL) {
printk("%s: unable to register host, detaching.\n", name); printk("%s: unable to register host, detaching.\n", name);
goto freedma; goto freedma;
...@@ -1344,8 +1338,6 @@ static int port_detect(unsigned long port_base, unsigned int j, ...@@ -1344,8 +1338,6 @@ static int port_detect(unsigned long port_base, unsigned int j,
else else
sprintf(dma_name, "DMA %u", dma_channel); sprintf(dma_name, "DMA %u", dma_channel);
spin_unlock_irq(&driver_lock);
for (i = 0; i < shost->can_queue; i++) for (i = 0; i < shost->can_queue; i++)
ha->cp[i].cp_dma_addr = pci_map_single(ha->pdev, ha->cp[i].cp_dma_addr = pci_map_single(ha->pdev,
&ha->cp[i], &ha->cp[i],
...@@ -1438,7 +1430,6 @@ static int port_detect(unsigned long port_base, unsigned int j, ...@@ -1438,7 +1430,6 @@ static int port_detect(unsigned long port_base, unsigned int j,
freeirq: freeirq:
free_irq(irq, &sha[j]); free_irq(irq, &sha[j]);
freelock: freelock:
spin_unlock_irq(&driver_lock);
release_region(port_base, REGION_SIZE); release_region(port_base, REGION_SIZE);
fail: fail:
return 0; return 0;
......
...@@ -96,14 +96,32 @@ int fcoe_link_speed_update(struct fc_lport *lport) ...@@ -96,14 +96,32 @@ int fcoe_link_speed_update(struct fc_lport *lport)
struct ethtool_cmd ecmd; struct ethtool_cmd ecmd;
if (!__ethtool_get_settings(netdev, &ecmd)) { if (!__ethtool_get_settings(netdev, &ecmd)) {
lport->link_supported_speeds &= lport->link_supported_speeds &= ~(FC_PORTSPEED_1GBIT |
~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT); FC_PORTSPEED_10GBIT |
FC_PORTSPEED_20GBIT |
FC_PORTSPEED_40GBIT);
if (ecmd.supported & (SUPPORTED_1000baseT_Half | if (ecmd.supported & (SUPPORTED_1000baseT_Half |
SUPPORTED_1000baseT_Full)) SUPPORTED_1000baseT_Full |
SUPPORTED_1000baseKX_Full))
lport->link_supported_speeds |= FC_PORTSPEED_1GBIT; lport->link_supported_speeds |= FC_PORTSPEED_1GBIT;
if (ecmd.supported & SUPPORTED_10000baseT_Full)
lport->link_supported_speeds |= if (ecmd.supported & (SUPPORTED_10000baseT_Full |
FC_PORTSPEED_10GBIT; SUPPORTED_10000baseKX4_Full |
SUPPORTED_10000baseKR_Full |
SUPPORTED_10000baseR_FEC))
lport->link_supported_speeds |= FC_PORTSPEED_10GBIT;
if (ecmd.supported & (SUPPORTED_20000baseMLD2_Full |
SUPPORTED_20000baseKR2_Full))
lport->link_supported_speeds |= FC_PORTSPEED_20GBIT;
if (ecmd.supported & (SUPPORTED_40000baseKR4_Full |
SUPPORTED_40000baseCR4_Full |
SUPPORTED_40000baseSR4_Full |
SUPPORTED_40000baseLR4_Full))
lport->link_supported_speeds |= FC_PORTSPEED_40GBIT;
switch (ethtool_cmd_speed(&ecmd)) { switch (ethtool_cmd_speed(&ecmd)) {
case SPEED_1000: case SPEED_1000:
lport->link_speed = FC_PORTSPEED_1GBIT; lport->link_speed = FC_PORTSPEED_1GBIT;
...@@ -111,6 +129,15 @@ int fcoe_link_speed_update(struct fc_lport *lport) ...@@ -111,6 +129,15 @@ int fcoe_link_speed_update(struct fc_lport *lport)
case SPEED_10000: case SPEED_10000:
lport->link_speed = FC_PORTSPEED_10GBIT; lport->link_speed = FC_PORTSPEED_10GBIT;
break; break;
case 20000:
lport->link_speed = FC_PORTSPEED_20GBIT;
break;
case 40000:
lport->link_speed = FC_PORTSPEED_40GBIT;
break;
default:
lport->link_speed = FC_PORTSPEED_UNKNOWN;
break;
} }
return 0; return 0;
} }
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define DRV_NAME "fnic" #define DRV_NAME "fnic"
#define DRV_DESCRIPTION "Cisco FCoE HBA Driver" #define DRV_DESCRIPTION "Cisco FCoE HBA Driver"
#define DRV_VERSION "1.6.0.10" #define DRV_VERSION "1.6.0.11"
#define PFX DRV_NAME ": " #define PFX DRV_NAME ": "
#define DFX DRV_NAME "%d: " #define DFX DRV_NAME "%d: "
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "cq_enet_desc.h" #include "cq_enet_desc.h"
#include "cq_exch_desc.h" #include "cq_exch_desc.h"
static u8 fcoe_all_fcfs[ETH_ALEN]; static u8 fcoe_all_fcfs[ETH_ALEN] = FIP_ALL_FCF_MACS;
struct workqueue_struct *fnic_fip_queue; struct workqueue_struct *fnic_fip_queue;
struct workqueue_struct *fnic_event_queue; struct workqueue_struct *fnic_event_queue;
...@@ -101,13 +101,14 @@ void fnic_handle_link(struct work_struct *work) ...@@ -101,13 +101,14 @@ void fnic_handle_link(struct work_struct *work)
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
"link up\n"); "link up\n");
fcoe_ctlr_link_up(&fnic->ctlr); fcoe_ctlr_link_up(&fnic->ctlr);
} else } else {
/* UP -> UP */ /* UP -> UP */
spin_unlock_irqrestore(&fnic->fnic_lock, flags); spin_unlock_irqrestore(&fnic->fnic_lock, flags);
fnic_fc_trace_set_data( fnic_fc_trace_set_data(
fnic->lport->host->host_no, FNIC_FC_LE, fnic->lport->host->host_no, FNIC_FC_LE,
"Link Status: UP_UP", "Link Status: UP_UP",
strlen("Link Status: UP_UP")); strlen("Link Status: UP_UP"));
}
} }
} else if (fnic->link_status) { } else if (fnic->link_status) {
/* DOWN -> UP */ /* DOWN -> UP */
......
...@@ -743,7 +743,7 @@ void copy_and_format_trace_data(struct fc_trace_hdr *tdata, ...@@ -743,7 +743,7 @@ void copy_and_format_trace_data(struct fc_trace_hdr *tdata,
fmt = "%02d:%02d:%04ld %02d:%02d:%02d.%09lu ns%8x %c%8x\t"; fmt = "%02d:%02d:%04ld %02d:%02d:%02d.%09lu ns%8x %c%8x\t";
len += snprintf(fnic_dbgfs_prt->buffer + len, len += snprintf(fnic_dbgfs_prt->buffer + len,
(fnic_fc_trace_max_pages * PAGE_SIZE * 3) - len, max_size - len,
fmt, fmt,
tm.tm_mon + 1, tm.tm_mday, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_year + 1900,
tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_hour, tm.tm_min, tm.tm_sec,
...@@ -767,8 +767,7 @@ void copy_and_format_trace_data(struct fc_trace_hdr *tdata, ...@@ -767,8 +767,7 @@ void copy_and_format_trace_data(struct fc_trace_hdr *tdata,
j == ethhdr_len + fcoehdr_len + fchdr_len || j == ethhdr_len + fcoehdr_len + fchdr_len ||
(i > 3 && j%fchdr_len == 0)) { (i > 3 && j%fchdr_len == 0)) {
len += snprintf(fnic_dbgfs_prt->buffer len += snprintf(fnic_dbgfs_prt->buffer
+ len, (fnic_fc_trace_max_pages + len, max_size - len,
* PAGE_SIZE * 3) - len,
"\n\t\t\t\t\t\t\t\t"); "\n\t\t\t\t\t\t\t\t");
i++; i++;
} }
......
...@@ -5971,10 +5971,6 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev) ...@@ -5971,10 +5971,6 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev)
/* Save the PCI command register */ /* Save the PCI command register */
pci_read_config_word(pdev, 4, &command_register); pci_read_config_word(pdev, 4, &command_register);
/* Turn the board off. This is so that later pci_restore_state()
* won't turn the board on before the rest of config space is ready.
*/
pci_disable_device(pdev);
pci_save_state(pdev); pci_save_state(pdev);
/* find the first memory BAR, so we can find the cfg table */ /* find the first memory BAR, so we can find the cfg table */
...@@ -6022,11 +6018,6 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev) ...@@ -6022,11 +6018,6 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev)
goto unmap_cfgtable; goto unmap_cfgtable;
pci_restore_state(pdev); pci_restore_state(pdev);
rc = pci_enable_device(pdev);
if (rc) {
dev_warn(&pdev->dev, "failed to enable device.\n");
goto unmap_cfgtable;
}
pci_write_config_word(pdev, 4, command_register); pci_write_config_word(pdev, 4, command_register);
/* Some devices (notably the HP Smart Array 5i Controller) /* Some devices (notably the HP Smart Array 5i Controller)
...@@ -6159,26 +6150,22 @@ static void hpsa_interrupt_mode(struct ctlr_info *h) ...@@ -6159,26 +6150,22 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
h->msix_vector = MAX_REPLY_QUEUES; h->msix_vector = MAX_REPLY_QUEUES;
if (h->msix_vector > num_online_cpus()) if (h->msix_vector > num_online_cpus())
h->msix_vector = num_online_cpus(); h->msix_vector = num_online_cpus();
err = pci_enable_msix(h->pdev, hpsa_msix_entries, err = pci_enable_msix_range(h->pdev, hpsa_msix_entries,
h->msix_vector); 1, h->msix_vector);
if (err > 0) { if (err < 0) {
dev_warn(&h->pdev->dev, "MSI-X init failed %d\n", err);
h->msix_vector = 0;
goto single_msi_mode;
} else if (err < h->msix_vector) {
dev_warn(&h->pdev->dev, "only %d MSI-X vectors " dev_warn(&h->pdev->dev, "only %d MSI-X vectors "
"available\n", err); "available\n", err);
h->msix_vector = err;
err = pci_enable_msix(h->pdev, hpsa_msix_entries,
h->msix_vector);
}
if (!err) {
for (i = 0; i < h->msix_vector; i++)
h->intr[i] = hpsa_msix_entries[i].vector;
return;
} else {
dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
err);
h->msix_vector = 0;
goto default_int_mode;
} }
h->msix_vector = err;
for (i = 0; i < h->msix_vector; i++)
h->intr[i] = hpsa_msix_entries[i].vector;
return;
} }
single_msi_mode:
if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) { if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
dev_info(&h->pdev->dev, "MSI\n"); dev_info(&h->pdev->dev, "MSI\n");
if (!pci_enable_msi(h->pdev)) if (!pci_enable_msi(h->pdev))
...@@ -6541,6 +6528,23 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev) ...@@ -6541,6 +6528,23 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
if (!reset_devices) if (!reset_devices)
return 0; return 0;
/* kdump kernel is loading, we don't know in which state is
* the pci interface. The dev->enable_cnt is equal zero
* so we call enable+disable, wait a while and switch it on.
*/
rc = pci_enable_device(pdev);
if (rc) {
dev_warn(&pdev->dev, "Failed to enable PCI device\n");
return -ENODEV;
}
pci_disable_device(pdev);
msleep(260); /* a randomly chosen number */
rc = pci_enable_device(pdev);
if (rc) {
dev_warn(&pdev->dev, "failed to enable device.\n");
return -ENODEV;
}
pci_set_master(pdev);
/* Reset the controller with a PCI power-cycle or via doorbell */ /* Reset the controller with a PCI power-cycle or via doorbell */
rc = hpsa_kdump_hard_reset_controller(pdev); rc = hpsa_kdump_hard_reset_controller(pdev);
...@@ -6549,10 +6553,11 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev) ...@@ -6549,10 +6553,11 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
* "performant mode". Or, it might be 640x, which can't reset * "performant mode". Or, it might be 640x, which can't reset
* due to concerns about shared bbwc between 6402/6404 pair. * due to concerns about shared bbwc between 6402/6404 pair.
*/ */
if (rc == -ENOTSUPP) if (rc) {
return rc; /* just try to do the kdump anyhow. */ if (rc != -ENOTSUPP) /* just try to do the kdump anyhow. */
if (rc) rc = -ENODEV;
return -ENODEV; goto out_disable;
}
/* Now try to get the controller to respond to a no-op */ /* Now try to get the controller to respond to a no-op */
dev_warn(&pdev->dev, "Waiting for controller to respond to no-op\n"); dev_warn(&pdev->dev, "Waiting for controller to respond to no-op\n");
...@@ -6563,7 +6568,11 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev) ...@@ -6563,7 +6568,11 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
dev_warn(&pdev->dev, "no-op failed%s\n", dev_warn(&pdev->dev, "no-op failed%s\n",
(i < 11 ? "; re-trying" : "")); (i < 11 ? "; re-trying" : ""));
} }
return 0;
out_disable:
pci_disable_device(pdev);
return rc;
} }
static int hpsa_allocate_cmd_pool(struct ctlr_info *h) static int hpsa_allocate_cmd_pool(struct ctlr_info *h)
...@@ -6743,6 +6752,7 @@ static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h) ...@@ -6743,6 +6752,7 @@ static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h)
iounmap(h->transtable); iounmap(h->transtable);
if (h->cfgtable) if (h->cfgtable)
iounmap(h->cfgtable); iounmap(h->cfgtable);
pci_disable_device(h->pdev);
pci_release_regions(h->pdev); pci_release_regions(h->pdev);
kfree(h); kfree(h);
} }
......
...@@ -2440,6 +2440,7 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg, ...@@ -2440,6 +2440,7 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
{ {
u32 ioasc; u32 ioasc;
int error_index; int error_index;
struct ipr_hostrcb_type_21_error *error;
if (hostrcb->hcam.notify_type != IPR_HOST_RCB_NOTIF_TYPE_ERROR_LOG_ENTRY) if (hostrcb->hcam.notify_type != IPR_HOST_RCB_NOTIF_TYPE_ERROR_LOG_ENTRY)
return; return;
...@@ -2464,6 +2465,15 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg, ...@@ -2464,6 +2465,15 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
if (!ipr_error_table[error_index].log_hcam) if (!ipr_error_table[error_index].log_hcam)
return; return;
if (ioasc == IPR_IOASC_HW_CMD_FAILED &&
hostrcb->hcam.overlay_id == IPR_HOST_RCB_OVERLAY_ID_21) {
error = &hostrcb->hcam.u.error64.u.type_21_error;
if (((be32_to_cpu(error->sense_data[0]) & 0x0000ff00) >> 8) == ILLEGAL_REQUEST &&
ioa_cfg->log_level <= IPR_DEFAULT_LOG_LEVEL)
return;
}
ipr_hcam_err(hostrcb, "%s\n", ipr_error_table[error_index].error); ipr_hcam_err(hostrcb, "%s\n", ipr_error_table[error_index].error);
/* Set indication we have logged an error */ /* Set indication we have logged an error */
......
...@@ -130,6 +130,7 @@ ...@@ -130,6 +130,7 @@
#define IPR_IOASC_HW_DEV_BUS_STATUS 0x04448500 #define IPR_IOASC_HW_DEV_BUS_STATUS 0x04448500
#define IPR_IOASC_IOASC_MASK 0xFFFFFF00 #define IPR_IOASC_IOASC_MASK 0xFFFFFF00
#define IPR_IOASC_SCSI_STATUS_MASK 0x000000FF #define IPR_IOASC_SCSI_STATUS_MASK 0x000000FF
#define IPR_IOASC_HW_CMD_FAILED 0x046E0000
#define IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT 0x05240000 #define IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT 0x05240000
#define IPR_IOASC_IR_RESOURCE_HANDLE 0x05250000 #define IPR_IOASC_IR_RESOURCE_HANDLE 0x05250000
#define IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA 0x05258100 #define IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA 0x05258100
......
...@@ -726,13 +726,18 @@ static int iscsi_sw_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn, ...@@ -726,13 +726,18 @@ static int iscsi_sw_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn,
switch(param) { switch(param) {
case ISCSI_PARAM_CONN_PORT: case ISCSI_PARAM_CONN_PORT:
case ISCSI_PARAM_CONN_ADDRESS: case ISCSI_PARAM_CONN_ADDRESS:
case ISCSI_PARAM_LOCAL_PORT:
spin_lock_bh(&conn->session->frwd_lock); spin_lock_bh(&conn->session->frwd_lock);
if (!tcp_sw_conn || !tcp_sw_conn->sock) { if (!tcp_sw_conn || !tcp_sw_conn->sock) {
spin_unlock_bh(&conn->session->frwd_lock); spin_unlock_bh(&conn->session->frwd_lock);
return -ENOTCONN; return -ENOTCONN;
} }
rc = kernel_getpeername(tcp_sw_conn->sock, if (param == ISCSI_PARAM_LOCAL_PORT)
(struct sockaddr *)&addr, &len); rc = kernel_getsockname(tcp_sw_conn->sock,
(struct sockaddr *)&addr, &len);
else
rc = kernel_getpeername(tcp_sw_conn->sock,
(struct sockaddr *)&addr, &len);
spin_unlock_bh(&conn->session->frwd_lock); spin_unlock_bh(&conn->session->frwd_lock);
if (rc) if (rc)
return rc; return rc;
...@@ -895,6 +900,7 @@ static umode_t iscsi_sw_tcp_attr_is_visible(int param_type, int param) ...@@ -895,6 +900,7 @@ static umode_t iscsi_sw_tcp_attr_is_visible(int param_type, int param)
case ISCSI_PARAM_DATADGST_EN: case ISCSI_PARAM_DATADGST_EN:
case ISCSI_PARAM_CONN_ADDRESS: case ISCSI_PARAM_CONN_ADDRESS:
case ISCSI_PARAM_CONN_PORT: case ISCSI_PARAM_CONN_PORT:
case ISCSI_PARAM_LOCAL_PORT:
case ISCSI_PARAM_EXP_STATSN: case ISCSI_PARAM_EXP_STATSN:
case ISCSI_PARAM_PERSISTENT_ADDRESS: case ISCSI_PARAM_PERSISTENT_ADDRESS:
case ISCSI_PARAM_PERSISTENT_PORT: case ISCSI_PARAM_PERSISTENT_PORT:
......
...@@ -296,9 +296,9 @@ void fc_fc4_deregister_provider(enum fc_fh_type type, struct fc4_prov *prov) ...@@ -296,9 +296,9 @@ void fc_fc4_deregister_provider(enum fc_fh_type type, struct fc4_prov *prov)
BUG_ON(type >= FC_FC4_PROV_SIZE); BUG_ON(type >= FC_FC4_PROV_SIZE);
mutex_lock(&fc_prov_mutex); mutex_lock(&fc_prov_mutex);
if (prov->recv) if (prov->recv)
rcu_assign_pointer(fc_passive_prov[type], NULL); RCU_INIT_POINTER(fc_passive_prov[type], NULL);
else else
rcu_assign_pointer(fc_active_prov[type], NULL); RCU_INIT_POINTER(fc_active_prov[type], NULL);
mutex_unlock(&fc_prov_mutex); mutex_unlock(&fc_prov_mutex);
synchronize_rcu(); synchronize_rcu();
} }
......
...@@ -3505,6 +3505,7 @@ int iscsi_conn_get_addr_param(struct sockaddr_storage *addr, ...@@ -3505,6 +3505,7 @@ int iscsi_conn_get_addr_param(struct sockaddr_storage *addr,
len = sprintf(buf, "%pI6\n", &sin6->sin6_addr); len = sprintf(buf, "%pI6\n", &sin6->sin6_addr);
break; break;
case ISCSI_PARAM_CONN_PORT: case ISCSI_PARAM_CONN_PORT:
case ISCSI_PARAM_LOCAL_PORT:
if (sin) if (sin)
len = sprintf(buf, "%hu\n", be16_to_cpu(sin->sin_port)); len = sprintf(buf, "%hu\n", be16_to_cpu(sin->sin_port));
else else
......
...@@ -3385,7 +3385,7 @@ lpfc_stat_data_ctrl_store(struct device *dev, struct device_attribute *attr, ...@@ -3385,7 +3385,7 @@ lpfc_stat_data_ctrl_store(struct device *dev, struct device_attribute *attr,
if (strlen(buf) > (LPFC_MAX_DATA_CTRL_LEN - 1)) if (strlen(buf) > (LPFC_MAX_DATA_CTRL_LEN - 1))
return -EINVAL; return -EINVAL;
strcpy(bucket_data, buf); strncpy(bucket_data, buf, LPFC_MAX_DATA_CTRL_LEN);
str_ptr = &bucket_data[0]; str_ptr = &bucket_data[0];
/* Ignore this token - this is command token */ /* Ignore this token - this is command token */
token = strsep(&str_ptr, "\t "); token = strsep(&str_ptr, "\t ");
......
...@@ -656,7 +656,6 @@ lpfc_bsg_rport_els(struct fc_bsg_job *job) ...@@ -656,7 +656,6 @@ lpfc_bsg_rport_els(struct fc_bsg_job *job)
struct lpfc_nodelist *ndlp = rdata->pnode; struct lpfc_nodelist *ndlp = rdata->pnode;
uint32_t elscmd; uint32_t elscmd;
uint32_t cmdsize; uint32_t cmdsize;
uint32_t rspsize;
struct lpfc_iocbq *cmdiocbq; struct lpfc_iocbq *cmdiocbq;
uint16_t rpi = 0; uint16_t rpi = 0;
struct bsg_job_data *dd_data; struct bsg_job_data *dd_data;
...@@ -687,7 +686,6 @@ lpfc_bsg_rport_els(struct fc_bsg_job *job) ...@@ -687,7 +686,6 @@ lpfc_bsg_rport_els(struct fc_bsg_job *job)
elscmd = job->request->rqst_data.r_els.els_code; elscmd = job->request->rqst_data.r_els.els_code;
cmdsize = job->request_payload.payload_len; cmdsize = job->request_payload.payload_len;
rspsize = job->reply_payload.payload_len;
if (!lpfc_nlp_get(ndlp)) { if (!lpfc_nlp_get(ndlp)) {
rc = -ENODEV; rc = -ENODEV;
...@@ -2251,7 +2249,6 @@ lpfc_sli4_bsg_diag_mode_end(struct fc_bsg_job *job) ...@@ -2251,7 +2249,6 @@ lpfc_sli4_bsg_diag_mode_end(struct fc_bsg_job *job)
i = 0; i = 0;
while (phba->link_state != LPFC_LINK_DOWN) { while (phba->link_state != LPFC_LINK_DOWN) {
if (i++ > timeout) { if (i++ > timeout) {
rc = -ETIMEDOUT;
lpfc_printf_log(phba, KERN_INFO, LOG_LIBDFC, lpfc_printf_log(phba, KERN_INFO, LOG_LIBDFC,
"3140 Timeout waiting for link to " "3140 Timeout waiting for link to "
"diagnostic mode_end, timeout:%d ms\n", "diagnostic mode_end, timeout:%d ms\n",
...@@ -2291,7 +2288,6 @@ lpfc_sli4_bsg_link_diag_test(struct fc_bsg_job *job) ...@@ -2291,7 +2288,6 @@ lpfc_sli4_bsg_link_diag_test(struct fc_bsg_job *job)
LPFC_MBOXQ_t *pmboxq; LPFC_MBOXQ_t *pmboxq;
struct sli4_link_diag *link_diag_test_cmd; struct sli4_link_diag *link_diag_test_cmd;
uint32_t req_len, alloc_len; uint32_t req_len, alloc_len;
uint32_t timeout;
struct lpfc_mbx_run_link_diag_test *run_link_diag_test; struct lpfc_mbx_run_link_diag_test *run_link_diag_test;
union lpfc_sli4_cfg_shdr *shdr; union lpfc_sli4_cfg_shdr *shdr;
uint32_t shdr_status, shdr_add_status; uint32_t shdr_status, shdr_add_status;
...@@ -2342,7 +2338,6 @@ lpfc_sli4_bsg_link_diag_test(struct fc_bsg_job *job) ...@@ -2342,7 +2338,6 @@ lpfc_sli4_bsg_link_diag_test(struct fc_bsg_job *job)
link_diag_test_cmd = (struct sli4_link_diag *) link_diag_test_cmd = (struct sli4_link_diag *)
job->request->rqst_data.h_vendor.vendor_cmd; job->request->rqst_data.h_vendor.vendor_cmd;
timeout = link_diag_test_cmd->timeout * 100;
rc = lpfc_sli4_bsg_set_link_diag_state(phba, 1); rc = lpfc_sli4_bsg_set_link_diag_state(phba, 1);
...@@ -2693,14 +2688,13 @@ lpfc_bsg_dma_page_alloc(struct lpfc_hba *phba) ...@@ -2693,14 +2688,13 @@ lpfc_bsg_dma_page_alloc(struct lpfc_hba *phba)
INIT_LIST_HEAD(&dmabuf->list); INIT_LIST_HEAD(&dmabuf->list);
/* now, allocate dma buffer */ /* now, allocate dma buffer */
dmabuf->virt = dma_alloc_coherent(&pcidev->dev, BSG_MBOX_SIZE, dmabuf->virt = dma_zalloc_coherent(&pcidev->dev, BSG_MBOX_SIZE,
&(dmabuf->phys), GFP_KERNEL); &(dmabuf->phys), GFP_KERNEL);
if (!dmabuf->virt) { if (!dmabuf->virt) {
kfree(dmabuf); kfree(dmabuf);
return NULL; return NULL;
} }
memset((uint8_t *)dmabuf->virt, 0, BSG_MBOX_SIZE);
return dmabuf; return dmabuf;
} }
...@@ -2828,8 +2822,10 @@ diag_cmd_data_alloc(struct lpfc_hba *phba, ...@@ -2828,8 +2822,10 @@ diag_cmd_data_alloc(struct lpfc_hba *phba,
size -= cnt; size -= cnt;
} }
mlist->flag = i; if (mlist) {
return mlist; mlist->flag = i;
return mlist;
}
out: out:
diag_cmd_data_free(phba, mlist); diag_cmd_data_free(phba, mlist);
return NULL; return NULL;
...@@ -3344,7 +3340,7 @@ lpfc_bsg_get_dfc_rev(struct fc_bsg_job *job) ...@@ -3344,7 +3340,7 @@ lpfc_bsg_get_dfc_rev(struct fc_bsg_job *job)
* will wake up thread waiting on the wait queue pointed by context1 * will wake up thread waiting on the wait queue pointed by context1
* of the mailbox. * of the mailbox.
**/ **/
void static void
lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
{ {
struct bsg_job_data *dd_data; struct bsg_job_data *dd_data;
...@@ -4593,7 +4589,7 @@ lpfc_bsg_handle_sli_cfg_ext(struct lpfc_hba *phba, struct fc_bsg_job *job, ...@@ -4593,7 +4589,7 @@ lpfc_bsg_handle_sli_cfg_ext(struct lpfc_hba *phba, struct fc_bsg_job *job,
* being reset) and com-plete the job, otherwise issue the mailbox command and * being reset) and com-plete the job, otherwise issue the mailbox command and
* let our completion handler finish the command. * let our completion handler finish the command.
**/ **/
static uint32_t static int
lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job, lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job,
struct lpfc_vport *vport) struct lpfc_vport *vport)
{ {
......
...@@ -451,7 +451,6 @@ int lpfc_send_rrq(struct lpfc_hba *, struct lpfc_node_rrq *); ...@@ -451,7 +451,6 @@ int lpfc_send_rrq(struct lpfc_hba *, struct lpfc_node_rrq *);
int lpfc_set_rrq_active(struct lpfc_hba *, struct lpfc_nodelist *, int lpfc_set_rrq_active(struct lpfc_hba *, struct lpfc_nodelist *,
uint16_t, uint16_t, uint16_t); uint16_t, uint16_t, uint16_t);
uint16_t lpfc_sli4_xri_inrange(struct lpfc_hba *, uint16_t); uint16_t lpfc_sli4_xri_inrange(struct lpfc_hba *, uint16_t);
void lpfc_cleanup_wt_rrqs(struct lpfc_hba *);
void lpfc_cleanup_vports_rrqs(struct lpfc_vport *, struct lpfc_nodelist *); void lpfc_cleanup_vports_rrqs(struct lpfc_vport *, struct lpfc_nodelist *);
struct lpfc_node_rrq *lpfc_get_active_rrq(struct lpfc_vport *, uint16_t, struct lpfc_node_rrq *lpfc_get_active_rrq(struct lpfc_vport *, uint16_t,
uint32_t); uint32_t);
......
...@@ -1439,7 +1439,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode) ...@@ -1439,7 +1439,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
/* #2 HBA attribute entry */ /* #2 HBA attribute entry */
ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size); ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size);
ae->ad.bits.AttrType = be16_to_cpu(MANUFACTURER); ae->ad.bits.AttrType = be16_to_cpu(MANUFACTURER);
strcpy(ae->un.Manufacturer, "Emulex Corporation"); strncpy(ae->un.Manufacturer, "Emulex Corporation", 64);
len = strlen(ae->un.Manufacturer); len = strlen(ae->un.Manufacturer);
len += (len & 3) ? (4 - (len & 3)) : 4; len += (len & 3) ? (4 - (len & 3)) : 4;
ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len); ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len);
...@@ -1449,7 +1449,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode) ...@@ -1449,7 +1449,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
/* #3 HBA attribute entry */ /* #3 HBA attribute entry */
ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size); ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size);
ae->ad.bits.AttrType = be16_to_cpu(SERIAL_NUMBER); ae->ad.bits.AttrType = be16_to_cpu(SERIAL_NUMBER);
strcpy(ae->un.SerialNumber, phba->SerialNumber); strncpy(ae->un.SerialNumber, phba->SerialNumber, 64);
len = strlen(ae->un.SerialNumber); len = strlen(ae->un.SerialNumber);
len += (len & 3) ? (4 - (len & 3)) : 4; len += (len & 3) ? (4 - (len & 3)) : 4;
ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len); ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len);
...@@ -1459,7 +1459,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode) ...@@ -1459,7 +1459,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
/* #4 HBA attribute entry */ /* #4 HBA attribute entry */
ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size); ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size);
ae->ad.bits.AttrType = be16_to_cpu(MODEL); ae->ad.bits.AttrType = be16_to_cpu(MODEL);
strcpy(ae->un.Model, phba->ModelName); strncpy(ae->un.Model, phba->ModelName, 256);
len = strlen(ae->un.Model); len = strlen(ae->un.Model);
len += (len & 3) ? (4 - (len & 3)) : 4; len += (len & 3) ? (4 - (len & 3)) : 4;
ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len); ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len);
...@@ -1469,7 +1469,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode) ...@@ -1469,7 +1469,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
/* #5 HBA attribute entry */ /* #5 HBA attribute entry */
ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size); ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size);
ae->ad.bits.AttrType = be16_to_cpu(MODEL_DESCRIPTION); ae->ad.bits.AttrType = be16_to_cpu(MODEL_DESCRIPTION);
strcpy(ae->un.ModelDescription, phba->ModelDesc); strncpy(ae->un.ModelDescription, phba->ModelDesc, 256);
len = strlen(ae->un.ModelDescription); len = strlen(ae->un.ModelDescription);
len += (len & 3) ? (4 - (len & 3)) : 4; len += (len & 3) ? (4 - (len & 3)) : 4;
ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len); ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len);
...@@ -1500,7 +1500,8 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode) ...@@ -1500,7 +1500,8 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
/* #7 HBA attribute entry */ /* #7 HBA attribute entry */
ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size); ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size);
ae->ad.bits.AttrType = be16_to_cpu(DRIVER_VERSION); ae->ad.bits.AttrType = be16_to_cpu(DRIVER_VERSION);
strcpy(ae->un.DriverVersion, lpfc_release_version); strncpy(ae->un.DriverVersion,
lpfc_release_version, 256);
len = strlen(ae->un.DriverVersion); len = strlen(ae->un.DriverVersion);
len += (len & 3) ? (4 - (len & 3)) : 4; len += (len & 3) ? (4 - (len & 3)) : 4;
ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len); ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len);
...@@ -1510,7 +1511,8 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode) ...@@ -1510,7 +1511,8 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
/* #8 HBA attribute entry */ /* #8 HBA attribute entry */
ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size); ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) rh + size);
ae->ad.bits.AttrType = be16_to_cpu(OPTION_ROM_VERSION); ae->ad.bits.AttrType = be16_to_cpu(OPTION_ROM_VERSION);
strcpy(ae->un.OptionROMVersion, phba->OptionROMVersion); strncpy(ae->un.OptionROMVersion,
phba->OptionROMVersion, 256);
len = strlen(ae->un.OptionROMVersion); len = strlen(ae->un.OptionROMVersion);
len += (len & 3) ? (4 - (len & 3)) : 4; len += (len & 3) ? (4 - (len & 3)) : 4;
ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len); ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + len);
......
...@@ -269,7 +269,7 @@ static int ...@@ -269,7 +269,7 @@ static int
lpfc_debugfs_hbqinfo_data(struct lpfc_hba *phba, char *buf, int size) lpfc_debugfs_hbqinfo_data(struct lpfc_hba *phba, char *buf, int size)
{ {
int len = 0; int len = 0;
int cnt, i, j, found, posted, low; int i, j, found, posted, low;
uint32_t phys, raw_index, getidx; uint32_t phys, raw_index, getidx;
struct lpfc_hbq_init *hip; struct lpfc_hbq_init *hip;
struct hbq_s *hbqs; struct hbq_s *hbqs;
...@@ -279,7 +279,7 @@ lpfc_debugfs_hbqinfo_data(struct lpfc_hba *phba, char *buf, int size) ...@@ -279,7 +279,7 @@ lpfc_debugfs_hbqinfo_data(struct lpfc_hba *phba, char *buf, int size)
if (phba->sli_rev != 3) if (phba->sli_rev != 3)
return 0; return 0;
cnt = LPFC_HBQINFO_SIZE;
spin_lock_irq(&phba->hbalock); spin_lock_irq(&phba->hbalock);
/* toggle between multiple hbqs, if any */ /* toggle between multiple hbqs, if any */
......
...@@ -78,7 +78,8 @@ struct lpfc_nodelist { ...@@ -78,7 +78,8 @@ struct lpfc_nodelist {
struct list_head nlp_listp; struct list_head nlp_listp;
struct lpfc_name nlp_portname; struct lpfc_name nlp_portname;
struct lpfc_name nlp_nodename; struct lpfc_name nlp_nodename;
uint32_t nlp_flag; /* entry flags */ uint32_t nlp_flag; /* entry flags */
uint32_t nlp_add_flag; /* additional flags */
uint32_t nlp_DID; /* FC D_ID of entry */ uint32_t nlp_DID; /* FC D_ID of entry */
uint32_t nlp_last_elscmd; /* Last ELS cmd sent */ uint32_t nlp_last_elscmd; /* Last ELS cmd sent */
uint16_t nlp_type; uint16_t nlp_type;
...@@ -157,6 +158,9 @@ struct lpfc_node_rrq { ...@@ -157,6 +158,9 @@ struct lpfc_node_rrq {
#define NLP_FIRSTBURST 0x40000000 /* Target supports FirstBurst */ #define NLP_FIRSTBURST 0x40000000 /* Target supports FirstBurst */
#define NLP_RPI_REGISTERED 0x80000000 /* nlp_rpi is valid */ #define NLP_RPI_REGISTERED 0x80000000 /* nlp_rpi is valid */
/* Defines for nlp_add_flag (uint32) */
#define NLP_IN_DEV_LOSS 0x00000001 /* Dev Loss processing in progress */
/* ndlp usage management macros */ /* ndlp usage management macros */
#define NLP_CHK_NODE_ACT(ndlp) (((ndlp)->nlp_usg_map \ #define NLP_CHK_NODE_ACT(ndlp) (((ndlp)->nlp_usg_map \
& NLP_USG_NODE_ACT_BIT) \ & NLP_USG_NODE_ACT_BIT) \
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -1811,12 +1811,12 @@ lpfc_sli4_config(struct lpfc_hba *phba, struct lpfcMboxq *mbox, ...@@ -1811,12 +1811,12 @@ lpfc_sli4_config(struct lpfc_hba *phba, struct lpfcMboxq *mbox,
* page, this is used as a priori size of SLI4_PAGE_SIZE for * page, this is used as a priori size of SLI4_PAGE_SIZE for
* the later DMA memory free. * the later DMA memory free.
*/ */
viraddr = dma_alloc_coherent(&phba->pcidev->dev, SLI4_PAGE_SIZE, viraddr = dma_zalloc_coherent(&phba->pcidev->dev,
&phyaddr, GFP_KERNEL); SLI4_PAGE_SIZE, &phyaddr,
GFP_KERNEL);
/* In case of malloc fails, proceed with whatever we have */ /* In case of malloc fails, proceed with whatever we have */
if (!viraddr) if (!viraddr)
break; break;
memset(viraddr, 0, SLI4_PAGE_SIZE);
mbox->sge_array->addr[pagen] = viraddr; mbox->sge_array->addr[pagen] = viraddr;
/* Keep the first page for later sub-header construction */ /* Keep the first page for later sub-header construction */
if (pagen == 0) if (pagen == 0)
......
...@@ -1031,6 +1031,8 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, ...@@ -1031,6 +1031,8 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; pcmd = (struct lpfc_dmabuf *) cmdiocb->context2;
prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list); prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
if (!prsp)
goto out;
lp = (uint32_t *) prsp->virt; lp = (uint32_t *) prsp->virt;
sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t));
......
此差异已折叠。
此差异已折叠。
...@@ -79,6 +79,7 @@ struct lpfc_iocbq { ...@@ -79,6 +79,7 @@ struct lpfc_iocbq {
#define LPFC_FIP_ELS_ID_SHIFT 14 #define LPFC_FIP_ELS_ID_SHIFT 14
#define LPFC_IO_OAS 0x10000 /* OAS FCP IO */ #define LPFC_IO_OAS 0x10000 /* OAS FCP IO */
#define LPFC_IO_FOF 0x20000 /* FOF FCP IO */
uint32_t drvrTimeout; /* driver timeout in seconds */ uint32_t drvrTimeout; /* driver timeout in seconds */
uint32_t fcp_wqidx; /* index to FCP work queue */ uint32_t fcp_wqidx; /* index to FCP work queue */
......
...@@ -670,22 +670,22 @@ void lpfc_sli4_hba_reset(struct lpfc_hba *); ...@@ -670,22 +670,22 @@ void lpfc_sli4_hba_reset(struct lpfc_hba *);
struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t, struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t,
uint32_t); uint32_t);
void lpfc_sli4_queue_free(struct lpfc_queue *); void lpfc_sli4_queue_free(struct lpfc_queue *);
uint32_t lpfc_eq_create(struct lpfc_hba *, struct lpfc_queue *, uint32_t); int lpfc_eq_create(struct lpfc_hba *, struct lpfc_queue *, uint32_t);
uint32_t lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint16_t); int lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint16_t);
uint32_t lpfc_cq_create(struct lpfc_hba *, struct lpfc_queue *, int lpfc_cq_create(struct lpfc_hba *, struct lpfc_queue *,
struct lpfc_queue *, uint32_t, uint32_t); struct lpfc_queue *, uint32_t, uint32_t);
int32_t lpfc_mq_create(struct lpfc_hba *, struct lpfc_queue *, int32_t lpfc_mq_create(struct lpfc_hba *, struct lpfc_queue *,
struct lpfc_queue *, uint32_t); struct lpfc_queue *, uint32_t);
uint32_t lpfc_wq_create(struct lpfc_hba *, struct lpfc_queue *, int lpfc_wq_create(struct lpfc_hba *, struct lpfc_queue *,
struct lpfc_queue *, uint32_t); struct lpfc_queue *, uint32_t);
uint32_t lpfc_rq_create(struct lpfc_hba *, struct lpfc_queue *, int lpfc_rq_create(struct lpfc_hba *, struct lpfc_queue *,
struct lpfc_queue *, struct lpfc_queue *, uint32_t); struct lpfc_queue *, struct lpfc_queue *, uint32_t);
void lpfc_rq_adjust_repost(struct lpfc_hba *, struct lpfc_queue *, int); void lpfc_rq_adjust_repost(struct lpfc_hba *, struct lpfc_queue *, int);
uint32_t lpfc_eq_destroy(struct lpfc_hba *, struct lpfc_queue *); int lpfc_eq_destroy(struct lpfc_hba *, struct lpfc_queue *);
uint32_t lpfc_cq_destroy(struct lpfc_hba *, struct lpfc_queue *); int lpfc_cq_destroy(struct lpfc_hba *, struct lpfc_queue *);
uint32_t lpfc_mq_destroy(struct lpfc_hba *, struct lpfc_queue *); int lpfc_mq_destroy(struct lpfc_hba *, struct lpfc_queue *);
uint32_t lpfc_wq_destroy(struct lpfc_hba *, struct lpfc_queue *); int lpfc_wq_destroy(struct lpfc_hba *, struct lpfc_queue *);
uint32_t lpfc_rq_destroy(struct lpfc_hba *, struct lpfc_queue *, int lpfc_rq_destroy(struct lpfc_hba *, struct lpfc_queue *,
struct lpfc_queue *); struct lpfc_queue *);
int lpfc_sli4_queue_setup(struct lpfc_hba *); int lpfc_sli4_queue_setup(struct lpfc_hba *);
void lpfc_sli4_queue_unset(struct lpfc_hba *); void lpfc_sli4_queue_unset(struct lpfc_hba *);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* included with this package. * * included with this package. *
*******************************************************************/ *******************************************************************/
#define LPFC_DRIVER_VERSION "10.2.8001.0." #define LPFC_DRIVER_VERSION "10.4.8000.0."
#define LPFC_DRIVER_NAME "lpfc" #define LPFC_DRIVER_NAME "lpfc"
/* Used for SLI 2/3 */ /* Used for SLI 2/3 */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Kernel configuration file for the MPT2SAS # Kernel configuration file for the MPT2SAS
# #
# This code is based on drivers/scsi/mpt2sas/Kconfig # This code is based on drivers/scsi/mpt2sas/Kconfig
# Copyright (C) 2007-2012 LSI Corporation # Copyright (C) 2007-2014 LSI Corporation
# (mailto:DL-MPTFusionLinux@lsi.com) # (mailto:DL-MPTFusionLinux@lsi.com)
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
......
此差异已折叠。
此差异已折叠。
/* /*
* Copyright (c) 2000-2013 LSI Corporation. * Copyright (c) 2000-2014 LSI Corporation.
* *
* *
* Name: mpi2_sas.h * Name: mpi2_sas.h
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册