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

Pull SCSI updates from James Bottomley:
 "Usual driver updates (ufs, lpfc, fnic, target, mpi3mr).

  The substantive core changes are adding a 'serial' sysfs attribute and
  getting sd to support > PAGE_SIZE sectors"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (98 commits)
  scsi: target: Don't validate ignored fields in PROUT PREEMPT
  scsi: qla2xxx: Use nr_cpu_ids instead of NR_CPUS for qp_cpu_map allocation
  scsi: ufs: core: Disable timestamp for Kioxia THGJFJT0E25BAIP
  scsi: mpi3mr: Fix typo
  scsi: sd: fix missing put_disk() when device_add(&disk_dev) fails
  scsi: libsas: Delete unused to_dom_device() and to_dev_attr()
  scsi: storvsc: Handle PERSISTENT_RESERVE_IN truncation for Hyper-V vFC
  scsi: iscsi_tcp: Remove unneeded selections of CRYPTO and CRYPTO_MD5
  scsi: lpfc: Update lpfc version to 15.0.0.0
  scsi: lpfc: Add PCI ID support for LPe42100 series adapters
  scsi: lpfc: Introduce 128G link speed selection and support
  scsi: lpfc: Check ASIC_ID register to aid diagnostics during failed fw updates
  scsi: lpfc: Update construction of SGL when XPSGL is enabled
  scsi: lpfc: Remove deprecated PBDE feature
  scsi: lpfc: Add REG_VFI mailbox cmd error handling
  scsi: lpfc: Log MCQE contents for mbox commands with no context
  scsi: lpfc: Select mailbox rq_create cmd version based on SLI4 if_type
  scsi: lpfc: Break out of IRQ affinity assignment when mask reaches nr_cpu_ids
  scsi: ufs: core: Make the header files self-contained
  scsi: ufs: core: Remove an include directive from ufshcd-crypto.h
  ...
