3 ms·
Tell HN: I have found a hardware heisenbug in my laptop
I use a Lenovo x220 and this is one of the most loved laptops among the IT crowd. Sometimes I opened it after 1 hour of travel and found 0% of battery. Today I realized why it happens so.
My configuration is pretty default for Debian: when the lid is closed, the system sleeps, and when the lid is opened the system unsleeps. But if the lid opens and quickly closes due to vibration the system unsleeps and keeps working. If something heavy is running, the battery drains quickly. If you think that nothing heavier than an e-book is running then check your open e-books for any epub files opened. Atril the default viewer uses WebKit for rendering epub which means absurdly heavy CPU load which was my case.
What about the bug with the lid, it is unfixable on a program level. That reed switch is controlled by BIOS, and when the open-lid signal is received, the BIOS thing is going to be busy for several seconds doing some work to get the system unsleep. Solving the problem using bash script with asking the reed every 5 seconds seems like worse than a problem. Since the bug is hardware-caused, the solution has to be hardware as well. Bigger laptops from this series have a lock to prevent this from happening but this device has extremely little room inside of it so I understand why this model doesn't have the lock. Now I tie my laptop with rubber to prevent it from opening while traveling.
Such a pity no mobile device vendor does anything to prevent battery-powered devices from extra charge-discharge cycles.
- benrow 4y agoWow, that's a frustrating bug, but good spot working it out. As you say, sounds like interrupts are disabled while the open/close signal is being handled. Makes you wonder how it's handled in other models? Something physical like the lock you mention. Or maybe something in logic - like a series of flip flops? - to store and forward sensor actuations. Hardware is fascinating but not when it goes wrong :-(
- simonblack 4y agoMy configuration for a lid close is to merely turn off the screen. I dislike 'sleeping'or 'hibernating' computers. If I'm not going to use a laptop for a while, I shut it down. I have a Lenovo P53 running Mint. From turn-on to login screen is just 15 seconds. Why waste good battery on hibernation/sleeping if it's not necessary.