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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D9LNVDTBPE6Q.3KOYKLIH8PPZ7@bootlin.com>
Date: Fri, 02 May 2025 14:07:59 +0200
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@...tlin.com>
To: "Andy Shevchenko" <andriy.shevchenko@...el.com>
Cc: "Lee Jones" <lee@...nel.org>, "Rob Herring" <robh@...nel.org>,
 "Krzysztof Kozlowski" <krzk+dt@...nel.org>, "Conor Dooley"
 <conor+dt@...nel.org>, "Kamel Bouhara" <kamel.bouhara@...tlin.com>, "Linus
 Walleij" <linus.walleij@...aro.org>, "Bartosz Golaszewski" <brgl@...ev.pl>,
 "Dmitry Torokhov" <dmitry.torokhov@...il.com>,
 Uwe Kleine-König <ukleinek@...nel.org>, "Michael Walle"
 <mwalle@...nel.org>, "Mark Brown" <broonie@...nel.org>, "Greg
 Kroah-Hartman" <gregkh@...uxfoundation.org>, "Rafael J. Wysocki"
 <rafael@...nel.org>, "Danilo Krummrich" <dakr@...nel.org>,
 <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <linux-gpio@...r.kernel.org>, <linux-input@...r.kernel.org>,
 <linux-pwm@...r.kernel.org>, Grégory Clement
 <gregory.clement@...tlin.com>, "Thomas Petazzoni"
 <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v7 03/11] pinctrl: Add MAX7360 pinctrl driver

On Fri May 2, 2025 at 12:15 PM CEST, Andy Shevchenko wrote:
> On Mon, Apr 28, 2025 at 01:57:21PM +0200, Mathieu Dubois-Briand wrote:
>> Add driver for Maxim Integrated MAX7360 pinctrl on the PORT pins. Pins
>> can be used either for GPIO, PWM or rotary encoder functionalities.
>
>> +struct max7360_pinctrl {
>> +	struct pinctrl_dev *pctldev;
>> +	struct pinctrl_desc pinctrl_desc;
>
> Does`pahole` agree with your choice of layout?
>

I believe so. `pahole drivers/pinctrl/pinctrl-max7360.ko` says:
struct max7360_pinctrl {
        struct pinctrl_dev *       pctldev;              /*     0     4 */
        struct pinctrl_desc        pinctrl_desc;         /*     4    44 */

        /* XXX last struct has 3 bytes of padding */

        /* size: 48, cachelines: 1, members: 2 */
        /* paddings: 1, sum paddings: 3 */
        /* last cacheline: 48 bytes */
};

>> +	chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
>> +	if (!chip)
>> +		return -ENOMEM;
>> +
>> +	pd = &chip->pinctrl_desc;
>> +
>> +	pd->pctlops = &max7360_pinctrl_ops;
>> +	pd->pmxops = &max7360_pmxops;
>> +	pd->name = dev_name(dev);
>> +	pd->pins = max7360_pins;
>> +	pd->npins = MAX7360_MAX_GPIO;
>> +	pd->owner = THIS_MODULE;
>> +
>> +	device_set_of_node_from_dev(dev, dev->parent);
>
> I don't like this, but I have no better idea right now. Perhaps add a comment
> on top to explain this call?
>

I'm adding this comment here, and a similar one in the PWM driver.

/*
 * This MFD sub-device does not have any associated device tree node:
 * properties are stored in the device node of the parent (MFD) device
 * and this same node is used in phandles of client devices.
 * Reuse this device tree node here, as otherwise the pinctrl subsystem
 * would be confused by this topology.
 */

OK for all other comments.

Thanks for your review.
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