Google
  Web www.spinics.net

Kernel Oops after call to platform_driver_register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hello everyone,

I'm currently working on a framebuffer driver for a small graphic LCD  
with a Sitronix ST7529 controller.  I'm basing my code on  
s1d13xxxfb.h and skeletonfb.h, and I'm getting a kernel Oops in the  
call to platform_driver_register of my driver's initialization  
routine.  As can be seen in the output below, it seems that a null  
pointer is being dereferenced in the call to strncmp in  
platform_match.  platform_match compares the device name, which is  
initialized in my board configuration file, to the driver name,  
initialized in the driver file.  I can see that the device is  
registered from the board file during the boot process because my  
debug code is executing, but the driver fails to register when I  
attempt to load the module with insmod.  The relevant info from these  
files is pasted below.  Does anyone have an idea why I'm getting this  
Oops or what I can do to track it down?

Many thanks in advance,
Alex


 From st7529fb.h:
======================================================================== 
====
#define ST_FBID		"ST7529"
#define ST_DEVICENAME	"st7529fb"

struct st7529fb_regval {
	u16	addr;
	u8	value;
};
struct st7529fb_par {
	void __iomem	*regs;
	unsigned char	status;
#ifdef CONFIG_PM
	void		*regs_save;	/* pm saves all registers here */
	void		*disp_save;	/* pm saves entire screen here */
#endif
};

struct st7529fb_pdata {
	const struct st7529fb_regval	*initregs;
	const unsigned int		initregssize;
};


 From st7529fb.c:
======================================================================== 
====
static struct platform_driver st7529fb_driver = {
	.probe = st7529fb_probe,
	.remove = st7529fb_remove,
#ifdef CONFIG_PM
	.suspend = st7529fb_suspend, /* optional but recommended */
	.resume = st7529fb_resume,   /* optional but recommended */
	.driver = {
		.name = ST_DEVICENAME,
	},#endif
};

static int __init st7529fb_init(void){
#ifndef MODULE
	if (fb_get_options("st7529fb", NULL))
		return -ENODEV;
#endif
	dbg(PFX "initializing driver\n");
	return platform_driver_register(&st7529fb_driver)
}


 From board-at91sam9260ek.c
======================================================================== 
====
static struct st7529fb_pdata st7529fb_data = {
	.initregssize	= 0,
};

#define ST7529_FB_START		0x10400001	/* Stub address */
#define ST7529_FB_LEN		255*160
#define ST7529_REG_START	0x10400000
#define ST7529_REG_LEN		1
static struct resource st7529fb_resources[] = {
	[0] = {
		.start	= ST7529_FB_START,
		.end	= ST7529_FB_START + ST7529_FB_LEN - 1,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= ST7529_REG_START,
		.end	= ST7529_REG_START + ST7529_REG_LEN - 1,
		.flags	= IORESOURCE_MEM,
	},
};

static struct platform_device st7529fb_device = {
	.name		= ST_DEVICENAME,
	.id		= 0,
	.dev		= {
		.platform_data	= &st7529fb_data,
	},
	.num_resources	= ARRAY_SIZE(st7529fb_resources),
	.resource	= st7529fb_resources,
};

void __init at91_add_device_st7529(void)
{
	printk("Registering ST7529 device\n");
	platform_device_register(&st7529fb_device);
}


