From patchwork Mon May 20 14:46:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10951533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20594933 for ; Mon, 20 May 2019 14:47:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D3A8288D1 for ; Mon, 20 May 2019 14:47:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01963288D8; Mon, 20 May 2019 14:47:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C41F288E8 for ; Mon, 20 May 2019 14:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wOQmrHgx1d0dulXT9ggjyszxoL1FwNFXy/tCinongRQ=; b=TXpUO9VAWSZaf2 zRvbQOvcsGjR4/GGmSt63LWht2wEfqrd4W6TFjIwGtQWQzV8LuocVF20d9i78dMsQYK+/5eLtOrCG x4lsOqvnA8YUJqJcRRznN9QFdiY5Fi/8NHADuStedNm9FEwQ4Lnqs4PeTkjHbB8vLDJD03mD6aMUX NPpbk+uutdmTFJjM9qTYQvXek5cC6BrQds57IENGKbK/8nJ2eBYwpw+sqIDJQSlzmbVkJM0cUPODu g30wD63LyQFQo9prnYpqln/EgW425WjsuW53gb7Vy3B2hnn1k+nM4UJ4wUE0/S6GReAZVQU4tcw7s SBHC2RqrSuMbLmIwusQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZE-0007nm-8c; Mon, 20 May 2019 14:47:08 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZA-0007lt-TD for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 14:47:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3woGulBQUBzAi0qKHgtmzZeUDpblfNtsGA0Nmvfd/ro=; b=rQAUJcrP3mTj1mlVWAHpWr1ewF qlcUR+OQoK2O8AvKMZYbQmMrpdeDDYevYT0Z5IQaQuml2Y07rPt+KC3XABp08FyuZbNcHyp9NBBQi MJsTPwbnSz+uFiHfFm68BS6XO29CZWMe8W4EnMwN2e4HAIa+YnY+2NdSNEKWLQtXzCPyHBUfMNZmp P/78d+vRUPu00tQdH59Nmmsqno6X7fFFAinUymxW/bBgqpPg4j1kB3RqRzOUzgUMPNGz8pLdRZYv8 Bvn/mauQonjnT/5R3HGCyGPfGGESVttaCV2c8pyblGAm2gdFHLb7LgVYAff8cdrP11dPE1lQsb6nT 6TOxysgw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:43220 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1hSjZ0-0003OH-GR; Mon, 20 May 2019 15:46:54 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hSjYz-0000Xh-VV; Mon, 20 May 2019 15:46:54 +0100 In-Reply-To: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> References: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/8] ARM: riscpc: replace gettimeoffset() with clocksource MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 20 May 2019 15:46:53 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_074704_937527_0BD0FCC4 X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-Virus-Scanned: ClamAV using ClamSMTP Replace the old gettimeoffset() interface (which became buggy in several ways) with a clocksource that atomically reads the count and status from the timer, and corrects the count as appropriate ensuring proper resolution of time without time warping backwards. We keep the original periodic timer non-clock event implementation to provide the kernel with a regular source of interrupts, which are required to keep the clocksource properly updated. Signed-off-by: Russell King --- arch/arm/Kconfig | 1 - arch/arm/mach-rpc/time.c | 38 +++++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9aed25a6019b..08a4915a69d2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -528,7 +528,6 @@ config ARCH_RPC select ARCH_ACORN select ARCH_MAY_HAVE_PC_FDC select ARCH_SPARSEMEM_ENABLE - select ARCH_USES_GETTIMEOFFSET select CPU_SA110 select FIQ select HAVE_IDE diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c index 2689771c1d38..1c84efc9db1f 100644 --- a/arch/arm/mach-rpc/time.c +++ b/arch/arm/mach-rpc/time.c @@ -13,7 +13,7 @@ * 04-Dec-1997 RMK Updated for new arch/arm/time.c * 13=Jun-2004 DS Moved to arch/arm/common b/c shared w/CLPS7500 */ -#include +#include #include #include #include @@ -27,11 +27,15 @@ #define RPC_CLOCK_FREQ 2000000 #define RPC_LATCH DIV_ROUND_CLOSEST(RPC_CLOCK_FREQ, HZ) -static u32 ioc_timer_gettimeoffset(void) +static u32 ioc_time; + +static u64 ioc_timer_read(struct clocksource *cs) { unsigned int count1, count2, status; - long offset; + unsigned long flags; + u32 ticks; + local_irq_save(flags); ioc_writeb (0, IOC_T0LATCH); barrier (); count1 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); @@ -41,27 +45,34 @@ static u32 ioc_timer_gettimeoffset(void) ioc_writeb (0, IOC_T0LATCH); barrier (); count2 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); + ticks = ioc_time + RPC_LATCH - count2; + local_irq_restore(flags); - offset = count2; if (count2 < count1) { /* - * We have not had an interrupt between reading count1 - * and count2. + * The timer has not reloaded between reading count1 and + * count2, check whether an interrupt was actually pending. */ if (status & (1 << 5)) - offset -= RPC_LATCH; + ticks += RPC_LATCH; } else if (count2 > count1) { /* - * We have just had another interrupt between reading - * count1 and count2. + * The timer has reloaded, so count2 indicates the new + * count since the wrap. The interrupt would not have + * been processed, so add the missed ticks. */ - offset -= RPC_LATCH; + ticks += RPC_LATCH; } - offset = (RPC_LATCH - offset) * (tick_nsec / 1000); - return DIV_ROUND_CLOSEST(offset, RPC_LATCH) * 1000; + return ticks; } +static struct clocksource ioctime_clocksource = { + .read = ioc_timer_read, + .mask = CLOCKSOURCE_MASK(32), + .rating = 100, +}; + void __init ioctime_init(void) { ioc_writeb(RPC_LATCH & 255, IOC_T0LTCHL); @@ -72,6 +83,7 @@ void __init ioctime_init(void) static irqreturn_t ioc_timer_interrupt(int irq, void *dev_id) { + ioc_time += RPC_LATCH; timer_tick(); return IRQ_HANDLED; } @@ -86,7 +98,7 @@ static struct irqaction ioc_timer_irq = { */ void __init ioc_timer_init(void) { - arch_gettimeoffset = ioc_timer_gettimeoffset; + WARN_ON(clocksource_register_hz(&ioctime_clocksource, RPC_CLOCK_FREQ)); ioctime_init(); setup_irq(IRQ_TIMER0, &ioc_timer_irq); } From patchwork Mon May 20 14:46:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10951535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F31BF1395 for ; Mon, 20 May 2019 14:47:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E195328847 for ; Mon, 20 May 2019 14:47:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5FEF288F3; Mon, 20 May 2019 14:47:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82F53288F1 for ; Mon, 20 May 2019 14:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ev9tJaS1KsEueeavU4uEIy7LBLwt+3vpdO8zA7tc0Fk=; b=MaKaDnruB630K3 m8b1n/lG6gzIDJ2mW9qJ3tVZelCXuQCEqUlUYE7ZwGfbWjCdcz38JOyzvbTb5cP5LKtwu6Edvvrar A8WHkIeEMrB3Pfb+7l53L3EfFCjCphe808hrgvm4bMHydY1k7w8YDcjm7Olw1fdVvfg9BFoVSbX68 77STvgdPIxov747pTFfVyb4p2lfRXi5Mw4nmR4/IR3Qz2Y3p2W/EAPMzOz0S3oBnSoC0n0iGwxgTX DNdviw3LjLJOLykJENDmsArlSxoGpbAcYOFLpaJeWRxpmX+sC2BBh6+7OLj5jwkhZaeG0sP7khq09 fUrGiLeVASeivdarjv6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZO-0007zR-2O; Mon, 20 May 2019 14:47:18 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZB-0007ly-PX for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 14:47:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8J+PxujrnIHTIvm7C4XOPAAmBzDL12INHbyAjk14YLE=; b=jAHP+eJZYh1XNzQkBoJ1BP+E9q Ex2iIQzQiZPSseQ1G6ixBE6vKDDwG8rN2SC1iiAXHxPPvWs+77BcL+LpbicrPl1Yl0O04F67Wo0F3 JbvAkoT/JOI9fK7e/o3DYyMKgDDwhYUnlfXfR3Zm6E0/zk9GtWh34KsTOgjCpmPQz/LH1GmPjMdui MniPVMxU/EUtOH3E24uCmbmVCvMspN0iRuIoWEaLa4RJd6qfhMiwtcGgqgU5IQaII6BcHlrWqbrQI o65ZOfxBB9qpTAz6dbi2khXqun4qAghNNBv6vSGJgbuCOqflMQ7J6wNlqd0DSR2XfOhnzLWa7+MaH Gozi29PA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:42708 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1hSjZ5-0003ON-PZ; Mon, 20 May 2019 15:46:59 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hSjZ5-0000Xo-4I; Mon, 20 May 2019 15:46:59 +0100 In-Reply-To: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> References: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/8] ARM: riscpc: fix lack of keyboard interrupts after irq conversion MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 20 May 2019 15:46:59 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_074705_861382_AE30B4D2 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-Virus-Scanned: ClamAV using ClamSMTP Fix lack of keyboard interrupts for RiscPC due to incorrect conversion. Fixes: e8d36d5dbb6a ("ARM: kill off set_irq_flags usage") Signed-off-by: Russell King --- arch/arm/mach-rpc/irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-rpc/irq.c b/arch/arm/mach-rpc/irq.c index b8a61cb11207..7f0f40178634 100644 --- a/arch/arm/mach-rpc/irq.c +++ b/arch/arm/mach-rpc/irq.c @@ -118,7 +118,7 @@ extern unsigned char rpc_default_fiq_start, rpc_default_fiq_end; void __init rpc_init_irq(void) { - unsigned int irq, clr, set = 0; + unsigned int irq, clr, set; iomd_writeb(0, IOMD_IRQMASKA); iomd_writeb(0, IOMD_IRQMASKB); @@ -130,6 +130,7 @@ void __init rpc_init_irq(void) for (irq = 0; irq < NR_IRQS; irq++) { clr = IRQ_NOREQUEST; + set = 0; if (irq <= 6 || (irq >= 9 && irq <= 15)) clr |= IRQ_NOPROBE; From patchwork Mon May 20 14:47:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10951537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3ADFB1395 for ; Mon, 20 May 2019 14:47:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28B0628879 for ; Mon, 20 May 2019 14:47:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D625288D1; Mon, 20 May 2019 14:47:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9907E28879 for ; Mon, 20 May 2019 14:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3RmOCdm5J2qisBSKn8akdo9PMut4AKEn+IxXIb6nk4M=; b=L7wm8LzaUh7lHM CKHRxarqReyqqtdIdr37VmMXp6V7nyBCalxFZPaA/rbuUcKt/gg3oLlSGWzW46DSjz+3NY1gbt0BB S/nlksMXWkRGTgnQSpI/Prasifb1ARCZlQ3N6oo+PvCMuUdeuEKkiaNKK2/dTJhUY6ez9Qskndeem kKMtyh+SxWVPg9FucdCeG9GRkO/J4kMcDxwK5LawjZnVy13/QSlraKlSas4TLxHIcm/YeIoMPkTEu Vb4xyNvBfFFsY/zk21AGFZdu7QtRWKSBh/XhbkgrzeZN3L2JX3XqNDWnHFhC7Q13+4ldv28CgRkYw IuEDT8+xuFn0f5NMYs7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZV-00089r-CD; Mon, 20 May 2019 14:47:25 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZH-0007p6-Kx for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 14:47:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6j+6ZAFxV1y7Qg1RWkX4ddRlT0yOR4aaVsAYpnFzC50=; b=xidY85DOIOJINvC6PEasTn0faz gjWvzuQU4W9tvCydywmR3nyfZst0ZXzDWT3yyydenKjM17TfyBH+sydMZ/qdWSnF0C6QBr8R/Jod8 CnUfFawSsqArH8SEMkJAoJlfByl6FF0kGtGWrUMv5ZYpaNVF2LuSAYpaAuMRJK/ys8Bc+5hjU4FlF wHhMftYXCkFlBc4uxKX/W1B/fzZaekpB2rXxcHCpmNFRRGL+fWplsHk/eXooTWuLGVO9ZsWeLod4g TuGVUnR2mc+WlwU4y4W/LMDi4lqCVQ/B1PWepPVrcN9AcCTatA2WzktWyrBoLqqIziA5UMESnL/QH 0UzcHpHA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:43224 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1hSjZB-0003Oc-CD; Mon, 20 May 2019 15:47:05 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hSjZA-0000Xv-8Y; Mon, 20 May 2019 15:47:04 +0100 In-Reply-To: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> References: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/8] ARM: riscpc: fix ecard printing MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 20 May 2019 15:47:04 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_074711_930372_221BCEDB X-CRM114-Status: GOOD ( 10.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-Virus-Scanned: ClamAV using ClamSMTP Multiple printk() statements appear to get broken into separate lines, which messes up the formatting. Fix these up. Signed-off-by: Russell King --- arch/arm/mach-rpc/ecard.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c index 04b2f22c2739..3e7b81cc4274 100644 --- a/arch/arm/mach-rpc/ecard.c +++ b/arch/arm/mach-rpc/ecard.c @@ -496,18 +496,21 @@ static void ecard_dump_irq_state(void) printk("Expansion card IRQ state:\n"); for (ec = cards; ec; ec = ec->next) { + const char *claimed; + if (ec->slot_no == 8) continue; - printk(" %d: %sclaimed, ", - ec->slot_no, ec->claimed ? "" : "not "); + claimed = ec->claimed ? "" : "not "; if (ec->ops && ec->ops->irqpending && ec->ops != &ecard_default_ops) - printk("irq %spending\n", + printk(" %d: %sclaimed irq %spending\n", + ec->slot_no, claimed, ec->ops->irqpending(ec) ? "" : "not "); else - printk("irqaddr %p, mask = %02X, status = %02X\n", + printk(" %d: %sclaimed irqaddr %p, mask = %02X, status = %02X\n", + ec->slot_no, claimed, ec->irqaddr, ec->irqmask, readb(ec->irqaddr)); } } From patchwork Mon May 20 14:47:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10951539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C085D933 for ; Mon, 20 May 2019 14:47:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE57D2844B for ; Mon, 20 May 2019 14:47:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2E4928879; Mon, 20 May 2019 14:47:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4EBC12844B for ; Mon, 20 May 2019 14:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XJy+a3Qwgxrac9JqtEMvavXCYfJoBnZmYKQQbZUXb9Q=; b=BrBcGk3A0T5ks5 LYzAP0ZNQtBBGTt8waWB9Ycy++K5TuZa2GQUV6XAGeu/4rD1z5j09ycglMUkf0RWVGN2X0Zvyn7BY ZIoN8DsivStY4yRM942+8NQocjHoHH1DX9L2wEVlsKQUhkzQUQPqj7mND7tPElqklcVsdW/eXR7// olrhki8j7r2yHxU7TRZxFe3bZLRTO96P09yA0V2E6Xd3IVrnOiNXF2gyHIhtauRcVZkioYvBdSMQi +PFKNnYieDYXgxLZonqtG0xT7WuRGZkD8bGnfHuD+aZIPBMWVKjcmmvVhkeI1Wb0VmtnZDkcBZVpe ml93krJTHWGpcpsO5gng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZg-0008PB-Rl; Mon, 20 May 2019 14:47:36 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZK-0007uV-L5 for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 14:47:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=a0iUrMI8agCigZC1DvHlJMdWpsiSQY7mMK/V5gww7sM=; b=WmBrh+/k6yTSNpBPb9fhVMQjCt B+Qeuc1G9bvb3KvhwKt6t5/mqoY2o3pknaP6OyHwRtpeFwlVehtd3//TkNowgwhqogGc2n8CmOLLF qM1xEl62Lojv/ETTYwP7LFk/dFUwWFLfOTJx6mN5vcL3P1rPEoYqr+VCP1J/Gfj/DDNdp/o7K1NVf QPdPGyWOgdNUeqvabwv9teywNTDOdt42+eM1tWN4t08gadZDQhC4zMIUh+Khy+ufPpFVIQh8Kg36a EUpZqlkhDCJkxzbDk0EWAzsBBgrgamMsJbtFyIVzbPYhCsISlEJ4FMc1CJbfp/S7vd0nFLux6GNGZ kZivr4Aw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:42712 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1hSjZG-0003Oo-6J; Mon, 20 May 2019 15:47:10 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hSjZF-0000Y2-CA; Mon, 20 May 2019 15:47:09 +0100 In-Reply-To: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> References: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/8] ARM: riscpc: fix DMA MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 20 May 2019 15:47:09 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_074714_844602_B0411BC5 X-CRM114-Status: GOOD ( 11.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-Virus-Scanned: ClamAV using ClamSMTP DMA got broken a while back in two different ways: 1) a change in the behaviour of disable_irq() to wait for the interrupt to finish executing causes us to deadlock at the end of DMA. 2) a change to avoid modifying the scatterlist left the first transfer uninitialised. DMA is only used with expansion cards, so has gone unnoticed. Fixes: fa4e99899932 ("[ARM] dma: RiscPC: don't modify DMA SG entries") Signed-off-by: Russell King --- arch/arm/mach-rpc/dma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index fb48f3141fb4..c4c96661eb89 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c @@ -131,7 +131,7 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id) } while (1); idma->state = ~DMA_ST_AB; - disable_irq(irq); + disable_irq_nosync(irq); return IRQ_HANDLED; } @@ -174,6 +174,9 @@ static void iomd_enable_dma(unsigned int chan, dma_t *dma) DMA_FROM_DEVICE : DMA_TO_DEVICE); } + idma->dma_addr = idma->dma.sg->dma_address; + idma->dma_len = idma->dma.sg->length; + iomd_writeb(DMA_CR_C, dma_base + CR); idma->state = DMA_ST_AB; } From patchwork Mon May 20 14:47:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10951559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 898151395 for ; Mon, 20 May 2019 14:48:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76D63288E6 for ; Mon, 20 May 2019 14:48:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B6B02890C; Mon, 20 May 2019 14:48:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 14BE22890F for ; Mon, 20 May 2019 14:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+QFE01pGe7vUhxfEY/8P31jHaRCRnWZvURhUCzl0L/8=; b=kVntkNOWavMCol PkGzz3nY+VwVPHaQi0ekFHpYsZJjs2eKk38QjdD1+vOM0j1nhXylFKhtbOKjTW2lhn03d6ZExJLIm zkCa3tmoy1POts84735bDXbZWcyYMFtYqbxE55FtYQziSnNPr/NMoQCkY2ECXLbSKC94koP/aGUdJ I9KwtwWyXDTd7Qdb2+rcr0J98SmXMfgabmmeLc1n5B2Sr/IxhYOhmKS8eI2DV0V+NxtOWsQQRP9Ho oTakxBkry+4n2AT3G/bNbtLB8F5G70yk3ilVZ0XuDYTWfpHDN+pERfSqjwWFG3A9mhIfnCmDv/hbL jnJHHxrY2vx2CKzhGanQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSja2-0000Hk-OG; Mon, 20 May 2019 14:47:58 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZP-0007zl-0R for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 14:47:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dVXNwRaht4mbhZtEHlBmOsgFUVlPVkYwCCg6xIosRPE=; b=G57yju6Vm0d0zf4YHcaAgv9U8T 9XEnylhU03pXEtbzgBJgxUaTcSZN6IrSHXj1QNteDfE72P6zJo9hIXl9eZ2porZDQcX1hVDZH48l1 jztDmSRAW2X2mxWWotT+ULRQ4Fizhuol4Z+uGpOLOPBTm4aoBPRMSd/8PvuL2cqPg5s9XqrpzIK+i Z2Vhqe5vvdKYT/WTq5Hu6rN7Sb/g7nxvvVSkPeCJc9IOgrfdzaXOOAwBI2ehKiK+7K+WSChbI/wJS guxU3724cVsVzgvRtdgTqFQmwZFtLp4YYYmQ2LGhvRYK0ibhoaXOZFWyw5DRk+U4JxPhLXYRluyrU oRcPjD7w==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:43228 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1hSjZL-0003Ou-1d; Mon, 20 May 2019 15:47:15 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hSjZK-0000Y9-Gf; Mon, 20 May 2019 15:47:14 +0100 In-Reply-To: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> References: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/8] ARM: riscpc: dma: eliminate "cur_sg" scatterlist usage MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 20 May 2019 15:47:14 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_074719_653368_089A6C01 X-CRM114-Status: GOOD ( 14.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-Virus-Scanned: ClamAV using ClamSMTP All we really need is the DMA address and size, we don't need the baggage of a full scatterlist structure. Signed-off-by: Russell King --- arch/arm/mach-rpc/dma.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index c4c96661eb89..37750c6493b4 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c @@ -30,7 +30,8 @@ struct iomd_dma { unsigned int state; unsigned long base; /* Controller base address */ int irq; /* Controller IRQ */ - struct scatterlist cur_sg; /* Current controller buffer */ + dma_addr_t cur_addr; + unsigned int cur_len; dma_addr_t dma_addr; unsigned int dma_len; }; @@ -53,13 +54,13 @@ typedef enum { #define CR (IOMD_IO0CR - IOMD_IO0CURA) #define ST (IOMD_IO0ST - IOMD_IO0CURA) -static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma) +static void iomd_get_next_sg(struct iomd_dma *idma) { unsigned long end, offset, flags = 0; if (idma->dma.sg) { - sg->dma_address = idma->dma_addr; - offset = sg->dma_address & ~PAGE_MASK; + idma->cur_addr = idma->dma_addr; + offset = idma->cur_addr & ~PAGE_MASK; end = offset + idma->dma_len; @@ -69,7 +70,7 @@ static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma) if (offset + TRANSFER_SIZE >= end) flags |= DMA_END_L; - sg->length = end - TRANSFER_SIZE; + idma->cur_len = end - TRANSFER_SIZE; idma->dma_len -= end - offset; idma->dma_addr += end - offset; @@ -87,11 +88,11 @@ static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma) } } else { flags = DMA_END_S | DMA_END_L; - sg->dma_address = 0; - sg->length = 0; + idma->cur_addr = 0; + idma->cur_len = 0; } - sg->length |= flags; + idma->cur_len |= flags; } static irqreturn_t iomd_dma_handle(int irq, void *dev_id) @@ -107,26 +108,26 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id) return IRQ_HANDLED; if ((idma->state ^ status) & DMA_ST_AB) - iomd_get_next_sg(&idma->cur_sg, idma); + iomd_get_next_sg(idma); switch (status & (DMA_ST_OFL | DMA_ST_AB)) { case DMA_ST_OFL: /* OIA */ case DMA_ST_AB: /* .IB */ - iomd_writel(idma->cur_sg.dma_address, base + CURA); - iomd_writel(idma->cur_sg.length, base + ENDA); + iomd_writel(idma->cur_addr, base + CURA); + iomd_writel(idma->cur_len, base + ENDA); idma->state = DMA_ST_AB; break; case DMA_ST_OFL | DMA_ST_AB: /* OIB */ case 0: /* .IA */ - iomd_writel(idma->cur_sg.dma_address, base + CURB); - iomd_writel(idma->cur_sg.length, base + ENDB); + iomd_writel(idma->cur_addr, base + CURB); + iomd_writel(idma->cur_len, base + ENDB); idma->state = 0; break; } if (status & DMA_ST_OFL && - idma->cur_sg.length == (DMA_END_S|DMA_END_L)) + idma->cur_len == (DMA_END_S|DMA_END_L)) break; } while (1); From patchwork Mon May 20 14:47:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10951571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B63DE933 for ; Mon, 20 May 2019 14:48:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4A7228538 for ; Mon, 20 May 2019 14:48:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9934A28910; Mon, 20 May 2019 14:48:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 468B0288E0 for ; Mon, 20 May 2019 14:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h2p1JrGypxdW+T/n/XYnQpGpANEKvyllu+IIx8iuRvE=; b=LJujzYgrmIH0LX UonfmI8uq+WVnm+lffCs30qByaiR1THCges9YNlOojUoSpVgWAqFdH2vC4bDKfRwaupcQQuEkaasT fCxf+QwhLuWbi7xogRBqrVjhm7T51bqdYT6dc1Adh2zil2oie31hofknJtrsDPLVZXHl4oTSH7Xa4 d8yO0Imlp/LeiScGljbnR313SGERsWIqs+Nh4x1jdMBWGtiL3xASc6H8HHvgSrWnJFLfdzIGaC9Vj BximQT/ZKsKnQcg1H3mgchEn4tQZi18kkT3CPMFhCzArDDG9sCwfsZiu9OoszZG1oN6GcOxLfyRXz QCvhF7dsntJKygaxSAhA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSja8-0000Pf-Ha; Mon, 20 May 2019 14:48:04 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZU-000874-EL for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 14:47:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sx8jZ8xkTcaYCALkUI7SlSTg/5SsVi5Usjg0XCjqbZ8=; b=KU7Ew3MOPNIxbdtT1ja24rZq5s nhbRQVjpySv1ZxcPXm43ro0UjkhsXA/ouwaZNkW2YBE6vU2h+JR+QwcZGCwroSu4C5RTKIAV1ZZAW KlzAA7tPGx9UKPCJ6z7O5xwPrFr9cSMJVCpoZinjIU3jEkDe/jJQHFg47qWzbPWY3KR1Hg9yuatcd lSVveye6MxFCkcXssrWcKMX8ZOAJ+f9+WD0BNWungYXy/GBAbSyqicEXksLCpE54eVcvGd5zhnZks Y6BcBS9FUt19QDUGRDRrzsAbI2ZNiQ5RiI7jGTA1FmzhkwTQmnKSrF6xlnmHjFSdU3uXLs25anrxw v9Iec/tQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:43232 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1hSjZQ-0003P0-4y; Mon, 20 May 2019 15:47:20 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hSjZP-0000YH-Kw; Mon, 20 May 2019 15:47:19 +0100 In-Reply-To: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> References: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/8] ARM: riscpc: dma: make state a local variable MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 20 May 2019 15:47:19 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_074724_956327_BBDB3EFB X-CRM114-Status: GOOD ( 12.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-Virus-Scanned: ClamAV using ClamSMTP Make state a local variable to avoid rewriting it in the DMA loop. Signed-off-by: Russell King --- arch/arm/mach-rpc/dma.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index 37750c6493b4..e2b9c95d853b 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c @@ -99,15 +99,15 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id) { struct iomd_dma *idma = dev_id; unsigned long base = idma->base; + unsigned int state = idma->state; + unsigned int status; do { - unsigned int status; - status = iomd_readb(base + ST); if (!(status & DMA_ST_INT)) - return IRQ_HANDLED; + goto out; - if ((idma->state ^ status) & DMA_ST_AB) + if ((state ^ status) & DMA_ST_AB) iomd_get_next_sg(idma); switch (status & (DMA_ST_OFL | DMA_ST_AB)) { @@ -115,14 +115,14 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id) case DMA_ST_AB: /* .IB */ iomd_writel(idma->cur_addr, base + CURA); iomd_writel(idma->cur_len, base + ENDA); - idma->state = DMA_ST_AB; + state = DMA_ST_AB; break; case DMA_ST_OFL | DMA_ST_AB: /* OIB */ case 0: /* .IA */ iomd_writel(idma->cur_addr, base + CURB); iomd_writel(idma->cur_len, base + ENDB); - idma->state = 0; + state = 0; break; } @@ -131,9 +131,10 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id) break; } while (1); - idma->state = ~DMA_ST_AB; + state = ~DMA_ST_AB; disable_irq_nosync(irq); - +out: + idma->state = state; return IRQ_HANDLED; } From patchwork Mon May 20 14:47:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10951589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0571933 for ; Mon, 20 May 2019 14:48:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE28E286DD for ; Mon, 20 May 2019 14:48:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC91F28910; Mon, 20 May 2019 14:48:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F178288E1 for ; Mon, 20 May 2019 14:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PQyB0uVFxzvjatCl/RUfcNIIORzJhysdcwGhxi6wcSM=; b=X3p5NSVghyk116 E7pdPsv6vTIkuJMbUXH9EfCUzLth7/3nZg6vrfIHEBoMTudkSLNd/e1sVk2ri4W5cCCoi6SvvYihd B9PXRSA2FdDeSwIXIw7PS9PL/iruT1SJP6632XjyfGA6gdwsqmL+iIQl9Mod5v1/GntEsHORg+prr xp0HqvJJD8n4SBYIn3HOr563jLfE/nnTT+tgclTWTASQiG5B4gfmuidREJeyRJRhQYGTaiR7G6gwQ xxd96NsbItyOBFPNeN2YEtqYbdph2ZcYTmRs7j61nlIrr4aA7mhkteMD+7hbj5cdKiU5UW1AUo1vs aM+tb4THXayyAFTtz7oQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjaL-0000hM-5U; Mon, 20 May 2019 14:48:17 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZc-0008HT-GU for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 14:47:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=21w7KE8tXy3iMmpWOOluePmpf84SK3SGDnuK211RYxk=; b=wygKvi9sXRSWegAFtSuYEF93f2 1UMrAeU/NnOH3KwnzB4RxVWajq6WDV0Bw00+Zj04f/pbSDFqskJg2dJsvd6Z4om+jICLnCDNSggO5 5tRDIJ7h0vVAOLBLkw4eZoUPO/vYx5JQLbG/9G/O99KsIIRKyf62cVVB9XhLEsc2I8XSJMZ26noml LT9WYW1E+TeTur+l2WkFWCxoZ1Grt/PLdtvBCSvv9FcAr3mkCY9s9NqfHm+7uXAfZj0kfky2HqI3w R7Ojbhsy9cEs/xZ9BRCbjXvefGqOt08pIC4eEtIjRJU6qohnNY9X8g/jkfq5IOjsv+52OqNyxAJqM LHiTbNFA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33290 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1hSjZV-0003P7-OG; Mon, 20 May 2019 15:47:25 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hSjZU-0000YU-Oa; Mon, 20 May 2019 15:47:24 +0100 In-Reply-To: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> References: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 7/8] ARM: riscpc: dma: improve address/length writing MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 20 May 2019 15:47:24 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_074733_166399_8DE36551 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-Virus-Scanned: ClamAV using ClamSMTP Rearrange writing the DMA addresses to generate more efficient code. Signed-off-by: Russell King --- arch/arm/mach-rpc/dma.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index e2b9c95d853b..6140472d148e 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c @@ -100,7 +100,7 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id) struct iomd_dma *idma = dev_id; unsigned long base = idma->base; unsigned int state = idma->state; - unsigned int status; + unsigned int status, cur, end; do { status = iomd_readb(base + ST); @@ -110,21 +110,17 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id) if ((state ^ status) & DMA_ST_AB) iomd_get_next_sg(idma); - switch (status & (DMA_ST_OFL | DMA_ST_AB)) { - case DMA_ST_OFL: /* OIA */ - case DMA_ST_AB: /* .IB */ - iomd_writel(idma->cur_addr, base + CURA); - iomd_writel(idma->cur_len, base + ENDA); - state = DMA_ST_AB; - break; - - case DMA_ST_OFL | DMA_ST_AB: /* OIB */ - case 0: /* .IA */ - iomd_writel(idma->cur_addr, base + CURB); - iomd_writel(idma->cur_len, base + ENDB); - state = 0; - break; + // This efficiently implements state = OFL != AB ? AB : 0 + state = ((status >> 2) ^ status) & DMA_ST_AB; + if (state) { + cur = CURA; + end = ENDA; + } else { + cur = CURB; + end = ENDB; } + iomd_writel(idma->cur_addr, base + cur); + iomd_writel(idma->cur_len, base + end); if (status & DMA_ST_OFL && idma->cur_len == (DMA_END_S|DMA_END_L)) From patchwork Mon May 20 14:47:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10951605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2A99933 for ; Mon, 20 May 2019 14:48:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0CCB2844B for ; Mon, 20 May 2019 14:48:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9545428910; Mon, 20 May 2019 14:48:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1BF792890E for ; Mon, 20 May 2019 14:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OMqg/+s95o1RYrbqCZGytzMBUzSerCoDepFhdonhlb4=; b=p0FHT1sJ2VDtre aN8dRfeYLVz11IUdGHEZskFLATNLgAQHkLf60nvCflBd1GCT2bcDRRC6l0F62us9fsDeLXqUW0k1N iDTxrny0iV7kbJBzLZrfj65hgf42gf9e50WpzgEb3fE1bN22W2zq5YMhpZyrGCq+oOVdE/EmPaB2w AXapQZcQ2svqYpeERZ4EPHI88S8u4jnXEeKvMoO5Nnb0Gah86d9w5+kBw73onYM8dfxutru4peL3z AhCRNPO0hmwwAsxd0I4fPM8M26DUcdE81quY1CMYZk5c9Zd5S3PtoS4uyDmq36Rj8HrPyTD2//myP hBEsbgkkVEPzFJfI8CTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjaT-0000vR-JE; Mon, 20 May 2019 14:48:25 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSjZf-0008Mx-FO for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 14:47:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FmimIr60tvqQY83Jar2RtP/mDmpKNOdQ8909mv+al3o=; b=cX+KwCtrubPECIGCkAH26NPfqF gBHpMIif090FAE2hQZ78ZOQyhHZjqpHyS8GBfq2Af2B3+XJt/eJk8YPLnhRBFV0IwaW8afTBnO7sZ 1SN2rP+shWVXLldomgmo1raBaC0ed8J2XldURqQ8jLc1n81O/LmRf7aHbyi2Gnkt9kXrro99abv0v NrAUi1JBLdN1V3TGuTKrDZvlKSCorLxGHQz8yMbbd0jAwDGKQv02AxyPebuLMfSsNiaCW5Bk7e8Tb loKEfj5iytgbH353Xm311OqAm+ktuvXRZ+ql0BAf7QHOpNWfclX0KFnhASWzhUN5OBRR1MSn0goxN RaQNCT7w==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:42722 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1hSjZa-0003PH-Uk; Mon, 20 May 2019 15:47:31 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hSjZZ-0000Yb-Sd; Mon, 20 May 2019 15:47:29 +0100 In-Reply-To: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> References: <20190520144615.gzrztyhoncyfc5xr@shell.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 8/8] ARM: riscpc: dma: use __iomem pointers for writing DMA MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 20 May 2019 15:47:29 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_074736_094487_2E512C2B X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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-Virus-Scanned: ClamAV using ClamSMTP Use __iomem pointers for efficiency to write the DMA registers. This avoids the compiler emitting several instructions for each access to calculate the register address. Signed-off-by: Russell King --- arch/arm/mach-rpc/dma.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index 6140472d148e..eeda808a7320 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c @@ -27,9 +27,9 @@ struct iomd_dma { struct dma_struct dma; - unsigned int state; - unsigned long base; /* Controller base address */ + void __iomem *base; /* Controller base address */ int irq; /* Controller IRQ */ + unsigned int state; dma_addr_t cur_addr; unsigned int cur_len; dma_addr_t dma_addr; @@ -98,12 +98,12 @@ static void iomd_get_next_sg(struct iomd_dma *idma) static irqreturn_t iomd_dma_handle(int irq, void *dev_id) { struct iomd_dma *idma = dev_id; - unsigned long base = idma->base; + void __iomem *base = idma->base; unsigned int state = idma->state; unsigned int status, cur, end; do { - status = iomd_readb(base + ST); + status = readb(base + ST); if (!(status & DMA_ST_INT)) goto out; @@ -119,8 +119,8 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id) cur = CURB; end = ENDB; } - iomd_writel(idma->cur_addr, base + cur); - iomd_writel(idma->cur_len, base + end); + writel(idma->cur_addr, base + cur); + writel(idma->cur_len, base + end); if (status & DMA_ST_OFL && idma->cur_len == (DMA_END_S|DMA_END_L)) @@ -152,7 +152,7 @@ static void iomd_free_dma(unsigned int chan, dma_t *dma) static void iomd_enable_dma(unsigned int chan, dma_t *dma) { struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); - unsigned long dma_base = idma->base; + void __iomem *base = idma->base; unsigned int ctrl = TRANSFER_SIZE | DMA_CR_E; if (idma->dma.invalid) { @@ -175,27 +175,27 @@ static void iomd_enable_dma(unsigned int chan, dma_t *dma) idma->dma_addr = idma->dma.sg->dma_address; idma->dma_len = idma->dma.sg->length; - iomd_writeb(DMA_CR_C, dma_base + CR); + writeb(DMA_CR_C, base + CR); idma->state = DMA_ST_AB; } if (idma->dma.dma_mode == DMA_MODE_READ) ctrl |= DMA_CR_D; - iomd_writeb(ctrl, dma_base + CR); + writeb(ctrl, base + CR); enable_irq(idma->irq); } static void iomd_disable_dma(unsigned int chan, dma_t *dma) { struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); - unsigned long dma_base = idma->base; + void __iomem *base = idma->base; unsigned long flags; local_irq_save(flags); if (idma->state != ~DMA_ST_AB) disable_irq(idma->irq); - iomd_writeb(0, dma_base + CR); + writeb(0, base + CR); local_irq_restore(flags); } @@ -358,17 +358,17 @@ static int __init rpc_dma_init(void) */ iomd_writeb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT); - iomd_dma[DMA_0].base = IOMD_IO0CURA; + iomd_dma[DMA_0].base = IOMD_BASE + IOMD_IO0CURA; iomd_dma[DMA_0].irq = IRQ_DMA0; - iomd_dma[DMA_1].base = IOMD_IO1CURA; + iomd_dma[DMA_1].base = IOMD_BASE + IOMD_IO1CURA; iomd_dma[DMA_1].irq = IRQ_DMA1; - iomd_dma[DMA_2].base = IOMD_IO2CURA; + iomd_dma[DMA_2].base = IOMD_BASE + IOMD_IO2CURA; iomd_dma[DMA_2].irq = IRQ_DMA2; - iomd_dma[DMA_3].base = IOMD_IO3CURA; + iomd_dma[DMA_3].base = IOMD_BASE + IOMD_IO3CURA; iomd_dma[DMA_3].irq = IRQ_DMA3; - iomd_dma[DMA_S0].base = IOMD_SD0CURA; + iomd_dma[DMA_S0].base = IOMD_BASE + IOMD_SD0CURA; iomd_dma[DMA_S0].irq = IRQ_DMAS0; - iomd_dma[DMA_S1].base = IOMD_SD1CURA; + iomd_dma[DMA_S1].base = IOMD_BASE + IOMD_SD1CURA; iomd_dma[DMA_S1].irq = IRQ_DMAS1; for (i = DMA_0; i <= DMA_S1; i++) {