From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sujit Reddy Thumma Subject: Re: [PATCH V2 3/4] scsi: ufs: Fix device and host reset methods Date: Wed, 03 Jul 2013 22:05:27 +0530 Message-ID: <51D452CF.80402@codeaurora.org> References: <1372444531-24340-1-git-send-email-sthumma@codeaurora.org> <1372444531-24340-4-git-send-email-sthumma@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-scsi-owner@vger.kernel.org To: Santosh Y Cc: Vinayak Holikatti , "James E.J. Bottomley" , linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org On 7/3/2013 11:19 AM, Santosh Y wrote: >> + >> >+/** >> >+ * ufshcd_eh_device_reset_handler - device reset handler registered to >> >+ * scsi layer. >> >+ * @cmd - SCSI command pointer >> >+ * >> >+ * Returns SUCCESS/FAILED >> >+ */ >> >+static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) >> >+{ >> >+ struct ufs_hba *hba; >> >+ int err; >> >+ unsigned long flags; >> >+ >> >+ hba = shost_priv(cmd->device->host); >> >+ >> >+ spin_lock_irqsave(hba->host->host_lock, flags); >> >+ if (hba->ufshcd_state == UFSHCD_STATE_RESET) { >> >+ dev_warn(hba->dev, "%s: reset in progress\n", __func__); >> >+ err = SUCCESS; >> >+ spin_unlock_irqrestore(hba->host->host_lock, flags); >> >+ goto out; > It is better to wait here until the state changes to 'operational' or > 'error' before returning success. Okay. Sounds good. -- Regards, Sujit