All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Guenter Roeck <groeck@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Guenter Roeck <groeck@chromium.org>,
	Wei-Ning Huang <wnhuang@google.com>
Subject: Re: drivers/firmware/google/vpd.c: duplicate sysfs file
Date: Mon, 13 Nov 2017 11:04:00 -0800	[thread overview]
Message-ID: <20171113190400.hayy4iff5wmjy3qt@dtor-ws> (raw)
In-Reply-To: <6634ab5b-b21f-120e-2a29-52c824d5dcff@infradead.org>

On Mon, Nov 13, 2017 at 10:18:35AM -0800, Randy Dunlap wrote:
> On 11/13/2017 06:41 AM, Guenter Roeck wrote:
> > 
> > 
> > On Sun, Nov 12, 2017 at 10:36 PM, Randy Dunlap <rdunlap@infradead.org <mailto:rdunlap@infradead.org>> wrote:
> > 
> >     sysfs: cannot create duplicate filename '/devices/platform/vpd'
> > 
> >     on the second load of this driver.  I.e.,
> > 
> >     modprobe vpd-sysfs
> >     rmmod vpd-sysfs
> >     modprobe vpd-sysfs
> >     [boom]
> > 
> > Neither the platform device nor the platform driver driver are ever unregistered, so this isn't entirely surprising. I'll try to reproduce and send a patch.
> 
> 
> Seems to be a common theme:
> 
> google> grep --color=never "platform.*register" *.c
> coreboot_table-acpi.c:	return platform_driver_register(&coreboot_table_acpi_driver);
> coreboot_table-of.c:	return platform_driver_register(&coreboot_table_of_driver);

These are not unloadable (for better or worse) - they do not have
module_exit() in them.

> 
> gsmi.c:	gsmi_dev.pdev = platform_device_register_full(&gsmi_dev_info);
> gsmi.c:	platform_device_unregister(gsmi_dev.pdev);
> gsmi.c:	platform_device_unregister(gsmi_dev.pdev);
> [looks good]
> 
> memconsole-coreboot.c:	pdev = platform_device_register_simple("memconsole", -1, NULL, 0);
> memconsole-coreboot.c:	platform_driver_register(&memconsole_driver);

Same here: not unloadable.

> 
> vpd.c:	pdev = platform_device_register_simple("vpd", -1, NULL, 0);
> vpd.c:	platform_driver_register(&vpd_driver);

Arguably this should not even be a platform driver, there is no hardware
behind it. I was planning on purring some notifiers into coreboot table
driver and using notifiers to attach vpd to them. -ENOTIME though.

Thanks.

-- 
Dmitry

  reply	other threads:[~2017-11-13 19:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13  6:36 drivers/firmware/google/vpd.c: duplicate sysfs file Randy Dunlap
     [not found] ` <CABXOdTfJkdWzqptbqkbJqNtxx5+qeW=+4CZFUG9UxJ6QADAsRw@mail.gmail.com>
2017-11-13 18:18   ` Randy Dunlap
2017-11-13 19:04     ` Dmitry Torokhov [this message]
2017-11-13 19:09       ` Guenter Roeck
2017-11-13 19:23         ` Greg Kroah-Hartman
2017-11-13 20:14           ` Guenter Roeck
2017-11-13 22:01             ` Dmitry Torokhov
2017-11-13 22:24               ` Guenter Roeck
2017-11-13 22:26                 ` Dmitry Torokhov

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=20171113190400.hayy4iff5wmjy3qt@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=groeck@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=wnhuang@google.com \
    /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.