Re: [PATCH] pm80xx: Spinlock fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/23, Tomas Henzl wrote:
>
> On 12/23/2013 04:06 PM, Jack Wang wrote:
> > On 12/23/2013 03:55 PM, Jason Seba wrote:
> >> Why is this considered dangerous?  I put some thought into it and
> >> couldn't find any obvious reason why it wouldn't work, but I also
> >> couldn't find any other drivers that work this way.  Is there a
> >> particular reason to avoid doing it this way?
> >>
> > If you use global flags, you may change interrupt state depends on context.
>
> The problem could show up when different threads try to store different content to the flags.

Agreed. I have no idea if the patch is right or not, but at least
the changelog should clearly explain that only one thread can do
spin_lock_irqsave(&x->lock, x->lock_flags) at any time, otherwise
the patch (and the code) _looks_ wrong even if it is correct.

And if we can't use a local "unsigned long flags" because _unlock
can happen in another function, imho this should be mentioned in
the changelog as well.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux