Re: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-29 Thread Rozhuk Ivan
On Sat, 20 Jul 2019 00:54:47 +0200
Evilham  wrote:


> Minor glitches:
> - xbacklight doesn't work, neither does intel-backlight because 
>   it's AMD
> - Speakers don't appear to work, audio input/output on 3.5 jack 
>   does.
> - SD card reader doesn't work (Bounty for 125 USD: 
>   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204521)

I have Asus 505 and backlight not work too (try via xfce4-power-manager).

I dig into it and found that problem somewhere in ACPI code.

1. It does not proper export some functions and FreeBSD
ACPI + xfce4-power-manager cant detect support this feature.
I hack kernel:
Index: /usr/src/sys/dev/acpica/acpi_video.c
===
--- /usr/src/sys/dev/acpica/acpi_video.c(revision 350398)
+++ /usr/src/sys/dev/acpica/acpi_video.c(working copy)
@@ -1053,8 +1053,12 @@
dcs = 0;
status = acpi_GetInteger(handle, "_DCS", );
if (ACPI_FAILURE(status))
-   printf("can't evaluate %s._DCS - %s\n",
-  acpi_name(handle), AcpiFormatException(status));
+   status = acpi_GetInteger(handle, "_STA", );
+   if (ACPI_FAILURE(status)) {
+   /* Assume that device OK by default. */
+   dcs = (DCS_EXISTS | DCS_ACTIVE | DCS_READY |
+   DCS_FUNCTIONAL | DCS_ATTACHED);
+   }
 
return (dcs);
 }
and now acpi/xfce4-power-manager show that feature supported but
it does not work.
(later I can move this hack into ACPI ASL code that load into bios, but it 
harder to maintain)

2. I dig more depper and decompile acpi code via isl.
There is a mess.
I found that function that set backlight level check some mem/register
value before write new backlight value.
I fail to found place where this value changed.
I try rewrite code to remove this check and recompile ACPI and load new
version witout this check on FreeBSD boot, it loaded but backlight still
not work.

Also I set in loader.conf:
hw.acpi.osname="Windows 2015"   # Some systems' ASL may have problems because 
they look for names of Microsoft operating systems.
because there is at least 4 different places in decompiled ACPI
where OS version and name checked - not help with blackligth, but as I see
this unblock some features/devices.


Also i2c touchpad dont work.
https://reviews.freebsd.org/D16698
not help.


For speakers probably wrong snddev set.
Try change hw.snd.default_unit.


> WARNING !drm_modeset_is_locked(>mutex) failed at 
> /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-6365030/drivers/gpu/drm/drm_atomic_helper.c:821
> [Multiple times...]
> kernel trap 22 with interrupts disabled
> kernel trap 22 with interrupts 
> disabled
> kernel trap 22 with interrupts disabled
> kernel trap 22 with interrupts disabled
> panic: spin lock held too long

I have another issue with amdgpu:
after lid closed and open again video freezes to few seconds every 10 seconds.
Switch to scfb xorg driver to fix it, but get small tearing on video playback.

___
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: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-21 Thread Evilham

On dg., jul. 21 2019, Cristian Pogolsha wrote:


Hi,

Thank you for the instructions. I have a question related to
post-installation. My system doesn't boot after installing and 
rebooting
the system. It just doesn't find the partition on the drive. I 
get a blank
screen when selecting from the boot media list. What 
partitioning scheme
did you use for your installation? Or is this problem 
addressable with step

#2 in your instructions? Putting in the boot/loader.conf ->
set.hw.pci.mcfg=0?


The **hw.pci.mcfg=0** line in /boot/loader.conf is so that your 
booting won't hang the same way it did on installation without 
manual parameters, shouldn't be related to your current issue.
Remember to add the comment linking to the bug as well, so that 
you can remove it when those changes land in -CURRENT
Also add yourself to the CC field in the bug, that way you can 
help test those changes.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231760q

Your current issue sounds like a problem with the way you 
installed / set up the system and is probably better for 
freebsd-questions:

https://lists.freebsd.org/mailman/listinfo/freebsd-questions

FWIW: I boot using EFI from ZFS in a geli-encrypted partition in a 
GPT disk, I recall some manual fiddling but those were likely 
because I needed sth particular.

--
Evilham
___
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: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-21 Thread Evilham

On ds., jul. 20 2019, Evilham wrote:

Serious issue:
I was just debugging this right now, more infos with a proper
bug
report will come, but I think the system encounters a deadlock
sometimes with the drm-kmod / amdgpu which results in a kernel
panic.
It is a serious issue, but it allows me to use the computer 
for

