From patchwork Mon Mar 17 13:05:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 3843451 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 901DC9F334 for ; Mon, 17 Mar 2014 13:06:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7D40201DE for ; Mon, 17 Mar 2014 13:06:25 +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 A9BC42015E for ; Mon, 17 Mar 2014 13:06:24 +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 1WPXF5-0005Mr-4c; Mon, 17 Mar 2014 13:06:11 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPXF2-0001K0-NS; Mon, 17 Mar 2014 13:06:08 +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 1WPXEz-0001IL-Ey for linux-arm-kernel@lists.infradead.org; Mon, 17 Mar 2014 13:06:07 +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 <0N2L00C6L0DESV90@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 17 Mar 2014 22:05:38 +0900 (KST) X-AuditID: cbfee61b-b7f456d000006dfd-da-5326f322e21c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 69.DF.28157.223F6235; Mon, 17 Mar 2014 22:05:38 +0900 (KST) Received: from amdc1032.localnet ([106.116.147.136]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2L0061F0DC9660@mmp2.samsung.com>; Mon, 17 Mar 2014 22:05:38 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Tejun Heo Subject: [PATCH] ata: ahci_sunxi: disable resources on driver removal Date: Mon, 17 Mar 2014 14:05:15 +0100 Message-id: <4639408.hubNkUp5Oa@amdc1032> User-Agent: KMail/4.8.4 (Linux/3.2.0-54-generic-pae; KDE/4.8.5; i686; ; ) MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jQV2lz2rBBjMnGFm8OT6dyWLT42us Fsd2PGKyuLxrDpvF1k17mS1eTnrIavFr+VFGB3aPJ5suMnpsWtXJ5rF5Sb3H+31X2TxaW5az enzeJBfAFsVlk5Kak1mWWqRvl8CVsfLRZcaCs1wVZ74+Ym1gbOXsYuTkkBAwkdjz9g4LhC0m ceHeerYuRi4OIYHpjBLr9rcxQzgtTBKXfp1nBaliE7CSmNi+ihHEFhGQlbgy7SEjSBGzwBNG iQUnt7KBJIQFXCVu7VkAZrMIqEq8ObIbrIFXQFNi5q2DYOtEBTwldmxfyQYRF5T4MfkeWJxZ QF5i3/6prBC2lsT6nceZJjDyzUJSNgtJ2SwkZQsYmVcxiqYWJBcUJ6XnGukVJ+YWl+al6yXn 525iBAfwM+kdjKsaLA4xCnAwKvHwTlBWCxZiTSwrrsw9xCjBwawkwuv0DijEm5JYWZValB9f VJqTWnyIUZqDRUmc92CrdaCQQHpiSWp2ampBahFMlomDU6qBUb6zePHq2Wv983Sc23epeLTH NldpTRJsDFkpphB+LuqyXl/c/17+8u1rzKdrmW/5pPZl3uRQphWrJs11fWKVaaJzXWqh4CPj 1TFe25feLnrbZPh+X+Gb+xo1kyvUojlP772S+U6pIPFz6MmfhwNtLFc+eOD/tMMqdxbbxzvL d+x/y8a2rG6qlBJLcUaioRZzUXEiAHi7eqFcAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140317_090605_712683_ABD4C2D3 X-CRM114-Status: UNSURE ( 8.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) Cc: linux-ide@vger.kernel.org, Oliver Schinagl , linux-kernel@vger.kernel.org, Hans de Goede , Maxime Ripard , 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: , 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 Add custom ->host_stop method to disable resources on driver removal. Signed-off-by: Bartlomiej Zolnierkiewicz --- Compile tested only. drivers/ata/ahci_sunxi.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) Index: b/drivers/ata/ahci_sunxi.c =================================================================== --- a/drivers/ata/ahci_sunxi.c 2014-03-17 13:48:26.292485389 +0100 +++ b/drivers/ata/ahci_sunxi.c 2014-03-17 13:55:48.912477842 +0100 @@ -156,13 +156,25 @@ static void ahci_sunxi_start_engine(stru sunxi_setbits(port_mmio + PORT_CMD, PORT_CMD_START); } +static void ahci_sunxi_host_stop(struct ata_host *host) +{ + struct ahci_host_priv *hpriv = host->private_data; + + ahci_platform_disable_resources(hpriv); +} + +static struct ata_port_operations ahci_sunxi_port_ops = { + .inherits = &ahci_platform_ops, + .host_stop = ahci_sunxi_host_stop, +}; + static const struct ata_port_info ahci_sunxi_port_info = { AHCI_HFLAGS(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI | AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ), .flags = AHCI_FLAG_COMMON | ATA_FLAG_NCQ, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, - .port_ops = &ahci_platform_ops, + .port_ops = &ahci_sunxi_port_ops, }; static int ahci_sunxi_probe(struct platform_device *pdev)