All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Ike Panhc" <ike.pan@canonical.com>,
	"Barnabás Pőcze" <pobrn@protonmail.com>,
	"Platform Driver" <platform-driver-x86@vger.kernel.org>,
	"Mark Gross" <mgross@linux.intel.com>
Subject: Re: [PATCH v2 09/24] platform/x86: ideapad-laptop: always propagate error codes from device attributes' show() callback
Date: Mon, 25 Jan 2021 12:40:01 +0100	[thread overview]
Message-ID: <cbee040a-53c8-b58f-3231-58d774bbda0a@redhat.com> (raw)
In-Reply-To: <CAHp75VdmwxZeqY3qdO6AuK3QTF=p+Wn9qByMsLEzaV4VV78QHQ@mail.gmail.com>

Hi,

On 1/25/21 12:35 PM, Andy Shevchenko wrote:
> On Mon, Jan 25, 2021 at 1:26 PM Hans de Goede <hdegoede@redhat.com> wrote:
>> On 1/25/21 11:57 AM, Andy Shevchenko wrote:
>>> On Mon, Jan 25, 2021 at 9:37 AM Ike Panhc <ike.pan@canonical.com> wrote:
>>>>
>>>> On 1/17/21 3:49 AM, Andy Shevchenko wrote:
>>>>> On Wed, Jan 13, 2021 at 8:23 PM Barnabás Pőcze <pobrn@protonmail.com> wrote:
>>>>>>
>>>>>> Consumers can differentiate an error from a successful read much more
>>>>>> easily if the read() call fails with the appropriate errno instead of
>>>>>> returning a magic string like "-1".
>>>>>
>>>>> Is user space ready for this (for the record, it seems an ABI breakage)?
>>>>>
>>>>
>>>> read() and getting errno looks sysfs/driver broken to me. I think
>>>> if button/method is not available, it's better to be something like
>>>> sysfs_emit(buf, "%d\n", -ENODEV)
>>>
>>> Either way it will be an ABI breakage.
>>
>> True any change here will be an ABI breakage, but I really do not expect
>> anything to be dependent on this weird behavior of returning errors by
>> writing some magic value to the buffer, rather then just error-ing out
>> of the read() call.
>>
>> The kernel-convention here clearly is to make the read() syscall fail with
>> -ESOMETHING on errors. So I see this as making the driver conform to the
>> expected sysfs API behavior. Since this change is nicely split out into a
>> separate patch, we can always revert it if it turns out there actually
>> is something depending on this. But again I see that as highly
>> unlikely.
> 
> Me too. My point is that every stakeholder here understands that.
> Perhaps elaborated in the commit message.

Ack, adding a note about this to the commit message would be good.

Barnabás, can you add a note about this to the commit message?

Also I think we are about ready for you to post a v3 of this
series (when you have time to do so).

Regards,

Hans


  reply	other threads:[~2021-01-26  5:53 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 18:20 [PATCH v2 00/24] platform/x86: ideapad-laptop: cleanup, keyboard backlight and "always on USB charging" control support, reenable touchpad control Barnabás Pőcze
2021-01-13 18:20 ` [PATCH v2 01/24] platform/x86: ideapad-laptop: remove unnecessary dev_set_drvdata() call Barnabás Pőcze
2021-01-13 18:20 ` [PATCH v2 02/24] platform/x86: ideapad-laptop: use appropriately typed variable to store the return value of ACPI methods Barnabás Pőcze
2021-01-13 18:20 ` [PATCH v2 03/24] platform/x86: ideapad-laptop: sort includes lexicographically Barnabás Pőcze
2021-01-13 18:20 ` [PATCH v2 04/24] platform/x86: ideapad-laptop: use sysfs_emit() Barnabás Pőcze
2021-01-13 18:20 ` [PATCH v2 05/24] platform/x86: ideapad-laptop: use for_each_set_bit() helper to simplify event processing Barnabás Pőcze
2021-01-13 18:20 ` [PATCH v2 06/24] platform/x86: ideapad-laptop: use msecs_to_jiffies() helper instead of hand-crafted formula Barnabás Pőcze
2021-01-13 18:21 ` [PATCH v2 07/24] platform/x86: ideapad-laptop: use dev_{err,warn} or appropriate variant to display log messages Barnabás Pőcze
2021-01-16 19:46   ` Andy Shevchenko
2021-01-16 20:34     ` Barnabás Pőcze
2021-01-25  6:13       ` Ike Panhc
2021-01-13 18:21 ` [PATCH v2 08/24] platform/x86: ideapad-laptop: convert ACPI helpers to return -EIO in case of failure Barnabás Pőcze
2021-01-16 19:47   ` Andy Shevchenko
2021-01-16 20:28     ` Barnabás Pőcze
2021-01-16 20:42       ` Andy Shevchenko
2021-01-16 21:28         ` Barnabás Pőcze
2021-01-17 21:04           ` Andy Shevchenko
2021-01-13 18:21 ` [PATCH v2 09/24] platform/x86: ideapad-laptop: always propagate error codes from device attributes' show() callback Barnabás Pőcze
2021-01-16 19:49   ` Andy Shevchenko
2021-01-25  7:36     ` Ike Panhc
2021-01-25 10:57       ` Andy Shevchenko
2021-01-25 11:26         ` Hans de Goede
2021-01-25 11:35           ` Andy Shevchenko
2021-01-25 11:40             ` Hans de Goede [this message]
2021-01-25 14:17               ` Barnabás Pőcze
2021-01-13 18:21 ` [PATCH v2 10/24] platform/x86: ideapad-laptop: misc. device attribute changes Barnabás Pőcze
2021-01-16 19:52   ` Andy Shevchenko
2021-01-16 21:54     ` Barnabás Pőcze
2021-01-17 21:00       ` Andy Shevchenko
2021-01-13 18:21 ` [PATCH v2 11/24] platform/x86: ideapad-laptop: group and separate (un)related constants into enums Barnabás Pőcze
2021-01-13 18:21 ` [PATCH v2 12/24] platform/x86: ideapad-laptop: rework and create new ACPI helpers Barnabás Pőcze
2021-01-16 20:13 ` [PATCH v2 00/24] platform/x86: ideapad-laptop: cleanup, keyboard backlight and "always on USB charging" control support, reenable touchpad control 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=cbee040a-53c8-b58f-3231-58d774bbda0a@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=ike.pan@canonical.com \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=pobrn@protonmail.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.