From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756794AbcA2VMz (ORCPT ); Fri, 29 Jan 2016 16:12:55 -0500 Received: from vms173023pub.verizon.net ([206.46.173.23]:34795 "EHLO vms173023pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755251AbcA2VMx (ORCPT ); Fri, 29 Jan 2016 16:12:53 -0500 X-Greylist: delayed 3612 seconds by postgrey-1.27 at vger.kernel.org; Fri, 29 Jan 2016 16:12:53 EST X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=Nc0brD34 c=1 sm=1 tr=0 a=bXmWQgKa9n63w7XTPFb8JQ==:117 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=7aQ_Q-yQQ-AA:10 a=N54-gffFAAAA:8 a=4UeOtXkhtOvrIpnWA_kA:9 a=QEXdDO2ut3YA:10 Reply-to: minyard@acm.org Subject: Re: [Openipmi-developer] ipmi_si feature request: SMBIOS-based autoloading References: <56A7757A.6040704@acm.org> <56A777EF.4010205@acm.org> To: Andy Lutomirski Cc: Andy Lutomirski , OpenIPMI Developers , "linux-kernel@vger.kernel.org" , brijeshkumar.singh@amd.com, Jean Delvare From: Corey Minyard Message-id: <56ABC798.8070403@acm.org> Date: Fri, 29 Jan 2016 14:12:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/2016 11:29 AM, Andy Lutomirski wrote: > On Tue, Jan 26, 2016 at 5:43 AM, Corey Minyard wrote: >> On 01/26/2016 07:32 AM, Corey Minyard wrote: >>> On 01/24/2016 07:45 PM, Andy Lutomirski wrote: >>>> ipmi_si doesn't autoload on systems where it's found via SMBIOS. >>>> Could that be fixed? >>> I'm not really sure. I kind of assumed this was handled in userland >>> like the ACPI tables. I don't think there are many systems that have >>> SMBIOS and not ACPI, so I'm not sure of the impact here or what >>> to do. > I've never seen it handled in userland adequately on Fedora, Ubuntu, or CentOS. Well, that was much harder than I expected. There's not much there for handling DMI devices, so I added some basic infrastructure to do this. I looked at some other methods, but they were really hacks. Expect some patches on this soon. > > FWIW, it might pay to have ipmi_si pull in ipmi_devintf as well. Then > ipmitool would work out of the box. Yeah, I've gotten enough complaints on this, I'll go ahead and do it. I tried adding MODULE_SOFTDEP, but that doesn't seem to work out of the box. So I need to figure out the best way to do this. -corey >>>> If I were doing it, I'd suggest rigging up some code that's compiled >>>> in to the main kernel even if ipmi_si is a module that creates the >>>> platform device if the dmi device is there and then set up a modalias >>>> so that the platofrm device causes ipmi_si to load. >>>> >>>> (In general, having the same driver create the platform device and >>>> register the platform driver means that autoloading is unlikely to >>>> work right. See arch/x86/kernel/pmem.c for an example of a weird >>>> legacy device that gets this right.) >>> This sounds like kind of a hack. > It's a bit of a hack in that case. It does preserve the general > driver model approach where a lower-level thing enumerates the system > and instantiates devices and then a higher-level driver binds to the > devices. > >>>> Alternatively, maybe /sys/firmware/dmi could learn how to advertise >>>> modaliases. But that might be a giant mess to solve a tiny problem. >>> This sounds like the right way, but you are probably right. Are >>> there any other resources that could benefit from this? I"m >>> guessing not. > No clue. Jean might know. Jean? > >>> There is already a "dmi_save_ipmi_device" function that gets called >>> when scanning the SMBIOS table (see drivers/firmware/dmi_scan.c). >>> Maybe a tie-in there? That happens pretty early, though, I'm not >>> sure if it's too early. >>> >>> Of course it would be easy to have a file like pmem.c that detects >>> if an IPMI device is in the SMBIOS table and create a platform >>> device for it. >>> >>> Are you willing to do this work? > I'm willing to do some plumbing, but I'm not sure I want to dig deeply > into the innards of ipmi_si initialization. > >>> -corey >>> >> Actually, there is some cleanup that has to occur here, let me look at this >> a little bit. > It looks like the driver currently decides how to talk to the hardware > and then instantiates the platform device. For my approach to work, > it would have to be refactored a bit: instantiate the platform device > with the info about how to talk to hardware and then have the platform > driver fish that info back out of the platform device. Is that what > you're talking about? > > I also don't understand the distinction between ipmi_si and ipmi_bmc. > > --Andy