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: <aSX4dXXmlHcz0zeU@smile.fi.intel.com>
Date: Tue, 25 Nov 2025 20:41:57 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Mikhail Kshevetskiy <mikhail.kshevetskiy@...sys.eu>
Cc: Lorenzo Bianconi <lorenzo@...nel.org>, Ray Liu <ray.liu@...oha.com>,
	Mark Brown <broonie@...nel.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Matthias Brugger <matthias.bgg@...il.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Andy Shevchenko <andy@...nel.org>,
	linux-arm-kernel@...ts.infradead.org, linux-spi@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-mediatek@...ts.infradead.org,
	Andreas Gnau <andreas.gnau@...sys.eu>
Subject: Re: [PATCH v4 1/3] spi: airoha-snfi: en7523: workaround flash
 damaging if UART_TXD was short to GND

On Tue, Nov 25, 2025 at 05:20:44PM +0300, Mikhail Kshevetskiy wrote:
> On 11/25/25 13:14, Andy Shevchenko wrote:
> > On Tue, Nov 25, 2025 at 01:04:12PM +0300, Mikhail Kshevetskiy wrote:
> >> On 11/25/25 10:18, Andy Shevchenko wrote:
> >>> On Tue, Nov 25, 2025 at 05:10:49AM +0300, Mikhail Kshevetskiy wrote:

...

> could you clarify what's wrong here?
> 
> >>>> -	err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
> >>>> -	if (err)
> >>>> -		return err;

Sure, just don't touch these lines. Only set the respective ops depending
on dma_enable.

With that done the patch will look better and less confusing about affection of
DMA mask setting on DMA operations (which are kinda orthogonal).

> >>>> +	if (dma_enable) {
> >>>> +		err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
> >>>> +		if (err)
> >>>> +			return err;
> >>>> +	}
> >>> Why do you need this to be conditional? The settings of DMA mask should not
> >>> affect the (in)ability of the device to perform DMA. I.o.w. it should not
> >>> influence PIO mode. Can you confirm this?
> >>>
> >> no any particular reason, just see no sense to set mask if dma will not
> >> be used
> > So, this is an unneeded churn in the patch. Device is [still] capable of DMA?
> > Yes. Set the mask. The DMA/PIO choice is done on the upper layer (as you do it
> > via ops).

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