[COMMON] scsi: Get scsi lun for UFS RPMB ioctl cmds
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 10:14:08 +0000 (19:14 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:48 +0000 (17:20 +0900)
Change-Id: I8d6f94bb07b9c0708982a0cdd64a21c6108f872e
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufshcd.c

index 6bf6f10900fafaca10c58b5b85c1dee83f45f461..4900522746a6a5f6c1071a195502ad5b8912e5de 100644 (file)
@@ -251,6 +251,10 @@ static int ufshcd_scale_clks(struct ufs_hba *hba, bool scale_up);
 static irqreturn_t ufshcd_intr(int irq, void *__hba);
 static int ufshcd_change_power_mode(struct ufs_hba *hba,
                             struct ufs_pa_layer_attr *pwr_mode);
+static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
+                                    enum ufs_dev_pwr_mode pwr_mode);
+static int ufshcd_send_request_sense(struct ufs_hba *hba,
+                               struct scsi_device *sdp);
 static inline bool ufshcd_valid_tag(struct ufs_hba *hba, int tag)
 {
        return tag >= 0 && tag < hba->nutrs;
@@ -2435,6 +2439,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
        unsigned long flags;
        int tag;
        int err = 0;
+       unsigned int scsi_lun;
 
        hba = shost_priv(host);
 
@@ -2511,7 +2516,9 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
        lrbp->sense_bufflen = UFSHCD_REQ_SENSE_SIZE;
        lrbp->sense_buffer = cmd->sense_buffer;
        lrbp->task_tag = tag;
-       lrbp->lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
+
+       scsi_lun = ufshcd_get_scsi_lun(cmd);
+       lrbp->lun = ufshcd_scsi_to_upiu_lun(scsi_lun);
        lrbp->intr_cmd = !ufshcd_is_intr_aggr_allowed(hba) ? true : false;
        lrbp->req_abort_skip = false;