Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-11-27 Thread Li-Wen Hsu
On Mon, Oct 12, 2020 at 5:22 PM Eirik Øverby  wrote:
>
> On Wednesday, September 16, 2020 9:05:43 AM CEST Warner Losh wrote:
> > I too can report this for my Lenovo Yoga running code as of September 13,
> > but with manu's latest drm...  It used to work fine, but my last build on
> > the system was from May. Most likely a new panic in that code path, but
> > I've not chased down further...
>
> So I got a gen8 to play with, and the list of grievances is long - but I have
> one observation that may be of interest:
> The gen8 would be usable (at least seemingly so) with a 13-kernel from lat
> 2019 or very early 2020. Then around the end of January - I've bisected it
> down to around Jan 24, give or take, it would start wedging _hard_ after a
> minute or two of heavy load (compiling, cat /dev/random, that sort of thing).
> It was a problem prior to that too but it was _much_ harder to trigger, at
> least based on my tests this weekend.
>
> The "solution" is to add
>   hint.hwpstate_intel.0.disabled="1"
> to /boot/loader.conf. This obviously has disastrous impact on battery life.
> The emt module takes over, so power management is a lot more rudimentary
> (powerd now does nearly nothing, while powerd++ kills interactivity). Battery
> life is much shorter than on my gen6, and it gets hotter.
>
> BUT: This thing - gen8 - would get stuck in the acpi_beep before adding this
> to loader.conf. After adding the hint, I have not had a single failure when
> resuming. It's behaving much better than my gen6.

Recently I got an interesting observation: if I suspend with `zzz`,
(which is basically doing `acpiconf -s S3`), and resuming by pushing
the power button, there is 95% chance of resuming failure.
However, if I use close/open the lid to suspend/resume, I haven't hit
any failure since last week.

I suppose that these 2 suspend/resume methods are basically doing the
same thing?  My hw.acpi.lid_switch_state sysctl is S3.

I have tried suspending with `zzz` then closing the lid, there is
about 50% failure rate, but the sample number is very small.

Is there any idea about what makes the difference between these 2
suspend/resume methods?

I'm running 13.0-CURRENT r367582, with drm-devel-kmod-5.4.62.g20201109
and gpu-firmware-kmod-g20200920. My /boot/loader.conf has
hw.i915kms.enable_psr=0 but no hint.hwpstate_intel.0.disabled=1

Best,
Li-Wen
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-10-12 Thread Eirik Øverby
On Wednesday, September 16, 2020 9:05:43 AM CEST Warner Losh wrote:
> I too can report this for my Lenovo Yoga running code as of September 13,
> but with manu's latest drm...  It used to work fine, but my last build on
> the system was from May. Most likely a new panic in that code path, but
> I've not chased down further...

So I got a gen8 to play with, and the list of grievances is long - but I have 
one observation that may be of interest:
The gen8 would be usable (at least seemingly so) with a 13-kernel from lat 
2019 or very early 2020. Then around the end of January - I've bisected it 
down to around Jan 24, give or take, it would start wedging _hard_ after a 
minute or two of heavy load (compiling, cat /dev/random, that sort of thing). 
It was a problem prior to that too but it was _much_ harder to trigger, at 
least based on my tests this weekend.

The "solution" is to add
  hint.hwpstate_intel.0.disabled="1"
to /boot/loader.conf. This obviously has disastrous impact on battery life. 
The emt module takes over, so power management is a lot more rudimentary 
(powerd now does nearly nothing, while powerd++ kills interactivity). Battery 
life is much shorter than on my gen6, and it gets hotter.

BUT: This thing - gen8 - would get stuck in the acpi_beep before adding this 
to loader.conf. After adding the hint, I have not had a single failure when 
resuming. It's behaving much better than my gen6.

Worth noting that I patched the ig4 driver to allow it to find the I2C device 
(just adding the PCI device IDs to the end of the lists already there), so 
iichid would work and give me a trackpad. Latest drm-devel-kmod works well, 
but install the xf86 intel driver and set "AccelMethod" "sna" in the 
appropriate xorg config file.

