mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: viresh kumar <viresh.kumar@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>,
	spear-devel@list.st.com, linux-kernel@vger.kernel.org,
	Hein Tibosch <hein_tibosch@yahoo.es>
Subject: Re: [PATCH 5/7] dw_dmac: autoconfigure data_width or get it via platform data
Date: Thu, 20 Sep 2012 12:42:10 +0300	[thread overview]
Message-ID: <1348134130.13371.39.camel@smile> (raw)
In-Reply-To: <CAOh2x=kRV-K+0SfBwoTkA641G9CeQWP4-4COMZKmkZGNL=1Dgw@mail.gmail.com>

On Tue, 2012-09-18 at 12:41 +0530, viresh kumar wrote: 
> On Mon, Sep 17, 2012 at 1:09 PM, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > @@ -647,7 +657,11 @@ dwc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
> >                 return NULL;
> >         }
> >
> > -       src_width = dst_width = dwc_fast_fls(src | dest | len);
> > +       src_width = dst_width = min_t(unsigned int,
> > +                                     /* For memory-to-memory transfers we
> > +                                      * always use AHB master 1 */
> 
> Sorry couldn't understand your comment. :(
> We use master 0 for src and master 1 for dst in memcpy.
Yeah, it might require to rewrite the logic a bit to depend on proper
AHB master properties.

I will fix it.

> > @@ -747,7 +764,9 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
> >                         mem = sg_dma_address(sg);
> >                         len = sg_dma_len(sg);
> >
> > -                       mem_width = dwc_fast_fls(mem | len);
> > +                       mem_width = min_t(unsigned int,
> > +                                         data_width,
> > +                                         dwc_fast_fls(mem | len));
> 
> can above three be merged into a single line or two lines?
I think so, if there no objections from checkpatch.pl side.

> > @@ -807,7 +828,9 @@ slave_sg_todev_fill_desc:
> >                         mem = sg_dma_address(sg);
> >                         len = sg_dma_len(sg);
> >
> > -                       mem_width = dwc_fast_fls(mem | len);
> > +                       mem_width = min_t(unsigned int,
> > +                                         data_width,
> > +                                         dwc_fast_fls(mem | len));
> 
> ditto
See above.

> > @@ -1413,6 +1436,17 @@ static int __devinit dw_probe(struct platform_device *pdev)
> >
> >         /* get hardware configuration parameters */
> >         max_blk_size = dma_readl(dw, MAX_BLK_SIZE);
> > +       if (autocfg)
> > +               dw->nr_masters = (dw_params >> DW_PARAMS_NR_MASTER & 3) + 1;
> > +       else
> > +               dw->nr_masters = pdata->nr_masters;
> > +       for (i = 0; i < dw->nr_masters; i++) {
> > +               if (autocfg)
> > +                       dw->data_width[i] =
> > +                               (dw_params >> DW_PARAMS_DATA_WIDTH(i) & 3) + 2;
> > +               else
> > +                       dw->data_width[i] = pdata->data_width[i];
> > +       }
> 
> There are many autocfg, if, else statements now in probe. Can you try
> to group these
> into as minimum if, else calls?
Ok, will try to optimize it.

> > --- a/drivers/dma/dw_dmac_regs.h
> > +++ b/drivers/dma/dw_dmac_regs.h
> > @@ -106,6 +106,12 @@ struct dw_dma_regs {
> >
> >  /* Bitfields in DW_PARAMS */
> >  #define DW_PARAMS_NR_CHAN      8               /* number of channels */
> > +#define DW_PARAMS_NR_MASTER    11              /* number of AHB masters */
> > +#define DW_PARAMS_DATA_WIDTH(n)        (15 + 2 * (n))
> > +#define DW_PARAMS_DATA_WIDTH1  15              /* master 1 data width */
> > +#define DW_PARAMS_DATA_WIDTH2  17              /* master 2 data width */
> > +#define DW_PARAMS_DATA_WIDTH3  19              /* master 3 data width */
> > +#define DW_PARAMS_DATA_WIDTH4  21              /* master 4 data width */
> >  #define DW_PARAMS_EN           28              /* encoded parameters */

> Do these changes in a single patch 2/7
>From this comment I guess you would like to have dw_dmac_regs.h changes
at one place. Am I right?


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

  reply	other threads:[~2012-09-20  9:42 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17  7:39 [PATCH 0/7] dw_dmac: introduce autoconfiguration Andy Shevchenko
2012-09-17  7:39 ` [PATCH 1/7] dw_dmac: mark dwc_dump_chan_regs as inline Andy Shevchenko
2012-09-18  6:35   ` viresh kumar
2012-09-17  7:39 ` [PATCH 2/7] dw_dmac: fill optional encoded parameters in register structure Andy Shevchenko
2012-09-18  6:39   ` viresh kumar
2012-09-18  6:55     ` Andy Shevchenko
2012-09-18  7:59       ` viresh kumar
2012-09-20  9:30         ` Andy Shevchenko
2012-09-20  9:32           ` viresh kumar
2012-09-20  9:51             ` Andy Shevchenko
2012-09-17  7:39 ` [PATCH 3/7] dw_dmac: get number of channels from hardware if possible Andy Shevchenko
2012-09-18  6:50   ` viresh kumar
2012-09-20  9:35     ` Andy Shevchenko
2012-09-20  9:40       ` viresh kumar
2012-09-21  6:04         ` viresh kumar
2012-09-17  7:39 ` [PATCH 4/7] dw_dmac: autoconfigure block_size or use platform data Andy Shevchenko
2012-09-18  6:57   ` viresh kumar
2012-09-20  9:38     ` Andy Shevchenko
2012-09-17  7:39 ` [PATCH 5/7] dw_dmac: autoconfigure data_width or get it via " Andy Shevchenko
2012-09-18  7:11   ` viresh kumar
2012-09-20  9:42     ` Andy Shevchenko [this message]
2012-09-20  9:46       ` viresh kumar
2012-09-20  9:53         ` Andy Shevchenko
2012-09-17  7:39 ` [PATCH 6/7] dw_dmac: check if controller supports LLP Andy Shevchenko
2012-09-18  7:13   ` viresh kumar
2012-09-20  9:43     ` Andy Shevchenko
2012-09-17  7:39 ` [PATCH 7/7] dw_dmac: introduce software emulation of LLP transfers Andy Shevchenko
2012-09-18  7:17   ` viresh kumar
2012-09-20  9:46     ` Andy Shevchenko
2012-09-17 16:50 ` [PATCH 0/7] dw_dmac: introduce autoconfiguration Hein Tibosch
2012-09-18  6:11 ` Hein Tibosch
2012-09-18  7:18   ` viresh kumar
2012-09-20  9:48   ` Andy Shevchenko
2012-09-21 12:05 ` [PATCHv2 0/6] " Andy Shevchenko
2012-09-21 12:05   ` [PATCHv2 1/6] dw_dmac: mark dwc_dump_chan_regs as inline Andy Shevchenko
2012-09-21 12:05   ` [PATCHv2 2/6] dw_dmac: fill optional encoded parameters in register structure Andy Shevchenko
2012-09-21 13:55     ` viresh kumar
2012-09-21 12:05   ` [PATCHv2 3/6] dw_dmac: get number of channels from hardware if possible Andy Shevchenko
2012-09-21 13:56     ` viresh kumar
2012-09-21 12:05   ` [PATCHv2 4/6] dw_dmac: autoconfigure block_size or use platform data Andy Shevchenko
2012-09-21 14:00     ` viresh kumar
2012-09-21 15:09       ` Andy Shevchenko
2012-09-21 15:30         ` Viresh Kumar
2012-09-21 12:05   ` [PATCHv2 5/6] dw_dmac: autoconfigure data_width or get it via " Andy Shevchenko
2012-09-21 14:02     ` viresh kumar
2012-09-25 11:39       ` [PATCHv3] " Andy Shevchenko
2012-09-26  3:29         ` viresh kumar
2012-09-27 10:06         ` Vinod Koul
2012-09-27 10:33           ` Vinod Koul
2012-09-27 13:10             ` Andy Shevchenko
2012-10-01  9:04             ` Andy Shevchenko
2012-10-01  9:45               ` Vinod Koul
2012-10-01 10:07                 ` Andy Shevchenko
2012-09-27 14:00           ` Andy Shevchenko
2012-09-27 14:27             ` Vinod Koul
2012-09-21 12:05   ` [PATCHv2 6/6] dw_dmac: introduce software emulation of LLP transfers Andy Shevchenko
2012-09-21 14:03     ` viresh kumar
2012-09-27 10:05   ` [PATCHv2 0/6] dw_dmac: introduce autoconfiguration 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=1348134130.13371.39.camel@smile \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hein_tibosch@yahoo.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spear-devel@list.st.com \
    --cc=vinod.koul@intel.com \
    --cc=viresh.kumar@linaro.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

all inboxes | Powered by JetHome®