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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87plgtq0qb.ffs@tglx>
Date: Wed, 30 Apr 2025 14:42:52 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Jiri Slaby <jirislaby@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Subject: Re: [patch V2 35/45] genirq/manage: Rework irq_set_irq_wake()

On Wed, Apr 30 2025 at 08:37, Jiri Slaby wrote:
> On 29. 04. 25, 8:55, Thomas Gleixner wrote:
>> Use the new guards to get and lock the interrupt descriptor and tidy up the
>> code.
>> -	unsigned long flags;
>> -	struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
>> -	int ret = 0;
>> +	int ret = -EINVAL;
>
> Hmm...
>
>> -	if (!desc)
>> -		return -EINVAL;
>> +	scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_GLOBAL) {
>> +		struct irq_desc *desc = scoped_irqdesc;
>>   
>> +		/*
>> +		 * wakeup-capable irqs can be shared between drivers that
>> +		 * don't need to have the same sleep mode behaviors.
>> +		 */
>> +		if (on) {
>> +			if (desc->wake_depth++ == 0) {
>> +				ret = set_irq_wake_real(irq, on);
>> +				if (ret)
>> +					desc->wake_depth = 0;
>> +				else
>> +					irqd_set(&desc->irq_data, IRQD_WAKEUP_STATE);
>> +			}
>
> So in this (imaginary) else branch (i.e. desc->wake_depth++ != 0), you 
> return EINVAL now?
>
> Previously, it was 0 (correctly), if I am looking correctly.

Duh, yes.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