Wednesday 9 December 2015

Ubuntu 14.04 on Lenovo ideapad 100-14IBY (Part 2)

Following up on the first part, this post will cover issues I experience after installing Ubuntu 14.04 and the steps I took to investigate them. The following issues immediately caught my attention:

  • WiFi connection dropped - no WiFi until reboot
  • Returning from flight mode leaves WiFi disabled - or at least unusable
  • Suspend/resume does not work - stuck at a black screen
  • Reboot and shutdown need the physical power button to be pressed
  • Brightness control buttons inverted - "up" will dim the backlight and vice versa

WiFi stability issues

The lspci output from the first part shows that the ideapad is equipped with a RTL8723be WiFi card. Googling revealed others has similar issues which could be dodged or at least significantly improved by disabling hardware encryption.


cat <<EOF | sudo tee /etc/modprobe.d/rtl8723be.conf
options rtl8723be swenc=1
EOF

In order for the changes to take effect, one either has to reboot or remove and then probe the kernel module. With this change applied, WiFi seemed much more stable, entering and returning from flight mode worked just fine, and occasional WiFi issues could be simply resolved disconnecting and reconnecting, although rather infrequently toggling flight mode or removing and probing the module were needed. In addition to this, I disabled IPv6 for our local WiFi connection. The results were good enough so I moved on to the next topic.

Inverted back-light control buttons

Googling revealed other have experienced this issue before me, however, the common suggestions of using acpi_osi=Linux acpi_backlight=vendor boot parameters did not help, nor did any element of the superset of these two parameters. The only side effect was constantly maximum brightness, which cannot be changed with the buttons at all. On the Lenovo support forum I read that people using Windows experienced the same until new Lenovo provided drivers were installed... As I was running out of time, I decided to categorize this as a minor cosmetic issue and removed those boot parameters.

It is worth to note that after installation I had just about an hour to work with the ideapad which then I left the with the owner and had to continue my investigation at home, reading and googling, without access to the hardware. Therefore I quickly skipped to the next topic.

Suspend/resume, reboot and shutdown issues

It was rather obvious from the beginning that all issues around changing the power state have a common root cause. I assumed a faulty or non-standard ACPI implementation might be the root cause. I entered firmware setup and carefully reviewed the settings but did not find any obvious configuration option which might be related. I experimented with disabling virtualization support and thermal management capabilities but did not see any improvement.

Assuming the ACPI implementation of the ideapad wants to be smart and compensate some broken Windows versions, I attempted to fix the issue by experimenting with acpi_osi settings.

The ACPI _OSI call

It is not unheard of that BIOS/firmware bugs cause reboot problems. ACPI offers a way for the firmware to query which operating system [version] is running - and this feature is frequent used by vendors with good intention to work around specific operating system bugs but in long term this practice translated to the proliferation of non-standard OS implementations and wrongly applied ACPI quirks.

It is documented in the ACPI BIOS Guideline for Linux that by default the Linux kernel since version 2.6.23 no longer returns true for _OSI("Linux")ACPI invocations, effectively lying to the firmware in order to discourage vendors from applying Linux specific quirks as opposed to strictly following the standards. At the same time, the Linux kernel also returns true when _OSI is invoked with any known Windows OS string. This behaviour can be controlled via the acpi_osi parameter already mentioned before.

Other sources recommend to use acpi_osi=Linux in combination with acpi_osi='!Windows 2012' for UEFI based laptops. I have experimented with many variations, selectively enabling and disabling OS strings for individual Windows version. Unfortunately, this did not resolve the issue.

Update something

The ideapad came with firmware version CCCN12WW(V1.01) released on 03/23/2015 as confirmed via sudo dmidecode, and the most recent firmware found on the Lenovo support site is CCCN18WW (V2.04) released on 11/27/2015. While it would be a logical next step to update the firmware, Lenovo only provides a Windows executable, no way to flash the update from Linux or to prepare bootable media for flashing. The rules I have set for myself does not allow using windows based tools, so I had to stay with firmware v1.01. I believe it is rather strange that the ideapad is shipped with FreeDOS but no firmware update can be run anything other than Windows 7 or newer releases.

