Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test basic functionality #31

Closed
SolidHal opened this issue Sep 4, 2018 · 23 comments
Closed

Test basic functionality #31

SolidHal opened this issue Sep 4, 2018 · 23 comments
Labels
TODO Need to work on next

Comments

@SolidHal
Copy link
Owner

SolidHal commented Sep 4, 2018

The basic functionality needs to be confirmed.

  • Video
  • HDMI out
  • Sound over hdmi?
  • Speakers
  • Headphone
  • Keyboard
  • Trackpad
  • USB
  • SD card reader
  • Battery management
  • Close lid sleep/hibernate/suspend
  • wireless
@SolidHal SolidHal added the TODO Need to work on next label Sep 4, 2018
@Motophan
Copy link

Motophan commented Sep 5, 2018

Once I can get the image booted I will do this, can test daily builds. I have HDMI out, etc.

@dimkr
Copy link

dimkr commented Sep 8, 2018

For some reason, with 4.18.5 and your patches I get system lockups when I run wpa_supplicant against my AR9271 dongle. I'm not sure which patch is the one that should fix dwc2. @SolidHal, can you point me to the relevant patch, so I can see if anything changed in the relevant areas in the kernel?

@Motophan
Copy link

Motophan commented Sep 8, 2018 via email

@SolidHal
Copy link
Owner Author

SolidHal commented Sep 8, 2018

Hey @dimkr! First of all, thank for all of your work on devsus, your project did a lot to inspire me to build this.

The patch that fixes dwc2 (which is a modified version of the one from one of the devsus branches) can be found here https://github.com/SolidHal/PrawnOS/blob/master/resources/BuildResources/patches-tested/chromeos-dwc2-glue.patch. The build system only tries to apply the patches if the linux source folder is "fresh" aka was just untar'd, so removing the [ "$FRESH" = true ] && from the following line in scripts/buildKernel.sh should make debugging easier. I had to do this as otherwise it prompts the user to reverse the patch or throws errors.

