Re: [PATCH] pm80xx: Spinlock fix

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

 



On 12/23, Jason Seba wrote:
>
>  Wouldn't the contents of the global flags value be protected by the
> spinlock itself?

This can be even true because nowadays spin_lock_irqsave() writes to
"flags" after it takes the lock, and _irqrestore works gets the copy
of "flags" before it releases the lock.

Still this doesn't look safe and afaik this is not documented. Although
I have to admit that after I actually looked at the current implementation
I think this should work.

Perhaps we should ask the maintainers upstream? Even if this works, I am
not sure this is _supposed_ to work. I mean, in theory spin_lock_irqave()
can be changed as, say

	#define spin_lock_irqsave(lock, flags)		\
		do {    				\
			local_irq_save(flags);		\
			spin_lock(lock);		\
		} while (0)

(and iirc it was defined this way a long ago). In this case "flags" is
obviously not protected.

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