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: <20230607154921.00007efe@Huawei.com>
Date:   Wed, 7 Jun 2023 15:49:21 +0100
From:   Jonathan Cameron <Jonathan.Cameron@...wei.com>
To:     "Paller, Kim Seer" <KimSeer.Paller@...log.com>
CC:     Jonathan Cameron <jic23@...nel.org>,
        "lars@...afoo.de" <lars@...afoo.de>,
        "krzysztof.kozlowski@...aro.org" <krzysztof.kozlowski@...aro.org>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] iio: adc: max14001: New driver

On Wed, 7 Jun 2023 11:17:33 +0000
"Paller, Kim Seer" <KimSeer.Paller@...log.com> wrote:

> > -----Original Message-----
> > From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> > Sent: Tuesday, June 6, 2023 6:36 PM
> > To: Paller, Kim Seer <KimSeer.Paller@...log.com>
> > Cc: Jonathan Cameron <jic23@...nel.org>; lars@...afoo.de;
> > krzysztof.kozlowski@...aro.org; broonie@...nel.org; lgirdwood@...il.com;
> > linux-iio@...r.kernel.org; linux-kernel@...r.kernel.org
> > Subject: Re: [PATCH v2 2/2] iio: adc: max14001: New driver
> > 
> > [External]
> > 
> > 
> >   
> > > >  
> > > > > +	struct mutex		lock;
> > > > > +	struct regmap		*regmap;
> > > > > +	int			vref_mv;
> > > > > +	/*
> > > > > +	 * DMA (thus cache coherency maintenance) requires the
> > > > > +	 * transfer buffers to live in their own cache lines.  
> > > >
> > > > You are looking at an old kernel I guess - we fixed all of these - and
> > > > introduced IIO_DMA_MINALIGN for __aligned(IIO_DMA_MINALIGN) to
> > > > make it easier to fix any such problems in future.
> > > >
> > > > Upshot is that ___cacheline_aligned aligns to the l1 cacheline length.
> > > > Some fun systems (such as the big servers I use in my dayjob) have higher
> > > > cacheline sizes for their larger / further from CPU caches.
> > > > One group of SoCs out there is known to both do non coherent DMA and
> > > > have a larger line size for the bit relevant to that than ___cacheline_aligned
> > > > gives you. So on that rare platform this is currently broken.  
> > >
> > > It's good to know. Given this information, is there anything specific that I
> > > need to change in the code or implementation related to
> > > the ___cacheline_aligned part?  
> > 
> > Replace it with __aligned(IIO_DMA_MINALIGN) as has hopefully now been
> > done
> > in all upstream drivers.  
> 
> When I attempted to implement this change, I encountered a checkpatch warning 
> in the latest kernel version. The warning indicated that externs should be avoided 
> in .c files and emphasized the need for an identifier name for the function 
> definition argument 'IIO_DMA_MINALIGN'. I attempted to define a macro with an 
> appropriate identifier name, but I still received the same checkpatch warning. 
> It's possible that I may have overlooked something in my approach. I would 
> appreciate your thoughts and insights on this matter. Thanks.

Ignore checkpatch for this one. Check patch is miss handling of
__aligned.

At a guess - needs an entry in this list:
https://elixir.bootlin.com/linux/latest/source/scripts/checkpatch.pl#L513

Though I'm never great at understanding the perl so may have that wrong.

Jonathan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