work,
it doesn't happen every couple hours, but it does happen a
couple
times a day.

FWIW, this is part of the crashlog:

WARNING !drm_modeset_is_locked(>mutex) failed at
/wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-6365030/drivers/gpu/drm/drm_atomic_helper.c:821
[Multiple times...]
kernel trap 22 with interrupts disabled
 kernel trap 22 with interrupts
 disabled
kernel trap 22 with interrupts disabled
kernel trap 22 with interrupts disabled
 panic: spin lock held too long



And this is why I wanted to do more debugging before raising an 
issue :-).


It kept happening without drm-kmod but the backtrace was 
different, which allowed me to reduce it to a piece of alpha 
Software I use pretty much all the time: WireGuard.

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239351

So, update: there is no *serious* issue when using the ThinkPad 
A485, it works mostly fine with minor annoyances (including the 
fact that installation media won't work out of the box).

--
Evilham
___
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"


acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-21 Thread Cristian Pogolsha
Hi,

Thank you for the instructions. I have a question related to
post-installation. My system doesn't boot after installing and rebooting
the system. It just doesn't find the partition on the drive. I get a blank
screen when selecting from the boot media list. What partitioning scheme
did you use for your installation? Or is this problem addressable with step
#2 in your instructions? Putting in the boot/loader.conf ->
set.hw.pci.mcfg=0?

Thank you very much,
Cristian
___
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: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-21 Thread StaffSilence
Having same issue with an i915 inside a hp envy

On July 19, 2019 3:15:11 PM PDT, Cristian Pogolsha  wrote:
>Hi,
>
>I tried recently to boot FreeBSD current r350103 on a Thinkpad A485.
>It's
>the AMD Ryzen equivalent of the T480. During the boot I encountered
>this
>ACPI related error
>https://drive.google.com/file/d/1dzgSonn6Cuc1YrDeAUYSqHZlcmzaDY2Y/view
>Sorry that I'm posting images instead of plain text. I have no idea how
>to
>do kernel dumps during the bootload of a live image. I would be happy
>to
>post more information if required, let me know how I can do it.
>
>Thank you,
>Cristian
>___
>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"
___
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: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-20 Thread Evilham

Hey,

thanks for the feedback and your work, didn't think this would be 
interesting for anyone but the laptop owners.



On ds., jul. 20 2019, Greg V. wrote:

On July 20, 2019 1:54:47 AM GMT+03:00, Evilham 
 wrote:



it even suspends and resumes back to X


Wow, that's great news! Desktop Ryzen+Vega doesn't (not that I 
need suspend very much on desktop haha)


Indeed, I was pleasantly surprised too


- xbacklight doesn't work, neither does intel-backlight because
 it's AMD


Since it's a Thinkpad, do the brightness keys work anyway? Does 
acpi_ibm work?


Forgot to mention brightness keys, they also don't work.
I just tried acpi_ibm and it also didn't help.


Serious issue:
I was just debugging this right now, more infos with a proper 
bug

report will come, but I think the system encounters a deadlock
sometimes with the drm-kmod / amdgpu which results in a kernel
panic.


If you're on the packaged drm-kmod v4.16, it's amazing that 
Raven GPU works at all. You should try drm-v5.0 from git.



kld_list="amdgpu"


Huh, interesting, I'm trying to compile drm-v5.0 right now.
This comment and Pete's made me re-visit the graphics settings, 
specifics below.



It even works when loaded this early? Interesting. Do you also 
not have the EFI framebuffer conflict? i.e. without disabling 
vt.syscons, everything just works reliably?


Yes, with my previous laptop that was necessary, but this one has 
no need for those settings, it works just fine without and font 
size is according to the screen (i.e. it's not huge).




On ds., jul. 20 2019, Pete Wright wrote:


On 7/19/19 3:54 PM, Evilham wrote:


Serious issue:
I was just debugging this right now, more infos with a proper 
bug

report will come, but I think the system encounters a deadlock
sometimes with the drm-kmod / amdgpu which results in a kernel 
panic.
It is a serious issue, but it allows me to use the computer for 
work,
it doesn't happen every couple hours, but it does happen a 
couple

times a day.

FWIW, this is part of the crashlog:

WARNING !drm_modeset_is_locked(>mutex) failed at
/wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-6365030/drivers/gpu/drm/drm_atomic_helper.c:821
[Multiple times...]
kernel trap 22 with interrupts disabled
 kernel trap 22 with interrupts
 disabled
kernel trap 22 with interrupts disabled
kernel trap 22 with interrupts disabled
 panic: spin lock held too long



interesting. can you post this kernel panic, and any backtraces 
you are

able to get here:

https://github.com/FreeBSDDesktop/kms-drm/issues

also, are you using the xf86-video-amdgpu driver, or the stock
modesetting driver to X?



That was my plan for when I manage to fully isolate that it is on 
drm-kmod, thank you for confirming the path!


I noticed I did have xf86-video-amdgpu installed, but just removed 
it and all traces of drm-kmod as well as the kld_list="amdgpu" bit 
and X actually works without it and without the xf86-video 
packages.


HDMI output won't work though, I guess that makes sense.

We'll see if working like this the system doesn't crash at all, if 
it does it may be related to #231760 and not to drm-kmod.


If it does not crash without drm-kmod, I'll try my build of 
drm-kmod v5.0 before opening an issue, that'd be more information 
:-).


I did have the question as to why the packaged version is 4.16 but 
didn't quite find an answer to that on the wikis / documentation.


Thank you again,
--
Evilham
___
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: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-20 Thread Greg V
On July 20, 2019 1:54:47 AM GMT+03:00, Evilham  wrote:

> it even suspends and resumes back to X

Wow, that's great news! Desktop Ryzen+Vega doesn't (not that I need suspend 
very much on desktop haha)

>- xbacklight doesn't work, neither does intel-backlight because 
>  it's AMD

Since it's a Thinkpad, do the brightness keys work anyway? Does acpi_ibm work?

>Serious issue:
>I was just debugging this right now, more infos with a proper bug 
>report will come, but I think the system encounters a deadlock 
>sometimes with the drm-kmod / amdgpu which results in a kernel 
>panic.

If you're on the packaged drm-kmod v4.16, it's amazing that Raven GPU works at 
all. You should try drm-v5.0 from git.

>kld_list="amdgpu"

It even works when loaded this early? Interesting. Do you also not have the EFI 
framebuffer conflict? i.e. without disabling vt.syscons, everything just works 
reliably?
___
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: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-19 Thread Cristian Pogolsha
Hi Jordy,

Thank you for your fast reply. Your links were very helpful.
As per the bugzilla report
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231760, during the kernel
load screen I dropped to shell prompt and changed the boot params with
command
'set hw.pci.mcfg="0"

I was successful booting and installing FreeBSD from there. Hope it works
for you too!

Kind regards,
Cristian

On Sat, Jul 20, 2019 at 12:35 AM Jordy van Wolferen  wrote:

> Hi,
>
> I have the Thinkpad E485 and I'm also unable to boot FreeBSD on it.
> It has some UEFI firmware issues, for linux it needs some kernel arguments
> to get it to boot:
> "ivrs_ioapic[32]=00:14.0 ivrs_ioapic[33]=00:00.0 iommu=pt"
>
> https://forums.lenovo.com/t5/Other-Linux-Discussions/ThinkPad-E485-E585-Firmware-bug-ACPI-IVRS-table/td-p/4191484
> .
> On linux I have to add the following kernel arguments:
> "ivrs_ioapic[32]=00:14.0 ivrs_ioapic[33]=00:00.0 iommu=pt", I would like to
> know what the equivalent for FreeBSD arguments are.
>
> There is also an open bug for Ryzen mobile on FreeBSD:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231760
>
> Hope this helps a bit.
>
> Best regards,
> Jordy
>
> On Sat, Jul 20, 2019 at 12:15 AM Cristian Pogolsha 
> wrote:
>
>> Hi,
>>
>> I tried recently to boot FreeBSD current r350103 on a Thinkpad A485. It's
>> the AMD Ryzen equivalent of the T480. During the boot I encountered this
>> ACPI related error
>> https://drive.google.com/file/d/1dzgSonn6Cuc1YrDeAUYSqHZlcmzaDY2Y/view
>> Sorry that I'm posting images instead of plain text. I have no idea how to
>> do kernel dumps during the bootload of a live image. I would be happy to
>> post more information if required, let me know how I can do it.
>>
>> Thank you,
>> Cristian
>> ___
>> 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
>> "
>>
>
___
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: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-19 Thread Pete Wright

On 7/19/19 3:54 PM, Evilham wrote:
>
> Serious issue:
> I was just debugging this right now, more infos with a proper bug
> report will come, but I think the system encounters a deadlock
> sometimes with the drm-kmod / amdgpu which results in a kernel panic.
> It is a serious issue, but it allows me to use the computer for work,
> it doesn't happen every couple hours, but it does happen a couple
> times a day.
>
> FWIW, this is part of the crashlog:
>
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-6365030/drivers/gpu/drm/drm_atomic_helper.c:821
> [Multiple times...]
> kernel trap 22 with interrupts disabled
>    kernel trap 22 with interrupts
>    disabled
> kernel trap 22 with interrupts disabled
> kernel trap 22 with interrupts disabled
>    panic: spin lock held too long
>

interesting.  can you post this kernel panic, and any backtraces you are
able to get here:

https://github.com/FreeBSDDesktop/kms-drm/issues

also, are you using the xf86-video-amdgpu driver, or the stock
modesetting driver to X?


thanks!

-pete


-- 
Pete Wright
p...@nomadlogic.org
310.309.9298

___
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: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-19 Thread Evilham

Hey,

On ds., jul. 20 2019, Cristian Pogolsha wrote:

I tried recently to boot FreeBSD current r350103 on a Thinkpad 
A485. It's
the AMD Ryzen equivalent of the T480. During the boot I 
encountered this

ACPI related error
https://drive.google.com/file/d/1dzgSonn6Cuc1YrDeAUYSqHZlcmzaDY2Y/view


I have the same laptop and recently spent a fair amount of time 
getting it to work, I've been wanting to document this in a more 
proper fashion (e.g. FreeBSD's wiki) but haven't gotten the time, 
maybe since this will save you time, you would be able to put this 
and your own findings together and do that?
If not, at the very least people searching on the web will have 
now a better chance to find this email.


Note: I run on a daily basis, 12-RELEASE but I tested 13-CURRENT 
about a month ago and everything applied verbatim.



First things: in order to get the Thinkpad A485 to boot, wait 
until you see the logo and press 3 for boot options, once there 
type:


set hw.pci.mcfg=0
boot

It should work alright now, after installing the system, triple 
check that /boot/loader.conf contains this:


# Ryzen hack: FreeBSD bug #231760
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231760
hw.pci.mcfg=0

# Wireless Intel AC8265
# Not strictly necessary, but the Realtek that is shipped is not 
 supported

# You can easily (and carefully) change them.
if_iwm_load="YES"
iwm8265fw_load="YES"


Now, if you want X, you should install drm-kmod and add following 
to your /etc/rc.conf:

# Graphics
kld_list="amdgpu"


Those are the tricky bits to get the system to work IIRC (also: 
your ethernet is re1, not re0).


After this, the system should work fine (it even suspends and 
resumes back to X!), with minor glitches and a serious issue.
Take into account that I didn't research these too much because 
they are minor annoyances for me.


Minor glitches:
- xbacklight doesn't work, neither does intel-backlight because 
 it's AMD
- Speakers don't appear to work, audio input/output on 3.5 jack 
 does.
- SD card reader doesn't work (Bounty for 125 USD: 
 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204521)


Serious issue:
I was just debugging this right now, more infos with a proper bug 
report will come, but I think the system encounters a deadlock 
sometimes with the drm-kmod / amdgpu which results in a kernel 
panic.
It is a serious issue, but it allows me to use the computer for 
work, it doesn't happen every couple hours, but it does happen a 
couple times a day.


FWIW, this is part of the crashlog:

WARNING !drm_modeset_is_locked(>mutex) failed at 
/wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-6365030/drivers/gpu/drm/drm_atomic_helper.c:821

[Multiple times...]
kernel trap 22 with interrupts disabled
   kernel trap 22 with interrupts 
   disabled

kernel trap 22 with interrupts disabled
kernel trap 22 with interrupts disabled
   panic: spin lock held too long


Sorry that I'm posting images instead of plain text. I have no 
idea how to
do kernel dumps during the bootload of a live image. I would be 
happy to

post more information if required, let me know how I can do it.


No worries, it took me forever to find the bug that had the 
sysctl.



I hope this helps you out,
--
Evilham
___
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"


acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-19 Thread Cristian Pogolsha
Hi,

I tried recently to boot FreeBSD current r350103 on a Thinkpad A485. It's
the AMD Ryzen equivalent of the T480. During the boot I encountered this
ACPI related error
https://drive.google.com/file/d/1dzgSonn6Cuc1YrDeAUYSqHZlcmzaDY2Y/view
Sorry that I'm posting images instead of plain text. I have no idea how to
do kernel dumps during the bootload of a live image. I would be happy to
post more information if required, let me know how I can do it.

Thank you,
Cristian
___
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"