Choose style:

Author Topic: Ubuntu 17.10 corrupts BIOS on some Lenovo, Toshiba, Acer, and now Dell laptops  (Read 2220 times)

0 Members and 1 Guest are viewing this topic.

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5260
  • Karma: 942
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
Here's a plausible theory (and repudiation of the current thinking)  ...  :)


Spoiler (click here to view / hide)
I think the reason why 4.14.x works is because of commit 9d63f17661e2 ("spi-nor: intel-spi: Fix broken software sequencing codes").

The current theory is that for certain serial flashes (those with SPI_NOR_HAS_LOCK set in drivers/mtd/spi-nor/spi-nor.c) Linux SPI-NOR core wants to clear the status register (SR) in addition to reading the chip JEDEC ID. This is done to make sure protection bits (BP0, BP1 and BP2) are cleared.

The sequence looks like this:

  WREN (write enable)
  WRSR with 0 (write status register)

However, the intel-spi driver had an off-by-one bug that causes it to write two bytes instead of one. So the above sequence actually looks like:

  WREN (write enable)
  WRSR with 0, X (write status register)

Where X is something that is in FDATA[1] FIFO. Most likely this is part of the just read chip JEDEC ID. Now, WRSR command is weird in a sense that it allows writing both the status register and the control register even though there are separate commands to read them. If the Xabove has bit 6 set we end up writing this to the control register which means that we have:

 SR=0x00 CR=0x40 (CR value can be something else but bit 6 needs to be set)

Because BP0, BP1 and BP2 in SR are 0 and CMP in CR is 1, this means that the whole chip becomes read-only (CMP complements BP0, BP1 and BP2) and this prevents the BIOS from saving settings anymore.

The off-by-one bug was already fixed in the mainline kernel by commit 9d63f17661e2 ("spi-nor: intel-spi: Fix broken software sequencing codes") in September.
[close]
« Last Edit: December 27, 2017, 03:27:41 pm by VinDSL, Reason: Clarification »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25491
  • Karma: 2807
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Cool, hopefully they're getting closer to the bottom now.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5260
  • Karma: 942
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
Here's an odd one for ya. Probably just a coinkydink, but who knows ...

I had a hell of a time getting my 32bit circa 2004 Peppermint/Ubu test machine booted. I hadn't started it in a couple of weeks.

Figured out, my CMOS was scrambled - wouldn't boot - couldn't save changes to BIOS, blah, blah, blah. Sound familiar?  :-\

After a couple of hours or trial and error, I finally got to the login screen. First thing I did was:

Code: [Select]
Commit Log for Thu Dec 28 10:13:52 2017
Upgraded the following packages:
linux-generic-hwe-16.04-edge (4.13.0.19.26) to 4.13.0.22.28
linux-headers-generic-hwe-16.04-edge (4.13.0.19.26) to 4.13.0.22.28
linux-image-generic-hwe-16.04-edge (4.13.0.19.26) to 4.13.0.22.28

That worked a treat, so I subsequently decided to play it say (judging by the mail lists) and install the Linux 4.14.10 mainline kernel.

Spoiler (click here to view / hide)
╭─vindsl@Boogaloo-6 ~ 
╰─➤  inxi -Fxz
System:    Host: Boogaloo-6 Kernel: 4.14.10-041410-generic i686 (32 bit gcc: 7.2.0)
           Desktop: N/A Distro: Peppermint Seven
Machine:   Mobo: N/A model: Canterwood
           Bios: Phoenix v: 6.00 PG date: 04/09/2004
CPU:       Single core Intel Pentium 4 (-HT-) cache: 2048 KB
           flags: (pae sse sse2) bmips: 6815
           clock speeds: max: 3407 MHz 1: 3407 MHz 2: 3407 MHz
Graphics:  Card: NVIDIA G73 [GeForce 7600 GT] bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 drivers: nouveau (unloaded: fbdev,vesa)
           Resolution: 1920x1080@60.00hz
           GLX Renderer: Gallium 0.4 on NV4B
           GLX Version: 2.1 Mesa 17.0.7 Direct Rendering: Yes
Audio:     Card Intel 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller
           driver: snd_intel8x0 ports: d800 dc00 bus-ID: 00:1f.5
           Sound: ALSA v: k4.14.10-041410-generic
Network:   Card-1: Intel 82547EI Gigabit Ethernet Controller
           driver: e1000 v: 7.3.21-k8-NAPI port: a000 bus-ID: 02:01.0
           IF: enp2s1 state: down mac: <filter>
           Card-2: Lite-On LNE100TX
           driver: tulip v: 1.1.15 port: 9400 bus-ID: 03:0c.0
           IF: enp3s12 state: unknown speed: N/A duplex: N/A mac: <filter>
