Skip to content

Commit

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

Pull SCSI updates from James Bottomley:
 "Updates to the usual drivers (ufs, lpfc, qla2xxx, mpi3mr) plus some
  misc small fixes.

  The only core changes are to both bsg and scsi to pass in the device
  instead of setting it afterwards as q->queuedata, so no functional
  change"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (69 commits)
  scsi: aha152x: Use DECLARE_COMPLETION_ONSTACK for non-constant completion
  scsi: qla2xxx: Convert comma to semicolon
  scsi: qla2xxx: Update version to 10.02.09.300-k
  scsi: qla2xxx: Use QP lock to search for bsg
  scsi: qla2xxx: Reduce fabric scan duplicate code
  scsi: qla2xxx: Fix optrom version displayed in FDMI
  scsi: qla2xxx: During vport delete send async logout explicitly
  scsi: qla2xxx: Complete command early within lock
  scsi: qla2xxx: Fix flash read failure
  scsi: qla2xxx: Return ENOBUFS if sg_cnt is more than one for ELS cmds
  scsi: qla2xxx: Fix for possible memory corruption
  scsi: qla2xxx: validate nvme_local_port correctly
  scsi: qla2xxx: Unable to act on RSCN for port online
  scsi: ufs: exynos: Add support for Flash Memory Protector (FMP)
  scsi: ufs: core: Add UFSHCD_QUIRK_KEYS_IN_PRDT
  scsi: ufs: core: Add fill_crypto_prdt variant op
  scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_CRYPTO_ENABLE
  scsi: ufs: core: fold ufshcd_clear_keyslot() into its caller
  scsi: ufs: core: Add UFSHCD_QUIRK_CUSTOM_CRYPTO_PROFILE
  scsi: ufs: mcq: Make .get_hba_mac() optional
  ...
  • Loading branch information
torvalds committed Jul 19, 2024
2 parents 661fb4e + 23cef42 commit 4305ca0
Show file tree
Hide file tree
Showing 65 changed files with 3,141 additions and 615 deletions.
14 changes: 8 additions & 6 deletions Documentation/ABI/testing/sysfs-driver-ufs
Original file line number Diff line number Diff line change
Expand Up @@ -920,14 +920,16 @@ Description: This file shows whether the configuration descriptor is locked.

What: /sys/bus/platform/drivers/ufshcd/*/attributes/max_number_of_rtt
What: /sys/bus/platform/devices/*.ufs/attributes/max_number_of_rtt
Date: February 2018
Contact: Stanislav Nijnikov <stanislav.nijnikov@wdc.com>
Date: May 2024
Contact: Avri Altman <avri.altman@wdc.com>
Description: This file provides the maximum current number of
outstanding RTTs in device that is allowed. The full
information about the attribute could be found at
UFS specifications 2.1.
outstanding RTTs in device that is allowed. bMaxNumOfRTT is a
read-write persistent attribute and is equal to two after device
manufacturing. It shall not be set to a value greater than
bDeviceRTTCap value, and it may be set only when the hw queues are
empty.

The file is read only.
The file is read write.

What: /sys/bus/platform/drivers/ufshcd/*/attributes/exception_event_control
What: /sys/bus/platform/devices/*.ufs/attributes/exception_event_control
Expand Down
3 changes: 1 addition & 2 deletions block/bsg-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,12 @@ struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
if (blk_mq_alloc_tag_set(set))
goto out_tag_set;

q = blk_mq_alloc_queue(set, lim, NULL);
q = blk_mq_alloc_queue(set, lim, dev);
if (IS_ERR(q)) {
ret = PTR_ERR(q);
goto out_queue;
}

q->queuedata = dev;
blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT);

bset->bd = bsg_register_queue(q, dev, name, bsg_transport_sg_io_fn);
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/BusLogic.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static struct blogic_drvr_options blogic_drvr_options[BLOGIC_MAX_ADAPTERS];
BusLogic can be assigned a string by insmod.
*/

