From patchwork Tue Mar 25 18:51:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 3890021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AFF849F334 for ; Tue, 25 Mar 2014 18:53:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D523C201C8 for ; Tue, 25 Mar 2014 18:53:13 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C861B20173 for ; Tue, 25 Mar 2014 18:53:12 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSWSv-0000vD-Sb; Tue, 25 Mar 2014 18:52:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSWSo-0006PX-28; Tue, 25 Mar 2014 18:52:42 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSWST-0006L3-Ie for linux-arm-kernel@lists.infradead.org; Tue, 25 Mar 2014 18:52:23 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N3000MZM9QMAY90@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 26 Mar 2014 03:51:58 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-1c-5331d04e4c3b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 71.6C.29263.E40D1335; Wed, 26 Mar 2014 03:51:58 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N3000J1S9Q7U6A0@mmp1.samsung.com>; Wed, 26 Mar 2014 03:51:57 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Tejun Heo Subject: [PATCH v4 1/4] ata: ahci_platform: fix ahci_platform_data->suspend method handling Date: Tue, 25 Mar 2014 19:51:38 +0100 Message-id: <1395773501-6663-2-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1395773501-6663-1-git-send-email-b.zolnierkie@samsung.com> References: <1395773501-6663-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jAV2/C4bBBof+s1lsnLGe1eLcrQZW izfHpzNZ3FnBbLHp8TVWi2M7HjFZXN41h81if+8GJouG7h52izkzNrNa/Fp+lNFi5cW/zA48 Htdf/Wfy2DnrLrvHplWdbB5zpjWxeJy8cJLFY/OSeo/3+66yefRtWcXo8fTHXmaP4ze2M3l8 3iQXwB3FZZOSmpNZllqkb5fAldF9YhZbwUmuirb365kbGO9wdDFyckgImEi8Xn2IBcIWk7hw bz1bFyMXh5DAIkaJC4+uQTldTBJz999hBqliE7CSmNi+ihHEFhGQlbgy7SEjSBGzQBezxJLZ W8ASwgKxEgsnLGMHsVkEVCXW7/gL1MzBwSvgLnHmKSvENkWJ7mcT2EBsTgEPif/31jGB2EIg JfPms01g5F3AyLCKUTS1ILmgOCk911CvODG3uDQvXS85P3cTIziAn0ntYFzZYHGIUYCDUYmH d8IEw2Ah1sSy4srcQ4wSHMxKIrx/TwKFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8x5otQ4UEkhP LEnNTk0tSC2CyTJxcEo1MPqy75oTvHr5pWUqrXoXdi9zOVDpfLHWeFbWHr66vJPPknvXv2VP eX/03a5LCnu/OR85Nq9SWjYhTf3elrdcH1f/+rnlJteiv6+F2ioFfNKPTshbuTLC8W2HuFbb qTkW0ZF8vfLvtV9Om9w9N8FD5t6sqVq/qoKWiLLuYZnBs3o7j3rLw0apQz+UWIozEg21mIuK EwEecmBPXAIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140325_145221_893973_09B77C21 X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -7.3 (-------) Cc: davinci-linux-open-source@linux.davincidsp.com, linux-ide@vger.kernel.org, Kevin Hilman , Shiraz Hashim , spear-devel@list.st.com, Sekhar Nori , linux-kernel@vger.kernel.org, Hans de Goede , b.zolnierkie@samsung.com, Viresh Kumar , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Looking at ST SPEAr1340 AHCI code (the only user of the deprecated pdata->suspend and pdata->resume) it is obvious the we should return after calling pdata->suspend() only if the function have returned non-zero return value. The code has been broken since commit 1e70c2 ("ata/ahci_platform: Add clock framework support"). Fix it. Cc: Viresh Kumar Cc: Shiraz Hashim Acked-by: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz --- v4: - no changes v3: - no changes v2: - updated patch description drivers/ata/ahci_platform.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 70fbf66..7bd6adf 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -521,12 +521,19 @@ int ahci_platform_suspend(struct device *dev) if (rc) return rc; - if (pdata && pdata->suspend) - return pdata->suspend(dev); + if (pdata && pdata->suspend) { + rc = pdata->suspend(dev); + if (rc) + goto resume_host; + } ahci_platform_disable_resources(hpriv); return 0; + +resume_host: + ahci_platform_resume_host(dev); + return rc; } EXPORT_SYMBOL_GPL(ahci_platform_suspend);