Re: [PATCH 23/32] PCI: pciehp: Avoid slot access during reset

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

 



On Fri, Jun 22, 2018 at 11:23:19AM +0200, Lukas Wunner wrote:
> On Thu, Jun 21, 2018 at 03:06:00PM +0300, Mika Westerberg wrote:
> > On Sat, Jun 16, 2018 at 09:25:00PM +0200, Lukas Wunner wrote:
> > >  struct controller {
> > >  	struct mutex ctrl_lock;
> > >  	struct pcie_device *pcie;
> > > +	struct rw_semaphore reset_lock;
> > 
> > Is there any particular reason why you can't use a regular mutex here?
> 
> It would unnecessarily serialize pciehp_probe() against pciehp_ist()
> even though it's legal for the two to run in parallel.
> 
> I only want to serialize pciehp_reset_slot() with the rest of the driver,
> more specifically those portions accessing the Presence Detect State bit
> in the Slot Status register and the Data Link Layer Link Active bit in
> the Link Status register.  And the only functions remaining that access
> those bits are pciehp_probe() and pciehp_ist().  The tool to achieve that
> kind of serialization is an rw_semaphore.

In that case I think it may be good idea to put the above to the
changelog so it is clear why rw_semaphore is used here.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux