lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOh2x==d46_R2btWmi1KnmY-TfAGRxHrwSzT6NFVFP-Hp0-0Kw@mail.gmail.com>
Date:	Tue, 15 Jan 2013 07:24:55 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:	Vinod Koul <vinod.koul@...el.com>, linux-kernel@...r.kernel.org,
	spear-devel <spear-devel@...t.st.com>
Subject: Re: [PATCH] dw_dmac: don't exceed AHB master number in dwc_get_data_width

On Mon, Jan 14, 2013 at 7:50 PM, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
> The driver's default assumes that hardware has two AHB masters which might be
> not true. In such rare cases we have not to exceed a number of the AHB masters
> present in the hardware. Thus, the AHB master with highest possible number will
> be used to retrieve the data witdh value.
>
> The patch also changes the logic a bit when the master parameter of the
> dwc_get_data_width() is out of range. Now the function will return a value
> related to the first AHB master.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/dma/dw_dmac.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index 30ff2a4..b2d564a 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -80,13 +80,14 @@ static inline unsigned int dwc_get_data_width(struct dma_chan *chan, int master)
>  {
>         struct dw_dma *dw = to_dw_dma(chan->device);
>         struct dw_dma_slave *dws = chan->private;
> +       unsigned int m = 0;
>
>         if (master == SRC_MASTER)
> -               return dw->data_width[dwc_get_sms(dws)];
> +               m = dwc_get_sms(dws);
>         else if (master == DST_MASTER)
> -               return dw->data_width[dwc_get_dms(dws)];
> +               m = dwc_get_dms(dws);
>
> -       return 0;
> +       return dw->data_width[min_t(unsigned int, dw->nr_masters - 1, m)];

The details of the patch are fine, but i didn't get how do you get
master 1 selected
on a system where you have only 1 master?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