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] [day] [month] [year] [list]
Message-ID: <MWHPR02MB2623F73BEA721D64EE2C3BF9AF5A0@MWHPR02MB2623.namprd02.prod.outlook.com>
Date:   Fri, 29 Mar 2019 11:08:52 +0000
From:   Naga Sureshkumar Relli <nagasure@...inx.com>
To:     Vignesh Raghavendra <vigneshr@...com>,
        Boris Brezillon <boris.brezillon@...labora.com>
CC:     "broonie@...nel.org" <broonie@...nel.org>,
        "bbrezillon@...nel.org" <bbrezillon@...nel.org>,
        "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "dwmw2@...radead.org" <dwmw2@...radead.org>,
        "marek.vasut@...il.com" <marek.vasut@...il.com>,
        "richard@....at" <richard@....at>,
        "linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Michal Simek <michals@...inx.com>,
        "nagasuresh12@...il.com" <nagasuresh12@...il.com>
Subject: RE: [LINUX PATCH 2/3] spi: spi-mem: call
 spi_mem_default_supports_op() first

Hi Vignesh,

> -----Original Message-----
> From: linux-spi-owner@...r.kernel.org <linux-spi-owner@...r.kernel.org> On Behalf Of
> Vignesh Raghavendra
> Sent: Friday, March 29, 2019 4:32 PM
> To: Boris Brezillon <boris.brezillon@...labora.com>; Naga Sureshkumar Relli
> <nagasure@...inx.com>
> Cc: broonie@...nel.org; bbrezillon@...nel.org; linux-spi@...r.kernel.org;
> dwmw2@...radead.org; marek.vasut@...il.com; richard@....at; linux-
> mtd@...ts.infradead.org; linux-kernel@...r.kernel.org; Michal Simek <michals@...inx.com>;
> nagasuresh12@...il.com
> Subject: Re: [LINUX PATCH 2/3] spi: spi-mem: call spi_mem_default_supports_op() first
> 
> Hi Naga Sureshkumar
> 
> On 29/03/19 1:25 AM, Boris Brezillon wrote:
> > On Thu, 28 Mar 2019 16:46:24 +0530
> > Naga Sureshkumar Relli <naga.sureshkumar.relli@...inx.com> wrote:
> >
> >> Call spi_mem_default_supports_op() first, before calling controller
> >> specific ctlr->supports_op().
> >> With this, controller drivers can drop checking the buswidths again.
> >
> > No, this was done on purpose, in case the controller does not want the
> > default check to be applied (say it does not need bus-width props to
> > be defined and has another way to check if a device can be accessed in
> > dual, quad or octal mode).
> > Just call spi_mem_default_supports_op() from your driver
> > ->supports_op() hook if needed.
> >
> 
> Could you rework to follow Boris's suggestion here?
Sure. I will update.

Thanks,
Naga Sureshkumar Relli
> 
> >>
> >> Suggested-by: Vignesh Raghavendra <vigneshr@...com>
> >> Signed-off-by: Naga Sureshkumar Relli
> >> <naga.sureshkumar.relli@...inx.com>
> >> ---
> >> Details can be found at https://lkml.org/lkml/2019/3/1/183
> >> ---
> >>  drivers/spi/spi-mem.c | 7 +++++--
> >>  1 file changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index
> >> 5217a56..56aa158 100644
> >> --- a/drivers/spi/spi-mem.c
> >> +++ b/drivers/spi/spi-mem.c
> >> @@ -189,11 +189,14 @@ static bool spi_mem_internal_supports_op(struct spi_mem
> *mem,
> >>  					 const struct spi_mem_op *op)
> >>  {
> >>  	struct spi_controller *ctlr = mem->spi->controller;
> >> +	bool ret;
> >> +
> >> +	ret = spi_mem_default_supports_op(mem, op);
> >>
> >>  	if (ctlr->mem_ops && ctlr->mem_ops->supports_op)
> >> -		return ctlr->mem_ops->supports_op(mem, op);
> >> +		ret =  ctlr->mem_ops->supports_op(mem, op);
> >>
> >> -	return spi_mem_default_supports_op(mem, op);
> >> +	return ret;
> >>  }
> >>
> >>  /**
> >
> 
> --
> Regards
> Vignesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