What I could update was the Linux kernel. The default HWE kernel these days is 3.19.0-37-generic #42~14.04.1-Ubuntu, and I installed linux-image-4.2.0-19-generic which is the Ubuntu 15.10 kernel. This update did also did not change the ACPI issue.

Firmware developers and counter-intuitive decisions

Eventually, the ACPI issue could be resolved by experimenting in the firmware settings on pure trial and error basis. The ideapad came with FreeDOS, and was configured to support BIOS/CSM mode as a fallback if UEFI boot failed. This I quickly disabled legacy mode right after installing Ubuntu. Also, UEFI Secure Boot was disabled by default which I found reasonable as I do not fancy Microsoft's practices of trying to hinder the installation of alternative operating systems.

In the "Exit" menu of the firmware setup, right under "Load Defaults" there is an parameter called "OS Optimized Defaults" which was set to "Other OS". The other option is "Windows 8 64-bit". This is only used when someone activates "Load Defaults" and as I would expects, it enables Secure Boot, sets UEFI only boot mode and some other settings found on the setup screens.

Just for the fun of it, I changed the "OS Optimized Defaults" to "Win8 64bit" and loaded defaults. As expected, it activated Secure Boot but did not change any of the other values on the setup screens. I was surprised to see that this completely fixed the ACPI issues. I returned to the firmware setup screen, disabled Secure Boot, changed "OS Optimized Defaults" back to "Other OS" - but did not load defaults. After booting Ubuntu, I confirmed that suspend, resume, reboot and shutdown work well. My conclusion is that loading Windows 8 64-bit optimized defaults also changed firmware settings which are not exposed on the setup screen. This is a very counter-intuitive practice as loading default firmware setup values should not do anything else than loading defaults for the values exposed on the setup screens.

Closing notes

With all major issues addressed, I released the ideapad for production use. I made the owner aware of the inverted backlight controls buttons and told to provide feedback if any WiFi stability issues occur during field use. The remaining glitches will be addressed subsequent posts.

