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: 3867311 Return-Path: X-Original-To: patchwork-davinci@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 63619BF540 for ; Thu, 20 Mar 2014 18:28:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9954E201E7 for ; Thu, 20 Mar 2014 18:28:52 +0000 (UTC) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B6B5201C7 for ; Thu, 20 Mar 2014 18:28:51 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2KIRlIZ017607; Thu, 20 Mar 2014 13:27:47 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2KIRdIR002766; Thu, 20 Mar 2014 13:27:46 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Thu, 20 Mar 2014 13:27:42 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2KIRf8f030014; Thu, 20 Mar 2014 13:27:41 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3253080627; Thu, 20 Mar 2014 12:27:40 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflxv17.itg.ti.com (dflxv17.itg.ti.com [128.247.5.93]) by linux.omap.com (Postfix) with ESMTP id 40A448062A for ; Thu, 20 Mar 2014 12:27:38 -0600 (CST) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2KIRcZi018976 for ; Thu, 20 Mar 2014 13:27:38 -0500 Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2KIRbJt021978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 20 Mar 2014 13:27:37 -0500 Received: from [216.82.250.99:21668] by server-9.bemta-12.messagelabs.com id 62/BA-23449-9133B235; Thu, 20 Mar 2014 18:27:37 +0000 X-Env-Sender: b.zolnierkie@samsung.com X-Msg-Ref: server-7.tower-126.messagelabs.com!1395340055!9926614!1 X-Originating-IP: [203.254.224.33] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjAzLjI1NC4yMjQuMzMgPT4gMzY3NDY5\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14368 invoked from network); 20 Mar 2014 18:27:36 -0000 Received: from mailout3.samsung.com (HELO mailout3.samsung.com) (203.254.224.33) by server-7.tower-126.messagelabs.com with DES-CBC3-SHA encrypted SMTP; 20 Mar 2014 18:27:36 -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 davinci-linux-open-source@linux.davincidsp.com; 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= CC: , , Kevin Hilman , Shiraz Hashim , , , Hans de Goede , , Viresh Kumar , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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);