Drives:    HDD Total Size: 1000.2GB (12.8% used)
           ID-1: /dev/sda model: SAMSUNG_HD103SJ size: 1000.2GB
Partition: ID-1: / size: 120G used: 4.5G (4%) fs: ext4 dev: /dev/sda8
           ID-2: /home size: 612G used: 115G (20%) fs: ext4 dev: /dev/sda9
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 53.5C mobo: N/A gpu: 47.0
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 159 Uptime: 44 min Memory: 532.4/2012.8MB
           Init: systemd runlevel: 5 Gcc sys: N/A
           Client: Shell (zsh 5.1.1) inxi: 2.2.35
[close]

Anyway, gotta love Linux. The old girl lives to fight another day  8)


Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25491
  • Karma: 2807
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Yeah running hwe-edge 4.13 kernel at the moment probably isn't wise.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5260
  • Karma: 942
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
Theoretically, the issue was fixed in Kernel Version 4.13.0-21

Of course, I had 4.13.0.19 sitting there, like a ticking time bomb ... 

Maybe I should file a bug for all the DFI LanParty PRO875B rev B1  (2004) users out there. LoL!  :D

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1823
  • Karma: 250
    • View Profile
Good to know that!! Totally unaware of this, I've actually moved my daughter's system over to 4.13.0-21 yesterday

Skickat från min SM-G900F via Tapatalk


Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5260
  • Karma: 942
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
Good to know that!! Totally unaware of this, I've actually moved my daughter's system over to 4.13.0-21 yesterday

Confirmation ...  ;)


Spoiler (click here to view / hide)
** Description changed:

  Description: An update to linux kernel on Ubuntu 17.10 that enabled the
  intel-spi-* drivers made Insyde BIOS unusable. Main issues were Settings
  being not stored, USB Boot impossible and EFI entries read-only.
 
  Fix: The issue was fixed in Kernel Version 4.13.0-21. But previous
  affected machines still suffered from a broken BIOS.
 
  Repair: Boot Linux and Install Kernel Version 4.14.9. Reboot into Linux
  and BIOS should be restored to a working state.
 
  ---
 
  Test Case: Fix has been verified by our HWE team on affected hardware.
 
  Regression Potential: Minimal, it's unlikely anyone is actually doing
  anything which requires this driver.
 
  ---

<SNIP>
[close]

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25491
  • Karma: 2807
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Oh that's cool .. 4.14.9 fixes already broken systems .. glad they found a fix :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1823
  • Karma: 250
    • View Profile
Yeah! That's cool...
Looked in Synaptic today, but 4.14 is not available. Guess if one needs it, it would have to be compiled from source

Skickat från min SM-G900F via Tapatalk


Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25491
  • Karma: 2807
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
I'm assuming you could manually download/install it precompiled from the Ubuntu Mainline Kernel PPA
http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.9/
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1823
  • Karma: 250
    • View Profile
Duh !!
Obviously...

Skickat från min SM-G900F via Tapatalk


Offline Slim.Fatz

  • Trusted User
  • Veteran
  • *****
  • Posts: 1755
  • Karma: 468
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Hi pin,

Yes, what PCNetSpec suggested works fine -- at least on the machines on which I have tried this.

Regards,

-- Slim
"Life first -- Peppermint a close 2nd!" -- Zeb

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline zebedeeboss

  • Global Moderator
  • Hero
  • *****
  • Posts: 3035
  • Karma: 562
  • Life first... Peppermint a close 2nd :)
    • View Profile
  • Peppermint version(s): P10 / P9 Respin
I'm assuming you could manually download/install it precompiled from the Ubuntu Mainline Kernel PPA
http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.9/
Hi All

but before doing so I assume you have to unload current proprietary drivers - reboot to nouveau - load the new kernel - reboot and then re-install proprietary drivers assuming all is working well...

Regards Zeb...
Be Kind Whenever Possible...   It is Always Possible - Dalai Lama

Linux User #565092
P10 x64 Desktop - AMD Threadripper 2950X - 64Gb RAM - NVIDIA RTX2080Ti 11Gb - 2 x 27" 4k 3840x2160 - 1 x 34" 5120x2160
P9/10 @ P9 x64 Laptop - i7-7700HQ @ 2.80GHz - 8Gb RAM - Nvidia GTX1050 4Gb - 15.6" HD 1920x1080

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25491
  • Karma: 2807
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Yes Zeb that would be advisable.

That said, there no need to do this in Peppermint unless you've switched to the hwe-edge kernel track or have manually installed the 4.13 kernel some other way .. our default kernel is not affected.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec