Re: [PATCH v2 2/2] ACPI / Sleep: Check low power idle constraints for debug only

From: Srinivas Pandruvada
Date: Thu Aug 10 2017 - 18:54:24 EST


On Thu, 2017-08-10 at 22:07 +0000, Mario.Limonciello@xxxxxxxx wrote:
>
> >
> >
[...]

> > +
> > + ret = acpi_device_get_power(adev, &state);
> > + if (!ret)
> > + pr_debug("LPI: %s required min power state
> > %d, current
> > power state %d, real power state %d\n",
> > + Âlpi_constraints_table[i].name,
> > + Âlpi_constraints_table[i].min_dsta
> > te,
> > + Âadev->power.state, state);
> Isn't this superfluous to be showing the state returned from
> acpi_device_get_power and
> also probing directly at the state? You can't just rely on the
> information you got
> back from apci_device_get_power?
They can be different as one is real power state and the other is what
was set.
For example on Dell 9365 it shows

[ 1924.393653] LPI: \_SB.PCI0.XHC required min power state 3, current
power state 3, real power state 255Â

>
> >
> > +
> > + if (adev->flags.power_manageable && adev-
> > >power.state <
> > + lpi_constraints_table[i].m
> > in_dstate)
> > + pr_info("LPI: Constraint [%s] not
> > matched\n",
> > + Âlpi_constraints_table[i].name);
> Similarly here, can't you just compare against &state instead?
>
The problem then the check will fail for XHCI on Dell 9365. So not
using "state".

Thanks,
Srinivas
> >
> > + }
> > +}
> > +
> > Âstatic void acpi_sleep_run_lps0_dsm(unsigned int func)
> > Â{
> > Â union acpi_object *out_obj;
> > @@ -729,6 +886,9 @@ static int lps0_device_attach(struct
> > acpi_device *adev,
> > Â ÂÂ"_DSM function 0 evaluation
> > failed\n");
> > Â }
> > Â ACPI_FREE(out_obj);
> > +
> > + lpi_device_get_constraints();
> > +
> > Â return 0;
> > Â}
> >
> > @@ -773,6 +933,8 @@ static void acpi_freeze_wake(void)
> > Â Â*/
> > Â if (acpi_sci_irq_valid() &&
> > Â ÂÂÂÂ!irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq)))
> > {
> > + if (pm_debug_messages_enabled())
> > + lpi_check_constraints();
> > Â pm_system_cancel_wakeup();
> > Â s2idle_wakeup = true;
> > Â }
> > --
> > 2.7.5