Commit ef2b7eb5 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull SCSI fixes from James Bottomley:
 "One core change that moves a disk start message to a location where it
  will only be printed once instead of twice plus a couple of error
  handling race fixes in the ufs driver"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: sd: Do not repeat the starting disk message
  scsi: ufs: core: Fix ufshcd_abort_one racing issue
  scsi: ufs: core: Fix ufshcd_clear_cmd racing issue
parents d6e1712b 7a6bbc28
...@@ -4119,8 +4119,6 @@ static int sd_resume(struct device *dev) ...@@ -4119,8 +4119,6 @@ static int sd_resume(struct device *dev)
{ {
struct scsi_disk *sdkp = dev_get_drvdata(dev); struct scsi_disk *sdkp = dev_get_drvdata(dev);
sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
if (opal_unlock_from_suspend(sdkp->opal_dev)) { if (opal_unlock_from_suspend(sdkp->opal_dev)) {
sd_printk(KERN_NOTICE, sdkp, "OPAL unlock failed\n"); sd_printk(KERN_NOTICE, sdkp, "OPAL unlock failed\n");
return -EIO; return -EIO;
...@@ -4137,12 +4135,13 @@ static int sd_resume_common(struct device *dev, bool runtime) ...@@ -4137,12 +4135,13 @@ static int sd_resume_common(struct device *dev, bool runtime)
if (!sdkp) /* E.g.: runtime resume at the start of sd_probe() */ if (!sdkp) /* E.g.: runtime resume at the start of sd_probe() */
return 0; return 0;
sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
if (!sd_do_start_stop(sdkp->device, runtime)) { if (!sd_do_start_stop(sdkp->device, runtime)) {
sdkp->suspended = false; sdkp->suspended = false;
return 0; return 0;
} }
sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
ret = sd_start_stop_device(sdkp, 1); ret = sd_start_stop_device(sdkp, 1);
if (!ret) { if (!ret) {
sd_resume(dev); sd_resume(dev);
......
...@@ -105,16 +105,15 @@ EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac); ...@@ -105,16 +105,15 @@ EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac);
* @hba: per adapter instance * @hba: per adapter instance
* @req: pointer to the request to be issued * @req: pointer to the request to be issued
* *
* Return: the hardware queue instance on which the request would * Return: the hardware queue instance on which the request will be or has
* be queued. * been queued. %NULL if the request has already been freed.
*/ */
struct ufs_hw_queue *ufshcd_mcq_req_to_hwq(struct ufs_hba *hba, struct ufs_hw_queue *ufshcd_mcq_req_to_hwq(struct ufs_hba *hba,
struct request *req) struct request *req)
{ {
u32 utag = blk_mq_unique_tag(req); struct blk_mq_hw_ctx *hctx = READ_ONCE(req->mq_hctx);
u32 hwq = blk_mq_unique_tag_to_hwq(utag);
return &hba->uhq[hwq]; return hctx ? &hba->uhq[hctx->queue_num] : NULL;
} }
/** /**
...@@ -515,6 +514,8 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag) ...@@ -515,6 +514,8 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag)
if (!cmd) if (!cmd)
return -EINVAL; return -EINVAL;
hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd)); hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd));
if (!hwq)
return 0;
} else { } else {
hwq = hba->dev_cmd_queue; hwq = hba->dev_cmd_queue;
} }
......
...@@ -6456,6 +6456,8 @@ static bool ufshcd_abort_one(struct request *rq, void *priv) ...@@ -6456,6 +6456,8 @@ static bool ufshcd_abort_one(struct request *rq, void *priv)
/* Release cmd in MCQ mode if abort succeeds */ /* Release cmd in MCQ mode if abort succeeds */
if (is_mcq_enabled(hba) && (*ret == 0)) { if (is_mcq_enabled(hba) && (*ret == 0)) {
hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(lrbp->cmd)); hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(lrbp->cmd));
if (!hwq)
return 0;
spin_lock_irqsave(&hwq->cq_lock, flags); spin_lock_irqsave(&hwq->cq_lock, flags);
if (ufshcd_cmd_inflight(lrbp->cmd)) if (ufshcd_cmd_inflight(lrbp->cmd))
ufshcd_release_scsi_cmd(hba, lrbp); ufshcd_release_scsi_cmd(hba, lrbp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment