[PATCH net-next] ionic: fix a sleeping in atomic bug

Subsystems: networking drivers, pensando ethernet drivers, the rest

STALE1794d LANDED

Landed in mainline as 52a67fbf0cff on 2021-09-03.

3 messages, 3 authors, 2021-09-03 · open the first message on its own page

[PATCH net-next] ionic: fix a sleeping in atomic bug

From: Dan Carpenter <hidden>
Date: 2021-09-03 13:19:55

This code is holding spin_lock_bh(&lif->rx_filters.lock); so the
allocation needs to be atomic.

Fixes: 969f84394604 ("ionic: sync the filters in the work task")
Signed-off-by: Dan Carpenter <redacted>
---
 drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
index 7e3a5634c161..25ecfcfa1281 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
@@ -318,7 +318,7 @@ void ionic_rx_filter_sync(struct ionic_lif *lif)
 			if (f->state == IONIC_FILTER_STATE_NEW ||
 			    f->state == IONIC_FILTER_STATE_OLD) {
 				sync_item = devm_kzalloc(dev, sizeof(*sync_item),
-							 GFP_KERNEL);
+							 GFP_ATOMIC);
 				if (!sync_item)
 					goto loop_out;
 
-- 
2.20.1

Re: [PATCH net-next] ionic: fix a sleeping in atomic bug

From: Shannon Nelson <hidden>
Date: 2021-09-03 15:14:29

On 9/3/21 6:18 AM, Dan Carpenter wrote:
This code is holding spin_lock_bh(&lif->rx_filters.lock); so the
allocation needs to be atomic.

Fixes: 969f84394604 ("ionic: sync the filters in the work task")
Signed-off-by: Dan Carpenter <redacted>
Signed-off-by: Shannon Nelson <redacted>
quoted hunk
---
  drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
index 7e3a5634c161..25ecfcfa1281 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
@@ -318,7 +318,7 @@ void ionic_rx_filter_sync(struct ionic_lif *lif)
  			if (f->state == IONIC_FILTER_STATE_NEW ||
  			    f->state == IONIC_FILTER_STATE_OLD) {
  				sync_item = devm_kzalloc(dev, sizeof(*sync_item),
-							 GFP_KERNEL);
+							 GFP_ATOMIC);
  				if (!sync_item)
  					goto loop_out;
  

Re: [PATCH net-next] ionic: fix a sleeping in atomic bug

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-09-03 23:18:00

On Fri, 3 Sep 2021 08:14:25 -0700 Shannon Nelson wrote:
On 9/3/21 6:18 AM, Dan Carpenter wrote:
quoted
This code is holding spin_lock_bh(&lif->rx_filters.lock); so the
allocation needs to be atomic.

Fixes: 969f84394604 ("ionic: sync the filters in the work task")
Signed-off-by: Dan Carpenter <redacted>  
Signed-off-by: Shannon Nelson <redacted>
Applied, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help