From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753039AbbCWNMA (ORCPT ); Mon, 23 Mar 2015 09:12:00 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:17646 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbbCWNL7 (ORCPT ); Mon, 23 Mar 2015 09:11:59 -0400 X-AuditID: cbfee61a-f79c06d000004e71-12-5510111df311 From: Bartlomiej Zolnierkiewicz To: Johan Hovold Cc: Lee Jones , Samuel Ortiz , Support Opensource , Milo Kim , patches@opensource.wolfsonmicro.com, Fabio Estevam , Marek Szyprowski , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/5] mfd: Fix platform device ids to avoid probe failure Date: Mon, 23 Mar 2015 14:11:50 +0100 Message-id: <2485401.Gb44YTtKCE@amdc1032> User-Agent: KMail/4.8.4 (Linux/3.2.0-70-generic-pae; KDE/4.8.5; i686; ; ) In-reply-to: <20150323100718.GD3557@localhost> References: <1426879403-19265-1-git-send-email-b.zolnierkie@samsung.com> <20150323100718.GD3557@localhost> MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=us-ascii X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRmVeSWpSXmKPExsVy+t9jQV1ZQYFQg3+NyhazunQtmm70sFrc /3qU0eLyrjlsFmuP3GW3WP5rHYvF8rf/2SxOd7Na7G29yOzA6bHik77Hv8P9TB6bVnWyedy5 tofNY97JQI+XE3+zefRtWcXocfzGdiaPz5vkAjijuGxSUnMyy1KL9O0SuDJWHrvFUnBMqKLx A1sD4zu+LkZODgkBE4lZfz8yQdhiEhfurWfrYuTiEBKYzigx7fUrJgjnG6PE6qX/mUGq2ASs JCa2r2LsYuTgEBFQlpjyRhAkzCxwgEni5qRsEFtYwF+i59BOdhCbRUBV4vSmz2CtvAKaErvn LQGLiwp4SuycfoARxOYU0JNofnsXLC4kkCPRvOs9I0S9oMSPyfdYIObLS+zbP5UVwtaSWL/z ONMERoFZSMpmISmbhaRsASPzKkbR1ILkguKk9FxDveLE3OLSvHS95PzcTYzguHgmtYNxZYPF IUYBDkYlHt6GcP5QIdbEsuLK3EOMEhzMSiK81XeBQrwpiZVVqUX58UWlOanFhxilOViUxHmV 7NtChATSE0tSs1NTC1KLYLJMHJxSDYwNU7qW32OaHBjt9fFnsXL99gsbz/FLJEZca7vxpntp +0su66jystk97oz3gtXiBRK2GR85quHKz13On9S24qHG7NzwimVpxT8XNlmuT96tKrP/wu01 Wp3nxA7NqmeZfr2k0aRKJkTJYHeXycHCrocJZmG/3VsNjE6IqT8Tnxt64BP/hgitGCWW4oxE Qy3mouJEAEAwmAKHAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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