linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: omap: Fix a section warning regression
@ 2012-05-28  6:53 Tony Lindgren
  2012-05-28  8:22 ` Felipe Balbi
  2012-05-28 10:36 ` [PATCH] mmc: omap: Fix NULL pointer dereference if mmc_omap_new_slot() fails Tony Lindgren
  0 siblings, 2 replies; 5+ messages in thread
From: Tony Lindgren @ 2012-05-28  6:53 UTC (permalink / raw)
  To: linux-arm-kernel

Commit b6e0703b (mmc: omap: make it behave well as a module) made some
__devinit changes but missed one function causing a section warning:

WARNING: vmlinux.o(.devinit.text+0x8604): Section mismatch in reference
from the function mmc_omap_probe)
The function __devinit mmc_omap_probe() references a function
__init mmc_omap_new_slot()

Signed-off-by: Tony Lindgren <tony@atomide.com>

--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1300,7 +1300,7 @@ static const struct mmc_host_ops mmc_omap_ops = {
 	.set_ios	= mmc_omap_set_ios,
 };
 
-static int __init mmc_omap_new_slot(struct mmc_omap_host *host, int id)
+static int __devinit mmc_omap_new_slot(struct mmc_omap_host *host, int id)
 {
 	struct mmc_omap_slot *slot = NULL;
 	struct mmc_host *mmc;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] mmc: omap: Fix a section warning regression
  2012-05-28  6:53 [PATCH] mmc: omap: Fix a section warning regression Tony Lindgren
@ 2012-05-28  8:22 ` Felipe Balbi
  2012-06-06 13:45   ` Chris Ball
  2012-05-28 10:36 ` [PATCH] mmc: omap: Fix NULL pointer dereference if mmc_omap_new_slot() fails Tony Lindgren
  1 sibling, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2012-05-28  8:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 27, 2012 at 11:53:47PM -0700, Tony Lindgren wrote:
> Commit b6e0703b (mmc: omap: make it behave well as a module) made some
> __devinit changes but missed one function causing a section warning:
> 
> WARNING: vmlinux.o(.devinit.text+0x8604): Section mismatch in reference
> from the function mmc_omap_probe)
> The function __devinit mmc_omap_probe() references a function
> __init mmc_omap_new_slot()
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> 
> --- a/drivers/mmc/host/omap.c
> +++ b/drivers/mmc/host/omap.c
> @@ -1300,7 +1300,7 @@ static const struct mmc_host_ops mmc_omap_ops = {
>  	.set_ios	= mmc_omap_set_ios,
>  };
>  
> -static int __init mmc_omap_new_slot(struct mmc_omap_host *host, int id)
> +static int __devinit mmc_omap_new_slot(struct mmc_omap_host *host, int id)
>  {
>  	struct mmc_omap_slot *slot = NULL;
>  	struct mmc_host *mmc;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120528/2669f1a8/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] mmc: omap: Fix NULL pointer dereference if mmc_omap_new_slot() fails
  2012-05-28  6:53 [PATCH] mmc: omap: Fix a section warning regression Tony Lindgren
  2012-05-28  8:22 ` Felipe Balbi
@ 2012-05-28 10:36 ` Tony Lindgren
  2012-06-06 13:46   ` Chris Ball
  1 sibling, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2012-05-28 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

Commit b01a4f1c (mmc: omap: convert to per instance workqueue) initializes
the workqueue too late causing the following:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in:
CPU: 0    Not tainted  (3.4.0-08218-gb48b2c3 #158)
PC is at __queue_work+0x8/0x46c
LR is at queue_work_on+0x38/0x40
pc : [<c005bb4c>]    lr : [<c005c00c>]    psr: 60000193
sp : c0691e1c  ip : 00000000  fp : c07374ac
r10: c7aae400  r9 : c0395700  r8 : 00000100
r7 : c0691e70  r6 : 00000000  r5 : 00000000  r4 : c7aae440
r3 : 00000001  r2 : c7aae440  r1 : 00000000  r0 : 00000000
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 00c5387d  Table: 80004000  DAC: 00000017
Process swapper/0 (pid: 0, stack limit = 0xc06902f8)
Stack: (0xc0691e1c to 0xc0692000)

Fix this by initializing the workqueue before mmc_omap_remove_slot()
get called. Tested on n770, looks like n800 at least still has some
other issue with MMC.

Signed-off-by: Tony Lindgren <tony@atomide.com>

--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1485,24 +1485,27 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev)
 	}
 
 	host->nr_slots = pdata->nr_slots;