MODULE_DESCRIPTION("BusLogic MultiMaster and FlashPoint SCSI Host Adapter driver");
MODULE_LICENSE("GPL");
#ifdef MODULE
static char *BusLogic;
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/advansys.c
Original file line number Diff line number Diff line change
Expand Up @@ -11545,6 +11545,7 @@ static void __exit advansys_exit(void)
module_init(advansys_init);
module_exit(advansys_exit);

MODULE_DESCRIPTION("AdvanSys SCSI Adapter driver");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE("advansys/mcode.bin");
MODULE_FIRMWARE("advansys/3550.bin");
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/aha152x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ static int aha152x_abort(struct scsi_cmnd *SCpnt)
static int aha152x_device_reset(struct scsi_cmnd * SCpnt)
{
struct Scsi_Host *shpnt = SCpnt->device->host;
DECLARE_COMPLETION(done);
DECLARE_COMPLETION_ONSTACK(done);
int ret, issued, disconnected;
unsigned char old_cmd_len = SCpnt->cmd_len;
unsigned long flags;
Expand Down
2 changes: 2 additions & 0 deletions drivers/scsi/aha1542.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,8 @@ static int aha1542_biosparam(struct scsi_device *sdev,

return 0;
}

MODULE_DESCRIPTION("Adaptec AHA-1542 SCSI host adapter driver");
MODULE_LICENSE("GPL");

static int aha1542_init_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/aha1740.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,4 +681,5 @@ static __exit void aha1740_exit (void)
module_init (aha1740_init);
module_exit (aha1740_exit);

MODULE_DESCRIPTION("Adaptec AHA1740 SCSI host adapter driver");
MODULE_LICENSE("GPL");
9 changes: 4 additions & 5 deletions drivers/scsi/arm/acornscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,7 @@ static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt)
return 0;
}

DEF_SCSI_QCMD(acornscsi_queuecmd)
static DEF_SCSI_QCMD(acornscsi_queuecmd)

enum res_abort { res_not_running, res_success, res_success_clear, res_snooze };

