On Tue, 28 May 2024 22:21:10 -0700 Dan Williams <dan.j.williams@xxxxxxxxx> wrote: > > + > > + /* > > + * For the case where a NPEM command has not completed immediately, > > + * it is recommended that software not continuously “spin” on > > polling > > + * the status register, but rather poll under interrupt at a > > reduced > > + * rate; for example at 10 ms intervals. > > I think the use of read_poll_timeout() obviates the need for this > comment. I.e. read_poll_timeout() is self documenting. > This is not describing how read_poll_timeout works but why I need it at all. I don't think that there is and ever will be a controller that needs a time to complete the NPEM request. From my experience this is immediate action. This is explanation why I have to keep it this way even if it has almost no sense :) Mariusz > > + * > > + * PCIe r6.1 sec 6.28 "Implementation Note: Software Polling of > > NPEM > > + * Command Completed" > > + */ > > + ret = read_poll_timeout(npem_read_reg, ret_val, > > + ret_val || (cc_status & > > PCI_NPEM_STATUS_CC), > > + 10 * USEC_PER_MSEC, USEC_PER_SEC, false, > > npem, > > + PCI_NPEM_STATUS, &cc_status); > > + if (ret) > > + return ret_val;