+
+	host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0);
+	if (!host->mmc_omap_wq)
+		goto err_plat_cleanup;
+
 	for (i = 0; i < pdata->nr_slots; i++) {
 		ret = mmc_omap_new_slot(host, i);
 		if (ret < 0) {
 			while (--i >= 0)
 				mmc_omap_remove_slot(host->slots[i]);
 
-			goto err_plat_cleanup;
+			goto err_destroy_wq;
 		}
 	}
 
 	host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
 
-	host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0);
-	if (!host->mmc_omap_wq)
-		goto err_plat_cleanup;
-
 	return 0;
 
+err_destroy_wq:
+	destroy_workqueue(host->mmc_omap_wq);
 err_plat_cleanup:
 	if (pdata->cleanup)
 		pdata->cleanup(&pdev->dev);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] mmc: omap: Fix a section warning regression
  2012-05-28  8:22 ` Felipe Balbi
@ 2012-06-06 13:45   ` Chris Ball
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Ball @ 2012-06-06 13:45 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, May 28 2012, Felipe Balbi wrote:
> On Sun, May 27, 2012 at 11:53:47PM -0700, Tony Lindgren wrote:
>> Commit b6e0703b (mmc: omap: make it behave well as a module) made some
>> __devinit changes but missed one function causing a section warning:
>> 
>> WARNING: vmlinux.o(.devinit.text+0x8604): Section mismatch in reference
>> from the function mmc_omap_probe)
>> The function __devinit mmc_omap_probe() references a function
>> __init mmc_omap_new_slot()
>> 
>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> Acked-by: Felipe Balbi <balbi@ti.com>

Thanks, pushed to mmc-next for 3.5.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] mmc: omap: Fix NULL pointer dereference if mmc_omap_new_slot() fails
  2012-05-28 10:36 ` [PATCH] mmc: omap: Fix NULL pointer dereference if mmc_omap_new_slot() fails Tony Lindgren
@ 2012-06-06 13:46   ` Chris Ball
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Ball @ 2012-06-06 13:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, May 28 2012, Tony Lindgren wrote:
> Commit b01a4f1c (mmc: omap: convert to per instance workqueue) initializes
> the workqueue too late causing the following:
>
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
> pgd = c0004000
> [00000000] *pgd=00000000
> Internal error: Oops: 5 [#1] SMP ARM
> Modules linked in:
> CPU: 0    Not tainted  (3.4.0-08218-gb48b2c3 #158)
> PC is at __queue_work+0x8/0x46c
> LR is at queue_work_on+0x38/0x40
> pc : [<c005bb4c>]    lr : [<c005c00c>]    psr: 60000193
> sp : c0691e1c  ip : 00000000  fp : c07374ac
> r10: c7aae400  r9 : c0395700  r8 : 00000100
> r7 : c0691e70  r6 : 00000000  r5 : 00000000  r4 : c7aae440
> r3 : 00000001  r2 : c7aae440  r1 : 00000000  r0 : 00000000
> Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Control: 00c5387d  Table: 80004000  DAC: 00000017
> Process swapper/0 (pid: 0, stack limit = 0xc06902f8)
> Stack: (0xc0691e1c to 0xc0692000)
>
> Fix this by initializing the workqueue before mmc_omap_remove_slot()
> get called. Tested on n770, looks like n800 at least still has some
> other issue with MMC.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Thanks, pushed to mmc-next for 3.5.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-06 13:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28  6:53 [PATCH] mmc: omap: Fix a section warning regression Tony Lindgren
2012-05-28  8:22 ` Felipe Balbi
2012-06-06 13:45   ` Chris Ball
2012-05-28 10:36 ` [PATCH] mmc: omap: Fix NULL pointer dereference if mmc_omap_new_slot() fails Tony Lindgren
2012-06-06 13:46   ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).