public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Vinod Koul <vinod.koul@intel.com>
Cc: Viresh Kumar <vireshk@kernel.org>,
	linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,
	Rob Herring <robh+dt@kernel.org>,
	Hans-Christian Egtvedt <egtvedt@samfundet.no>,
	Tejun Heo <tj@kernel.org>, Mark Brown <broonie@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Vineet Gupta <vgupta@synopsys.com>
Subject: Re: [PATCH v3 08/15] dmaengine: dw: revisit data_width property
Date: Wed, 13 Apr 2016 19:21:53 +0300	[thread overview]
Message-ID: <1460564513.6620.170.camel@linux.intel.com> (raw)
In-Reply-To: <20160413161715.GU2274@localhost>

On Wed, 2016-04-13 at 21:47 +0530, Vinod Koul wrote:
> On Wed, Apr 13, 2016 at 07:05:48PM +0300, Andy Shevchenko wrote:
> > 
> > On Wed, 2016-04-13 at 21:27 +0530, Vinod Koul wrote:
> > > 
> > > On Fri, Mar 18, 2016 at 04:24:47PM +0200, Andy Shevchenko wrote:
> > > The driver should still work with older DT implementation, so you
> > > need
> > > to
> > > keep support for that in driver and hence I don't see any benfit
> > > we
> > > would
> > > get from doing both in driver!
> > The device tree is screwed by a process that allows to do almost
> > whatever you want. Here I'm trying to rectify the usage of the
> > field.
> Well at least we should try to do the right thing which means pushing
> back
> on ABI breakage..

There is no such.

> 
> > 
> > The old is still supported and benefit is apparently in unifying
> > standard properties across the drivers.
> Hrmmm how is that?

The common usage for data-width property is "in bytes". And I like the
idea. I don't know why at all I chose to keep encoded value there in the
first place and no one commented at that time. I suppose because of
screwed device tree process. I think now it's better to follow some
standard / registered properties in new drivers.

> 
> > 
> > > 
> > > > 
> > > > @@ -102,8 +102,8 @@ dw_dma_parse_dt(struct platform_device
> > > > *pdev)
> > > >  {
> > > >  	struct device_node *np = pdev->dev.of_node;
> > > >  	struct dw_dma_platform_data *pdata;
> > > > -	u32 tmp, arr[DW_DMA_MAX_NR_MASTERS];
> > > >  	u32 nr_channels;
> > > > +	u32 tmp;
> > > >  
> > > >  	if (!np) {
> > > >  		dev_err(&pdev->dev, "Missing DT data\n");
> > > > @@ -138,10 +138,10 @@ dw_dma_parse_dt(struct platform_device
> > > > *pdev)
> > > >  		pdata->nr_masters = tmp;
> > > >  	}
> > > >  
> > > > -	if (!of_property_read_u32_array(np, "data_width", arr,
> > > > -				pdata->nr_masters))
> > > > -		for (tmp = 0; tmp < pdata->nr_masters; tmp++)
> > > > -			pdata->data_width[tmp] = arr[tmp];
> You stop reading the array

Yes, due to "- Use one value for all AHB masters for now". No reason to
read all of them.

> > > > +	if (!of_property_read_u32(np, "data-width", &tmp))
> > > > +		pdata->data_width = tmp;
> > > > +	else if (!of_property_read_u32(np, "data_width", &tmp))
> > > > +		pdata->data_width = BIT(tmp & 0x07);
> And read a value? how will this work with older array?

It will read first element.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2016-04-13 16:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 14:24 [PATCH v3 00/15] Fixes / cleanups in dw_dmac (affects on few subsystems) Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 01/15] dmaengine: dw: fix master selection Andy Shevchenko
2016-04-04 17:03   ` Vinod Koul
2016-04-04 17:10     ` Andy Shevchenko
2016-04-06 18:56       ` Vinod Koul
2016-04-06 19:56         ` Andy Shevchenko
2016-04-06 21:09           ` Koul, Vinod
2016-04-07 13:03             ` Andy Shevchenko
2016-04-13 13:36             ` Andy Shevchenko
2016-04-08 13:22         ` [PATCH v3.5 1/1] " Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 02/15] dmaengine: dw: rename masters to reflect actual topology Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 03/15] dmaengine: dw: set src and dst master select according to xfer direction Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 04/15] dmaengine: dw: fix byte order of hw descriptor fields Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 05/15] dmaengine: dw: set LMS field in descriptors Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 06/15] dmaengine: dw: clear LLP_[SD]_EN bits in last descriptor of a chain Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 07/15] dmaengine: dw: substitute dma_read_byaddr by dma_readl_native Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 08/15] dmaengine: dw: revisit data_width property Andy Shevchenko
2016-04-13 15:57   ` Vinod Koul
2016-04-13 16:05     ` Andy Shevchenko
2016-04-13 16:17       ` Vinod Koul
2016-04-13 16:21         ` Andy Shevchenko [this message]
2016-04-13 16:40           ` Mark Brown
2016-04-15 12:45             ` Andy Shevchenko
2016-04-16  5:45               ` Vinod Koul
2016-03-18 14:24 ` [PATCH v3 09/15] dmaengine: dw: define counter variables as unsigned int Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 10/15] dmaengine: dw: keep entire platform data in struct dw_dma Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 11/15] dmaengine: dw: pass platform data via struct dw_dma_chip Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 12/15] dmaengine: dw: move dwc->paused to dwc->flags Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 13/15] dmaengine: dw: move dwc->initialized " Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 14/15] dmaengine: dw: move residue to a descriptor Andy Shevchenko
2016-03-18 14:24 ` [PATCH v3 15/15] dmaengine: dw: set cdesc to NULL when free cyclic transfers Andy Shevchenko
2016-04-13 16:08 ` [PATCH v3 00/15] Fixes / cleanups in dw_dmac (affects on few subsystems) Vinod Koul

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=1460564513.6620.170.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=egtvedt@samfundet.no \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tj@kernel.org \
    --cc=vgupta@synopsys.com \
    --cc=vinod.koul@intel.com \
    --cc=vireshk@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox