[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210321053347.312135-1-ztong0001@gmail.com>
Date: Sun, 21 Mar 2021 01:33:48 -0400
From: Tong Zhang <ztong0001@...il.com>
To: Matthew Wilcox <willy@...radead.org>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Tong Zhang <ztong0001@...il.com>
Subject: [PATCH] scsi: sym53c8xx_2: Fix WARN_ON in __sym_mfree_dma
This fix is similar to b36522150e5b. The WARN_ON is triggered due to
irq being disabled while dma_free_coherent expect it enabled.
[ 1.501363] WARNING: CPU: 0 PID: 179 at kernel/dma/mapping.c:467 dma_free_attrs+0x38/0x50
[ 1.503940] RIP: 0010:dma_free_attrs+0x38/0x50
[ 1.509138] Call Trace:
[ 1.509273] ___free_dma_mem_cluster+0x60/0x90 [sym53c8xx]
[ 1.509570] __sym_mfree+0xb2/0xd0 [sym53c8xx]
[ 1.509811] __sym_mfree_dma+0x65/0xa0 [sym53c8xx]
[ 1.510070] sym_hcb_free+0x8b/0x1e0 [sym53c8xx]
[ 1.510320] sym_free_resources+0x5c/0x7e [sym53c8xx]
[ 1.510592] sym2_probe.cold+0x3e3/0x555 [sym53c8xx]
Signed-off-by: Tong Zhang <ztong0001@...il.com>
---
drivers/scsi/sym53c8xx_2/sym_malloc.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/scsi/sym53c8xx_2/sym_malloc.c b/drivers/scsi/sym53c8xx_2/sym_malloc.c
index eb5c045c7c59..54ec7e7bf87f 100644
--- a/drivers/scsi/sym53c8xx_2/sym_malloc.c
+++ b/drivers/scsi/sym53c8xx_2/sym_malloc.c
@@ -321,20 +321,16 @@ void *__sym_calloc_dma(m_pool_ident_t dev_dmat, int size, char *name)
void __sym_mfree_dma(m_pool_ident_t dev_dmat, void *m, int size, char *name)
{
- unsigned long flags;
m_pool_p mp;
- spin_lock_irqsave(&sym53c8xx_lock, flags);
mp = ___get_dma_pool(dev_dmat);
if (!mp)
- goto out;
+ return;
__sym_mfree(mp, m, size, name);
#ifdef SYM_MEM_FREE_UNUSED
if (!mp->nump)
___del_dma_pool(mp);
#endif
- out:
- spin_unlock_irqrestore(&sym53c8xx_lock, flags);
}
/*
--
2.25.1
Powered by blists - more mailing lists