Skip to contentSkip to conversation

mpt2sas: _scsih_smart_predicted_fault uses GFP_KERNEL in interrupt context

SCSI Anton Blanchard 2 participants 3 messages Jul 31, 2011 – Nov 10, 2011 SCSI

lore
Share & tools
lore
#0 lore raw

_scsih_smart_predicted_fault is called in an interrupt and therefore must allocate memory using GFP_ATOMIC.

---

drivers/scsi/mpt2sas/mpt2sas_scsih.c +1 -1
Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_scsih.c
===================================================================
@@ -4210,7 +4210,7 @@ _scsih_smart_predicted_fault(struct MPT2
 	/* insert into event log */
 	sz = offsetof(Mpi2EventNotificationReply_t, EventData) +
 	     sizeof(Mpi2EventDataSasDeviceStatusChange_t);
-	event_reply = kzalloc(sz, GFP_KERNEL);
+	event_reply = kzalloc(sz, GFP_ATOMIC);
 	if (!event_reply) {
 		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
 		    ioc->name, __FILE__, __LINE__, __func__);
#1 lore raw

Hi Kashyap,

Quoted 3 lines · On Sun, 31 Jul 2011 19:29:09 +1000 Anton Blanchard <[email protected]> wrote:

_scsih_smart_predicted_fault is called in an interrupt and therefore must allocate memory using GFP_ATOMIC.

Just noticed this hasn't made it upstream, any chance you could review it for merging?

Anton
--

_scsih_smart_predicted_fault is called in an interrupt and therefore must allocate memory using GFP_ATOMIC.

---

drivers/scsi/mpt2sas/mpt2sas_scsih.c +1 -1
Index: linux-work/drivers/scsi/mpt2sas/mpt2sas_scsih.c
===================================================================
@@ -4330,7 +4330,7 @@ _scsih_smart_predicted_fault(struct MPT2
 	/* insert into event log */
 	sz = offsetof(Mpi2EventNotificationReply_t, EventData) +
 	     sizeof(Mpi2EventDataSasDeviceStatusChange_t);
-	event_reply = kzalloc(sz, GFP_KERNEL);
+	event_reply = kzalloc(sz, GFP_ATOMIC);
 	if (!event_reply) {
 		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
 		    ioc->name, __FILE__, __LINE__, __func__);
#2 lore raw

The patch seem to be fine. Please consider this patch as an Acked by me

Regards,
Nagalakshmi

-----Original Message-----
From: Anton Blanchard [mailto:[email protected]]
Sent: Monday, November 07, 2011 4:35 PM
To: Desai, Kashyap
Cc: Moore, Eric; [email protected]; [email protected]
Subject: Re: [SCSI] mpt2sas: _scsih_smart_predicted_fault uses GFP_KERNEL in interrupt context

Hi Kashyap,

Quoted 3 lines · On Sun, 31 Jul 2011 19:29:09 +1000 Anton Blanchard <[email protected]> wrote:

_scsih_smart_predicted_fault is called in an interrupt and therefore must allocate memory using GFP_ATOMIC.

Just noticed this hasn't made it upstream, any chance you could review it for merging?

Anton
--

_scsih_smart_predicted_fault is called in an interrupt and therefore must allocate memory using GFP_ATOMIC.

---

drivers/scsi/mpt2sas/mpt2sas_scsih.c +1 -1
Index: linux-work/drivers/scsi/mpt2sas/mpt2sas_scsih.c
===================================================================
@@ -4330,7 +4330,7 @@ _scsih_smart_predicted_fault(struct MPT2
 	/* insert into event log */
 	sz = offsetof(Mpi2EventNotificationReply_t, EventData) +
 	     sizeof(Mpi2EventDataSasDeviceStatusChange_t);
-	event_reply = kzalloc(sz, GFP_KERNEL);
+	event_reply = kzalloc(sz, GFP_ATOMIC);
 	if (!event_reply) {
 		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
 		    ioc->name, __FILE__, __LINE__, __func__);