mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Andres Salomon <dilinger@queued.net>
Cc: Armin Wolf <W_Armin@gmx.de>,
	mjg59@srcf.ucam.org, rafael@kernel.org, lenb@kernel.org,
	hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com,
	platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/3] platform/x86: dell-laptop: Battery hook fixes
Date: Sun, 22 Sep 2024 10:53:10 +0200	[thread overview]
Message-ID: <20240922085310.sa3gwbsobd54vufg@pali> (raw)
In-Reply-To: <20240922034513.330343fb@5400>

On Sunday 22 September 2024 03:45:13 Andres Salomon wrote:
> On Sun, 22 Sep 2024 08:40:23 +0200
> Armin Wolf <W_Armin@gmx.de> wrote:
> 
> > This patch series fixes some issues around the battery hook handling
> > inside the ACPI battery driver and the dell-laptop driver.
> > 
> > The first patch simplifies the locking during battery hook removal as
> > a preparation for the second patch which fixes a possible crash when
> > unregistering a battery hook.
> > 
> > The third patch allows the dell-laptop driver to handle systems with
> > multiple batteries.
> > 
> > All patches where tested on a Dell Inspiron 3505 and appear to work.
> 
> Can you tell me more about the system? What type of battery is the second
> battery, and how is it attached? What do the kernel logs look like when the
> two batteries are registered? I'm still confused as to how the same
> battery->dev ends up being reused for multiple physical batteries.
> 
> The patches look good to me, btw; feel free to add my Reviewed-by
> if that's helpful.

For me these patches also looks good, so you can add also my
Reviewed-by. But please wait for the review from ACPI people.

> Also, with the caveat that I'm not quite understanding the aforementioned
> battery->dev conflict - worth noting that dell-laptop isn't the only driver
> that could have this problem with multiple batteries. A quick glance
> through some other drivers:
> 
>  - asus-wmi.c does basically the same thing in checking for just the first
>    battery, and the comment implies that there may be multiple batteries.
> 
>  - system76.c claims that the EC only supports one battery, so maybe that
>    one is okay? But to be on the safe side, it should probably do the same
>    thing.
> 
>  - thinkpad_acpi.c actually supports multiple batteries, so maybe it
>    doesn't have the problem. But if tpacpi_battery_probe() fails for one
>    of the batteries and the battery->dev is shared between the two
>    batteries, then same issue?

It is possible that there is same issue.

> 
> > 
> > Changes since v1:
> > - fix the underlying issue inside the ACPI battery driver
> > - reword patch for dell-laptop
> > 
> > Armin Wolf (3):
> >   ACPI: battery: Simplify battery hook locking
> >   ACPI: battery: Fix possible crash when unregistering a battery hook
> >   platform/x86: dell-laptop: Do not fail when encountering unsupported
> >     batteries
> > 
> >  drivers/acpi/battery.c                  | 27 ++++++++++++++++---------
> >  drivers/platform/x86/dell/dell-laptop.c | 15 +++++++++++---
> >  include/acpi/battery.h                  |  1 +
> >  3 files changed, 31 insertions(+), 12 deletions(-)
> > 
> > --
> > 2.39.5
> > 
> 
> 
> 
> -- 
> I'm available for contract & employment work, please contact me if
> interested.

  reply	other threads:[~2024-09-22  8:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-22  6:40 Armin Wolf
2024-09-22  6:40 ` [PATCH v2 1/3] ACPI: battery: Simplify battery hook locking Armin Wolf
2024-09-23 13:35   ` Ilpo Järvinen
2024-09-22  6:40 ` [PATCH v2 2/3] ACPI: battery: Fix possible crash when unregistering a battery hook Armin Wolf
2024-10-01 18:57   ` Rafael J. Wysocki
2024-09-22  6:40 ` [PATCH v2 3/3] platform/x86: dell-laptop: Do not fail when encountering unsupported batteries Armin Wolf
2024-09-22  7:45 ` [PATCH v2 0/3] platform/x86: dell-laptop: Battery hook fixes Andres Salomon
2024-09-22  8:53   ` Pali Rohár [this message]
2024-09-23 20:14   ` Armin Wolf
2024-09-30 18:53 ` Armin Wolf
2024-09-30 19:03   ` Rafael J. Wysocki

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=20240922085310.sa3gwbsobd54vufg@pali \
    --to=pali@kernel.org \
    --cc=W_Armin@gmx.de \
    --cc=dilinger@queued.net \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®