2021-02-10 23:15:57

by Sakari Ailus

[permalink] [raw]
Subject: [PATCH v11 1/7] ACPI: scan: Obtain device's desired enumeration power state

Store a device's desired enumeration power state in struct
acpi_device_power during acpi_device object's initialisation.

Signed-off-by: Sakari Ailus <[email protected]>
---
drivers/acpi/scan.c | 4 ++++
include/acpi/acpi_bus.h | 1 +
2 files changed, 5 insertions(+)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a184529d8fa40..6a9b4a92c4f66 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -987,6 +987,7 @@ static void acpi_bus_init_power_state(struct acpi_device *device, int state)

static void acpi_bus_get_power_flags(struct acpi_device *device)
{
+ unsigned long long dse = ACPI_STATE_D0;
u32 i;

/* Presence of _PS0|_PR0 indicates 'power manageable' */
@@ -1008,6 +1009,9 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
if (acpi_has_method(device->handle, "_DSW"))
device->power.flags.dsw_present = 1;

+ acpi_evaluate_integer(device->handle, "_DSE", NULL, &dse);
+ device->power.state_for_enumeration = dse;
+
/*
* Enumerate supported power management states
*/
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 02a716a0af5d4..becfc9f57002b 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -276,6 +276,7 @@ struct acpi_device_power {
int state; /* Current state */
struct acpi_device_power_flags flags;
struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
+ u8 state_for_enumeration; /* Maximum power state for enumeration */
};

/* Performance Management */
--
2.20.1


2021-02-11 19:16:37

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v11 1/7] ACPI: scan: Obtain device's desired enumeration power state

