lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Mar 2015 14:11:50 +0100
From:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:	Johan Hovold <johan@...nel.org>
Cc:	Lee Jones <lee.jones@...aro.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Support Opensource <support.opensource@...semi.com>,
	Milo Kim <milo.kim@...com>,
	patches@...nsource.wolfsonmicro.com,
	Fabio Estevam <fabio.estevam@...escale.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 0/5] mfd: Fix platform device ids to avoid probe failure


Hi,

On Monday, March 23, 2015 11:07:18 AM Johan Hovold wrote:
> On Fri, Mar 20, 2015 at 08:23:18PM +0100, Bartlomiej Zolnierkiewicz wrote:
> 
> > Commit 6e3f62f0793e ("mfd: core: Fix platform-device id generation")
> > changed the way platform device ids are generated from mfd id base and
> > cell ids in mfd_add_device().  Unfortunately the change in question
> > breaks mfd drivers which are using mfd_add_devices() with mfd id base
> > equal to -1 and non-zero cell ids (used to distinguish cells with
> > the same name field).  The result is that mfd core tries to register
> > platform devices with the same name which obviously fails and leads
> > to mfd device probe failure.
> 
> First of all, thanks for finding these. I obviously overlooked this
> class of drivers when fixing the device-id generation.
> 
> > Changing mfd_add_devices() mfd id base from -1 to 0 and at the same
> > time setting proper cell ids for all cells fixes the issue.
> 
> This is however not the right fix. Instead you should be using
> PLATFORM_DEVID_AUTO and keep the non-zero cell-ids as is, as this will
> allow more than one mfd-device to be registered without resorting to
> hacks.

Conversion of a driver to use PLATFORM_DEVID_AUTO changes names of
all platform devices registered by the driver.  In my patchset I just
tried to restore the broken functionality (patch that broke it went
in v3.19).  I thought that it was the best solution for v3.19 and
v4.0-rc4 (then PLATFORM_DEVID_AUTO conversion can be done sometime
later, i.e. in v4.1).

> Have a look at wm831x, for example, which offsets the device id base if
> a wm831x_num parameter is passed in platform data (non-dt) to allow more
> than one device to be registered. Your patch would break this, and still
> not provide any other way to have multiple devices in a system.

OK, I see the problem with wm831x driver and will provide v3 of my
patchset which would use PLATFORM_DEVID_AUTO for all drivers.

> Your changes would also break da9052, which would no longer allow more
> than one device to be registered, something which was already fixed once
> by commit b3f6c73db732 ("mfd: da9052-core: Fix platform-device id
> collision").

OK, patch #5 should be just dropped.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