From patchwork Mon Jan 9 16:06:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 9505345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 336156075F for ; Mon, 9 Jan 2017 16:08:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2667328474 for ; Mon, 9 Jan 2017 16:08:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B0FA284B1; Mon, 9 Jan 2017 16:08:29 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC13F28493 for ; Mon, 9 Jan 2017 16:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970251AbdAIQIZ (ORCPT ); Mon, 9 Jan 2017 11:08:25 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37171 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970209AbdAIQHU (ORCPT ); Mon, 9 Jan 2017 11:07:20 -0500 Received: by mail-wm0-f47.google.com with SMTP id c206so37926249wme.0 for ; Mon, 09 Jan 2017 08:07:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qUQ2Tqh7thtq55bN1UfE1q7wQhcigyThRtg+Rpjwiy0=; b=yRLmdlvJge3Mboju/RTkYKHswq1JZh4PYMkw2Szf3alB8ajRJmfidgH71zSOm+FP1c F1KwYWCz+NdVOXgu4uQ2UL744Dbv4RQygPz4DvY5GVGUSlXD+Yr+WdI8tPW1lmEIPeua KJsF/1QdRwu/lnV1IaEPJp+lJJfubgPw8A7QJDu1Il2UMNJstOaMS+2OFQYBeFUNGYxe 7C5kydxAWMIVjdHazVzCZ9xDYKHWMboVAASaM0oOVdVHDxIeppT5JwiisYOJTzPO/+1M cbZyxH9E6kkpEeb6DudnOmU5hfJINDu0TjDSsYrq5i3YjCoPWEi6M+xFmb0oa3ml5Q/w 3ENA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qUQ2Tqh7thtq55bN1UfE1q7wQhcigyThRtg+Rpjwiy0=; b=S+YkfaocGvy6wXLnQxYUb4JlWkIZ3VMfiHOKqHJFuM4efbMoKkJoKguhSTTWa3rzYp 1fcCRrZDn7h5sFOgETtAO/apKs2kbzaOAfFoJXLAZ8hgAWy7nxVkosIqffhYoY8U1hu+ xFwIWN/Yb4QqaTX5mUQrb4ejAk00XAmjcwxNEc/MfNkKLJb0aebJiO21aHNYrXshqxWi YDqbagl9/qMHc1srfWo+mNlMwKWDoywpU3fDZ6mMzvrJDecIllUap0Xj9D95GIkgxxd3 fuZYV4VfQRSOBb8hHmw0d6feigw+Ar3pFNUFqUIjanSAlZC2yWT3eeAB6xD3e8rWSlQT zA6w== X-Gm-Message-State: AIkVDXKMpNeB9R4tJ34gpl+/q/oaC+FsHSGIr35oMd3WBHWmJstd6n/cJAEFTKbF0tsgPTBA X-Received: by 10.223.176.142 with SMTP id i14mr279164wra.4.1483978039568; Mon, 09 Jan 2017 08:07:19 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id w18sm19656244wme.9.2017.01.09.08.07.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jan 2017 08:07:19 -0800 (PST) From: Alexandre Bailon To: vinod.koul@intel.com Cc: dmaengine@vger.kernel.org, linux-usb@vger.kernel.org, nsekhar@ti.com, khilman@baylibre.com, ptitiano@baylibre.com, tony@atomide.com, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, b-liu@ti.com, Alexandre Bailon Subject: [PATCH 02/11] dmaengine: cppi41: Split out the interrupt handler Date: Mon, 9 Jan 2017 17:06:47 +0100 Message-Id: <20170109160656.3470-3-abailon@baylibre.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170109160656.3470-1-abailon@baylibre.com> References: <20170109160656.3470-1-abailon@baylibre.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current interrupt handler do some actions specifics to am335x. These actions should be made by the platform interrupt handler. Split out the interrupt handler in two: one for the am335x platform and a generic one. Signed-off-by: Alexandre Bailon --- drivers/dma/cppi41.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 25ee71d..42744ed 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -284,18 +284,11 @@ static u32 cppi41_pop_desc(struct cppi41_dd *cdd, unsigned queue_num) return desc; } -static irqreturn_t cppi41_irq(int irq, void *data) +static irqreturn_t cppi41_irq(struct cppi41_dd *cdd) { - struct cppi41_dd *cdd = data; struct cppi41_channel *c; - u32 status; int i; - status = cppi_readl(cdd->usbss_mem + USBSS_IRQ_STATUS); - if (!(status & USBSS_IRQ_PD_COMP)) - return IRQ_NONE; - cppi_writel(status, cdd->usbss_mem + USBSS_IRQ_STATUS); - for (i = QMGR_PENDING_SLOT_Q(FIST_COMPLETION_QUEUE); i < QMGR_NUM_PEND; i++) { u32 val; @@ -351,6 +344,19 @@ static irqreturn_t cppi41_irq(int irq, void *data) return IRQ_HANDLED; } +static irqreturn_t am335x_cppi41_irq(int irq, void *data) +{ + struct cppi41_dd *cdd = data; + u32 status; + + status = cppi_readl(cdd->usbss_mem + USBSS_IRQ_STATUS); + if (!(status & USBSS_IRQ_PD_COMP)) + return IRQ_NONE; + cppi_writel(status, cdd->usbss_mem + USBSS_IRQ_STATUS); + + return cppi41_irq(cdd); +} + static dma_cookie_t cppi41_tx_submit(struct dma_async_tx_descriptor *tx) { dma_cookie_t cookie; @@ -949,7 +955,7 @@ static struct dma_chan *cppi41_dma_xlate(struct of_phandle_args *dma_spec, } static const struct cppi_glue_infos am335x_usb_infos = { - .isr = cppi41_irq, + .isr = am335x_cppi41_irq, .queues_rx = am335x_usb_queues_rx, .queues_tx = am335x_usb_queues_tx, .td_queue = { .submit = 31, .complete = 0 },