From patchwork Mon Mar 13 14:38:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 9621215 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 A381460244 for ; Mon, 13 Mar 2017 14:44:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9573526E54 for ; Mon, 13 Mar 2017 14:44:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89FEF28481; Mon, 13 Mar 2017 14:44: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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 342F426E54 for ; Mon, 13 Mar 2017 14:44:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752274AbdCMOoA (ORCPT ); Mon, 13 Mar 2017 10:44:00 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35942 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbdCMOny (ORCPT ); Mon, 13 Mar 2017 10:43:54 -0400 Received: by mail-pg0-f66.google.com with SMTP id 25so18279933pgy.3; Mon, 13 Mar 2017 07:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=0pPJM8hBO2MwTYHFctrUsSiRbs8QkewjetJ1KdDMXk0=; b=EAfm0HGxe+ODcQdvMf4VVDyLrRCNxYP8Vf+jnfS/zai7BMp0lOmD4R2o7qC33DGKf7 y1WNQz2E5Kb9ykhUO8nEk5NeDwQyapPPU14C7Rzz8N8Q4d0ZjljfYEyudEd85AYt8eFY r0wPqjNXrr9287vDTGouHlogF4jGzzVqghlGTy/NaZoGQdZjdJL/+o8cst/zITVgn8YY s/Z4evZUYBotmUh+Plc4x88Xh06H19DTpjE33kAVVfx0A0vODXkEMBvkjd1IWsrd8C0J d1+lMRouuJhQKSstQf1TwmC05Fqz0Jjvhx8l1hkGx68w1ByAAFJJKBzRlCWp4QNsU5uv 424g== 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:date:message-id:in-reply-to :references:subject; bh=0pPJM8hBO2MwTYHFctrUsSiRbs8QkewjetJ1KdDMXk0=; b=qRXJWoeaGeDu2TytrMe2Ap51j0W8sWaVKHdsqlhEfim3PnE4Lb/nfyz1AGIzzni8x2 6+GgNV6hfQhEX+rm9GIH2zrRhvFOa0kUM12/6sBmzIQ91OJVRcosQsLw8c64je0tQgMG /5gt8Omx0ysxDBaXlDJUvt79njSy1jTVrMeAmWmUEaGyMYKhOh1ATn8IFA7biSE6SFRm Jrz3oBG+m6cPTFz4TDQsmbxL1/blVdKZbBpQL17Ud5cnKUXPFi6LBc8RFj0JafB870w+ n2l7HM+hQ2S6lcbGTrglsaU7Q12xQqibzQnPnxoVOrDr2+AJXXl9gwNeqBfu2AvSeHKS HAOA== X-Gm-Message-State: AMke39l0mP9S7PpFVztdldt3r7fK1gTv0nyjoxnBLbVj+Q4OFsCVSymlWkGKzZUICA49gg== X-Received: by 10.99.171.75 with SMTP id k11mr36773050pgp.16.1489416232668; Mon, 13 Mar 2017 07:43:52 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id d3sm33349095pfc.51.2017.03.13.07.43.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2017 07:43:51 -0700 (PDT) From: Magnus Damm To: dmaengine@vger.kernel.org Cc: laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be, vinod.koul@intel.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, horms+renesas@verge.net.au, Magnus Damm , dan.j.williams@intel.com Date: Mon, 13 Mar 2017 23:38:15 +0900 Message-Id: <148941589552.8144.12085740563774580543.sendpatchset@little-apple> In-Reply-To: <148941587549.8144.11445088809156037649.sendpatchset@little-apple> References: <148941587549.8144.11445088809156037649.sendpatchset@little-apple> Subject: [PATCH 2/3] dmaengine: rcar-dmac: Slow mode prototype Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm This experimental slow mode support code simply extends the MID/RID value to allow encoding a 4-bit value in bit 8-11 to specify the SLM bit value. With this value set the channel associated with the device will be processed slower by the hardware. The idea is that the slow mode can be used for testing to force underruns to harden other parts of the system. Not-Yet-Signed-off-by: Magnus Damm --- drivers/dma/sh/rcar-dmac.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0002/drivers/dma/sh/rcar-dmac.c +++ work/drivers/dma/sh/rcar-dmac.c 2017-03-13 23:15:54.170607110 +0900 @@ -171,6 +171,7 @@ struct rcar_dmac_chan { struct rcar_dmac_chan_slave dst; struct rcar_dmac_chan_map map; int mid_rid; + unsigned int slm; spinlock_t lock; @@ -374,7 +375,7 @@ static void rcar_dmac_chan_start_xfer(st rcar_dmac_chan_write(chan, RCAR_DMADPBASE, (desc->hwdescs.dma & 0xfffffff0) | RCAR_DMADPBASE_SEL); - rcar_dmac_chan_write(chan, RCAR_DMACHCRB, + rcar_dmac_chan_write(chan, RCAR_DMACHCRB, chan->slm | RCAR_DMACHCRB_DCNT(desc->nchunks - 1) | RCAR_DMACHCRB_DRST); @@ -438,6 +439,7 @@ static void rcar_dmac_chan_start_xfer(st rcar_dmac_chan_write(chan, RCAR_DMATCR, chunk->size >> desc->xfer_shift); + rcar_dmac_chan_write(chan, RCAR_DMACHCRB, chan->slm); chcr |= RCAR_DMACHCR_DPM_DISABLED | RCAR_DMACHCR_IE; } @@ -1596,7 +1598,7 @@ static bool rcar_dmac_chan_filter(struct return false; } - return !test_and_set_bit(dma_spec->args[0], dmac->modules); + return !test_and_set_bit(dma_spec->args[0] & 0xff, dmac->modules); } static struct dma_chan *rcar_dmac_of_xlate(struct of_phandle_args *dma_spec, @@ -1661,7 +1663,12 @@ static struct dma_chan *rcar_dmac_of_xla return NULL; rchan = to_rcar_dmac_chan(chan); - rchan->mid_rid = dma_spec->args[0]; + rchan->mid_rid = dma_spec->args[0] & 0xff; + + if (dma_spec->args[0] > 0xff) { + rchan->slm = RCAR_DMACHCRB_SLM_CLK(dma_spec->args[0] >> 8); + dev_info(chan->device->dev, "slm set to 0x%x\n", rchan->slm); + } return chan; }