title: How do I periodically call a function in the non-interrupt context?
body: <p>In the Linux kernel, I need to periodically check the state of the switch chip by calling the <code>mdiobus_read()</code> (drivers/net/phy/mdio_bus.c).</p>
  
  <p>I tried to use Linux timer <code>add_timer()</code> but I found out that the callback is called in the interrupt context. Actually, there is a warning in the comment to the function <code>mdiobus_read()</code>:</p>
  
  <blockquote>
    <p>NOTE: MUST NOT be called from interrupt context,
    because the bus read/write functions may wait for an interrupt
    to conclude the operation.</p>
  </blockquote>
  
  <p>So, how to periodically call the function <code>mdiobus_read()</code>?</p>