Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp382038imm; Wed, 13 Jun 2018 01:50:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIcGTQLpXaAnY3id+y2EklLlqOTynz0brPzTWhjo2tHppnt/znU1EHpXUulcUTjkdSmQT5k X-Received: by 2002:a62:830e:: with SMTP id h14-v6mr4082432pfe.64.1528879816316; Wed, 13 Jun 2018 01:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528879816; cv=none; d=google.com; s=arc-20160816; b=KfOJP5DDCUp2wDNsF85oqOj56wFUkRANGhwgBxNPqLGTMz+OjDkj1ONBN4K3lOlnvK OnavEXklugBn0PiDD9RAeRwwFEnKzf1aK3u5LvAy7vllWLj2xyBwz/mw6YbSThQMh73q BEQywFlnuRVdN7IwYGlDs4utuaCRY54l4UzlLRmNE0KEYyGq8J4lHe8z4tgc0v8t6LdG yJgaINGLvAaHB4tI4lRzZ9KKb6IH2frA1qpkLQwkBULDMk5gSo2e9bcWJADHjgGKbXKt uPk4G8F3EoqyFLYYDklyxg9k4P9dOiyw7MbMI2tXr/RYKOkAGGJV4P2UpxSyJkLddy0Q gUIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:date:mime-version:cc:to:user-agent:subject :from:message-id:dkim-signature:arc-authentication-results; bh=+8DmjoyyxbgtuVnuQbUREDBcmkEtvP0NJdU1+hHu7zE=; b=fIvu8PYWIfvtoE7M2TLB96if6YT6xTOcqxLiqbI53O+WEwd/V3ygWvAUNsS2/FExhd H/UCl1kHF7T+JQ8Zbo7EJY1n87TTQrebt+2j5BYHtjdJtJL1I4HzaLTQLVxJMPM4TSAk hFzMQUbb1f+LCdfumsXn14vGA2oS5BzSf1sNd1G/EtMSDIYpHG0Q36SHcFC10QfnJ3eE 15B4E1iPNXlFUg9DMLEyrky2NxvWkoGOozLqQg3obmZlW2mIOB1vedMoglequheGghYm tFikxZxLCp0Q56h40CEhINvASyE3PsY38b9ccrnQ0U5subviq8krfYn+VAbe91Xu38Dl pVQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector1-renesas-com header.b="OgU/Y70I"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p21-v6si1862268pgv.112.2018.06.13.01.50.01; Wed, 13 Jun 2018 01:50:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector1-renesas-com header.b="OgU/Y70I"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934927AbeFMItb (ORCPT + 99 others); Wed, 13 Jun 2018 04:49:31 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:36657 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934480AbeFMIt1 (ORCPT ); Wed, 13 Jun 2018 04:49:27 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 13 Jun 2018 17:49:24 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id D278C7A7BB; Wed, 13 Jun 2018 17:49:24 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.51,218,1526310000"; d="scan'208";a="283882830" Received: from mail-ty1jpn01lp0178.outbound.protection.outlook.com (HELO JPN01-TY1-obe.outbound.protection.outlook.com) ([23.103.139.178]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 13 Jun 2018 17:49:24 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+8DmjoyyxbgtuVnuQbUREDBcmkEtvP0NJdU1+hHu7zE=; b=OgU/Y70IRKZE7slMmDcN4+hu3eWT7DqNEU46+F+NsWmDrD3MxIQCXmX2NJSvYcn+obr7yjnMhq915Z4ZSV5vShC8SgS8nNwMNUmdFCmaUcTCk5taTeILiYjZsFoHEHhtjZC4gO8wYlY4BLFmaUKKxpMJnW+FTiC3D7cHY94LhrU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.138) by TYAPR01MB2080.jpnprd01.prod.outlook.com (2603:1096:404:8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.18; Wed, 13 Jun 2018 08:49:22 +0000 Message-ID: <8736xrkrci.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2] dmaengine: rcar-dmac: don't use DMAC error interrupt User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Geert Uytterhoeven Cc: , Dan Williams , Magnus Damm , Linux-Renesas , Linux Kernel Mailing List , Laurent Pinchart , Kieran Bingham , Geert Uytterhoeven , , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Date: Wed, 13 Jun 2018 08:49:22 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: TY2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:404:56::17) To TYAPR01MB2080.jpnprd01.prod.outlook.com (2603:1096:404:8::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e0bb4343-0490-45e6-75e8-08d5d10a8f64 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:TYAPR01MB2080; X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2080;3:mdOGrNfsm0pKM6r25hCOxRTQdPKo1HvNXCD9M4PwWUdrA8e0gc6zeWJhZMJG6yJ6ZDefJzM3C7/g0ehSowejOvfPPZcPlxF21oppC117vs7XEfXPhGvJw9WlwxLLhQnSXzIBSA60QETqlA22UJR4Oa4o/xP2PLvkzFcjlODUeDzLuXlr0DLLhwyeXfQ5v2ETDl3FPJOG34iQlQcjMehIlbKLusLGMHl5fYhQGQoCym0pPgo3rsXUv6cfHH4unwt1;25:jIYCbZ5RANrDrApaWl40qL1QDHSm7En40G3uFLPe7DIORLvVmFPYwYphBRmP/xF1Wvz/CVFs1BAZ05PSStChxwIx9B2OQUNtLyJW9XelUU27Vwy8LugpeawCQBxrfD23jm5A6gQ5T0l2CQfjhyz49u+AiExOBSdZZfE3KcJaoPNEbdibyIUg78F4XJPHMbDrI2ehO+aNBAtUKE8xpv28SI7yawX2Zb9jESf0fMG00MUB4gOYKDi7gGW4tlnqTEuzQj7rWbDiz8FsLLofDZNJ6XwdzeL89+Ft2F1hOfCqJwacrq2e0JK+LaHdDszSuowpIRgW22vBeKV1R2dsMA/UFw==;31:wq/i6Y7XtjqmKx7sQNKUTBgTh/dGvKDx6alJsT3X35IwNcL1nBPz6cQ2SZj+oH9CTjhPRbtkBy3Z4iUvz9ubwwwm2c0V71MklF2PgkcgvszQP2HBeeMd2GEZAsTqannfIJQ3XcrADxzKgdSA821LySLfX9BDO4ATLnG/Ash5Pt2xXSjc+G48/oaRAt7oYVs+h3gw6ljHiy9ykE1b6g4oFV+vLruDRw0kPbtINjJDEgU= X-MS-TrafficTypeDiagnostic: TYAPR01MB2080: X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2080;20:rMVUSGAGcDCWQ/tz9U9WFHpmsanxW0p/qW2A+vHVgJA2Xe189BRm7FdwXTjEytbdOtsop5yN6ktMvfo+GAFG1/q88AzisYuKUjOQYWImPnTWeL/I8gSae0v27MGDL8FglPr9eeP3Gjq0ghnf3PXzBlBdVZMWhjLL2l27YGtKEOlIKvUkTTvch0jsheLiMdG7kE5l34Fjmztyr1+G75N0DDQOufPZVnzgwnSGsg93xsRlQTed6zC7vgFfXerFCxnwfgP09+0tVkxqIALTGhXuhxiMWateK4TqPKdsIcXPIE+w4IRwZM4Rw00oIb2IftHXzZ1P2HIkIM6g+k/h4wuiVVl075y2OoNARrpMCGAShzzR6F2l3C67/7Bmb3AUqAJcOiuDwOiXfcgAPum8+nJV+5//kt9LK7o1G1UrqFTOYLJrryAuY/iwD3IyEG+2Zw8sq9xqWqWTDn4uxM8BPp0D4UuACbRKuHme3ODfoNCtsxIzkjYFf7n+lUilnvBFxK5i;4:2jM2knSRi8uobqf7WFNa4y9nNwRPlDL8Y9lRTrQdregokXYxon4pQDdE2+bLQrFMAVhTmyzNeYGw5uf9kQXcj4/ZUg3w5OcILcU30yMdkq/2735thavmxYPwbulY7eBcga+x66WiVTl7X8o4EDaA8Qu2kaCg74B/79GnHhvfWmPThjXpm+MxEb6B5Cj4SxaCbNWGUXpL4G+hZwghBLZfMEsN+7Dvm070i8VOKS5rwxg7kaIRHE8+aDfrGx8qKHOFgZmx+Yg6Tgcf5efoQ5iUEA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:TYAPR01MB2080;BCL:0;PCL:0;RULEID:;SRVR:TYAPR01MB2080; X-Forefront-PRVS: 07025866F6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(366004)(376002)(346002)(39380400002)(189003)(199004)(6916009)(39060400002)(106356001)(53416004)(16586007)(36756003)(25786009)(58126008)(105586002)(316002)(386003)(4326008)(7696005)(7416002)(52116002)(81156014)(8936002)(486006)(53936002)(59450400001)(476003)(8676002)(6486002)(956004)(2616005)(47776003)(26005)(97736004)(86362001)(54906003)(81166006)(478600001)(23726003)(186003)(6116002)(3846002)(66066001)(16526019)(7736002)(5660300001)(68736007)(50466002)(69596002)(305945005)(2906002)(21314002)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:TYAPR01MB2080;H:morimoto-PC.renesas.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;TYAPR01MB2080;23:8aXYvOluqYQ0nZX96dGCeYEb66XfCy8fyXF79Y3Vv?= =?us-ascii?Q?qbNuGwmg+5ugs37gsbazoXCr6zQBJzI0QLQDxPMkFV9nUQ+xG8VIO9Iwmwvv?= =?us-ascii?Q?jZWc9bMY4btjiatbF2w3nPeglv9xuTuzVPJrweUbdiyOmcl2rWMNORwZkYEN?= =?us-ascii?Q?B59SvK38aVbaSXjzfmGWeRLSC+mr0PjQDMwwXFMOeRt2tjWi5PtdRvlpefJp?= =?us-ascii?Q?w9yUCeRrZpgqhAM9LS5Pq2PEed0fnT3rMg2TWhyXMdDCtfcvh+KdVxu1DGH3?= =?us-ascii?Q?Q1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6OHGbIK9hqa7pzF3FkoxgkWoxz9zpeCaMqciq/N9TJ1T4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2080;7:j7tM4YLfHw7QzSCvHY+bAxalWpT3nvPiiQYFkSLzW8GeR33Xy7kOQQU4PLg6sRCelu4cph5PMefUZ3IslZGn46Hw2Eb69DYUUwfiQ7p9M+UOcTUk9/NBoFKbnRzkMO80QVwNbphfBHc52++rORjMQjPPOKWcQR/DUiE7kr0l6hYYIlx7vux/ENUIO1mgNfQUUCZz/xZjraituuWW533QymlUJonGQxHZOGPLnHUq+M49ddgc2/3ijbA9v5vQo5Z2;20:+jQz9fDNtt7C2WdmjK3VIQ6XueLD/3VdEQsBu51cU5qKPZKjMj30sQHyRrR2X7HHM4g5NpHMX77lhaGHVn5p6c+cp6mXnNaIht7r2+Pk+D5cb4+NeiiBQDDSRRGcroPW9+L2i98scWD6OGJ64hQO/Gx14y8WExM52oukI8g/DYw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2018 08:49:22.7076 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0bb4343-0490-45e6-75e8-08d5d10a8f64 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB2080 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kuninori Morimoto Current rcar-dmac is using DMAC error interrupt which will handle all channel's error. But in this design, error handling itself will be issue if user want to use virtualization, multi OS, etc. This patch removes current DMAC error interrupt handling, and handle it on each channel interrupt handler. Signed-off-by: Magnus Damm [Kuninori: updated patch to adjust DMACHCR/DMAOR] Signed-off-by: Kuninori Morimoto Tested-by: Nguyen Viet Dung --- v1 -> v2 - add [Kuninori: xxx] line on git log - don't remove DT property - tidyup rcar_dmac_isr_channel() .../devicetree/bindings/dma/renesas,rcar-dmac.txt | 1 + drivers/dma/sh/rcar-dmac.c | 72 +++++++--------------- 2 files changed, 23 insertions(+), 50 deletions(-) diff --git a/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt b/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt index b1ba6395..b8e1c13 100644 --- a/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt +++ b/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt @@ -38,6 +38,7 @@ Required Properties: - interrupt-names: one entry for the error interrupt, named "error", plus one entry per channel, named "ch%u", where %u is the channel number ranging from zero to the number of channels minus one. + # "error" interrupt will be ignored, so far - clock-names: "fck" for the functional clock - clocks: a list of phandle + clock-specifier pairs, one for each entry diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 2a2ccd9..279c930 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -431,7 +431,8 @@ static void rcar_dmac_chan_start_xfer(struct rcar_dmac_chan *chan) chcr |= RCAR_DMACHCR_DPM_DISABLED | RCAR_DMACHCR_IE; } - rcar_dmac_chan_write(chan, RCAR_DMACHCR, chcr | RCAR_DMACHCR_DE); + rcar_dmac_chan_write(chan, RCAR_DMACHCR, + chcr | RCAR_DMACHCR_DE | RCAR_DMACHCR_CAIE); } static int rcar_dmac_init(struct rcar_dmac *dmac) @@ -783,7 +784,8 @@ static void rcar_dmac_chan_halt(struct rcar_dmac_chan *chan) u32 chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR); chcr &= ~(RCAR_DMACHCR_DSE | RCAR_DMACHCR_DSIE | RCAR_DMACHCR_IE | - RCAR_DMACHCR_TE | RCAR_DMACHCR_DE); + RCAR_DMACHCR_TE | RCAR_DMACHCR_DE | + RCAR_DMACHCR_CAE | RCAR_DMACHCR_CAIE); rcar_dmac_chan_write(chan, RCAR_DMACHCR, chcr); rcar_dmac_chcr_de_barrier(chan); } @@ -812,12 +814,7 @@ static void rcar_dmac_chan_reinit(struct rcar_dmac_chan *chan) } } -static void rcar_dmac_stop(struct rcar_dmac *dmac) -{ - rcar_dmac_write(dmac, RCAR_DMAOR, 0); -} - -static void rcar_dmac_abort(struct rcar_dmac *dmac) +static void rcar_dmac_stop_all_chan(struct rcar_dmac *dmac) { unsigned int i; @@ -829,11 +826,10 @@ static void rcar_dmac_abort(struct rcar_dmac *dmac) spin_lock(&chan->lock); rcar_dmac_chan_halt(chan); spin_unlock(&chan->lock); - - rcar_dmac_chan_reinit(chan); } } + /* ----------------------------------------------------------------------------- * Descriptors preparation */ @@ -1522,11 +1518,18 @@ static irqreturn_t rcar_dmac_isr_channel(int irq, void *dev) u32 mask = RCAR_DMACHCR_DSE | RCAR_DMACHCR_TE; struct rcar_dmac_chan *chan = dev; irqreturn_t ret = IRQ_NONE; + bool reinit = false; u32 chcr; spin_lock(&chan->lock); chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR); + if (chcr & RCAR_DMACHCR_CAE) { + rcar_dmac_chan_halt(chan); + reinit = true; + goto spin_lock_end; + } + if (chcr & RCAR_DMACHCR_TE) mask |= RCAR_DMACHCR_DE; rcar_dmac_chan_write(chan, RCAR_DMACHCR, chcr & ~mask); @@ -1539,8 +1542,16 @@ static irqreturn_t rcar_dmac_isr_channel(int irq, void *dev) if (chcr & RCAR_DMACHCR_TE) ret |= rcar_dmac_isr_transfer_end(chan); +spin_lock_end: spin_unlock(&chan->lock); + if (reinit) { + dev_err(chan->chan.device->dev, "Channel Address Error\n"); + + rcar_dmac_chan_reinit(chan); + ret = IRQ_HANDLED; + } + return ret; } @@ -1597,24 +1608,6 @@ static irqreturn_t rcar_dmac_isr_channel_thread(int irq, void *dev) return IRQ_HANDLED; } -static irqreturn_t rcar_dmac_isr_error(int irq, void *data) -{ - struct rcar_dmac *dmac = data; - - if (!(rcar_dmac_read(dmac, RCAR_DMAOR) & RCAR_DMAOR_AE)) - return IRQ_NONE; - - /* - * An unrecoverable error occurred on an unknown channel. Halt the DMAC, - * abort transfers on all channels, and reinitialize the DMAC. - */ - rcar_dmac_stop(dmac); - rcar_dmac_abort(dmac); - rcar_dmac_init(dmac); - - return IRQ_HANDLED; -} - /* ----------------------------------------------------------------------------- * OF xlate and channel filter */ @@ -1784,8 +1777,6 @@ static int rcar_dmac_probe(struct platform_device *pdev) struct rcar_dmac *dmac; struct resource *mem; unsigned int i; - char *irqname; - int irq; int ret; dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL); @@ -1824,17 +1815,6 @@ static int rcar_dmac_probe(struct platform_device *pdev) if (IS_ERR(dmac->iomem)) return PTR_ERR(dmac->iomem); - irq = platform_get_irq_byname(pdev, "error"); - if (irq < 0) { - dev_err(&pdev->dev, "no error IRQ specified\n"); - return -ENODEV; - } - - irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:error", - dev_name(dmac->dev)); - if (!irqname) - return -ENOMEM; - /* Enable runtime PM and initialize the device. */ pm_runtime_enable(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev); @@ -1885,14 +1865,6 @@ static int rcar_dmac_probe(struct platform_device *pdev) goto error; } - ret = devm_request_irq(&pdev->dev, irq, rcar_dmac_isr_error, 0, - irqname, dmac); - if (ret) { - dev_err(&pdev->dev, "failed to request IRQ %u (%d)\n", - irq, ret); - return ret; - } - /* Register the DMAC as a DMA provider for DT. */ ret = of_dma_controller_register(pdev->dev.of_node, rcar_dmac_of_xlate, NULL); @@ -1932,7 +1904,7 @@ static void rcar_dmac_shutdown(struct platform_device *pdev) { struct rcar_dmac *dmac = platform_get_drvdata(pdev); - rcar_dmac_stop(dmac); + rcar_dmac_stop_all_chan(dmac); } static const struct of_device_id rcar_dmac_of_ids[] = { -- 1.9.1