From patchwork Thu Mar 20 18:27:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 3867301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B9162BF540 for ; Thu, 20 Mar 2014 18:28:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E47E1201E4 for ; Thu, 20 Mar 2014 18:28:48 +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 CC786201C7 for ; Thu, 20 Mar 2014 18:28:47 +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 1WQhhV-0002dQ-SY; Thu, 20 Mar 2014 18:28:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQhhP-0003FA-Bx; Thu, 20 Mar 2014 18:28:15 +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 1WQhh7-0003BR-Ta for linux-arm-kernel@lists.infradead.org; Thu, 20 Mar 2014 18:28:00 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2Q00BMDZ9YBN20@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 21 Mar 2014 03:27:34 +0900 (KST) X-AuditID: cbfee61b-b7f456d000006dfd-ce-532b3316a0bc Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id D0.33.28157.6133B235; Fri, 21 Mar 2014 03:27:34 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2Q008LDZ9K0840@mmp2.samsung.com>; Fri, 21 Mar 2014 03:27:34 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Tejun Heo Subject: [PATCH v2 1/3] ata: ahci_platform: fix ahci_platform_data->suspend method handling Date: Thu, 20 Mar 2014 19:27:04 +0100 Message-id: <1395340026-3969-2-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1395340026-3969-1-git-send-email-b.zolnierkie@samsung.com> References: <1395340026-3969-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQV0xY+1gg5e7pSw2zljPanHuVgOr xZvj05ks7qxgttj0+BqrxbEdj5gsLu+aw2axv3cDk0VDdw+7xZwZm1ktfi0/ymix8uJfZgce j+uv/jN57Jx1l91j06pONo8505pYPE5eOMnisXlJvcf7fVfZPPq2rGL0ePpjL7PH8RvbmTw+ b5IL4I7isklJzcksSy3St0vgyuj7s5itYDFXxaL2TywNjIc4uhg5OSQETCTeHPvHCmGLSVy4 t56ti5GLQ0hgOqPEp117mCCcLiaJ0282M4JUsQlYSUxsXwVmiwjISlyZ9pARpIhZoItZYsns LWAJYYFYieZNk8HGsgioSuz51gkW5xVwl+hZsIQZYp2iRPezCWwgNqeAh8T//klgcSGgmvPd p9gmMPIuYGRYxSiaWpBcUJyUnmukV5yYW1yal66XnJ+7iREcws+kdzCuarA4xCjAwajEw1vB qR0sxJpYVlyZe4hRgoNZSYT3mi5QiDclsbIqtSg/vqg0J7X4EKM0B4uSOO/BVutAIYH0xJLU 7NTUgtQimCwTB6dUA+PEfy9+ndUxWLRogr1ZzypDW5ZHRe9Dvk406GPInsR6vUE/xGuJgfib 0odbV/qrv99iyN5sVtK2tWvJuSWFh4oeiL6QF1i8q0Q9+qC07L1MHiWNzSlxPL5vrPN4tzAz Jb0NXMq4c/rG/w9Eypd/nnlm66/Ex+xs17clXj42fV/ozi1x1Q9kjJ8psRRnJBpqMRcVJwIA ArxeO10CAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140320_142758_229565_4812D408 X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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 --- 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);