Expand Down Expand Up @@ -2552,7 +2552,7 @@ static enum res_abort acornscsi_do_abort(AS_Host *host, struct scsi_cmnd *SCpnt)
* Params : SCpnt - command to abort
* Returns : one of SCSI_ABORT_ macros
*/
int acornscsi_abort(struct scsi_cmnd *SCpnt)
static int acornscsi_abort(struct scsi_cmnd *SCpnt)
{
AS_Host *host = (AS_Host *) SCpnt->device->host->hostdata;
int result;
Expand Down Expand Up @@ -2634,7 +2634,7 @@ int acornscsi_abort(struct scsi_cmnd *SCpnt)
* Params : SCpnt - command causing reset
* Returns : one of SCSI_RESET_ macros
*/
int acornscsi_host_reset(struct scsi_cmnd *SCpnt)
static int acornscsi_host_reset(struct scsi_cmnd *SCpnt)
{
AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
struct scsi_cmnd *SCptr;
Expand Down Expand Up @@ -2679,8 +2679,7 @@ int acornscsi_host_reset(struct scsi_cmnd *SCpnt)
* Params : host - host to give information on
* Returns : a constant string
*/
const
char *acornscsi_info(struct Scsi_Host *host)
static const char *acornscsi_info(struct Scsi_Host *host)
{
static char string[100], *p;

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/arm/cumana_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ cumanascsi_2_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
* Params : host - driver host structure to return info for.
* Returns : pointer to a static buffer containing null terminated string.
*/
const char *cumanascsi_2_info(struct Scsi_Host *host)
static const char *cumanascsi_2_info(struct Scsi_Host *host)
{
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
static char string[150];
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/arm/eesox.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ eesoxscsi_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
* Params : host - driver host structure to return info for.
* Returns : pointer to a static buffer containing null terminated string.
*/
const char *eesoxscsi_info(struct Scsi_Host *host)
static const char *eesoxscsi_info(struct Scsi_Host *host)
{
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
static char string[150];
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/arm/powertec.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ powertecscsi_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
* Params : host - driver host structure to return info for.
* Returns : pointer to a static buffer containing null terminated string.
*/
const char *powertecscsi_info(struct Scsi_Host *host)
static const char *powertecscsi_info(struct Scsi_Host *host)
{
struct powertec_info *info = (struct powertec_info *)host->hostdata;
static char string[150];
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/atari_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,4 +894,5 @@ static struct platform_driver atari_scsi_driver __refdata = {
module_platform_driver_probe(atari_scsi_driver, atari_scsi_probe);

MODULE_ALIAS("platform:" DRV_MODULE_NAME);
MODULE_DESCRIPTION("Atari TT/Falcon NCR5380 SCSI driver");
MODULE_LICENSE("GPL");
2 changes: 2 additions & 0 deletions drivers/scsi/atp870u.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,8 @@ static void atp870u_remove (struct pci_dev *pdev)
atp870u_free_tables(pshost);
scsi_host_put(pshost);
}

MODULE_DESCRIPTION("ACARD SCSI host adapter driver");
MODULE_LICENSE("GPL");

static const struct scsi_host_template atp870u_template = {
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/elx/efct/efct_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,5 +778,6 @@ static void __exit efct_exit(void)
module_init(efct_init);
module_exit(efct_exit);
MODULE_VERSION(EFCT_DRIVER_VERSION);
MODULE_DESCRIPTION("Emulex Fibre Channel Target driver");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Broadcom");
1 change: 1 addition & 0 deletions drivers/scsi/g_NCR5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ module_param_array(card, int, NULL, 0);
MODULE_PARM_DESC(card, "card type (0=NCR5380, 1=NCR53C400, 2=NCR53C400A, 3=DTC3181E, 4=HP C2502)");

MODULE_ALIAS("g_NCR5380_mmio");
MODULE_DESCRIPTION("Generic NCR5380/NCR53C400 SCSI driver");
MODULE_LICENSE("GPL");

static void g_NCR5380_trigger_irq(struct Scsi_Host *instance)
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/imm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1279,4 +1279,5 @@ static struct parport_driver imm_driver = {
};
module_parport_driver(imm_driver);

MODULE_DESCRIPTION("IOMEGA MatchMaker parallel port SCSI host adapter driver");
MODULE_LICENSE("GPL");
1 change: 1 addition & 0 deletions drivers/scsi/isci/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ static __exit void isci_exit(void)
sas_release_transport(isci_transport_template);
}

MODULE_DESCRIPTION("Intel(R) C600 Series Chipset SAS Controller driver");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_FIRMWARE(ISCI_FW_NAME);
module_init(isci_init);
Expand Down
10 changes: 9 additions & 1 deletion drivers/scsi/lpfc/lpfc_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,7 @@ static int
lpfc_set_trunking(struct lpfc_hba *phba, char *buff_out)
{
LPFC_MBOXQ_t *mbox = NULL;
u32 payload_len;
unsigned long val = 0;
char *pval = NULL;
int rc = 0;
Expand Down Expand Up @@ -1869,9 +1870,11 @@ lpfc_set_trunking(struct lpfc_hba *phba, char *buff_out)
if (!mbox)
return -ENOMEM;

payload_len = sizeof(struct lpfc_mbx_set_trunk_mode) -
sizeof(struct lpfc_sli4_cfg_mhdr);
lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_FCOE,
LPFC_MBOX_OPCODE_FCOE_FC_SET_TRUNK_MODE,
12, LPFC_SLI4_MBX_EMBED);
payload_len, LPFC_SLI4_MBX_EMBED);

bf_set(lpfc_mbx_set_trunk_mode,
&mbox->u.mqe.un.set_trunk_mode,
Expand Down Expand Up @@ -1907,6 +1910,11 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr,

/* Get transceiver information */
rdp_context = kmalloc(sizeof(*rdp_context), GFP_KERNEL);
if (!rdp_context) {
len = scnprintf(buf, PAGE_SIZE - len,
"SPF info NA: alloc failure\n");
return len;
}

rc = lpfc_get_sfp_info_wait(phba, rdp_context);
if (rc) {
Expand Down
16 changes: 4 additions & 12 deletions drivers/scsi/lpfc/lpfc_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,22 +1553,14 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
if (ndlp->nlp_state == NLP_STE_REG_LOGIN_ISSUE &&
ndlp->nlp_fc4_type) {
ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE;
/* This is a fabric topology so if discovery
* started with an unsolicited PLOGI, don't
* send a PRLI. Targets don't issue PLOGI or
* PRLI when acting as a target. Likely this is
* an initiator function.
*/
if (!(ndlp->nlp_flag & NLP_RCV_PLOGI)) {
lpfc_nlp_set_state(vport, ndlp,
NLP_STE_PRLI_ISSUE);
lpfc_issue_els_prli(vport, ndlp, 0);
}
lpfc_nlp_set_state(vport, ndlp,
NLP_STE_PRLI_ISSUE);
lpfc_issue_els_prli(vport, ndlp, 0);
} else if (!ndlp->nlp_fc4_type) {
/* If fc4 type is still unknown, then LOGO */
lpfc_printf_vlog(vport, KERN_INFO,
LOG_DISCOVERY | LOG_NODE,
"6443 Sending LOGO ndlp x%px,"
"6443 Sending LOGO ndlp x%px, "
"DID x%06x with fc4_type: "
"x%08x, state: %d\n",
ndlp, did, ndlp->nlp_fc4_type,
Expand Down
19 changes: 12 additions & 7 deletions drivers/scsi/lpfc/lpfc_els.c
Original file line number Diff line number Diff line change
Expand Up @@ -7302,13 +7302,13 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
}
mbox->vport = phba->pport;

rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_SLI4_CONFIG_TMO);
if (rc == MBX_NOT_FINISHED) {
rc = 1;
goto error;
}

if (rc == MBX_TIMEOUT)
goto error;
if (phba->sli_rev == LPFC_SLI_REV4)
mp = mbox->ctx_buf;
else
Expand Down Expand Up @@ -7361,7 +7361,10 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
}

rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_SLI4_CONFIG_TMO);

if (rc == MBX_TIMEOUT)
goto error;
if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) {
rc = 1;
goto error;
Expand All @@ -7372,8 +7375,10 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
DMP_SFF_PAGE_A2_SIZE);

error:
mbox->ctx_buf = mpsave;
lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED);
if (mbox->mbox_flag & LPFC_MBX_WAKE) {
mbox->ctx_buf = mpsave;
lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED);
}

return rc;

Expand Down Expand Up @@ -9665,7 +9670,7 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
list_for_each_entry_safe(piocb, tmp_iocb, &abort_list, dlist) {
spin_lock_irqsave(&phba->hbalock, iflags);
list_del_init(&piocb->dlist);
if (mbx_tmo_err)
if (mbx_tmo_err || !(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
list_move_tail(&piocb->list, &cancel_list);
else
lpfc_sli_issue_abort_iotag(phba, pring, piocb, NULL);
Expand Down
10 changes: 9 additions & 1 deletion drivers/scsi/lpfc/lpfc_hbadisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
if (ndlp->nlp_state == NLP_STE_MAPPED_NODE)
return;

/* check for recovered fabric node */
if (ndlp->nlp_state == NLP_STE_UNMAPPED_NODE &&
ndlp->nlp_DID == Fabric_DID)
return;

if (rport->port_name != wwn_to_u64(ndlp->nlp_portname.u.wwn))
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
"6789 rport name %llx != node port name %llx",
Expand Down Expand Up @@ -546,6 +551,9 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
ndlp->nlp_DID, kref_read(&ndlp->kref),
ndlp, ndlp->nlp_flag,
vport->port_state);
spin_lock_irqsave(&ndlp->lock, iflags);
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
spin_unlock_irqrestore(&ndlp->lock, iflags);
return fcf_inuse;
}

Expand Down Expand Up @@ -5725,7 +5733,7 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did)
return ndlp;

if (ndlp->nlp_state > NLP_STE_UNUSED_NODE &&
ndlp->nlp_state < NLP_STE_PRLI_ISSUE) {
ndlp->nlp_state <= NLP_STE_PRLI_ISSUE) {
lpfc_disc_state_machine(vport, ndlp, NULL,
NLP_EVT_DEVICE_RECOVERY);
}
Expand Down
Loading

0 comments on commit 4305ca0

Please sign in to comment.