Skip to contentSkip to conversation

SLICOSS - use gfp_kernel where possible

PATCH In review Lior Dotan 3 participants 3 messages Feb 11, 2009 – Apr 7, 2009 Staging

lore
Share & tools
lore

Lior Dotan

author
#0 lore raw

PATCH 1/1 SLICOSS - use gfp_kernel where possible

Use GFP_KERNEL instead of GFP_ATOMIC where possible.

drivers/staging/slicoss/slicoss.c +4 -4
diff -X /usr/src/linux/Documentation/dontdiff -purN a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
@@ -1492,7 +1492,7 @@ static int slic_mcast_add_list(struct ad
 	}
 
 	/* Doesn't already exist.  Allocate a structure to hold it */
-	mcaddr = kmalloc(sizeof(struct mcast_address), GFP_ATOMIC);
+	mcaddr = kmalloc(sizeof(struct mcast_address), GFP_KERNEL);
 	if (mcaddr == NULL)
 		return 1;
 
@@ -2648,7 +2648,7 @@ static int slic_card_init(struct sliccar
 
 #if SLIC_DUMP_ENABLED
 	if (!card->dumpbuffer) {
-		card->dumpbuffer = kmalloc(DUMP_PAGE_SIZE, GFP_ATOMIC);
+		card->dumpbuffer = kmalloc(DUMP_PAGE_SIZE, GFP_KERNEL);
 
 		ASSERT(card->dumpbuffer);
 		if (card->dumpbuffer == NULL)
@@ -2667,7 +2667,7 @@ static int slic_card_init(struct sliccar
 	 *  Allocate COMMAND BUFFER
 	 */
 	if (!card->cmdbuffer) {
-		card->cmdbuffer = kmalloc(sizeof(struct dump_cmd), GFP_ATOMIC);
+		card->cmdbuffer = kmalloc(sizeof(struct dump_cmd), GFP_KERNEL);
 
 		ASSERT(card->cmdbuffer);
 		if (card->cmdbuffer == NULL)
@@ -2808,7 +2808,7 @@ static u32 slic_card_locate(struct adapt
 	}
 	if (!physcard) {
 		/* no structure allocated for this physical card yet */
-		physcard = kzalloc(sizeof(struct physcard), GFP_ATOMIC);
+		physcard = kzalloc(sizeof(struct physcard), GFP_KERNEL);
 		ASSERT(physcard);
 
 		DBG_MSG
#1 lore raw
Quoted 7 lines

-----Original Message-----
From: Lior Dotan [mailto:[email protected]]
Sent: Wednesday, February 11, 2009 6:35 AM
To: [email protected]
Cc: Christopher Harrer; [email protected]
Subject: [PATCH] SLICOSS - use gfp_kernel where possible

Quoted 6 lines

Use GFP_KERNEL instead of GFP_ATOMIC where possible.

Hi Greg,

In speaking with Lior, would it be possible to revert this patch? It's causing:

Quoted 4 lines
Mar 24 11:50:31 linuxdev kernel: BUG: sleeping function called from 

invalid context at mm/slub.c:1599 Mar 24 11:50:31 linuxdev kernel:
in_atomic(): 1, irqs_disabled(): 0, pid:
3251, name: avahi-daemon

Please let me know if you need any additional information or have any questions.

Cheers,

Chris

drivers/staging/slicoss/slicoss.c +4 -4
diff -X /usr/src/linux/Documentation/dontdiff -purN a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
@@ -1492,7 +1492,7 @@ static int slic_mcast_add_list(struct ad
 	}
 
 	/* Doesn't already exist.  Allocate a structure to hold it */
-	mcaddr = kmalloc(sizeof(struct mcast_address), GFP_ATOMIC);
+	mcaddr = kmalloc(sizeof(struct mcast_address), GFP_KERNEL);
 	if (mcaddr == NULL)
 		return 1;
 
@@ -2648,7 +2648,7 @@ static int slic_card_init(struct sliccar
 
 #if SLIC_DUMP_ENABLED
 	if (!card->dumpbuffer) {
-		card->dumpbuffer = kmalloc(DUMP_PAGE_SIZE, GFP_ATOMIC);
+		card->dumpbuffer = kmalloc(DUMP_PAGE_SIZE, GFP_KERNEL);
 
 		ASSERT(card->dumpbuffer);
 		if (card->dumpbuffer == NULL)
@@ -2667,7 +2667,7 @@ static int slic_card_init(struct sliccar
 	 *  Allocate COMMAND BUFFER
 	 */
 	if (!card->cmdbuffer) {
-		card->cmdbuffer = kmalloc(sizeof(struct dump_cmd), GFP_ATOMIC);
+		card->cmdbuffer = kmalloc(sizeof(struct dump_cmd), GFP_KERNEL);
 
 		ASSERT(card->cmdbuffer);
 		if (card->cmdbuffer == NULL)
@@ -2808,7 +2808,7 @@ static u32 slic_card_locate(struct adapt
 	}
 	if (!physcard) {
 		/* no structure allocated for this physical card yet */
-		physcard = kzalloc(sizeof(struct physcard), GFP_ATOMIC);
+		physcard = kzalloc(sizeof(struct physcard), GFP_KERNEL);
 		ASSERT(physcard);
 
 		DBG_MSG
#2 lore raw
Quoted 18 lines · Christopher Harrer
Quoted 7 lines

-----Original Message-----
From: Lior Dotan [mailto:[email protected]]
Sent: Wednesday, February 11, 2009 6:35 AM
To: [email protected]
Cc: Christopher Harrer; [email protected]
Subject: [PATCH] SLICOSS - use gfp_kernel where possible

Quoted 6 lines

Use GFP_KERNEL instead of GFP_ATOMIC where possible.

Hi Greg,

In speaking with Lior, would it be possible to revert this patch? It's causing:

Quoted 7 lines
Quoted 4 lines
Mar 24 11:50:31 linuxdev kernel: BUG: sleeping function called from 

invalid context at mm/slub.c:1599 Mar 24 11:50:31 linuxdev kernel:
in_atomic(): 1, irqs_disabled(): 0, pid:
3251, name: avahi-daemon

Please let me know if you need any additional information or have any questions.

Now reverted, sorry for the delay.

greg k-h