Comment 9 for bug 1741409

Revision history for this message
Colin Ian King (colin-king) wrote :

I can reproduce this with 4.16-rc2, I've debugged this down to:

drivers/char/hpet.c, hpet_timer_set_irq():

        if (irq < HPET_MAX_IRQ) {
                spin_lock_irq(&hpet_lock);
                v = readl(&timer->hpet_config);
                v |= irq << Tn_INT_ROUTE_CNF_SHIFT;
                writel(v, &timer->hpet_config);

.. the writel to hpet_config causes the reboot.

How to reproduce this issue:

git clone git://kernel.ubuntu.com/cking/stress-ng
cd stress-ng
git revert 0124b250ec205ea3cd6d9d68fb96c03ac294d12f
make
sudo ./stress-ng --dev 1

.. wait a while and it will eventually get around to the /dev/hpet and opening this causes the hang.

The minimal reproducer is:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

int main(void)
{
 int fd;

 fd = open("/dev/hpet", O_RDONLY | O_NONBLOCK);
 if (fd > 0)
  close(fd);

 exit(0);
}

run this as root and it will cause the reboot.