All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	Gareth Williams <gareth.williams.jx@renesas.com>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-renesas-soc@vger.kernel.org, dmaengine@vger.kernel.org,
	Milan Stevanovic <milan.stevanovic@se.com>,
	Jimmy Lalande <jimmy.lalande@se.com>,
	Pascal Eberhard <pascal.eberhard@se.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Herve Codina <herve.codina@bootlin.com>,
	Clement Leger <clement.leger@bootlin.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, Viresh Kumar <vireshk@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>,
	Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v8 5/9] dmaengine: dw: dmamux: Introduce RZN1 DMA router support
Date: Tue, 12 Apr 2022 12:12:32 +0200	[thread overview]
Message-ID: <20220412121232.69c85b20@xps13> (raw)
In-Reply-To: <YlQQBIeM0GZQ6UOE@matsya>

Hi Vinod,


> > +static void rzn1_dmamux_free(struct device *dev, void *route_data)
> > +{
> > +	struct rzn1_dmamux_data *dmamux = dev_get_drvdata(dev);
> > +	struct rzn1_dmamux_map *map = route_data;
> > +
> > +	dev_dbg(dev, "Unmapping DMAMUX request %u\n", map->req_idx);
> > +
> > +	mutex_lock(&dmamux->lock);
> > +	dmamux->used_chans &= ~BIT(map->req_idx);
> > +	mutex_unlock(&dmamux->lock);  
> 
> Why not use idr or bitmap for this. Hint: former does locking as well

I've changed the code to use a proper bitmap.

> 
> > +
> > +	kfree(map);
> > +}
> > +
> > +static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,
> > +					struct of_dma *ofdma)
> > +{
> > +	struct platform_device *pdev = of_find_device_by_node(ofdma->of_node);
> > +	struct rzn1_dmamux_data *dmamux = platform_get_drvdata(pdev);
> > +	struct rzn1_dmamux_map *map;
> > +	unsigned int dmac_idx, chan, val;
> > +	u32 mask;
> > +	int ret;
> > +
> > +	if (dma_spec->args_count != 6)  
> 
> magic

Defined.

> 
> > +		return ERR_PTR(-EINVAL);
> > +
> > +	map = kzalloc(sizeof(*map), GFP_KERNEL);
> > +	if (!map)
> > +		return ERR_PTR(-ENOMEM);
> > +
> > +	chan = dma_spec->args[0];
> > +	map->req_idx = dma_spec->args[4];
> > +	val = dma_spec->args[5];
> > +	dma_spec->args_count -= 2;
> > +

[...]

> > +	dev_dbg(&pdev->dev, "Mapping DMAMUX request %u to DMAC%u request %u\n",
> > +		map->req_idx, dmac_idx, chan);
> > +
> > +	mask = BIT(map->req_idx);
> > +	mutex_lock(&dmamux->lock);
> > +	dmamux->used_chans |= mask;
> > +	ret = r9a06g032_sysctrl_set_dmamux(mask, val ? mask : 0);  
> 
> I guess due to this it would be merged by whosoever merges this api.
> Please mention this in cover letter and how you propose this should be
> merged

Yes, the cover letter mentions this issue, but since then Geert
proposed to take everything through the renesas trees, which I agree
with. I will send a v9 and if you agree with it please provide your Ack
so that Geert can take it.

Thanks,
Miquèl

  reply	other threads:[~2022-04-12 11:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 16:18 [PATCH v8 0/9] RZN1 DMA support Miquel Raynal
2022-04-06 16:18 ` [PATCH v8 1/9] dt-bindings: dmaengine: Introduce RZN1 dmamux bindings Miquel Raynal
2022-04-06 16:18 ` [PATCH v8 2/9] dt-bindings: clock: r9a06g032-sysctrl: Reference the DMAMUX subnode Miquel Raynal
2022-04-06 16:18 ` [PATCH v8 3/9] dt-bindings: dmaengine: Introduce RZN1 DMA compatible Miquel Raynal
2022-04-06 16:18 ` [PATCH v8 4/9] soc: renesas: rzn1-sysc: Export function to set dmamux Miquel Raynal
2022-04-06 16:18 ` [PATCH v8 5/9] dmaengine: dw: dmamux: Introduce RZN1 DMA router support Miquel Raynal
2022-04-08  9:55   ` Ilpo Järvinen
2022-04-08 11:45     ` Andy Shevchenko
2022-04-08 12:38       ` Ilpo Järvinen
2022-04-12 10:12         ` Miquel Raynal
2022-04-11 11:24   ` Vinod Koul
2022-04-12 10:12     ` Miquel Raynal [this message]
2022-04-06 16:18 ` [PATCH v8 6/9] clk: renesas: r9a06g032: Probe possible children Miquel Raynal
2022-04-06 16:18 ` [PATCH v8 7/9] dmaengine: dw: Add RZN1 compatible Miquel Raynal
2022-04-06 16:18 ` [PATCH v8 8/9] ARM: dts: r9a06g032: Add the two DMA nodes Miquel Raynal
2022-04-06 16:18 ` [PATCH v8 9/9] ARM: dts: r9a06g032: Describe the DMA router Miquel Raynal
2022-04-07  0:45 ` [PATCH v8 0/9] RZN1 DMA support Stephen Boyd
2022-04-07  8:16   ` Miquel Raynal
2022-04-11 15:09     ` Geert Uytterhoeven
2022-04-12  7:31       ` Miquel Raynal
2022-04-12  7:37         ` Geert Uytterhoeven
2022-04-12  7:43           ` Miquel Raynal
2022-04-12  7:52             ` Geert Uytterhoeven
2022-04-12  8:03               ` Miquel Raynal
2022-04-12  8:12                 ` Geert Uytterhoeven
2022-04-12 10:08                   ` Miquel Raynal
2022-04-14 11:24                   ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220412121232.69c85b20@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=clement.leger@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=gareth.williams.jx@renesas.com \
    --cc=geert@linux-m68k.org \
    --cc=herve.codina@bootlin.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jimmy.lalande@se.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=milan.stevanovic@se.com \
    --cc=mturquette@baylibre.com \
    --cc=pascal.eberhard@se.com \
    --cc=phil.edworthy@renesas.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vireshk@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.