On Thu, Feb 11, 2021 at 12:08 AM Sakari Ailus
<[email protected]> wrote:
>
> Store a device's desired enumeration power state in struct
> acpi_device_power during acpi_device object's initialisation.
>
> Signed-off-by: Sakari Ailus <[email protected]>
> ---
> drivers/acpi/scan.c | 4 ++++
> include/acpi/acpi_bus.h | 1 +
> 2 files changed, 5 insertions(+)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index a184529d8fa40..6a9b4a92c4f66 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -987,6 +987,7 @@ static void acpi_bus_init_power_state(struct acpi_device *device, int state)
>
> static void acpi_bus_get_power_flags(struct acpi_device *device)
> {
> + unsigned long long dse = ACPI_STATE_D0;
> u32 i;
>
> /* Presence of _PS0|_PR0 indicates 'power manageable' */
> @@ -1008,6 +1009,9 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
> if (acpi_has_method(device->handle, "_DSW"))
> device->power.flags.dsw_present = 1;
>
> + acpi_evaluate_integer(device->handle, "_DSE", NULL, &dse);

As a matter of notice, it is likely that this object will be called
_DSC (Deepest State for Configuration) which better reflects its
function.

The ACPI ECR introducing it will be sent next week if all goes well.

Thanks!

> + device->power.state_for_enumeration = dse;
> +
> /*
> * Enumerate supported power management states
> */
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index 02a716a0af5d4..becfc9f57002b 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -276,6 +276,7 @@ struct acpi_device_power {
> int state; /* Current state */
> struct acpi_device_power_flags flags;
> struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
> + u8 state_for_enumeration; /* Maximum power state for enumeration */
> };
>
> /* Performance Management */
> --
> 2.20.1
>

2021-10-07 02:29:38

by Rajat Jain

[permalink] [raw]
Subject: Re: ACPI: scan: Obtain device's desired enumeration power state


Hello,

Now that we have landed the ACPI object for _DSC in the spec:
https://lore.kernel.org/linux-acpi/CAJZ5v0gwDEjC9T7wfCqDr7R0q_ptz2nVU52_8i8noXHPEign1g@mail.gmail.com/T/

I was wondering what is happening with the corresponding kernel patchset:
https://lore.kernel.org/linux-acpi/[email protected]/T/#m24e9f51119cbe6eb39f31c097ea3941d00a0baeb

I didn't see any pending comments, so is there a reason it did not land?

Thanks,

Rajat

--
2.33.0.685.g46640cef36-goog

2021-10-18 20:25:06

by Sakari Ailus

[permalink] [raw]
Subject: Re: ACPI: scan: Obtain device's desired enumeration power state

Hi Rajit,

On Wed, Oct 06, 2021 at 07:25:27PM -0700, Rajat Jain wrote:
>
> Hello,
>
> Now that we have landed the ACPI object for _DSC in the spec:
> https://lore.kernel.org/linux-acpi/CAJZ5v0gwDEjC9T7wfCqDr7R0q_ptz2nVU52_8i8noXHPEign1g@mail.gmail.com/T/
>
> I was wondering what is happening with the corresponding kernel patchset:
> https://lore.kernel.org/linux-acpi/[email protected]/T/#m24e9f51119cbe6eb39f31c097ea3941d00a0baeb
>
> I didn't see any pending comments, so is there a reason it did not land?

Thanks for the ping.

I've rebased the set and switched to _DSC so I believe it is ready to be
merged now:

<URL:https://lore.kernel.org/linux-media/[email protected]/T/#t>

I dropped the ov5670 patch from the set to avoid a conflict, I'll get this
merged through the media tree when the rest have landed there.

--
Regards,

Sakari Ailus

2021-10-19 20:09:33

by Rajat Jain

[permalink] [raw]
Subject: Re: ACPI: scan: Obtain device's desired enumeration power state

Hello Sakari,

Thanks for the updated patchset.

On Mon, Oct 18, 2021 at 1:23 PM Sakari Ailus
<[email protected]> wrote:
>
> Hi Rajit,
>
> On Wed, Oct 06, 2021 at 07:25:27PM -0700, Rajat Jain wrote:
> >
> > Hello,
> >
> > Now that we have landed the ACPI object for _DSC in the spec:
> > https://lore.kernel.org/linux-acpi/CAJZ5v0gwDEjC9T7wfCqDr7R0q_ptz2nVU52_8i8noXHPEign1g@mail.gmail.com/T/
> >
> > I was wondering what is happening with the corresponding kernel patchset:
> > https://lore.kernel.org/linux-acpi/[email protected]/T/#m24e9f51119cbe6eb39f31c097ea3941d00a0baeb
> >
> > I didn't see any pending comments, so is there a reason it did not land?
>
> Thanks for the ping.
>
> I've rebased the set and switched to _DSC so I believe it is ready to be
> merged now:
>
> <URL:https://lore.kernel.org/linux-media/[email protected]/T/#t>

I have 1 question. I see that these patches change the EEPROM and the
camera driver's probe routine to work around a device that is not
powered on (in D0 state). I2C core is also not powering it on now if
the ACPI says so. So how / when is the device actually getting powered
on now (being put in D0 state), after these patches?

Thanks,

Rajat

>
> I dropped the ov5670 patch from the set to avoid a conflict, I'll get this
> merged through the media tree when the rest have landed there.
>
> --
> Regards,
>
> Sakari Ailus

2022-01-10 18:56:40

by Rajat Jain

[permalink] [raw]
Subject: Re: ACPI: scan: Obtain device's desired enumeration power state

+Bingbu Cao [email protected]

Hello Sakari,

On Mon, Oct 18, 2021 at 1:23 PM Sakari Ailus
<[email protected]> wrote:
>
> Hi Rajit,
>
> On Wed, Oct 06, 2021 at 07:25:27PM -0700, Rajat Jain wrote:
> >
> > Hello,
> >
> > Now that we have landed the ACPI object for _DSC in the spec:
> > https://lore.kernel.org/linux-acpi/CAJZ5v0gwDEjC9T7wfCqDr7R0q_ptz2nVU52_8i8noXHPEign1g@mail.gmail.com/T/
> >
> > I was wondering what is happening with the corresponding kernel patchset:
> > https://lore.kernel.org/linux-acpi/[email protected]/T/#m24e9f51119cbe6eb39f31c097ea3941d00a0baeb
> >
> > I didn't see any pending comments, so is there a reason it did not land?
>
> Thanks for the ping.
>
> I've rebased the set and switched to _DSC so I believe it is ready to be
> merged now:
>
> <URL:https://lore.kernel.org/linux-media/[email protected]/T/#t>
>
> I dropped the ov5670 patch from the set to avoid a conflict, I'll get this
> merged through the media tree when the rest have landed there.


Thanks, I see that your patches series has been merged. Can you please
also line up this follow up series by Bingbu for inclusion into the
mainline kernel?

https://patchwork.kernel.org/project/linux-media/list/?series=595925

Thanks,

Rajat


>
> --
> Regards,
>
> Sakari Ailus

2022-01-10 22:32:02

by Sakari Ailus

[permalink] [raw]
Subject: Re: ACPI: scan: Obtain device's desired enumeration power state

Hi Rajat,

On Mon, Jan 10, 2022 at 10:55:58AM -0800, Rajat Jain wrote:
> > > https://lore.kernel.org/linux-acpi/CAJZ5v0gwDEjC9T7wfCqDr7R0q_ptz2nVU52_8i8noXHPEign1g@mail.gmail.com/T/
> > >
> > > I was wondering what is happening with the corresponding kernel patchset:
> > > https://lore.kernel.org/linux-acpi/[email protected]/T/#m24e9f51119cbe6eb39f31c097ea3941d00a0baeb
> > >
> > > I didn't see any pending comments, so is there a reason it did not land?
> >
> > Thanks for the ping.
> >
> > I've rebased the set and switched to _DSC so I believe it is ready to be
> > merged now:
> >
> > <URL:https://lore.kernel.org/linux-media/[email protected]/T/#t>
> >
> > I dropped the ov5670 patch from the set to avoid a conflict, I'll get this
> > merged through the media tree when the rest have landed there.
>
>
> Thanks, I see that your patches series has been merged. Can you please
> also line up this follow up series by Bingbu for inclusion into the
> mainline kernel?
>
> https://patchwork.kernel.org/project/linux-media/list/?series=595925

These patches are in media tree master:

<URL:https://git.linuxtv.org/media_tree.git/log/>

I'd expect to see these in Linux 5.17.

--
Kind regards,

Sakari Ailus