/Eirik


___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-16 Thread Eirik Øverby

On 9/16/20 11:05 AM, Hans Petter Selasky wrote:


To make sure suspend/resume is not blocked by USB you can try setting:

sysctl hw.usb.no_suspend_wait=1


Thanks, that is useful - it's a separate problem with my USB DAC. Not sure if 
it's relevant to the resume issue, though?

/Eirik
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-16 Thread Hans Petter Selasky

On 2020-09-16 10:51, Eirik Øverby wrote:

On 9/16/20 9:07 AM, Li-Wen Hsu wrote:

On Wed, Sep 16, 2020 at 2:30 PM Andriy Gapon  wrote:


On 15/09/2020 23:13, Eirik Øverby wrote:

On 9/15/20 9:50 PM, Andriy Gapon wrote:

On 15/09/2020 22:36, Eirik Øverby wrote:

Now, since I updated from r365358 to r365688, I have not once been able to wake 
from sleep.


Is that the only thing that changed?
Any port / package upgrades?


There have been updates to packages, yes - but it didn't even occur to me that 
these could impact the resume process at such an early stage. Not sure which 
that would be; obviously the drm module has been rebuilt each time I upgraded, 
but I don't have any other kernel modules installed from packages.


Which version of drm module are you using?


13.0-CURRENT FreeBSD 13.0-CURRENT #7 r365688
drm-devel-kmod-5.4.62.g20200905_1

Built against the running kernel sources, of course.



Yes, I specifically had drm modules in mind.


