All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Jean Delvare <jdelvare@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Corey Minyard <cminyard@mvista.com>,
	OpenIPMI Developers <openipmi-developer@lists.sourceforge.net>
Subject: Re: [PATCH 2/4] dmi: Add a DMI firmware node and handling
Date: Wed, 03 Feb 2016 10:51:16 -0600	[thread overview]
Message-ID: <56B23004.4080608@acm.org> (raw)
In-Reply-To: <CALCETrWn1SSJnb5JZTNzKa2Eb7HS+esOGVqMXUtVBfsRbG2m0g@mail.gmail.com>

On 02/02/2016 12:25 PM, Andy Lutomirski wrote:
> On Feb 2, 2016 5:37 AM, "Corey Minyard" <minyard@acm.org> wrote:
>> On 02/01/2016 03:25 AM, Jean Delvare wrote:
>>> Hi Corey,
>>>
>>> I won't comment on the IPMI side of this as this isn't my area. However
>>> I have a comment on the DMI part:
>>>
>>> Le Friday 29 January 2016 à 16:43 -0600, minyard@acm.org a écrit :
>>>> From: Corey Minyard <cminyard@mvista.com>
>>>>
>>>> This is so that an IPMI platform device can be created from a
>>>> DMI firmware entry.
>>>>
>>>> Signed-off-by: Corey Minyard <cminyard@mvista.com>
>>>> Cc: Jean Delvare <jdelvare@suse.de>
>>>> Cc: Andy Lutomirski <luto@kernel.org>
>>>> ---
>>>>    drivers/firmware/dmi_scan.c | 34 ++++++++++++++++++++++++----------
>>>>    include/linux/dmi.h         | 24 ++++++++++++++++++++++++
>>>>    include/linux/fwnode.h      |  1 +
>>>>    3 files changed, 49 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
>>>> index da471b2..13d9bca 100644
>>>> --- a/drivers/firmware/dmi_scan.c
>>>> +++ b/drivers/firmware/dmi_scan.c
>>>> @@ -41,6 +41,16 @@ static struct dmi_memdev_info {
>>>>    } *dmi_memdev;
>>>>    static int dmi_memdev_nr;
>>>>    +static void *dmi_zalloc(unsigned len)
>>>> +{
>>>> +       void *ret = dmi_alloc(len);
>>>> +
>>>> +       if (ret)
>>>> +               memset(ret, 0, len);
>>>> +
>>>> +       return ret;
>>>> +}
>>>> +
>>>>    static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
>>>>    {
>>>>          const u8 *bp = ((u8 *) dm) + dm->length;
>>>> @@ -242,6 +252,12 @@ static void __init dmi_save_type(const struct dmi_header *dm, int slot,
>>>> (...)
>>>> @@ -250,15 +266,14 @@ static void __init dmi_save_one_device(int type, const char *name)
>>>>          if (dmi_find_device(type, name, NULL))
>>>>                  return;
>>>>    -     dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1);
>>>> +       dev = dmi_zalloc(sizeof(*dev) + strlen(name) + 1);
>>>>          if (!dev)
>>>>                  return;
>>>>          dev->type = type;
>>>>          strcpy((char *)(dev + 1), name);
>>>>          dev->name = (char *)(dev + 1);
>>>> -       dev->device_data = NULL;
>>> This change seems rather unrelated, and I'm not sure what purpose it
>>> serves. On ia64 and arm64 it is clearly redundant as dmi_alloc calls
>>> kzalloc directly. On x86_64, extend_brk is called instead (don't ask me
>>> why, I have no clue) but looking at the code I see that it does
>>> memset(ret, 0, size) as well so memory is also zeroed there. Which makes
>>> dmi_alloc the same as dmi_zalloc on all 3 architectures.
>>>
>>> So please revert this change. This will make your patch easier to
>>> review, too.
>>>
>> Ok.  I had assumed extend_break wasn't zeroing since there were all the NULL assignments,
>> I should have looked.
>>
>> I was thinking about this, and the fwnode could just be added to the IPMI device.  I'm not
>> sure if you would prefer that over adding it to dmi_device.  The fwnode is in acpi_device,
>> and I was modelling these changes after that, but maybe that's not required here.
> I think dmi_device is right, especially if your patches result in a
> firmware_node sysfs link being created.  That way the link will point
> to the right place.

Yeah, that's the conclusion I had come to, I think.  It doesn't 
currently add the
firmware_node to sysfs, but that's easily added and probably a next logical
step.

I'll have a new set of patches out today after I compile test at each step.

Thanks,

-corey

  reply	other threads:[~2016-02-03 16:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 22:43 [PATCH 0/4] dmi: Rework to get IPMI autoloading from DMI tables minyard
2016-01-29 22:43 ` [PATCH 1/4] dmi: remove const from return of dmi_find_device minyard
2016-01-29 22:43 ` [PATCH 2/4] dmi: Add a DMI firmware node and handling minyard
2016-01-29 23:59   ` kbuild test robot
2016-01-30  0:35     ` Corey Minyard
2016-01-30  0:41   ` kbuild test robot
2016-01-31 22:46   ` Andy Lutomirski
2016-02-01  0:36     ` Corey Minyard
2016-02-01  9:25   ` Jean Delvare
2016-02-02 13:37     ` Corey Minyard
2016-02-02 18:25       ` Andy Lutomirski
2016-02-03 16:51         ` Corey Minyard [this message]
2016-01-29 22:43 ` [PATCH 3/4] dmi: Move IPMI DMI scanning to the DMI code minyard
2016-01-29 22:43 ` [PATCH 4/4] dmi/ipmi: Add IPMI DMI devices as platform devices minyard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B23004.4080608@acm.org \
    --to=minyard@acm.org \
    --cc=cminyard@mvista.com \
    --cc=jdelvare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=openipmi-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.