From patchwork Fri Aug 21 09:28:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7050801 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5BBECC05AC for ; Fri, 21 Aug 2015 09:39:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 816AF205F4 for ; Fri, 21 Aug 2015 09:39:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E646202FE for ; Fri, 21 Aug 2015 09:39:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753824AbbHUJjB (ORCPT ); Fri, 21 Aug 2015 05:39:01 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:57800 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753620AbbHUJi7 (ORCPT ); Fri, 21 Aug 2015 05:38:59 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NTF02R1PESYSN30@mailout3.samsung.com>; Fri, 21 Aug 2015 18:38:58 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.126]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id D4.D8.28411.2B1F6D55; Fri, 21 Aug 2015 18:38:58 +0900 (KST) X-AuditID: cbfee68e-f79c56d000006efb-13-55d6f1b2a10f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 23.18.23663.1B1F6D55; Fri, 21 Aug 2015 18:38:58 +0900 (KST) Received: from exypnos.sisodomain.com ([107.108.73.28]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NTF008WKEOTM680@mmp1.samsung.com>; Fri, 21 Aug 2015 18:38:57 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vinholikatti@gmail.com, JBottomley@odin.com, Seungwon Jeon Subject: [PATCH 09/10] scsi: ufs: return value of pwr_change_notify Date: Fri, 21 Aug 2015 14:58:00 +0530 Message-id: <1440149281-26336-10-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1440149281-26336-1-git-send-email-alim.akhtar@samsung.com> References: <1440149281-26336-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRmVeSWpSXmKPExsWyRsSkTnfTx2uhBmv+8lv8X3+bxeLyrjls Ft3Xd7BZfLh/kdlix8IqB1aPnbPusnsc/vGD2aNvyypGj8+b5AJYorhsUlJzMstSi/TtErgy Jjf9ZS54xVdxeOFe5gbGyTxdjJwcEgImEj13GxghbDGJC/fWs3UxcnEICaxglFjZ+pUNpuji uresEImljBInJ61jgXB+Mkpc2TEVrIpNQFvi7vQtTCC2iICNxPmbD8BsZoFwiWsbZrOD2MIC zhIPVh1mAbFZBFQl5txqBlvNK+Ah0fr1BzPENkWJ7mcTwGZyAsXvNs0DqxcScJe4fPkY2BUS As3sEk+3vWSCGCQg8W3yIaAiDqCErMSmA1BzJCUOrrjBMoFReAEjwypG0dSC5ILipPQiI73i xNzi0rx0veT83E2MwEA+/e9Z3w7GmwesDzEKcDAq8fDOiLwWKsSaWFZcmXuI0RRow0RmKdHk fGC85JXEGxqbGVmYmpgaG5lbmimJ8yZI/QwWEkhPLEnNTk0tSC2KLyrNSS0+xMjEwSnVwJhx d8vLu/oR3g8FZI9Oe+7ddPJmeua1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loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Seungwon Jeon Behavior of the "powwer mode change" contains vendor specific operation known as pwr_change_notify. This change adds return for pwr_change_notify to find success or failure. Signed-off-by: Seungwon Jeon Signed-off-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 8982da9..142a927 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2579,14 +2579,18 @@ static int ufshcd_change_power_mode(struct ufs_hba *hba, dev_err(hba->dev, "%s: power mode change failed %d\n", __func__, ret); } else { - if (hba->vops && hba->vops->pwr_change_notify) - hba->vops->pwr_change_notify(hba, - POST_CHANGE, NULL, pwr_mode); + if (hba->vops && hba->vops->pwr_change_notify) { + ret = hba->vops->pwr_change_notify(hba, + POST_CHANGE, NULL, pwr_mode); + if (ret) + goto out; + } memcpy(&hba->pwr_info, pwr_mode, sizeof(struct ufs_pa_layer_attr)); } +out: return ret; } @@ -2601,14 +2605,18 @@ int ufshcd_config_pwr_mode(struct ufs_hba *hba, struct ufs_pa_layer_attr final_params = { 0 }; int ret; - if (hba->vops && hba->vops->pwr_change_notify) - hba->vops->pwr_change_notify(hba, - PRE_CHANGE, desired_pwr_mode, &final_params); - else + if (hba->vops && hba->vops->pwr_change_notify) { + ret = hba->vops->pwr_change_notify(hba, + PRE_CHANGE, desired_pwr_mode, &final_params); + if (ret) + goto out; + } else { memcpy(&final_params, desired_pwr_mode, sizeof(final_params)); + } ret = ufshcd_change_power_mode(hba, &final_params); +out: return ret; } EXPORT_SYMBOL_GPL(ufshcd_config_pwr_mode);