SCSI fixes for 6.12-rc3
James Bottomley
maintainerFixes all in drivers. The largest is the mpi3mr which corrects a phy count limit that should only apply to the controller but was being incorrectly applied to expander phys.
The patch is available here:
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes
The short changelog is:
Peter Wang (2):
scsi: ufs: core: Requeue aborted request
scsi: ufs: core: Fix the issue of ICU failure
Ranjan Kumar (1):
scsi: mpi3mr: Validate SAS port assignments
Seunghwan Baek (1):
scsi: ufs: core: Set SDEV_OFFLINE when UFS is shut down
Wang Hai (1):
scsi: target: core: Fix null-ptr-deref in target_alloc_device()
And the diffstat:
drivers/scsi/mpi3mr/mpi3mr.h | 4 ++-- drivers/scsi/mpi3mr/mpi3mr_transport.c | 42 ++++++++++++++++++++++------------ drivers/target/target_core_device.c | 2 +- drivers/ufs/core/ufs-mcq.c | 15 ++++++------ drivers/ufs/core/ufshcd.c | 24 ++++++------------- 5 files changed, 45 insertions(+), 42 deletions(-)
With full diff below
drivers/scsi/mpi3mr/mpi3mr.h +2 -2
@@ -542,8 +542,8 @@ struct mpi3mr_hba_port {* @port_list: List of ports belonging to a SAS node * @num_phys: Number of phys associated with port * @marked_responding: used while refresing the sas ports -* @lowest_phy: lowest phy ID of current sas port -* @phy_mask: phy_mask of current sas port +* @lowest_phy: lowest phy ID of current sas port, valid for controller port +* @phy_mask: phy_mask of current sas port, valid for controller port * @hba_port: HBA port entry * @remote_identify: Attached device identification * @rphy: SAS transport layer rphy object
drivers/scsi/mpi3mr/mpi3mr_transport.c +27 -15
118 lines not on this page · raw message
drivers/target/target_core_device.c +1 -1
@@ -691,7 +691,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) dev->queues =kcalloc (nr_cpu_ids,sizeof (*dev->queues),GFP_KERNEL );if (!dev->queues) { - dev->transport->free_device (dev); + hba->backend->ops->free_device (dev);return NULL ; }
drivers/ufs/core/ufs-mcq.c +8 -7
@@ -539,7 +539,7 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag)struct scsi_cmnd *cmd = lrbp->cmd;struct ufs_hw_queue *hwq;void __iomem *reg, *opr_sqd_base; -u32 nexus, id, val; +u32 nexus, id, val, rtc;int err;if (hba->quirks &UFSHCD_QUIRK_MCQ_BROKEN_RTC )
@@ -569,17 +569,18 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag) opr_sqd_base =mcq_opr_base (hba,OPR_SQD , id);writel (nexus, opr_sqd_base +REG_SQCTI ); -/* SQRTCy.ICU = 1 */ -writel (SQ_ICU , opr_sqd_base +REG_SQRTC ); +/* Initiate Cleanup */ +writel (readl (opr_sqd_base +REG_SQRTC ) |SQ_ICU , + opr_sqd_base +REG_SQRTC );/* Poll SQRTSy.CUS = 1. Return result from SQRTSy.RTC */ reg = opr_sqd_base +REG_SQRTS ; err =read_poll_timeout (readl, val, val &SQ_CUS ,20 ,MCQ_POLL_US , false, reg); -if (err) -dev_err (hba->dev,"%s: failed. hwq=%d, tag=%d err=%ld\n" , - __func__, id, task_tag, -FIELD_GET (SQ_ICU_ERR_CODE_MASK ,readl (reg))); + rtc =FIELD_GET (SQ_ICU_ERR_CODE_MASK ,readl (reg)); +if (err || rtc) +dev_err (hba->dev,"%s: failed. hwq=%d, tag=%d err=%d RTC=%d\n" , + __func__, id, task_tag, err, rtc);if (ufshcd_mcq_sq_start (hba, hwq)) err = -ETIMEDOUT ;
drivers/ufs/core/ufshcd.c +7 -17
@@ -5416,10 +5416,12 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, }break ;case OCS_ABORTED : - result |=DID_ABORT <<16 ; -break ;case OCS_INVALID_COMMAND_STATUS : result |=DID_REQUEUE <<16 ; +dev_warn (hba->dev, +"OCS %s from controller for tag %d\n" , + (ocs ==OCS_ABORTED ?"aborted" :"invalid" ), + lrbp->task_tag);break ;case OCS_INVALID_CMD_TABLE_ATTR :case OCS_INVALID_PRDT_ATTR :
@@ -6465,26 +6467,12 @@ static bool ufshcd_abort_one(struct request *rq, void *priv)struct scsi_device *sdev = cmd->device;struct Scsi_Host *shost = sdev->host;struct ufs_hba *hba =shost_priv (shost); -struct ufshcd_lrb *lrbp = &hba->lrb[tag]; -struct ufs_hw_queue *hwq; -unsigned long flags; *ret =ufshcd_try_to_abort_task (hba, tag);dev_err (hba->dev,"Aborting tag %d / CDB %#02x %s\n" , tag, hba->lrb[tag].cmd ? hba->lrb[tag].cmd->cmnd[0 ] :-1 , *ret ?"failed" :"succeeded" ); -/* Release cmd in MCQ mode if abort succeeds */ -if (hba->mcq_enabled && (*ret ==0 )) { - hwq =ufshcd_mcq_req_to_hwq (hba,scsi_cmd_to_rq (lrbp->cmd)); -if (!hwq) -return 0 ; -spin_lock_irqsave (&hwq->cq_lock, flags); -if (ufshcd_cmd_inflight (lrbp->cmd)) -ufshcd_release_scsi_cmd (hba, lrbp); -spin_unlock_irqrestore (&hwq->cq_lock, flags); - } -return *ret ==0 ; }
@@ -10209,7 +10197,9 @@ static void ufshcd_wl_shutdown(struct device *dev)shost_for_each_device (sdev, hba->host) {if (sdev == hba->ufs_device_wlun)continue ; -scsi_device_quiesce (sdev); +mutex_lock (&sdev->state_mutex); +scsi_device_set_state (sdev,SDEV_OFFLINE ); +mutex_unlock (&sdev->state_mutex); }__ufshcd_wl_suspend (hba,UFS_SHUTDOWN_PM );
The pull request you sent on Sat, 19 Oct 2024 15:30:07 -0400:
The pull request you sent on Sat, 19 Oct 2024 15:30:07 -0400:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.gitscsi-fixes
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/531643fcd98c8d045d72a05cb0aaf49e5a4bdf5c
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html