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]
Date:	Fri, 9 Oct 2009 11:10:16 +0200
From:	Linus Walleij <linus.ml.walleij@...il.com>
To:	"Sosnowski, Maciej" <maciej.sosnowski@...el.com>
Cc:	Linus Walleij <linus.walleij@...ricsson.com>,
	"Williams, Dan J" <dan.j.williams@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] Add COH 901 318 DMA block driver

Then a quick comment in addition to the COH 901 318 v2...

2009/9/30 Sosnowski, Maciej <maciej.sosnowski@...el.com>:

>> +     coh901318_stop(chan);
>> +
>> +     spin_lock_irqsave(&cohc->lock, flags);
>> +
>> +     /* Clear any pending BE or TC interrupt */
>> +     if (cohc->id < 32) {
>> +             writel(1 << cohc->id, virtbase + COH901318_BE_INT_CLEAR1);
>> +             writel(1 << cohc->id, virtbase + COH901318_TC_INT_CLEAR1);
>> +     } else {
>> +             writel(1 << (cohc->id - 32), virtbase +
>> +                    COH901318_BE_INT_CLEAR2);
>> +             writel(1 << (cohc->id - 32), virtbase +
>> +                    COH901318_TC_INT_CLEAR2);
>> +     }
>> +
>> +     enable_powersave(cohc);
>
> enable_powersave() has been called in coh901318_stop() already

Yes, however an IRQ can come in between coh901318_stop() and
spin_lock_irqsave(), disabling powersave. So to avoid a possible race,
we enable it again. We cannot move coh901318_stop() after the spinlock
either, because the coh901318_stop() use the same spinlock, and then it
deadlocks. And I cannot require the lock to be held while calling
coh901318_stop() because it is an exported symbol.

Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