scsi: ufs: move unmap from ISR to Soft IRQ
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 04:41:16 +0000 (13:41 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:28 +0000 (17:20 +0900)
Change-Id: I4cbdb3904838ffdb82338b71463f523020d51f53
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h

index a4e2a7b3454414a37a4afe5664a0277b924abfc6..16a52479713d311354abaca5d7b553b061d00753 100644 (file)
@@ -2377,6 +2377,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
                goto out_unlock;
        case UFSHCD_STATE_ERROR:
                set_host_byte(cmd, DID_ERROR);
+               scsi_dma_map(cmd);
                cmd->scsi_done(cmd);
                goto out_unlock;
        default:
@@ -4552,6 +4553,13 @@ static inline void ufshcd_get_lu_power_on_wp_status(struct ufs_hba *hba,
        }
 }
 
+static void ufshcd_done(struct request *rq)
+{
+       struct scsi_cmnd *cmd = rq->special;
+       scsi_dma_unmap(cmd);
+       scsi_softirq_done(rq);
+}
+
 /**
  * ufshcd_slave_alloc - handle initial SCSI device configurations
  * @sdev: pointer to SCSI device
@@ -4578,6 +4586,8 @@ static int ufshcd_slave_alloc(struct scsi_device *sdev)
 
        ufshcd_get_lu_power_on_wp_status(hba, sdev);
 
+       blk_queue_softirq_done(sdev->request_queue, ufshcd_done);
+
        return 0;
 }
 
@@ -4834,7 +4844,6 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, int reason,
                if (cmd) {
                        ufshcd_add_command_trace(hba, index, "complete");
                        result = ufshcd_transfer_rsp_status(hba, lrbp);
-                       scsi_dma_unmap(cmd);
                        cmd->result = result;
                                if (reason)
                                        set_host_byte(cmd, reason);
index 0d85630b7536b215991e8e08cdef79424e510730..cc45d99f4dcc1ab1dec0864a7cb3abbb68401342 100644 (file)
@@ -811,6 +811,7 @@ extern int ufshcd_dme_get_attr(struct ufs_hba *hba, u32 attr_sel,
                               u32 *mib_val, u8 peer);
 extern int ufshcd_config_pwr_mode(struct ufs_hba *hba,
                struct ufs_pa_layer_attr *desired_pwr_mode);
+extern void scsi_softirq_done(struct request *rq);
 
 /* UIC command interfaces for DME primitives */
 #define DME_LOCAL      0