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: <4f994662-347d-4562-9108-5d7e3798fa51@ideasonboard.com>
Date: Thu, 28 Mar 2024 18:37:06 +0200
From: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
To: Sean Anderson <sean.anderson@...ux.dev>
Cc: Michal Simek <michal.simek@....com>, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org,
 Laurent Pinchart <laurent.pinchart@...asonboard.com>,
 Vinod Koul <vkoul@...nel.org>, dmaengine@...r.kernel.org
Subject: Re: [PATCH 2/3] dma: xilinx_dpdma: Remove unnecessary use of
 irqsave/restore

On 28/03/2024 17:00, Sean Anderson wrote:
> On 3/27/24 08:27, Tomi Valkeinen wrote:
>> Hi,
>>
>> On 08/03/2024 23:00, Sean Anderson wrote:
>>> xilinx_dpdma_chan_done_irq and xilinx_dpdma_chan_vsync_irq are always
>>> called with IRQs disabled from xilinx_dpdma_irq_handler. Therefore we
>>> don't need to save/restore the IRQ flags.
>>
>> I think this is fine, but a few thoughts:
>>
>> - Is spin_lock clearly faster than the irqsave variant, or is this a pointless optimization? It's safer to just use irqsave variant, instead of making sure the code is always called from the expected contexts.
> 
> It's not an optimization. Technically this will save a few instructions,
> but...
> 
>> - Is this style documented/recommended anywhere? Going through docs, I only found docs telling to use irqsave when mixing irq and non-irq contexts.
> 
> The purpose is mainly to make it clear that this is meant to be called
> in IRQ context. With irqsave, there's an implication that this could be
> called in non-IRQ context, which it never is.

Hmm, I see. Yes, I think that makes sense.

>> - Does this cause issues on PREEMPT_RT?
> 
> Why would it?

I was reading locktypes.rst, I started wondering what it means if 
spinlocks are changed into sleeping locks. But thinking about it again, 
it doesn't matter, as the irq will still be masked when in irq-context.

So:

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>

  Tomi



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