Hello,
On Tue, 19 Feb 2008 00:33:45 +0100
"Michal Panczyk" <mpanczyk_at_gmail.com> wrote:
> Hello all...
>
> I am working on merging LCD and backlight functions to h5400.c file.
> The code so far existed in h5400_lcd.c and h5400_bl.c and worked like
> charm.... I am not experienced kernel developer and I have some
> problems with this task...
> After some chats on IRC with Milan Plizk we decided that BL depends on
> LCD code, so LCD has to be initized first. Also because of this LCD
> and BL are treated as one issue. Most of the code is just copy&paste
> (for now...) - as I don't want to mess it up, before I am sure is is
> working.
> LCD is initized by the h5400_init function, after the samcop
> intization. This calls for other function of LCD
> code getting to the h5400_mq_set_power where it gets stuck at
> samcop_set_gpio_b. As far as I get the error it has empty (NULL)
> &h5400_samcop.dev. At least this is how I understand it. Could
> somebody point me to the direction of correcting this problem ? Why
> does it work outside h5000.c and not as build in ?
Yes, this is very well by now case of device initialization order. We
also discussed and agreed on consistent pattern to resolve such issues:
if a device A uses resources (e.g. GPIOs) of device B, then A should be
made a child device of B. I believe I consistently added child device
support to all of out MFD drivers, so framework is there.
So, have a look at h4000_lcd and h4000_bl devices - they both require
ASIC3 GPIOs for control, so made child devices of it.
There're of course more issues. First of all, there can be deep cases
of a device using GPIOs of two MFDs! h3900 has that already. We cannot
have support for 2 parents, so just do a dependency graph conversion to
make it a tree: one MFD made a child of another, and leaf devices
are attached to this child MFD (so we have 3-level hierarchy).
I'm not sure if you have this case (too late to check), but I mention
FIY.
Other case is LCD support - so far it is being done using a
machine-specific driver. Merging that into main machine file as is is
not elegant at least. It would be nice if machine definition contained
only devices, there properties, and methods. So, that calls for
factoring out an LCD driver for all(?) of our machines to use.
Bottom line: please do a BL driver for now, h4000 and other machines
can be examples. LCD will need more thought.
>
> During boot I get [1]: (most important part of boot log)
> ....
> [ 0.360000] Unable to handle kernel NULL pointer dereference at
> virtual address 0000000c
> [ 0.360000] Backtrace:
> [ 0.360000] [<c0130a1c>] (samcop_set_gpio_b+0x0/0x70) from
> [<c0029eac>] (h5400_mq_set_power+0x28/0x60)
> [ 0.360000] [<c0029e84>] (h5400_mq_set_power+0x0/0x60) from
> [<c000e7f0>] (h5400_init+0xe4/0x1f0)
> [ 0.360000] [<c000e70c>] (h5400_init+0x0/0x1f0) from [<c000c454>]
> (customize_machine+0x20/0x2c)
> [ 0.360000] [<c000c434>] (customize_machine+0x0/0x2c) from
> [<c000891c>] (init+0x98/0x1bc)
> ....
>
> The LCD cod is the same as in h5400_lcd, but just in case I attach
> diff of my version of h5000.c (with integrated LCD and BL).
>
>
> Cheers
> Michal Panczyk
>
>
> [1]: Full boot log:
>
> Uncompressing
> Linux............................................................................
> done, booting the kernel. [ 0.000000] Linux version 2.6.21-hh20
> (yans_at_Maly) (gcc version 4.1.2) #15 PREEMPT Sat Feb 16 01:28:45 CET
> 2008 [ 0.000000] CPU: XScale-PXA250 [69052904] revision 4
> (ARMv5TE), cr=0000397f [ 0.000000] Machine: HP iPAQ H5400
> [ 0.000000] Memory policy: ECC disabled, Data cache writeback
> [ 0.000000] Memory clock: 99.53MHz (*27)
> [ 0.000000] Run Mode clock: 199.07MHz (*2)
> [ 0.000000] Turbo Mode clock: 398.13MHz (*2.0, active)
> [ 0.000000] CPU0: D VIVT undefined 5 cache
> [ 0.000000] CPU0: I cache: 32768 bytes, associativity 32, 32 byte
> lines, 32 sets
> [ 0.000000] CPU0: D cache: 32768 bytes, associativity 32, 32 byte
> lines, 32 sets
> [ 0.000000] Built 1 zonelists. Total pages: 16256
> [ 0.000000] Kernel command line:
> mtdparts=ipaq:0x00040000_at_0x00000000(bootldr)ro,0x01FC0000_at_0x00040000(root)
> root=/dev/mtdblock1 noinitr
> [ 0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
> [ 0.000000] Console: colour dummy device 80x30
> [ 0.080000] Dentry cache hash table entries: 8192 (order: 3, 32768
> bytes) [ 0.090000] Inode-cache hash table entries: 4096 (order: 2,
> 16384 bytes) [ 0.110000] Memory: 64MB = 64MB total
> [ 0.110000] Memory: 62464KB available (2128K code, 222K data, 80K
> init) [ 0.340000] Mount-cache hash table entries: 512
> [ 0.340000] CPU: Testing write buffer coherency: ok
> [ 0.350000] NET: Registered protocol family 16
> [ 0.360000] Unable to handle kernel NULL pointer dereference at
> virtual address 0000000c
> [ 0.360000] pgd = c0004000
> [ 0.360000] [0000000c] *pgd=00000000
> [ 0.360000] Internal error: Oops: f5 [#1]
> [ 0.360000] Modules linked in:
> [ 0.360000] CPU: 0
> [ 0.360000] PC is at samcop_set_gpio_b+0x30/0x70
> [ 0.360000] LR is at samcop_set_gpio_b+0x2c/0x70
> [ 0.360000] pc : [<c0130a4c>] lr : [<c0130a48>] Not tainted
> [ 0.360000] sp : c0313f48 ip : c0313f48 fp : c0313f64
> [ 0.360000] r10: 00000000 r9 : 00000000 r8 : 00000000
> [ 0.360000] r7 : 20000013 r6 : 00000010 r5 : 00000010 r4 :
> 00000000 [ 0.360000] r3 : 00000001 r2 : 000c0014 r1 : 00000002
> r0 : 00000002 [ 0.360000] Flags: Nzcv IRQs off FIQs on Mode
> SVC_32 Segment kernel [ 0.360000] Control: 397F
> [ 0.360000] Table: A0004000 DAC: 00000017
> [ 0.360000] Process swapper (pid: 1, stack limit = 0xc0312258)
> [ 0.360000] Stack: (0xc0313f48 to 0xc0314000)
> [ 0.360000] 3f40: 00000000 c5000000 c0325800
> 00000001 c0313f7c c0313f68
> [ 0.360000] 3f60: c0029eac c0130a28 c0325800 00000000 c0313f9c
> c0313f80 c000e7f0 c0029e90
> [ 0.360000] 3f80: c0313fac c001a584 c0019ec8 c0312000 c0313fac
> c0313fa0 c000c454 c000e718
> [ 0.360000] 3fa0: c0313ff4 c0313fb0 c000891c c000c440 00000000
> 00000000 c0008884 c0038930
> [ 0.360000] 3fc0: 00000000 00000000 00000000 00000000 00000000
> 00000000 00000000 00000000
> [ 0.360000] 3fe0: 00000000 00000000 00000000 c0313ff8 c0038930
> c0008890 6f6428c3 b2657623
> [ 0.360000] Backtrace:
> [ 0.360000] [<c0130a1c>] (samcop_set_gpio_b+0x0/0x70) from
> [<c0029eac>] (h5400_mq_set_power+0x28/0x60)
> [ 0.360000] r7 = 00000001 r6 = C0325800 r5 = C5000000 r4 =
> 00000000 [ 0.360000] [<c0029e84>] (h5400_mq_set_power+0x0/0x60)
> from [<c000e7f0>] (h5400_init+0xe4/0x1f0)
> [ 0.360000] r4 = 00000000
> [ 0.360000] [<c000e70c>] (h5400_init+0x0/0x1f0) from [<c000c454>]
> (customize_machine+0x20/0x2c)
> [ 0.360000] r6 = C0312000 r5 = C0019EC8 r4 = C001A584
> [ 0.360000] [<c000c434>] (customize_machine+0x0/0x2c) from
> [<c000891c>] (init+0x98/0x1bc)
> [ 0.360000] [<c0008884>] (init+0x0/0x1bc) from [<c0038930>]
> (do_exit+0x0/0x8bc)
> [ 0.360000] r7 = 00000000 r6 = 00000000 r5 = 00000000 r4 =
> 00000000 [ 0.360000] Code: e121f003 e3a00001 ebfc0029 e59f2038
> (e594100c) [ 0.570000] Kernel panic - not syncing: Attempted to
> kill init!
>
>
>
> --
>
> Michal
> _______________________________________________
> Kernel-bugs mailing list
> Kernel-bugs_at_handhelds.org
> https://www.handhelds.org/mailman/listinfo/kernel-bugs
-- Best regards, Paul mailto:pmiscml_at_gmail.comReceived on Tue Feb 19 2008 - 18:21:01 EST
This archive was generated by hypermail 2.2.0 : Tue Feb 19 2008 - 18:21:14 EST