This commit is contained in:
Linus Torvalds
2026-04-21 08:22:18 -07:00
101 changed files with 4075 additions and 821 deletions
@@ -1768,3 +1768,26 @@ Description:
==================== ===========================
The attribute is read only.
What: /sys/bus/platform/drivers/ufshcd/*/dme_qos_notification
What: /sys/bus/platform/devices/*.ufs/dme_qos_notification
Date: March 2026
Contact: Can Guo <can.guo@oss.qualcomm.com>
Description:
This attribute reports and clears pending DME (Device Management
Entity) Quality of Service (QoS) notifications. This attribute
is a bitfield with the following bit assignments:
Bit Description
=== ======================================
0 DME QoS Monitor has been reset by host
1 QoS from TX is detected
2 QoS from RX is detected
3 QoS from PA_INIT is detected
Reading this attribute returns the pending DME QoS notification
bits. Writing '0' to this attribute clears pending DME QoS
notification bits. Writing any non-zero value is invalid and
will be rejected.
The attribute is read/write.
@@ -15,6 +15,7 @@ select:
compatible:
contains:
enum:
- qcom,milos-ufshc
- qcom,msm8998-ufshc
- qcom,qcs8300-ufshc
- qcom,sa8775p-ufshc
@@ -31,21 +32,28 @@ select:
properties:
compatible:
items:
- enum:
- qcom,msm8998-ufshc
- qcom,qcs8300-ufshc
- qcom,sa8775p-ufshc
- qcom,sc7180-ufshc
- qcom,sc7280-ufshc
- qcom,sc8180x-ufshc
- qcom,sc8280xp-ufshc
- qcom,sm8250-ufshc
- qcom,sm8350-ufshc
- qcom,sm8450-ufshc
- qcom,sm8550-ufshc
- const: qcom,ufshc
- const: jedec,ufs-2.0
oneOf:
- items:
- enum:
- qcom,x1e80100-ufshc
- const: qcom,sm8550-ufshc
- const: qcom,ufshc
- items:
- enum:
- qcom,milos-ufshc
- qcom,msm8998-ufshc
- qcom,qcs8300-ufshc
- qcom,sa8775p-ufshc
- qcom,sc7180-ufshc
- qcom,sc7280-ufshc
- qcom,sc8180x-ufshc
- qcom,sc8280xp-ufshc
- qcom,sm8250-ufshc
- qcom,sm8350-ufshc
- qcom,sm8450-ufshc
- qcom,sm8550-ufshc
- const: qcom,ufshc
- const: jedec,ufs-2.0
reg:
maxItems: 1
@@ -15,6 +15,7 @@ select:
compatible:
contains:
enum:
- qcom,eliza-ufshc
- qcom,kaanapali-ufshc
- qcom,sm8650-ufshc
- qcom,sm8750-ufshc
@@ -25,6 +26,7 @@ properties:
compatible:
items:
- enum:
- qcom,eliza-ufshc
- qcom,kaanapali-ufshc
- qcom,sm8650-ufshc
- qcom,sm8750-ufshc
@@ -66,6 +68,18 @@ required:
allOf:
- $ref: qcom,ufs-common.yaml
- if:
properties:
compatible:
contains:
enum:
- qcom,eliza-ufshc
then:
properties:
reg:
minItems: 2
reg-names:
minItems: 2
unevaluatedProperties: false
@@ -41,7 +41,7 @@ properties:
maxItems: 1
resets:
maxItems: 4
maxItems: 5
reset-names:
items:
@@ -49,6 +49,7 @@ properties:
- const: sys
- const: ufs
- const: grf
- const: mphy
reset-gpios:
maxItems: 1
@@ -98,8 +99,8 @@ examples:
interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&power RK3576_PD_USB>;
resets = <&cru SRST_A_UFS_BIU>, <&cru SRST_A_UFS_SYS>, <&cru SRST_A_UFS>,
<&cru SRST_P_UFS_GRF>;
reset-names = "biu", "sys", "ufs", "grf";
<&cru SRST_P_UFS_GRF>, <&cru SRST_MPHY_INIT>;
reset-names = "biu", "sys", "ufs", "grf", "mphy";
reset-gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_LOW>;
};
};
+1
View File
@@ -3925,6 +3925,7 @@ static const struct target_core_fabric_ops srpt_template = {
.tfc_wwn_attrs = srpt_wwn_attrs,
.tfc_tpg_attrib_attrs = srpt_tpg_attrib_attrs,
.default_compl_type = TARGET_QUEUE_COMPL,
.default_submit_type = TARGET_DIRECT_SUBMIT,
.direct_submit_supp = 1,
};
+2 -2
View File
@@ -1632,8 +1632,8 @@ common:
/*
Initialize the Host Adapter Full Model Name from the Model Name.
*/
strcpy(adapter->full_model, "BusLogic ");
strcat(adapter->full_model, adapter->model);
scnprintf(adapter->full_model, sizeof(adapter->full_model),
"BusLogic %s", adapter->model);
/*
Select an appropriate value for the Tagged Queue Depth either from a
BusLogic Driver Options specification, or based on whether this Host
+1 -2
View File
@@ -304,8 +304,6 @@ config ISCSI_TCP
tristate "iSCSI Initiator over TCP/IP"
depends on SCSI && INET
select CRC32
select CRYPTO
select CRYPTO_MD5
select SCSI_ISCSI_ATTRS
help
The iSCSI Driver provides a host with the ability to access storage
@@ -1151,6 +1149,7 @@ config SCSI_LPFC
depends on NVME_TARGET_FC || NVME_TARGET_FC=n
depends on NVME_FC || NVME_FC=n
select CRC_T10DIF
select CRC32
select IRQ_POLL
help
This lpfc driver supports the Emulex LightPulse
+1 -1
View File
@@ -82,7 +82,7 @@ extern int src_mode;
extern int dst_mode;
struct symbol;
void stop(const char *errstring, int err_code);
void __attribute__((noreturn)) stop(const char *errstring, int err_code);
void include_file(char *file_name, include_type type);
void expand_macro(struct symbol *macro_symbol);
struct instruction *seq_alloc(void);
+1 -1
View File
@@ -1104,7 +1104,7 @@ conditional:
last_scope = TAILQ_LAST(&scope_context->inner_scope,
scope_tailq);
if (last_scope == NULL
|| last_scope->type == T_ELSE) {
|| last_scope->type == (int)T_ELSE) {
stop("'else if' without leading 'if'", EX_DATAERR);
/* NOTREACHED */
+1 -1
View File
@@ -389,7 +389,7 @@ nop { return T_NOP; }
char c;
yptr = yytext;
while (c = *yptr++) {
while ((c = *yptr++)) {
/*
* Strip carriage returns.
*/
+2
View File
@@ -1612,6 +1612,7 @@ static const struct target_core_fabric_ops efct_lio_ops = {
.sess_get_initiator_sid = NULL,
.tfc_tpg_base_attrs = efct_lio_tpg_attrs,
.tfc_tpg_attrib_attrs = efct_lio_tpg_attrib_attrs,
.default_compl_type = TARGET_QUEUE_COMPL,
.default_submit_type = TARGET_DIRECT_SUBMIT,
.direct_submit_supp = 1,
};
@@ -1650,6 +1651,7 @@ static const struct target_core_fabric_ops efct_lio_npiv_ops = {
.tfc_tpg_base_attrs = efct_lio_npiv_tpg_attrs,
.tfc_tpg_attrib_attrs = efct_lio_npiv_tpg_attrib_attrs,
.default_compl_type = TARGET_QUEUE_COMPL,
.default_submit_type = TARGET_DIRECT_SUBMIT,
.direct_submit_supp = 1,
};
+3 -11
View File
@@ -101,11 +101,6 @@ static const char *translate_esas2r_event_level_to_kernel(const long level)
}
}
#pragma GCC diagnostic push
#ifndef __clang__
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
#endif
/*
* the master logging function. this function will format the message as
* outlined by the formatting string, the input device information and the
@@ -118,10 +113,9 @@ static const char *translate_esas2r_event_level_to_kernel(const long level)
*
* @return 0 on success, or -1 if an error occurred.
*/
static int esas2r_log_master(const long level,
const struct device *dev,
const char *format,
va_list args)
static __printf(3, 0)
int esas2r_log_master(const long level, const struct device *dev,
const char *format, va_list args)
{
if (level <= event_log_level) {
unsigned long flags = 0;
@@ -175,8 +169,6 @@ static int esas2r_log_master(const long level,
return 0;
}
#pragma GCC diagnostic pop
/*
* formats and logs a message to the system log.
*
+2 -2
View File
@@ -4613,7 +4613,7 @@ void fnic_fdls_disc_start(struct fnic_iport_s *iport)
if (!iport->usefip) {
if (iport->flags & FNIC_FIRST_LINK_UP) {
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
fnic_scsi_fcpio_reset(iport->fnic);
fnic_fcpio_reset(iport->fnic);
spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
iport->flags &= ~FNIC_FIRST_LINK_UP;
@@ -5072,7 +5072,7 @@ void fnic_fdls_link_down(struct fnic_iport_s *iport)
iport->fabric.flags = 0;
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
fnic_scsi_fcpio_reset(iport->fnic);
fnic_fcpio_reset(iport->fnic);
spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
list_for_each_entry_safe(tport, next, &iport->tport_list, links) {
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
+1 -1
View File
@@ -737,7 +737,7 @@ void fnic_work_on_fip_timer(struct work_struct *work)
if (memcmp(iport->selected_fcf.fcf_mac, zmac, ETH_ALEN) != 0) {
if (iport->flags & FNIC_FIRST_LINK_UP) {
fnic_scsi_fcpio_reset(iport->fnic);
fnic_fcpio_reset(iport->fnic);
iport->flags &= ~FNIC_FIRST_LINK_UP;
}
+4 -3
View File
@@ -30,7 +30,7 @@
#define DRV_NAME "fnic"
#define DRV_DESCRIPTION "Cisco FCoE HBA Driver"
#define DRV_VERSION "1.8.0.2"
#define DRV_VERSION "1.8.0.3"
#define PFX DRV_NAME ": "
#define DFX DRV_NAME "%d: "
@@ -438,6 +438,7 @@ struct fnic {
struct list_head tx_queue;
mempool_t *frame_pool;
mempool_t *frame_elem_pool;
mempool_t *frame_recv_pool;
struct work_struct tport_work;
struct list_head tport_event_list;
@@ -512,7 +513,6 @@ int fnic_host_reset(struct Scsi_Host *shost);
void fnic_reset(struct Scsi_Host *shost);
int fnic_issue_fc_host_lip(struct Scsi_Host *shost);
void fnic_get_host_port_state(struct Scsi_Host *shost);
void fnic_scsi_fcpio_reset(struct fnic *fnic);
int fnic_wq_copy_cmpl_handler(struct fnic *fnic, int copy_work_to_do, unsigned int cq_index);
int fnic_wq_cmpl_handler(struct fnic *fnic, int);
int fnic_flogi_reg_handler(struct fnic *fnic, u32);
@@ -541,7 +541,8 @@ fnic_chk_state_flags_locked(struct fnic *fnic, unsigned long st_flags)
}
void __fnic_set_state_flags(struct fnic *, unsigned long, unsigned long);
void fnic_dump_fchost_stats(struct Scsi_Host *, struct fc_host_statistics *);
void fnic_free_txq(struct list_head *head);
void fnic_free_txq(struct fnic *fnic);
void fnic_free_rxq(struct fnic *fnic);
int fnic_get_desc_by_devid(struct pci_dev *pdev, char **desc,
char **subsys_desc);
void fnic_fdls_link_status_change(struct fnic *fnic, int linkup);
+91 -21
View File
@@ -291,7 +291,7 @@ void fnic_handle_frame(struct work_struct *work)
if (fnic->stop_rx_link_events) {
list_del(&cur_frame->links);
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
kfree(cur_frame->fp);
mempool_free(cur_frame->fp, fnic->frame_recv_pool);
mempool_free(cur_frame, fnic->frame_elem_pool);
return;
}
@@ -317,7 +317,7 @@ void fnic_handle_frame(struct work_struct *work)
fnic_fdls_recv_frame(&fnic->iport, cur_frame->fp,
cur_frame->frame_len, fchdr_offset);
kfree(cur_frame->fp);
mempool_free(cur_frame->fp, fnic->frame_recv_pool);
mempool_free(cur_frame, fnic->frame_elem_pool);
}
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
@@ -337,8 +337,8 @@ void fnic_handle_fip_frame(struct work_struct *work)
if (fnic->stop_rx_link_events) {
list_del(&cur_frame->links);
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
kfree(cur_frame->fp);
kfree(cur_frame);
mempool_free(cur_frame->fp, fnic->frame_recv_pool);
mempool_free(cur_frame, fnic->frame_elem_pool);
return;
}
@@ -355,8 +355,8 @@ void fnic_handle_fip_frame(struct work_struct *work)
list_del(&cur_frame->links);
if (fdls_fip_recv_frame(fnic, cur_frame->fp)) {
kfree(cur_frame->fp);
kfree(cur_frame);
mempool_free(cur_frame->fp, fnic->frame_recv_pool);
mempool_free(cur_frame, fnic->frame_elem_pool);
}
}
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
@@ -375,10 +375,10 @@ static inline int fnic_import_rq_eth_pkt(struct fnic *fnic, void *fp)
eh = (struct ethhdr *) fp;
if ((eh->h_proto == cpu_to_be16(ETH_P_FIP)) && (fnic->iport.usefip)) {
fip_fr_elem = (struct fnic_frame_list *)
kzalloc_obj(struct fnic_frame_list, GFP_ATOMIC);
fip_fr_elem = mempool_alloc(fnic->frame_elem_pool, GFP_ATOMIC);
if (!fip_fr_elem)
return 0;
memset(fip_fr_elem, 0, sizeof(struct fnic_frame_list));
fip_fr_elem->fp = fp;
spin_lock_irqsave(&fnic->fnic_lock, flags);
list_add_tail(&fip_fr_elem->links, &fnic->fip_frame_queue);
@@ -519,13 +519,13 @@ static void fnic_rq_cmpl_frame_recv(struct vnic_rq *rq, struct cq_desc
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
frame_elem = mempool_alloc(fnic->frame_elem_pool,
GFP_ATOMIC | __GFP_ZERO);
frame_elem = mempool_alloc(fnic->frame_elem_pool, GFP_ATOMIC);
if (!frame_elem) {
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Failed to allocate memory for frame elem");
goto drop;
}
memset(frame_elem, 0, sizeof(struct fnic_frame_list));
frame_elem->fp = fp;
frame_elem->rx_ethhdr_stripped = ethhdr_stripped;
frame_elem->frame_len = bytes_written;
@@ -538,7 +538,7 @@ static void fnic_rq_cmpl_frame_recv(struct vnic_rq *rq, struct cq_desc
return;
drop:
kfree(fp);
mempool_free(fp, fnic->frame_recv_pool);
}
static int fnic_rq_cmpl_handler_cont(struct vnic_dev *vdev,
@@ -591,7 +591,7 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq)
int ret;
len = FNIC_FRAME_HT_ROOM;
buf = kmalloc(len, GFP_ATOMIC);
buf = mempool_alloc(fnic->frame_recv_pool, GFP_ATOMIC);
if (!buf) {
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Unable to allocate RQ buffer of size: %d\n", len);
@@ -609,7 +609,7 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq)
fnic_queue_rq_desc(rq, buf, pa, len);
return 0;
free_buf:
kfree(buf);
mempool_free(buf, fnic->frame_recv_pool);
return ret;
}
@@ -621,7 +621,7 @@ void fnic_free_rq_buf(struct vnic_rq *rq, struct vnic_rq_buf *buf)
dma_unmap_single(&fnic->pdev->dev, buf->dma_addr, buf->len,
DMA_FROM_DEVICE);
kfree(rq_buf);
mempool_free(rq_buf, fnic->frame_recv_pool);
buf->os_buf = NULL;
}
@@ -704,13 +704,13 @@ fdls_send_fcoe_frame(struct fnic *fnic, void *frame, int frame_size,
*/
if ((fnic->state != FNIC_IN_FC_MODE)
&& (fnic->state != FNIC_IN_ETH_MODE)) {
frame_elem = mempool_alloc(fnic->frame_elem_pool,
GFP_ATOMIC | __GFP_ZERO);
frame_elem = mempool_alloc(fnic->frame_elem_pool, GFP_ATOMIC);
if (!frame_elem) {
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Failed to allocate memory for frame elem");
return -ENOMEM;
}
memset(frame_elem, 0, sizeof(struct fnic_frame_list));
FNIC_FCS_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
"Queueing FC frame: sid/did/type/oxid = 0x%x/0x%x/0x%x/0x%x\n",
@@ -836,14 +836,34 @@ fnic_fdls_register_portid(struct fnic_iport_s *iport, u32 port_id,
return 0;
}
void fnic_free_txq(struct list_head *head)
void fnic_free_txq(struct fnic *fnic)
{
struct fnic_frame_list *cur_frame, *next;
list_for_each_entry_safe(cur_frame, next, head, links) {
list_for_each_entry_safe(cur_frame, next, &fnic->tx_queue, links) {
list_del(&cur_frame->links);
kfree(cur_frame->fp);
kfree(cur_frame);
mempool_free(cur_frame->fp, fnic->frame_pool);
mempool_free(cur_frame, fnic->frame_elem_pool);
}
}
void fnic_free_rxq(struct fnic *fnic)
{
struct fnic_frame_list *cur_frame, *next;
list_for_each_entry_safe(cur_frame, next, &fnic->frame_queue, links) {
list_del(&cur_frame->links);
mempool_free(cur_frame->fp, fnic->frame_recv_pool);
mempool_free(cur_frame, fnic->frame_elem_pool);
}
if (fnic->config.flags & VFCF_FIP_CAPABLE) {
list_for_each_entry_safe(cur_frame, next,
&fnic->fip_frame_queue, links) {
list_del(&cur_frame->links);
mempool_free(cur_frame->fp, fnic->frame_recv_pool);
mempool_free(cur_frame, fnic->frame_elem_pool);
}
}
}
@@ -898,7 +918,7 @@ void fnic_free_wq_buf(struct vnic_wq *wq, struct vnic_wq_buf *buf)
dma_unmap_single(&fnic->pdev->dev, buf->dma_addr, buf->len,
DMA_TO_DEVICE);
kfree(buf->os_buf);
mempool_free(buf->os_buf, fnic->frame_pool);
buf->os_buf = NULL;
}
@@ -1108,3 +1128,53 @@ void fnic_reset_work_handler(struct work_struct *work)
spin_unlock_irqrestore(&reset_fnic_list_lock,
reset_fnic_list_lock_flags);
}
void fnic_fcpio_reset(struct fnic *fnic)
{
unsigned long flags;
enum fnic_state old_state;
struct fnic_iport_s *iport = &fnic->iport;
DECLARE_COMPLETION_ONSTACK(fw_reset_done);
int time_remain;
/* issue fw reset */
spin_lock_irqsave(&fnic->fnic_lock, flags);
if (unlikely(fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)) {
/* fw reset is in progress, poll for its completion */
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"fnic is in unexpected state: %d for fw_reset\n",
fnic->state);
return;
}
old_state = fnic->state;
fnic->state = FNIC_IN_FC_TRANS_ETH_MODE;
fnic_update_mac_locked(fnic, iport->hwmac);
fnic->fw_reset_done = &fw_reset_done;
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Issuing fw reset\n");
if (fnic_fw_reset_handler(fnic)) {
spin_lock_irqsave(&fnic->fnic_lock, flags);
if (fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)
fnic->state = old_state;
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
} else {
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Waiting for fw completion\n");
time_remain = wait_for_completion_timeout(&fw_reset_done,
msecs_to_jiffies(FNIC_FW_RESET_TIMEOUT));
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Woken up after fw completion timeout\n");
if (time_remain == 0) {
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"FW reset completion timed out after %d ms\n",
FNIC_FW_RESET_TIMEOUT);
}
atomic64_inc(&fnic->fnic_stats.reset_stats.fw_reset_timeouts);
}
fnic->fw_reset_done = NULL;
}
+1 -1
View File
@@ -410,6 +410,7 @@ void fnic_fdls_add_tport(struct fnic_iport_s *iport,
void fnic_fdls_remove_tport(struct fnic_iport_s *iport,
struct fnic_tport_s *tport,
unsigned long flags);
void fnic_fcpio_reset(struct fnic *fnic);
/* fip.c */
void fnic_fcoe_send_vlan_req(struct fnic *fnic);
@@ -422,7 +423,6 @@ void fnic_handle_fip_timer(struct timer_list *t);
extern void fdls_fabric_timer_callback(struct timer_list *t);
/* fnic_scsi.c */
void fnic_scsi_fcpio_reset(struct fnic *fnic);
extern void fdls_fabric_timer_callback(struct timer_list *t);
void fnic_rport_exch_reset(struct fnic *fnic, u32 fcid);
int fnic_fdls_register_portid(struct fnic_iport_s *iport, u32 port_id,
+25 -3
View File
@@ -40,6 +40,7 @@ static struct kmem_cache *fnic_sgl_cache[FNIC_SGL_NUM_CACHES];
static struct kmem_cache *fnic_io_req_cache;
static struct kmem_cache *fdls_frame_cache;
static struct kmem_cache *fdls_frame_elem_cache;
static struct kmem_cache *fdls_frame_recv_cache;
static LIST_HEAD(fnic_list);
static DEFINE_SPINLOCK(fnic_list_lock);
static DEFINE_IDA(fnic_ida);
@@ -554,6 +555,7 @@ static int fnic_cleanup(struct fnic *fnic)
mempool_destroy(fnic->io_req_pool);
mempool_destroy(fnic->frame_pool);
mempool_destroy(fnic->frame_elem_pool);
mempool_destroy(fnic->frame_recv_pool);
for (i = 0; i < FNIC_SGL_NUM_CACHES; i++)
mempool_destroy(fnic->io_sgl_pool[i]);
@@ -928,6 +930,14 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
fnic->frame_elem_pool = pool;
pool = mempool_create_slab_pool(FDLS_MIN_FRAMES,
fdls_frame_recv_cache);
if (!pool) {
err = -ENOMEM;
goto err_out_fdls_frame_recv_pool;
}
fnic->frame_recv_pool = pool;
/* setup vlan config, hw inserts vlan header */
fnic->vlan_hw_insert = 1;
fnic->vlan_id = 0;
@@ -1085,6 +1095,8 @@ err_out_alloc_rq_buf:
}
vnic_dev_notify_unset(fnic->vdev);
err_out_fnic_notify_set:
mempool_destroy(fnic->frame_recv_pool);
err_out_fdls_frame_recv_pool:
mempool_destroy(fnic->frame_elem_pool);
err_out_fdls_frame_elem_pool:
mempool_destroy(fnic->frame_pool);
@@ -1157,7 +1169,6 @@ static void fnic_remove(struct pci_dev *pdev)
timer_delete_sync(&fnic->enode_ka_timer);
timer_delete_sync(&fnic->vn_ka_timer);
fnic_free_txq(&fnic->fip_frame_queue);
fnic_fcoe_reset_vlans(fnic);
}
@@ -1177,8 +1188,8 @@ static void fnic_remove(struct pci_dev *pdev)
list_del(&fnic->list);
spin_unlock_irqrestore(&fnic_list_lock, flags);
fnic_free_txq(&fnic->frame_queue);
fnic_free_txq(&fnic->tx_queue);
fnic_free_rxq(fnic);
fnic_free_txq(fnic);
vnic_dev_notify_unset(fnic->vdev);
fnic_free_intr(fnic);
@@ -1287,6 +1298,15 @@ static int __init fnic_init_module(void)
goto err_create_fdls_frame_cache_elem;
}
fdls_frame_recv_cache = kmem_cache_create("fdls_frame_recv",
FNIC_FRAME_HT_ROOM,
0, SLAB_HWCACHE_ALIGN, NULL);
if (!fdls_frame_recv_cache) {
pr_err("fnic fdls frame recv cach create failed\n");
err = -ENOMEM;
goto err_create_fdls_frame_recv_cache;
}
fnic_event_queue =
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fnic_event_wq");
if (!fnic_event_queue) {
@@ -1339,6 +1359,8 @@ err_create_fip_workq:
if (pc_rscn_handling_feature_flag == PC_RSCN_HANDLING_FEATURE_ON)
destroy_workqueue(reset_fnic_work_queue);
err_create_reset_fnic_workq:
kmem_cache_destroy(fdls_frame_recv_cache);
err_create_fdls_frame_recv_cache:
destroy_workqueue(fnic_event_queue);
err_create_fnic_workq:
kmem_cache_destroy(fdls_frame_elem_cache);
+6 -64
View File
@@ -471,7 +471,6 @@ enum scsi_qc_status fnic_queuecommand(struct Scsi_Host *shost,
int sg_count = 0;
unsigned long flags = 0;
unsigned long ptr;
int io_lock_acquired = 0;
uint16_t hwq = 0;
struct fnic_tport_s *tport = NULL;
struct rport_dd_data_s *rdd_data;
@@ -636,7 +635,6 @@ enum scsi_qc_status fnic_queuecommand(struct Scsi_Host *shost,
spin_lock_irqsave(&fnic->wq_copy_lock[hwq], flags);
/* initialize rest of io_req */
io_lock_acquired = 1;
io_req->port_id = rport->port_id;
io_req->start_time = jiffies;
fnic_priv(sc)->state = FNIC_IOREQ_CMD_PENDING;
@@ -689,6 +687,9 @@ enum scsi_qc_status fnic_queuecommand(struct Scsi_Host *shost,
/* REVISIT: Use per IO lock in the final code */
fnic_priv(sc)->flags |= FNIC_IO_ISSUED;
}
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
out:
cmd_trace = ((u64)sc->cmnd[0] << 56 | (u64)sc->cmnd[7] << 40 |
(u64)sc->cmnd[8] << 32 | (u64)sc->cmnd[2] << 24 |
@@ -699,10 +700,6 @@ out:
mqtag, sc, io_req, sg_count, cmd_trace,
fnic_flags_and_state(sc));
/* if only we issued IO, will we have the io lock */
if (io_lock_acquired)
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
atomic_dec(&fnic->in_flight);
atomic_dec(&tport->in_flight);
@@ -777,7 +774,7 @@ static int fnic_fcpio_fw_reset_cmpl_handler(struct fnic *fnic,
*/
if (ret) {
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
fnic_free_txq(&fnic->tx_queue);
fnic_free_txq(fnic);
goto reset_cmpl_handler_end;
}
@@ -1972,15 +1969,11 @@ void fnic_scsi_unload(struct fnic *fnic)
*/
spin_lock_irqsave(&fnic->fnic_lock, flags);
fnic->iport.state = FNIC_IPORT_STATE_LINK_WAIT;
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
if (fdls_get_state(&fnic->iport.fabric) != FDLS_STATE_INIT)
fnic_scsi_fcpio_reset(fnic);
spin_lock_irqsave(&fnic->fnic_lock, flags);
fnic->in_remove = 1;
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
fnic_fcpio_reset(fnic);
fnic_flush_tport_event_list(fnic);
fnic_delete_fcp_tports(fnic);
}
@@ -3040,54 +3033,3 @@ int fnic_eh_host_reset_handler(struct scsi_cmnd *sc)
ret = fnic_host_reset(shost);
return ret;
}
void fnic_scsi_fcpio_reset(struct fnic *fnic)
{
unsigned long flags;
enum fnic_state old_state;
struct fnic_iport_s *iport = &fnic->iport;
DECLARE_COMPLETION_ONSTACK(fw_reset_done);
int time_remain;
/* issue fw reset */
spin_lock_irqsave(&fnic->fnic_lock, flags);
if (unlikely(fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)) {
/* fw reset is in progress, poll for its completion */
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"fnic is in unexpected state: %d for fw_reset\n",
fnic->state);
return;
}
old_state = fnic->state;
fnic->state = FNIC_IN_FC_TRANS_ETH_MODE;
fnic_update_mac_locked(fnic, iport->hwmac);
fnic->fw_reset_done = &fw_reset_done;
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Issuing fw reset\n");
if (fnic_fw_reset_handler(fnic)) {
spin_lock_irqsave(&fnic->fnic_lock, flags);
if (fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)
fnic->state = old_state;
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
} else {
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Waiting for fw completion\n");
time_remain = wait_for_completion_timeout(&fw_reset_done,
msecs_to_jiffies(FNIC_FW_RESET_TIMEOUT));
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"Woken up after fw completion timeout\n");
if (time_remain == 0) {
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
"FW reset completion timed out after %d ms)\n",
FNIC_FW_RESET_TIMEOUT);
}
atomic64_inc(&fnic->fnic_stats.reset_stats.fw_reset_timeouts);
}
fnic->fw_reset_done = NULL;
}
+1 -1
View File
@@ -1326,7 +1326,7 @@ static int hisi_sas_control_phy(struct asd_sas_phy *sas_phy, enum phy_func func,
if (sts && !wait_for_completion_timeout(&completion,
HISI_SAS_WAIT_PHYUP_TIMEOUT)) {
dev_warn(dev, "phy%d wait phyup timed out for func %d\n",
dev_warn(dev, "phy%d wait phyup timed out for func %u\n",
phy_no, func);
if (phy->in_reset)
ret = -ETIMEDOUT;

Some files were not shown because too many files have changed in this diff Show More