Skip to content

Commit c7d2f89

Browse files
kawasakiKAGA-KOKO
authored andcommitted
bus: fsl-mc-msi: Fix MSI descriptor mutex lock for msi_first_desc()
Commit e8604b1 introduced a call to the helper function msi_first_desc(), which needs MSI descriptor mutex lock before call. However, the required mutex lock was not added. This results in lockdep assertion: WARNING: CPU: 4 PID: 119 at kernel/irq/msi.c:274 msi_first_desc+0xd0/0x10c msi_first_desc+0xd0/0x10c fsl_mc_msi_domain_alloc_irqs+0x7c/0xc0 fsl_mc_populate_irq_pool+0x80/0x3cc Fix this by adding the mutex lock and unlock around the function call. Fixes: e8604b1 ("bus: fsl-mc-msi: Simplify MSI descriptor handling") Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220412075636.755454-1-shinichiro.kawasaki@wdc.com
1 parent af2d861 commit c7d2f89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/bus/fsl-mc/fsl-mc-msi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,12 @@ int fsl_mc_msi_domain_alloc_irqs(struct device *dev, unsigned int irq_count)
224224
if (error)
225225
return error;
226226

227+
msi_lock_descs(dev);
227228
if (msi_first_desc(dev, MSI_DESC_ALL))
228-
return -EINVAL;
229+
error = -EINVAL;
230+
msi_unlock_descs(dev);
231+
if (error)
232+
return error;
229233

230234
/*
231235
* NOTE: Calling this function will trigger the invocation of the

0 commit comments

Comments
 (0)