Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754707Ab0LRJhy (ORCPT ); Sat, 18 Dec 2010 04:37:54 -0500 Received: from ch-smtp03.sth.basefarm.net ([80.76.149.214]:41351 "EHLO ch-smtp03.sth.basefarm.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754108Ab0LRJhw (ORCPT ); Sat, 18 Dec 2010 04:37:52 -0500 From: "Henrik Rydberg" Date: Sat, 18 Dec 2010 10:37:19 +0100 To: Guenter Roeck Cc: Matthew Garrett , "linux-kernel@vger.kernel.org" , "lm-sensors@lm-sensors.org" Subject: Re: [PATCH 1/2 V3] applesmc: Use PnP rather than hardcoding resources and devices Message-ID: <20101218093719.GA1493@polaris.bitmath.org> References: <20101217221618.GA13207@ericsson.com> <1292624661-32474-1-git-send-email-mjg@redhat.com> <20101218042320.GA14104@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101218042320.GA14104@ericsson.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 83.248.200.95 X-Scan-Result: No virus found in message 1PTtEX-0000LV-BY. X-Scan-Signature: ch-smtp03.sth.basefarm.net 1PTtEX-0000LV-BY bc2749e350f650eee5a617a91cf2a198 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4344 Lines: 70 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 > > 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:[] [] 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] [] ? applesmc_create_nodes+0x13c/0x170 [applesmc] [ 1.212517] [] ? printk+0x40/0x45 [ 1.212517] [] ? applesmc_pnp_probe+0x529/0x56a [applesmc] [ 1.212517] [] ? compare_pnp_id+0x1e/0xf0 [ 1.212517] [] ? applesmc_pnp_probe+0x0/0x56a [applesmc] [ 1.212517] [] ? pnp_device_probe+0x6f/0xe0 [ 1.212517] [] ? driver_sysfs_add+0x72/0xa0 [ 1.212517] [] ? driver_probe_device+0x87/0x1a0 [ 1.212517] [] ? __driver_attach+0x93/0xa0 [ 1.212517] [] ? __driver_attach+0x0/0xa0 [ 1.212517] [] ? bus_for_each_dev+0x4d/0x80 [ 1.212517] [] ? bus_add_driver+0x158/0x2d0 [ 1.212517] [] ? applesmc_init+0x0/0x14 [applesmc] [ 1.212517] [] ? driver_register+0x6c/0x130 [ 1.212517] [] ? applesmc_init+0x0/0x14 [applesmc] [ 1.212517] [] ? do_one_initcall+0x3a/0x170 [ 1.212517] [] ? sys_init_module+0xb9/0x200 [ 1.212517] [] ? 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 [] sysfs_create_file+0x9/0x30 [ 1.212517] RSP [ 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/