Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752841AbdF2MEX (ORCPT ); Thu, 29 Jun 2017 08:04:23 -0400 Received: from zimbra.gr13.net ([46.4.151.110]:32026 "EHLO zimbra.gr13.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbdF2MEU (ORCPT ); Thu, 29 Jun 2017 08:04:20 -0400 To: linux-kernel@vger.kernel.org From: "Enrico Weigelt, metux IT consult" Subject: Best practise for a polling device driver ? Message-ID: Date: Thu, 29 Jun 2017 12:04:14 +0000 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 653 Lines: 20 Hi folks, I'm currently writing a driver for an (pseudo-)serial device (actually, a bunch of HW fifo's, which look like serial controllers to the host), which only supports polling, no interrupts. So far, I'm just using a kthread in a loop, but that would have to run w/ high priority sleep very short (needs to transfer several MB/s on a am33xx), so probably not a good idea. Another option could be using timers for just looking at the status registers and issue sw interrupts, which are then handled just like the w/ the usual interrupt-driven serial ports (IOW: mimic an interrupt controller). What do you folks thinkt about that ? thx. --mtx