Oops output
======================================================================== 
====
# insmod st7529fb.ko
initializing ST7529 driver
Unable to handle kernel NULL pointer dereference at virtual address  
00000000
pgd = c3670000
[00000000] *pgd=23c37031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
Modules linked in: st7529fb
CPU: 0    Not tainted  (2.6.24 #22)
PC is at strncmp+0x18/0x50
LR is at platform_match+0x1c/0x28
pc : [<c00e4444>]    lr : [<c0118aec>]    psr: 20000013
sp : c3debe10  ip : 00000073  fp : c3debe1c
r10: c485c000  r9 : 00000000  r8 : c02045ac
r7 : bf0008e4  r6 : bf0008e4  r5 : c01f76bc  r4 : c01f76bc
r3 : 00000000  r2 : 00000013  r1 : 00000000  r0 : c01c56dc
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 23670000  DAC: 00000015
Process insmod (pid: 275, stack limit = 0xc3dea258)
Stack: (0xc3debe10 to 0xc3dec000)
be00:                                     c3debe2c c3debe20 c0118aec  
c00e443c
be20: c3debe4c c3debe30 c0116fa4 c0118ae0 c01f7760 c01f76bc c01171f8  
bf0008e4
be40: c3debe64 c3debe50 c011727c c0116f74 00000000 c3debe68 c3debe90  
c3debe68
be60: c0116384 c0117208 c0204644 c0204644 c01f7704 bf0008e4 bf0008ec  
00000000
be80: c485caf8 c3debea0 c3debe94 c0116e84 c011634c c3debec4 c3debea4  
c0116734
bea0: c0116e74 bf0008e4 c3715e00 bf000b00 c485caf8 c485c800 c3debed8  
c3debec8
bec0: c0117504 c01166d4 c3715f9c c3debee8 c3debedc c0118b7c c0117494  
c3debef8
bee0: c3debeec bf00201c c0118b20 c3debfa4 c3debefc c0057574 bf002010  
00000000
bf00: 00012008 00000000 00000000 00000000 00000000 00000000 00000000  
00000000
bf20: 00000000 00000000 00000000 00000000 00000000 00000000 c485d040  
c3761f80
bf40: c485caa8 c485c9e0 c485cad0 00000000 00000041 00000041 bf000b0c  
00000013
bf60: c485c764 c485c800 00000013 00000011 00000014 00000000 00000000  
4000098c
bf80: 00000004 00012018 00000080 c0020fa4 c3dea000 00012008 00000000  
c3debfa8
bfa0: c0020e00 c0056244 4000098c 00000004 00012018 00001274 00012008  
00000000
bfc0: 4000098c 00000004 00012018 00004000 be8d8ebb 00000002 00012008  
00008cd0
bfe0: 4005f68c be8d8d38 00008f10 4005f698 20000010 00012018 00000000  
00000000
Backtrace:[<c00e442c>] (strncmp+0x0/0x50) from [<c0118aec>]  
(platform_match+0x1c/0x28)
[<c0118ad0>] (platform_match+0x0/0x28) from [<c0116fa4>]  
(driver_probe_device+0x40/0x1b8)
[<c0116f64>] (driver_probe_device+0x0/0x1b8) from [<c011727c>]  
(__driver_attach+0x84/0xe4) r7:bf0008e4 r6:c01171f8 r5:c01f76bc  
r4:c01f7760
[<c01171f8>] (__driver_attach+0x0/0xe4) from [<c0116384>]  
(bus_for_each_dev+0x48/0x80) r5:c3debe68 r4:00000000
[<c011633c>] (bus_for_each_dev+0x0/0x80) from [<c0116e84>]  
(driver_attach+0x20/0x28) r7:c485caf8 r6:00000000 r5:bf0008ec  
r4:bf0008e4
[<c0116e64>] (driver_attach+0x0/0x28) from [<c0116734>]  
(bus_add_driver+0x70/0x1c0)
[<c01166c4>] (bus_add_driver+0x0/0x1c0) from [<c0117504>]  
(driver_register+0x80/0x88) r8:c485c800 r7:c485caf8 r6:bf000b00  
r5:c3715e00 r4:bf0008e4
[<c0117484>] (driver_register+0x0/0x88) from [<c0118b7c>]  
(platform_driver_register+0x6c/0x88) r4:c3715f9c
[<c0118b10>] (platform_driver_register+0x0/0x88) from [<bf00201c>]  
(st7529fb_init+0x1c/0x50 [st7529fb])
[<bf002000>] (st7529fb_init+0x0/0x50 [st7529fb]) from [<c0057574>]  
(sys_init_module+0x1340/0x1428)
[<c0056234>] (sys_init_module+0x0/0x1428) from [<c0020e00>]  
(ret_fast_syscall+0x0/0x2c)
Code: e24cb004 e3a03000 ea000008 e5d0c000 (e5d13000)
---[ end trace 5d724fd5d7a2bcb7 ]---
Segmentation fault


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Site Home]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux ARM Kernel]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Tools]     [DDR & Rambus]     [Monitors]

Powered by Linux

Google PageRank Checking tool