[PATCH linux dev-4.10] drivers/hwmon/occ: Switch to non-blocking for occ reads
Jeremy Kerr
jk at ozlabs.org
Tue Sep 19 17:13:06 AEST 2017
Hi Eddie,
> It's possible for the sbefifo ops to hang entirely if the system goes
> down (checkstop, etc), meaning that the occ and occ-hwmon drivers may
> hang during remove().
How does this address that though? Your comment implies that a thread is
stuck in occ_drv_read, is that correct?
I see that you're now opening in non-blocking mode, but:
> - rc = occ_drv_read(client, (char *)resp, sizeof(*resp));
> - if (rc < 0)
> - goto err;
> + do {
> + rc = occ_drv_read(client, (char *)resp, sizeof(*resp));
> + if (rc != -EAGAIN)
> + break;
> +
> + set_current_state(TASK_INTERRUPTIBLE);
> + schedule_timeout(msecs_to_jiffies(OCC_CMD_INCOMPLETE_MS));
> + } while (!p9_sbe_occ->cancel);
- the only way that you hit the !p9_sbe_occ->cancel condition is if
we've run the ->remove callback, in which case we *definitely* shouldn't
have threads still referencing the device. There seems to be nothing
preventing p9_sbe_occ from being free()ed underneath you.
If this patch works, it suggests that there's either a
reference-counting issue, or a memory leak.
Regards,
Jeremy
More information about the openbmc
mailing list