From patchwork Thu Sep 17 09:45:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7205081 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 BA779BF036 for ; Thu, 17 Sep 2015 09:56:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7BAE206F4 for ; Thu, 17 Sep 2015 09:56:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D94FB205E5 for ; Thu, 17 Sep 2015 09:56:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753923AbbIQJ4i (ORCPT ); Thu, 17 Sep 2015 05:56:38 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:55923 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753557AbbIQJy4 (ORCPT ); Thu, 17 Sep 2015 05:54:56 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NUT02LWEFJH3OC0@mailout1.samsung.com>; Thu, 17 Sep 2015 18:54:53 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.125]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 21.4C.29324.DED8AF55; Thu, 17 Sep 2015 18:54:53 +0900 (KST) X-AuditID: cbfee68d-f79106d00000728c-07-55fa8dedf553 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 47.3C.23663.CED8AF55; Thu, 17 Sep 2015 18:54:53 +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 <0NUT000DPFIZ1D40@mmp1.samsung.com>; Thu, 17 Sep 2015 18:54:52 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: JBottomley@odin.com, vinholikatti@gmail.com, amit.daniel@samsung.com, essuuj@gmail.com, devicetree@vger.kernel.org Subject: [PATCH v2 09/11] scsi: ufs: return value of pwr_change_notify Date: Thu, 17 Sep 2015 15:15:35 +0530 Message-id: <1442483137-32376-10-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1442483137-32376-1-git-send-email-alim.akhtar@samsung.com> References: <1442483137-32376-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsWyRsSkVvdt769Qg3/neS0aroZYzD9yjtVi +YUlTBb/199msbi8aw6bRff1HWwWOxZWObB77Jx1l93j8I8fzB59W1YxenzeJBfAEsVlk5Ka k1mWWqRvl8CV8XzLZ9aCh3wVtz5sYWtg7OLpYuTkkBAwkbhwtokZwhaTuHBvPVsXIxeHkMAK Ron9374zwhTNePuUHSKxlFGi4ccnZgjnJ6PErv6/7CBVbALaEnenb2ECsUUEbCTO33wAZjML VEjcOjOBBcQWFnCTWP3iMlicRUBV4uGHBaxdjBwcvAIeEqtPJUEsU5TofjaBDcTmBAq/+r8I rERIwF3i/IZakLUSAv3sEr1/JrFBjBGQ+Db5EAtIjYSArMSmA1DPSEocXHGDZQKj8AJGhlWM oqkFyQXFSelFhnrFibnFpXnpesn5uZsYgWF9+t+z3h2Mtw9YH2IU4GBU4uFVcPkVKsSaWFZc mXuI0RRow0RmKdHkfGD05JXEGxqbGVmYmpgaG5lbmimJ8ypK/QwWEkhPLEnNTk0tSC2KL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C0mzAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 "power 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 da52c45..0c9f319 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);