All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Heiner Kallweit" <hkallweit1@gmail.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Cc: Linux PM <linux-pm@vger.kernel.org>
Subject: Re: Warning since "power: supply: add charge_behaviour attributes"
Date: Wed, 5 Jan 2022 11:28:43 +0100	[thread overview]
Message-ID: <230c479e-00fa-7e04-beca-876c6c28e414@redhat.com> (raw)
In-Reply-To: <52cedbd4-7db2-7d81-f6c6-e6f6b7436545@gmail.com>

Hi Heiner,

On 1/5/22 00:03, Heiner Kallweit wrote:
> Since 1b0b6cc8030d ("power: supply: add charge_behaviour attributes") I get the following warning:
> power_supply_init_attrs: Property 37 skipped because it is missing from power_supply_attrs
> Seems the patch misses the following:
> 
> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index 2cfce2b2e..ef5109102 100644
> --- a/drivers/power/supply/power_supply_sysfs.c
> +++ b/drivers/power/supply/power_supply_sysfs.c
> @@ -179,6 +179,7 @@ static struct power_supply_attr power_supply_attrs[] = {
>         POWER_SUPPLY_ATTR(CHARGE_CONTROL_LIMIT_MAX),
>         POWER_SUPPLY_ATTR(CHARGE_CONTROL_START_THRESHOLD),
>         POWER_SUPPLY_ATTR(CHARGE_CONTROL_END_THRESHOLD),
> +       POWER_SUPPLY_ENUM_ATTR(CHARGE_BEHAVIOUR),
>         POWER_SUPPLY_ATTR(INPUT_CURRENT_LIMIT),
>         POWER_SUPPLY_ATTR(INPUT_VOLTAGE_LIMIT),
>         POWER_SUPPLY_ATTR(INPUT_POWER_LIMIT),
> 
> Didn't this show up when testing before submitting the patch?

Thank you for reporting this.

The warning did show up in dmesg, but the attribute still works despite the warning
because it is injected as an "extra" property through the drivers/acpi/battery.c
battery_hook_register() mechanism which uses device_add_groups() to add extra
properties handled by vendor specific extensions.

These extra properties do not use the drivers/power/supply/power_supply_sysfs.c
registered attributed handlers and this caused us to miss this, since everything
still works fine for the current user of the new charge_behaviour attribute
despite the warning.

And we completely missed the warning in dmesg.

Regards,

Hans


      parent reply	other threads:[~2022-01-05 10:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 23:03 Warning since "power: supply: add charge_behaviour attributes" Heiner Kallweit
2022-01-05  6:42 ` [PATCH 1/2] power: supply: fix charge_behaviour attribute initialization Thomas Weißschuh
2022-01-05 10:30   ` Hans de Goede
2022-01-05  6:42 ` [PATCH 2/2] power: supply: validate size of power_supply_attrs at compiletime Thomas Weißschuh
2022-01-05  6:49   ` Thomas Weißschuh
2022-01-05 10:28 ` Hans de Goede [this message]

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=230c479e-00fa-7e04-beca-876c6c28e414@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=sre@kernel.org \
    /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.