Re: [RFC PATCH 4.19.y-cip 24/50] PCI: endpoint: Replace spinlock with mutex
Pavel Machek
Hi!
Okay, we can't really protect sleeping code with a mutex.Apart of one mentioned above other point I would add is on a single core machine mutex_lock/unlock would be good choice.commit 3d3248dbd018502f654064c78efcd2e165ab3486 upstream.Could I get some kind of explanation why this is good idea? [1] https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/tree/drivers/pci/controller/pcie-rockchip-ep.c?h=linux-4.19.y-cip#n410But this one is not sleeping. It is mdelay(), not msleep(). [2] https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/tree/drivers/pci/controller/pcie-cadence-ep.c?h=linux-4.19.y-cip#n310And same here. If there's a place which does sleep with the spinlock held, I'd still be curious. OTOH, 1 msec is already threshold where mutex makes sense, so... this is okay. Thanks, Pavel -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
|
|