I also use X1C 6th and it was working perfectly after updating BIOS to
1.30 (which I'm currently using) in Sep. 2018 [1]. I don't remember
any suspend/resume failures. But since late 2019, it has exactly the
same symptom as yours. Suspending is fine, but upon resuming, there is
about a 50% probability that the power LDE continues pulsating with
all other LDEs like FnLock and CapsLock are on like the machine is
awake.


Right-o.


To make sure suspend/resume is not blocked by USB you can try setting:

sysctl hw.usb.no_suspend_wait=1

--HPS


___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-16 Thread Eirik Øverby
On 9/16/20 9:07 AM, Li-Wen Hsu wrote:
> On Wed, Sep 16, 2020 at 2:30 PM Andriy Gapon  wrote:
>>
>> On 15/09/2020 23:13, Eirik Øverby wrote:
>>> On 9/15/20 9:50 PM, Andriy Gapon wrote:
 On 15/09/2020 22:36, Eirik Øverby wrote:
> Now, since I updated from r365358 to r365688, I have not once been able 
> to wake from sleep.

 Is that the only thing that changed?
 Any port / package upgrades?
>>>
>>> There have been updates to packages, yes - but it didn't even occur to me 
>>> that these could impact the resume process at such an early stage. Not sure 
>>> which that would be; obviously the drm module has been rebuilt each time I 
>>> upgraded, but I don't have any other kernel modules installed from packages.
> 
> Which version of drm module are you using?

13.0-CURRENT FreeBSD 13.0-CURRENT #7 r365688
drm-devel-kmod-5.4.62.g20200905_1

Built against the running kernel sources, of course.


>> Yes, I specifically had drm modules in mind.
> 
> I also use X1C 6th and it was working perfectly after updating BIOS to
> 1.30 (which I'm currently using) in Sep. 2018 [1]. I don't remember
> any suspend/resume failures. But since late 2019, it has exactly the
> same symptom as yours. Suspending is fine, but upon resuming, there is
> about a 50% probability that the power LDE continues pulsating with
> all other LDEs like FnLock and CapsLock are on like the machine is
> awake.

Right-o.

/Eirik
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-16 Thread Andriy Gapon
On 16/09/2020 10:05, Warner Losh wrote:
> 
> 
> On Wed, Sep 16, 2020 at 12:31 AM Andriy Gapon  > wrote:
> 
> On 15/09/2020 23:13, Eirik Øverby wrote:
> > On 9/15/20 9:50 PM, Andriy Gapon wrote:
> >> On 15/09/2020 22:36, Eirik Øverby wrote:
> >>> Now, since I updated from r365358 to r365688, I have not once been 
> able
> to wake from sleep.
> >>
> >> Is that the only thing that changed?
> >> Any port / package upgrades?
> >
> > There have been updates to packages, yes - but it didn't even occur to 
> me
> that these could impact the resume process at such an early stage. Not 
> sure
> which that would be; obviously the drm module has been rebuilt each time I
> upgraded, but I don't have any other kernel modules installed from 
> packages.
> 
> Yes, I specifically had drm modules in mind.
> 
> 
> I too can report this for my Lenovo Yoga running code as of September 13, but
> with manu's latest drm...  It used to work fine, but my last build on the 
> system
> was from May. Most likely a new panic in that code path, but I've not chased
> down further...

One thing to check is to set debug.acpi.suspend_bounce=1 before suspending.
This will run suspend (and then resume) methods of all drivers just like for a
normal suspend, but will skip the actual ACPI suspend.

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-16 Thread Poul-Henning Kamp

Warner Losh writes:

> I too can report this for my Lenovo Yoga running code as of September 13,
> but with manu's latest drm...  It used to work fine, but my last build on
> the system was from May. Most likely a new panic in that code path, but
> I've not chased down further...

My T480 runs:

FreeBSD 13.0-CURRENT #1 r364533M: Mon Aug 24 00:02:01 UTC 2020

and

drm-devel-kmod-5.3.g20200724

And I have not seen any suspend/resume problems.


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-16 Thread Li-Wen Hsu
On Wed, Sep 16, 2020 at 2:30 PM Andriy Gapon  wrote:
>
> On 15/09/2020 23:13, Eirik Øverby wrote:
> > On 9/15/20 9:50 PM, Andriy Gapon wrote:
> >> On 15/09/2020 22:36, Eirik Øverby wrote:
> >>> Now, since I updated from r365358 to r365688, I have not once been able 
> >>> to wake from sleep.
> >>
> >> Is that the only thing that changed?
> >> Any port / package upgrades?
> >
> > There have been updates to packages, yes - but it didn't even occur to me 
> > that these could impact the resume process at such an early stage. Not sure 
> > which that would be; obviously the drm module has been rebuilt each time I 
> > upgraded, but I don't have any other kernel modules installed from packages.

Which version of drm module are you using?

> Yes, I specifically had drm modules in mind.

I also use X1C 6th and it was working perfectly after updating BIOS to
1.30 (which I'm currently using) in Sep. 2018 [1]. I don't remember
any suspend/resume failures. But since late 2019, it has exactly the
same symptom as yours. Suspending is fine, but upon resuming, there is
about a 50% probability that the power LDE continues pulsating with
all other LDEs like FnLock and CapsLock are on like the machine is
awake.

I still doubt if this is related to drm. I have tried to
suspend/resume without drm module loads, all successed, but the number
of the experiments are too small (< 10) so I can't tell if this is the
conclusion.

Currently I'm on r363470 with drm-devel-kmod-5.3.g20200724. While
reporting issue [2], I found that setting hw.i915kms.enable_psr=0 in
/boot/loader.conf helps. Before that it has about a 30% probability of
failing to resume (yes one of the few things getting better in 2020),
after that, I still see some failures, but the failure rate reduces to
about 5~10%.

I haven't upgraded to newer kernel/world and drm-devel-kmod yet.

[1] https://twitter.com/lwhsu/status/1039711710913945601
[2] https://github.com/freebsd/drm-kmod/issues/14

Best,
Li-Wen
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-16 Thread Warner Losh
On Wed, Sep 16, 2020 at 12:31 AM Andriy Gapon  wrote:

> On 15/09/2020 23:13, Eirik Øverby wrote:
> > On 9/15/20 9:50 PM, Andriy Gapon wrote:
> >> On 15/09/2020 22:36, Eirik Øverby wrote:
> >>> Now, since I updated from r365358 to r365688, I have not once been
> able to wake from sleep.
> >>
> >> Is that the only thing that changed?
> >> Any port / package upgrades?
> >
> > There have been updates to packages, yes - but it didn't even occur to
> me that these could impact the resume process at such an early stage. Not
> sure which that would be; obviously the drm module has been rebuilt each
> time I upgraded, but I don't have any other kernel modules installed from
> packages.
>
> Yes, I specifically had drm modules in mind.
>

I too can report this for my Lenovo Yoga running code as of September 13,
but with manu's latest drm...  It used to work fine, but my last build on
the system was from May. Most likely a new panic in that code path, but
I've not chased down further...

Warner
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-15 Thread Andriy Gapon
On 15/09/2020 23:13, Eirik Øverby wrote:
> On 9/15/20 9:50 PM, Andriy Gapon wrote:
>> On 15/09/2020 22:36, Eirik Øverby wrote:
>>> Now, since I updated from r365358 to r365688, I have not once been able to 
>>> wake from sleep.
>>
>> Is that the only thing that changed?
>> Any port / package upgrades?
> 
> There have been updates to packages, yes - but it didn't even occur to me 
> that these could impact the resume process at such an early stage. Not sure 
> which that would be; obviously the drm module has been rebuilt each time I 
> upgraded, but I don't have any other kernel modules installed from packages.

Yes, I specifically had drm modules in mind.


-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-15 Thread Eirik Øverby
On 9/15/20 9:50 PM, Andriy Gapon wrote:
> On 15/09/2020 22:36, Eirik Øverby wrote:
>> Now, since I updated from r365358 to r365688, I have not once been able to 
>> wake from sleep.
> 
> Is that the only thing that changed?
> Any port / package upgrades?

There have been updates to packages, yes - but it didn't even occur to me that 
these could impact the resume process at such an early stage. Not sure which 
that would be; obviously the drm module has been rebuilt each time I upgraded, 
but I don't have any other kernel modules installed from packages.

/Eirik
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-15 Thread Andriy Gapon
On 15/09/2020 22:36, Eirik Øverby wrote:
> Now, since I updated from r365358 to r365688, I have not once been able to 
> wake from sleep.

Is that the only thing that changed?
Any port / package upgrades?

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Wake from sleep kinda broken-ish? (ThinkPad Carbon X1 6th gen)

2020-09-15 Thread Eirik Øverby
Hi,

ever since I started using my 6th gen ThinkPad X1 Carbon as my daily work horse 
back in 2019 I have had occasional problems getting it to wake from sleep. 
Lately I thought I had nailed it down somewhat - making sure I close the lid 
(which is the only condition in which it will sleep on its own) only while the 
screen is actually on. Closing the lid when the screensaver had turned the 
display off would almost certainly prevent waking from sleep.

Now, since I updated from r365358 to r365688, I have not once been able to wake 
from sleep.

The problem manifests thus: The computer seems to go to sleep correctly; the 
LED on the display starts pulsating as it should and all fan activity stops. 
Upon opening the lid, the pulsating stops, but the power LED pulsates instead. 
There is no display activity and no signs of it actually waking up. 
Force-power-off is the only way to resuscitate, after which (and I am fairly 
sure I'm not imagining this) it is very hard to get my GELI password right - so 
another power cycle is required before the keyboard is fully reliable pre-boot.

I have absolutely no idea how to go about debugging this. The BIOS on the 
system is pretty new, the TPM chip is disabled (that seemed to help reliability 
quite a bit), and unused/unsupported devices are disabled in BIOS. No BIOS 
configuration has changed between the revisions.

Any hints would be more than welcome.

Thanks all,
/Eirik
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"