From patchwork Tue Oct 18 00:10:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: subhashj@codeaurora.org X-Patchwork-Id: 9380883 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ECB54608A7 for ; Tue, 18 Oct 2016 00:10:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD423289EB for ; Tue, 18 Oct 2016 00:10:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF7DF28FF2; Tue, 18 Oct 2016 00:10:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7755C28FF0 for ; Tue, 18 Oct 2016 00:10:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030298AbcJRAK0 (ORCPT ); Mon, 17 Oct 2016 20:10:26 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43819 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030316AbcJRAKV (ORCPT ); Mon, 17 Oct 2016 20:10:21 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4CCD5617C7; Tue, 18 Oct 2016 00:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476749420; bh=C8Fq3FZuh1BOZXN+MTxxvsP33cpZUW/xlyJIGifwp1s=; h=From:To:Cc:Subject:Date:From; b=DfsKZx39gMsxFmY6rmnzsB2n36Wlbb+AgqyKt3KmYYywE3AY/nzYtqPOySOR/LAGK YBcmFA87+Df+bRP86wuksspHnaec31LsM+i9AWI8hGpnqOshNY4aucWB+d7DQrXFPz NmL6ziIh2euAEfFZu+CyuzVF9Mf4bhFgiPUuU4Ic= Received: from subhashj-linux1.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: subhashj@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id CAE77617BF; Tue, 18 Oct 2016 00:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476749420; bh=C8Fq3FZuh1BOZXN+MTxxvsP33cpZUW/xlyJIGifwp1s=; h=From:To:Cc:Subject:Date:From; b=DfsKZx39gMsxFmY6rmnzsB2n36Wlbb+AgqyKt3KmYYywE3AY/nzYtqPOySOR/LAGK YBcmFA87+Df+bRP86wuksspHnaec31LsM+i9AWI8hGpnqOshNY4aucWB+d7DQrXFPz NmL6ziIh2euAEfFZu+CyuzVF9Mf4bhFgiPUuU4Ic= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org CAE77617BF Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=subhashj@codeaurora.org From: Subhash Jadavani To: vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: Dov Levenglick , Subhash Jadavani , linux-scsi@vger.kernel.org (open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 07/11] scsi: ufs: fail ufshcd_probe_hba() if power configuration fails Date: Mon, 17 Oct 2016 17:10:14 -0700 Message-Id: <1476749414-11325-1-git-send-email-subhashj@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dov Levenglick In case the power configuration fails, skip further processing of the probing function and return immediately. This has 2 reasons: 1. Don't allow the UFS to continue running in PWM 2. Avoid multiple calls to pm_runtime_put_sync() when not in error handling or power management contexts Signed-off-by: Dov Levenglick Signed-off-by: Subhash Jadavani --- drivers/scsi/ufs/ufshcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index c6fa3c0..fced52f 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5051,9 +5051,11 @@ static int ufshcd_probe_hba(struct ufs_hba *hba) __func__); } else { ret = ufshcd_config_pwr_mode(hba, &hba->max_pwr_info.info); - if (ret) + if (ret) { dev_err(hba->dev, "%s: Failed setting power mode, err = %d\n", __func__, ret); + goto out; + } } /* set the state as operational after switching to desired gear */