On 01/10/2017 01:34 PM, Mark Brown wrote: > On Sat, Dec 17, 2016 at 11:16:17PM +0100, Hauke Mehrtens wrote: >> On 12/14/2016 04:21 PM, Mark Brown wrote: > >>> Why not just have your interrupt handler schedule something on a >>> workqueue to check whatever it is needs checking here? > >> 2. When something went wrong and I got an error IRQ for example, I would >> like to add this information to the spi message that was transfered, but >> the only way I see it to not wake the completion and let it run into a >> timeout. > > Just set an error status in the message and then complete the current > transfer or the message. > >> I would like to have a function in which I can do some busy waiting till >> the last word is really written to the wire and also return if the >> transfer was successful or what error occurred. > > The busy waiting really is pretty specialist. What should I do now? I can add the transfer status in some other way, no problem, but how do I tell Linux that the transfer finished when it really finished. I also tried to just ignore the last word, but when the controller is configured for the next transfer, the old one gets corrupted. There is a per transfered word IRQ, I can use that, but it is probably triggered very often and I do not know if it works in all situations and it has to get synced with the fifo IRQs which is probably complicated. I can also start my own driver thread to do the busy waiting and trigger the spi_finalize_current_transfer() later after busy waiting in the driver. I can also use transfer_one_message() I would prefer to add an additional busy waiting after the wait_for_completion_timeout() like I did in this patch, but how should this look like? Hauke -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html