RE: pm8001: locking in mpi_sata_completion() is broken

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

 



So could you send a patch to not set the flags to 0, or I post a patch to do
this later.
Thanks

Jack
> 
> On Thu, Dec 15, 2011 at 09:26:46AM +0800, Jack Wang wrote:
> > >   2018                          mb();/*in order to force CPU
ordering*/
> > >   2019
> spin_unlock_irqrestore(&pm8001_ha->lock,
> > > flags);
> > >
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > Calling irqrestore before we've done an irqsave.  What are we trying
to
> > > restore?
> > [Jack Wang]
> > We hold spin_lock_irqsave when we process interrupt, so here we need
restore
> > it to do task done clean.
> 
> 
> You're not restoring a previous saved state, flags is set to zero
> here.  You're calling:
> 				spin_unlock_irqrestore(&pm8001_ha->lock, 0);
> 
> The whole function is badly broken.  mpi_sata_event() has similar
> problems.
> 
> With spin_lock_irqsave() and spin_unlock_irqrestore() you first have
> to save the state to "flags" before you can restore it.  Doing it
> the other way round doesn't make any sort sense.
> 
> regards,
> dan carpenter

--
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