[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/*.patch; do patch -p1 < $i; done

Another useful thing for debugging the kernel is make inject_kernel which if you have an already built PrawnOS image in the root of the checkout will take the newly built kernel image and inject it into the previously built image removing the need for the long filesystem build process. I'm working to document the whole make system as I post this.

Regarding kernel version 4.18.5, I had been testing with a later version of 4.17 (maybe 4.17.9?) and ran into a ton of issues so for now I plan to stick with 4.17.2. Do you get the same lockups on 4.17.2 (just for curiosity's sake)?

@Motophan Thanks! I'm glad you got it booting! The kernel config may not have support for it enabled by default as it is pretty sparse, mostly for debug reasons. If you know what driver it uses, I'd more than happy to enable it in the config, then all you have to do is run make kernel and make kernel_inject (assuming you haven't deleted the prawnOS.img), write that prawnOS.img to a flash drive and go.
Otherwise, you can do make kernel_config which cross compiles make menuconfig, which will allow you to enable it yourself. If you do get it working, a pull request would be awesome.

*EDIT: Corrected make crossmenconfig to make kernel_config

@dimkr
Copy link

dimkr commented Sep 8, 2018

The patch that fixes dwc2

This patch doesn't seem to work for me. My C201 is an early 2015 2GB one and I use a generic AR9271 from AliExpress, plus the ThinkPenguin AR9271 dongle.

I haven't tried 4.17.x, but I did try 4.9.125 and I do see an improvement after backporting some ath9k_htc changes from 4.19-rc2. There is an issue with ath9k_htc and there was some regression around 4.15, that got fixed in 4.15+ AFAIK. Also, there are some known issues with the firmware and the USB IP used in the AR9271.

Even with all available ath9k_htc fixes and the Chrome OS dwc2, I get that "failed to wake up blah blah" from ath9k_htc in the kernel log. There are zero dwc2-related errors and zero lockups when running ifconfig/wpa_supplicant, but the dongle doesn't do anything. So now I don't know if it's dwc2, ath9k_htc or something about the hardware to blame.

Can you share more details about your setup? The C201 model and revision, etc'?

@SolidHal SolidHal mentioned this issue Sep 8, 2018
@SolidHal
Copy link
Owner Author

SolidHal commented Sep 8, 2018

@dimkr Huh, thats especially odd.
I have a c201 that was refurbished with 4gb ram, unfortunately its missing the original manufacturer information sticker. I use a THinkPenguin AR9271 dongle in place of the webcam as I mentioned in the README, so maybe that changes something?
I have a mid 2016 4gb as well without the modification and a thingpenguin AR9271 that I can try out later as well to see if anything works differently.

Would you mind trying out an image built with a clean commit of PrawnOS, with the 4.17.2? I can provide a link to a built image if taht would make it easier.

@dimkr
Copy link

dimkr commented Sep 8, 2018

@SolidHal, if you have a ready image, that would be great! I remember I tested the dwc2 patch against a 2017 4GB C201, so I'll test on both C201s I own. There could be a difference in build environments in addition to changes in the kernel and stuff - I remember it took me ages to find out that kernels built with GCC 4.9 don't boot and I'm very cautious in C201 related issues since then :)

@SolidHal
Copy link
Owner Author

SolidHal commented Sep 9, 2018

@dimkr Sorry it took so long to upload, here a link. https://archive.org/details/PrawnOSAlphaC201Libre2GBVERSION2

I added some information to the README about what I use for my build environment as well if you'd like to replicate that.

@dimkr
Copy link

dimkr commented Sep 9, 2018

@SolidHal Thank you! Downloading, I'll try this image on the older C201. If things don't work with your image, it means the kernel (probably dwc2, ath9k_htc or both) is still broken, because this laptop works perfectly with the Chrome OS 3.14 kernel. Otherwise, if it works, I'll try it on the newer 4GB one too.

@dimkr
Copy link

dimkr commented Sep 12, 2018

I've tested the image on my older 2GB C201 and the AR9271 is unstable. I'm on vacation until Sunday and then I have to back up all files on the newer 4GB C201, so it will take time until I get to test the image on that one as well.

@SolidHal
Copy link
Owner Author

@dimkr Could you tell me how you are testing how stable the AR9271 is?
I've been using my AR9271 for the past few days and it seems pretty stable, but I haven't been picking apart dmesg very much so I may just be getting lucky.

@dimkr
Copy link

dimkr commented Sep 12, 2018

@SolidHal I just connect to WiFi using wpa_supplicant and dhclient. Then I run apt update. It takes less than a minute until all traffic is stopped (apt freezes during download). With some kernels (probably those missing some dwc2 fixes), ifconfig, wpa_supplicant and anything else that queries or changes network interface related parameters freezes, because something in the kernel hangs. On other kernels, traffic is stopped but I can still run stuff like ifconfig. When I unplug the dongle, I get some ath9k_htc and/or dwc2 errors in dmesg.

@SolidHal
Copy link
Owner Author

Weird, I'll try recreating those steps. A few more questions:
When using the PrawnOS alpha image, were you running off of usb or had you installed it to the emmc?
Had you ran /Installresources/InstallPackages.sh ?
Have you been using the same AR9271 dongle?
What AR9217 dongle(s) have you been using?
With the prawnOS Alpha image, does the whole kernel hang or does the traffic just stop?

And finally, when you get a chance, could you attach a dmesg log that includes when you run wpa_supplicant through when you unplug the dongle?
Thanks! I hope we can get this figured out. I wouldn't be surprised if there's some other patch the chromeos kernel has that prawnOS doesn't yet have.

@Motophan
Copy link

Motophan commented Sep 12, 2018 via email

@dimkr
Copy link

dimkr commented Sep 12, 2018

@SolidHal I was using your image, booted from USB without running the script. I use a generic Chinese dongle and a Thinkpenguin one. I booted after shutting down, ran wpa_passphrase, wpa_supplicant, dhclient and apt. After some time, only traffic stops: this isn't a full system lockup. With some kernels (don't remember if your image has this problem, too) ifconfig freezes too in this state.

Next week I'll try to flash your kernel to the eMMC to see if this could could be a power issue (the dongle shuts down due to under voltage) - maybe a (cheap) flash drive consumes too much voltage that's shared between the USB ports. Too bad I don't have a powered USB hub, since that could rule out this possibility. With the Chrome OS 3.14 kernel everything works perfectly, but there are changes in power management support in the kernel between 3.14 and 4.17, of course.

@SolidHal
Copy link
Owner Author

I pulled out my other c201,a 2gb model, and my second AR9271 and managed to recreate this issue while booting off of usb. It seems to lock up completely, and eventually the kernel crashes.

If I plug in the AR9271 after boot, I get errors just like in this issue qca/open-ath9k-htc-firmware#136. Do you as well @dimkr ?

I realize now why I'm not seeing this issue on my main 4GB c201; Because I have my ath9271 soldered in to the webcam wiring. (or maybe its a 2GB vs 4GB issue, but I doubt it?)

Things I'll test:
Running off of usb vs emmc
4gb vs 2gb models
libreboot vs stock coreboot

The issue I linked above also mentions not having this problem when using a usb hub, but doesn't mention if it is powered or unpowered. I'll test with one of each.

Its sounding more and more like a kernel issue, especially if everything works fine with the chrome os 3.14 kernel. After testing the above things I'll start digging into the kernel. If using an unpowered usb hub fixes this, a pretty nasty usb bug is hiding somewhere.

@ghost
Copy link

ghost commented Sep 13, 2018

If I plug in the AR9271 after boot, I get errors just like in this issue qca/open-ath9k-htc-firmware#136. Do you as well @dimkr ?

I get three kinds of errors: these you mentioned, something related to ath and timeout (I remember the number 500 or 5000 mentioned in the logs), USB connection/disconnection related messages and errors due to inability to transfer the ath9k_htc firmware, right after the error you see.

(or maybe its a 2GB vs 4GB issue, but I doubt it?)

I think this could be related to board revisions (although we're 90% right assuming this is probably something about kernel): I know RK3288 and the USB IP in it have hardware revisions, so maybe later C201s are different and that affects the ability to reproduce this issue.

@SolidHal
Copy link
Owner Author

I'm going to move this conversation over to #38 to better track this issue.

@Motophan
Copy link

Motophan commented Sep 14, 2018 via email

@SolidHal
Copy link
Owner Author

@Motophan, the issue with the ath9k devices is now fixed! Everything needed to fix it is commited so feel free to try out a build. I'll have another compiled image uploaded soon if you don't want to build it.

@Motophan
Copy link

Motophan commented Sep 21, 2018 via email

@SolidHal
Copy link
Owner Author

@Motophan I'm glad you like it!

@SolidHal
Copy link
Owner Author

SolidHal commented Oct 4, 2018

Closing this as all functions have been tested, other issues opened for specific problems.

@SolidHal SolidHal closed this as completed Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO Need to work on next
Projects
None yet
Development

No branches or pull requests

3 participants