All of lore.kernel.org
 help / color / mirror / Atom feed
From: simon.guinot@sequanux.org
To: Hans de Goede <hdegoede@redhat.com>
Cc: Henning Schild <henning.schild@siemens.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>, Pavel Machek <pavel@ucw.cz>,
	Mark Gross <markgross@kernel.org>, Lee Jones <lee@kernel.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	Sheng-Yuan Huang <syhuang3@nuvoton.com>,
	Tasanakorn Phaipool <tasanakorn@gmail.com>
Subject: Re: [PATCH v4 1/5] gpio-f7188x: Add GPIO support for Nuvoton NCT6116
Date: Wed, 24 Aug 2022 18:02:25 +0200	[thread overview]
Message-ID: <YwZLkeu2RmJsDPC+@76cbfcf04d45> (raw)
In-Reply-To: <3ec46cab-c775-824c-6bad-6fdddeea6e6a@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4935 bytes --]

On Wed, Aug 24, 2022 at 04:24:46PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 8/24/22 16:17, Henning Schild wrote:
> > Am Wed, 24 Aug 2022 15:54:28 +0200
> > schrieb Hans de Goede <hdegoede@redhat.com>:
> > 
> >> Hi Henning,
> >>
> >> On 8/24/22 15:50, Henning Schild wrote:
> >>> Am Wed, 24 Aug 2022 15:10:55 +0200
> >>> schrieb simon.guinot@sequanux.org:
> >>>   
> >>>> On Tue, Aug 23, 2022 at 04:54:59PM +0200, Henning Schild wrote:  
> >>>>> Am Tue, 23 Aug 2022 17:47:38 +0300
> >>>>> schrieb Andy Shevchenko <andriy.shevchenko@linux.intel.com>:    
> >>>>
> >>>> Hi Andy,
> >>>>
> >>>> Thanks for this new version. It is looking good to me.
> >>>>  
> >>>>>     
> >>>>>> On Tue, Aug 23, 2022 at 12:23:40PM +0200, Henning Schild wrote:
> >>>>>>   
> >>>>>>> Add GPIO support for Nuvoton NCT6116 chip. Nuvoton SuperIO
> >>>>>>> chips are very similar to the ones from Fintek. In other
> >>>>>>> subsystems they also share drivers and are called a family of
> >>>>>>> drivers.
> >>>>>>>
> >>>>>>> For the GPIO subsystem the only difference is that the direction
> >>>>>>> bit is reversed and that there is only one data bit per pin. On
> >>>>>>> the SuperIO level the logical device is another one.
> >>>>>>>
> >>>>>>> On a chip level we do not have a manufacturer ID to check and
> >>>>>>> also no revision.      
> >>>>>>
> >>>>>> ...
> >>>>>>     
> >>>>>>> - * GPIO driver for Fintek Super-I/O F71869, F71869A, F71882,
> >>>>>>> F71889 and F81866
> >>>>>>> + * GPIO driver for Fintek and Nuvoton Super-I/O chips      
> >>>>>>
> >>>>>> I'm not sure it's good idea to drop it from here. It means reader
> >>>>>> has to get this info in a hard way.
> >>>>>>
> >>>>>> ...    
> >>>>>
> >>>>> Let us see what others say. I wanted to keep this in line with
> >>>>> what Kconfig says and the oneliner in the Kconfig was getting
> >>>>> pretty longish. Hence i decided to shorten that. Other drivers
> >>>>> also seem to not list all the possible chips in many places, it
> >>>>> is all maint effort when a new chips is added and the list is in
> >>>>> like 5 places.    
> >>>>
> >>>> I agree with you that we can drop this line. It was already
> >>>> incomplete and the information is quite readable a few lines below
> >>>> in both the define list and the chip enumeration.
> >>>>  
> >>>>>     
> >>>>>>> +#define gpio_dir_invert(type)	((type) == nct6116d)
> >>>>>>> +#define gpio_data_single(type)	((type) == nct6116d)
> >>>>>>>  
> >>>>>>
> >>>>>> What's prevents us to add a proper prefix to these? I don't like
> >>>>>> the idea of them having "gpio" prefix.
> >>>>>>
> >>>>>> ...
> >>>>>>     
> >>>>>>> +		pr_info(DRVNAME ": Unsupported device
> >>>>>>> 0x%04x\n", devid);
> >>>>>>> +			pr_debug(DRVNAME ": Not a Fintek
> >>>>>>> device at 0x%08x\n", addr);
> >>>>>>> +	pr_info(DRVNAME ": Found %s at %#x\n",
> >>>>>>> +		pr_info(DRVNAME ":   revision %d\n",      
> >>>>>>
> >>>>>> Can we, please, utilize pr_fmt()?
> >>>>>>     
> >>>>>>> +			(int)superio_inb(addr,
> >>>>>>> SIO_FINTEK_DEVREV));      
> >>>>>>
> >>>>>> Explicit casting in printf() means wrong specifier in 99% of
> >>>>>> cases.   
> >>>>>
> >>>>> For all the other comments i will wait for a second opinion. I
> >>>>> specifically did not change existing code for more than the
> >>>>> functional changes needed. And a bit of checkpatch.pl fixing.
> >>>>> Beautification could be done on the way but would only cause
> >>>>> inconsistency. That driver is what it is, if someone wants to
> >>>>> overhaul the style ... that should be another patch. One likely
> >>>>> not coming from me.    
> >>>>
> >>>> About the int cast, I think you can drop it while you are updating
> >>>> this line. It is unneeded.  
> >>>
> >>> Ok two voices for doing that one fix along the way. I will send a v5
> >>> and hope nobody insists on me fixing the other findings in code i
> >>> never wrote.  
> >>
> >> You did not write it, but you are using it to do hw-enablement for
> >> your company's products. So being asked to also some touch-ups
> >> left and right while you are at it really is not unexpected IMHO.
> > 
> > Sure thing. Dropping a few characters from a line i touch anyhow is
> > easy enough. But i.e a refactoring to pr_fmt would feel like asking too
> > much in my book. That feels like work of the author or maintainer.
> 
> Right, but that assumes that the original author / maintainer is still
> around and actively contributing which unfortunately is not always
> the case.

Actually the original author is not active but he is still keeping an
eye on the driver :)

I still review and test the patches I catch on the MLs. And I am ready
to do some maintenance work if needed.

Henning, I think you could have done the pr_fmt conversion. It is not
a big deal and it would have been nice. But indeed, you don't have to...

Simon

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-08-24 16:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 10:23 [PATCH v4 0/5] add support for another simatic board Henning Schild
2022-08-23 10:23 ` [PATCH v4 1/5] gpio-f7188x: Add GPIO support for Nuvoton NCT6116 Henning Schild
2022-08-23 14:47   ` Andy Shevchenko
2022-08-23 14:54     ` Henning Schild
2022-08-24 13:10       ` simon.guinot
2022-08-24 13:50         ` Henning Schild
2022-08-24 13:54           ` Hans de Goede
2022-08-24 14:17             ` Henning Schild
2022-08-24 14:24               ` Hans de Goede
2022-08-24 16:02                 ` simon.guinot [this message]
2022-08-26 13:30               ` Linus Walleij
2022-08-23 10:23 ` [PATCH v4 2/5] gpio-f7188x: use unique labels for banks/chips Henning Schild
2022-08-23 10:23 ` [PATCH v4 3/5] leds: simatic-ipc-leds-gpio: add new model 227G Henning Schild
2022-08-23 10:23 ` [PATCH v4 4/5] platform/x86: simatic-ipc: enable watchdog for 227G Henning Schild
2022-08-23 10:23 ` [PATCH v4 5/5] platform/x86: simatic-ipc: add new model 427G Henning Schild
2022-08-23 14:49 ` [PATCH v4 0/5] add support for another simatic board Andy Shevchenko

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=YwZLkeu2RmJsDPC+@76cbfcf04d45 \
    --to=simon.guinot@sequanux.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@bgdev.pl \
    --cc=hdegoede@redhat.com \
    --cc=henning.schild@siemens.com \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=syhuang3@nuvoton.com \
    --cc=tasanakorn@gmail.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.