19 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks a lot, your post helped me to resolve the same suspend/resume, reboot and shutdown issues on Lenovo ideapad 100-15IBY with Ubuntu 14.04

    ReplyDelete
    Replies
    1. Glad to hear that. Did you also face the WiFi connectivity issue on you 100-15IBY?

      Delete
    2. Yes, but manage to resolve it. The shutdown/reboot issue on the other hand took me a lot of time and I could'n find a solution. So thanks again! I found another person with the same issue in the ubuntu forum, I'll give him link to your post, hope that you don't mind.

      Delete
    3. That's fine, thanks for the feedback.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Great!
    Works great for me, Ubuntu and other distros can shutdown, reboot, etc.

    Thanks!

    (Haha have issues with my answer)

    ReplyDelete
  5. Thanks a lot for your solutions for ideapad 100-14IBY. Now runs Linuy Mit on it instead of creepy fu.... WIN 10.

    Thanks, thanks, thanks

    ReplyDelete
  6. Hello, have you also found that graphical operations look not tuned with Ubuntu 15.10? I have this laptop with SSD disk (cat /sys/block/sda/queue/rotational return 0) and I am not sure I have the speed I should expect.

    ReplyDelete
    Replies
    1. I have not evaluated 15.10 on the ideapad, so I cannot address that part of your question. I have not found issues with 14.04 during normal office and leisure time workloads. Note that this does not include gaming or video editing.
      You could run a GPU benchmark such as glmark2 or phoronix-test-suite to assess the overall performance of your GPU, or you could just monitor your system during normal load to find the bottleneck specific to your usage pattern - capture CPU, GPU load, RAM, disk throughput and utilization via iostat.
      Would you mind to share what kind of SSD (brand, model) it is?

      Delete
    2. hi, I am not able to check any more details with glmark2, nor iostat, since I replaced this for another model, Lenovo G50-45 (80E301U7YA). Actually I will receive the new model tomorrow. I am very sorry, because these details would be nice to have on this post. However, can you update me if your Ubuntu 14.04 recognized IdeaPad 100 correct drivers, for all your devices.

      Delete
  7. Sorry for the delay.

    /dev/sda:

    Model=SAMSUNG MZYLF128HCHP-000L2, FwRev=FXT63L1Q, SerialNo=S28YNXBG864574
    Config={ Fixed }
    RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
    BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16
    CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=250069680
    IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
    PIO modes: pio0 pio1 pio2 pio3 pio4
    DMA modes: mdma0 mdma1 mdma2
    UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
    AdvancedPM=no WriteCache=enabled
    Drive conforms to: unknown: ATA/ATAPI-2,3,4,5,6,7

    * signifies the current active mode

    The problem on my side is that disk works super slow, when I tested with

    sudo hdparm -Tt /dev/sda

    /dev/sda:
    Timing cached reads: 2910 MB in 2.00 seconds = 1454.49 MB/sec
    Timing buffered disk reads: 794 MB in 3.01 seconds = 264.01 MB/sec


    Usually the values for the "Timing cached reads" exceeds the 9000MB/s on my other SSD disk on other laptop.

    Someone told me this may be because I don't have drivers for chipset. I searched for the drivers
    http://linux-drivers.net/index.php?p=notebook&s=lenovo
    but no drivers exists for this laptop in there.

    I can tell more the lspci returns this

    00:00.0 Host bridge: Intel Corporation Atom Processor Z36xxx/Z37xxx Series SoC Transaction Register (rev 0e)
    00:02.0 VGA compatible controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Graphics & Display (rev 0e)
    00:13.0 SATA controller: Intel Corporation Atom Processor E3800 Series SATA AHCI Controller (rev 0e)
    00:14.0 USB controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series USB xHCI (rev 0e)
    00:1a.0 Encryption controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Trusted Execution Engine (rev 0e)
    00:1b.0 Audio device: Intel Corporation Atom Processor Z36xxx/Z37xxx Series High Definition Audio Controller (rev 0e)
    00:1c.0 PCI bridge: Intel Corporation Atom Processor E3800 Series PCI Express Root Port 1 (rev 0e)
    00:1c.1 PCI bridge: Intel Corporation Atom Processor E3800 Series PCI Express Root Port 2 (rev 0e)
    00:1c.2 PCI bridge: Intel Corporation Atom Processor E3800 Series PCI Express Root Port 3 (rev 0e)
    00:1c.3 PCI bridge: Intel Corporation Atom Processor E3800 Series PCI Express Root Port 4 (rev 0e)
    00:1d.0 USB controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series USB EHCI (rev 0e)
    00:1f.0 ISA bridge: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Power Control Unit (rev 0e)
    00:1f.3 SMBus: Intel Corporation Atom Processor E3800 Series SMBus Controller (rev 0e)
    02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader (rev 01)
    03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller (rev 0a)
    04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter


    The problem I see is this machine has been made for FreeDOS or Windows 7+ and not meant to work with Ubuntu. It works but Chromium browser opens in 12 seconds, for instance, so super slow.

    The other thing, I have the feeling the graphics card that is integrated works super slow..

    Thanks

    ReplyDelete
  8. Many many thanks for the BIOS tip to get ACPI working!

    Have you managed to get bluetooth working?
    I've managed to get stable wifi with the lwfinger driver, but bluetooth still does nothing.

    ReplyDelete
  9. my 100-15IBY does a weird lag when the wireless wifi is on and not connected. it happend at random moment. but when I am connected, all good.
    I don't know if anyone has got the same issue.

    ReplyDelete
    Replies
    1. Please share whether or not you are using additional kernel module parameters besides swenc=1 - such as ips or fwlps. It might be a result of overly aggressive link power control which can be tuned via those other parameters. Anybody is welcome to chime in and share what parameter combination works best for them.

      Delete
  10. MAN you make my DAY! The ACPI thing about reboot/shutdown was driving me nuts. Thanks for sharing!

    ReplyDelete
  11. I have tje problem that Graphics are buggy.
    the sound too.
    I cant watch films without amy lag.
    I installd the Driver but there is the same fail.
    Is there an iea?

    ReplyDelete
  12. Got the same shutdown problems on my dual-boot Lenovo with Linux mint and Linux lite. Followed your instructions and now the problems are gone. You did a great job, many thanks!

    ReplyDelete