From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754663AbcHSLDp (ORCPT ); Fri, 19 Aug 2016 07:03:45 -0400 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:52756 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754338AbcHSLDi (ORCPT ); Fri, 19 Aug 2016 07:03:38 -0400 Date: Fri, 19 Aug 2016 12:03:05 +0100 From: One Thousand Gnomes To: Sebastian Reichel Cc: Rob Herring , Greg Kroah-Hartman , Marcel Holtmann , Jiri Slaby , Pavel Machek , Peter Hurley , NeilBrown , "Dr . H . Nikolaus Schaller" , Arnd Bergmann , Linus Walleij , "open list:BLUETOOTH DRIVERS" , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH 0/3] UART slave device bus Message-ID: <20160819120305.4a3b1b54@lxorguk.ukuu.org.uk> In-Reply-To: <20160819052125.ze5zilppwoe3f2lx@earth> References: <20160818011445.22726-1-robh@kernel.org> <20160818202900.hyvm4hfxedifuefn@earth> <20160819052125.ze5zilppwoe3f2lx@earth> Organization: Intel Corporation X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I meant "Either some function similar to userspace's poll() is > needed, ...". Something like uart_dev_wait_for_rx() You can't really do that - it might never return and then how do you want to handle timeouts and cleanups > Alternatively the rx function could be a callback, that > is called when there is new data. That's what the existing API gives you as an ldisc, it can't be immediate in many cases however but must be buffered. > > I'm assuming the only immediate consumers are in-kernel. > > Yes, but the driver should be notified about incoming data. Alan From mboxrd@z Thu Jan 1 00:00:00 1970 From: One Thousand Gnomes Subject: Re: [RFC PATCH 0/3] UART slave device bus Date: Fri, 19 Aug 2016 12:03:05 +0100 Message-ID: <20160819120305.4a3b1b54@lxorguk.ukuu.org.uk> References: <20160818011445.22726-1-robh@kernel.org> <20160818202900.hyvm4hfxedifuefn@earth> <20160819052125.ze5zilppwoe3f2lx@earth> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160819052125.ze5zilppwoe3f2lx@earth> Sender: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sebastian Reichel Cc: Rob Herring , Greg Kroah-Hartman , Marcel Holtmann , Jiri Slaby , Pavel Machek , Peter Hurley , NeilBrown , "Dr . H . Nikolaus Schaller" , Arnd Bergmann , Linus Walleij , "open list:BLUETOOTH DRIVERS" , "linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-serial@vger.kernel.org > I meant "Either some function similar to userspace's poll() is > needed, ...". Something like uart_dev_wait_for_rx() You can't really do that - it might never return and then how do you want to handle timeouts and cleanups > Alternatively the rx function could be a callback, that > is called when there is new data. That's what the existing API gives you as an ldisc, it can't be immediate in many cases however but must be buffered. > > I'm assuming the only immediate consumers are in-kernel. > > Yes, but the driver should be notified about incoming data. Alan