lkml.org 
[lkml]   [2010]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2 V3] applesmc: Use PnP rather than hardcoding resources and devices
On Fri, Dec 17, 2010 at 08:23:21PM -0800, Guenter Roeck wrote:
> On Fri, Dec 17, 2010 at 05:24:20PM -0500, Matthew Garrett wrote:
> > The AppleSMC device is described in ACPI, including a list of its resources.
> > We should use those rather than hardcoding the ports. A side-effect is that
> > we can then remove the DMI matching, since there's a unique identifier to
> > indicate that the machine has one of these devices.
> >
> > Signed-off-by: Matthew Garrett <mjg@redhat.com>
>
> You added a whitespace error, and kfree() is safe and doesn't need a check.
> I fixed those, so no need to resubmit. If Henrik gives his Ack we are ready to go.

Ok, although the idea is interesting, it seems this patch will need
some reworking and testing. I tested the patches on a recent
MacBookAir3,1, and i get this:

[ 1.211182] Pid: 779, comm: modprobe Not tainted 2.6.37-rc5+ #280 Mac-942452F5819B1C1B/MacBookAir3,1
[ 1.211282] RIP: 0010:[<ffffffff811259b9>] [<ffffffff811259b9>] sysfs_create_file+0x9/0x30
[ 1.211424] RSP: 0018:ffff88007f1e7d48 EFLAGS: 00010202
[ 1.211498] RAX: 0000000000000124 RBX: ffff88006bd58540 RCX: 0000000000000004
[ 1.211575] RDX: 0000000000000004 RSI: ffff88006bd58540 RDI: 0000000000000010
[ 1.211653] RBP: ffffffffa000b040 R08: 0000000000000000 R09: ffff88006bd58540
[ 1.211731] R10: 0000000000000001 R11: 00000000ffffffff R12: 0000000000000001
[ 1.211808] R13: 0000000000000000 R14: 0000000000000000 R15: ffff88006bd58568
[ 1.211886] FS: 00007fbe4a458700(0000) GS:ffff88006ec00000(0000) knlGS:0000000000000000
[ 1.211984] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 1.212007] CR2: 0000000000000040 CR3: 0000000069de9000 CR4: 00000000000406b0
[ 1.212007] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1.212007] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1.212007] Process modprobe (pid: 779, threadinfo ffff88007f1e6000, task ffff88006bd38000)
[ 1.212007] Stack:
[ 1.212007] 0000000000405056 ffffffffa0009ecc 0000000000405056 ffffffff8139b969
[ 1.212517] 0000000100000030 0000000000000010 ffffffffa000b040 0000000000000090
[ 1.212517] 0000000000000125 0000000000000000 0000000000000000 ffffffffa000ad60
[ 1.212517] Call Trace:
[ 1.212517] [<ffffffffa0009ecc>] ? applesmc_create_nodes+0x13c/0x170 [applesmc]
[ 1.212517] [<ffffffff8139b969>] ? printk+0x40/0x45
[ 1.212517] [<ffffffffa000a89f>] ? applesmc_pnp_probe+0x529/0x56a [applesmc]
[ 1.212517] [<ffffffff81222ede>] ? compare_pnp_id+0x1e/0xf0
[ 1.212517] [<ffffffffa000a376>] ? applesmc_pnp_probe+0x0/0x56a [applesmc]
[ 1.212517] [<ffffffff8122307f>] ? pnp_device_probe+0x6f/0xe0
[ 1.212517] [<ffffffff8126a342>] ? driver_sysfs_add+0x72/0xa0
[ 1.212517] [<ffffffff8126a5d7>] ? driver_probe_device+0x87/0x1a0
[ 1.212517] [<ffffffff8126a783>] ? __driver_attach+0x93/0xa0
[ 1.212517] [<ffffffff8126a6f0>] ? __driver_attach+0x0/0xa0
[ 1.212517] [<ffffffff812695cd>] ? bus_for_each_dev+0x4d/0x80
[ 1.212517] [<ffffffff81269ea8>] ? bus_add_driver+0x158/0x2d0
[ 1.212517] [<ffffffffa000e000>] ? applesmc_init+0x0/0x14 [applesmc]
[ 1.212517] [<ffffffff8126a9dc>] ? driver_register+0x6c/0x130
[ 1.212517] [<ffffffffa000e000>] ? applesmc_init+0x0/0x14 [applesmc]
[ 1.212517] [<ffffffff810002ca>] ? do_one_initcall+0x3a/0x170
[ 1.212517] [<ffffffff8106f8a9>] ? sys_init_module+0xb9/0x200
[ 1.212517] [<ffffffff810023bb>] ? system_call_fastpath+0x16/0x1b
[ 1.212517] Code: 8b 03 85 c0 74 05 f0 ff 03 eb 9d be b7 00 00 00 48 c7 c7 e7 4e 46 81 e8 06 2b f1 ff eb e8 0f 1f 40 00 48 83 ec 08 48 85 ff 74 1c <48> 8b 7f 30 48 85 f6 74 13 48 85 ff 74 0e ba 02 00 00 00 48 83
[ 1.212517] RIP [<ffffffff811259b9>] sysfs_create_file+0x9/0x30
[ 1.212517] RSP <ffff88007f1e7d48>
[ 1.212517] CR2: 0000000000000040
[ 1.218078] ---[ end trace ad091051b87fc759 ]---
So where to attach the sysfs nodes... There is also a userspace issue
here, since a lot of applications are hard-wired to
/sys/devices/platform/applesmc.768/.

Thanks,
Henrik


\
 
 \ /
  Last update: 2010-12-18 10:41    [from the cache]
©2003-2011 Jasper Spaans