From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56EB5C54744 for ; Tue, 27 Aug 2024 23:42:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:To:Cc:From:Subject: References:In-Reply-To:Content-Transfer-Encoding:MIME-Version:Content-Type: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=b48HefyftxFF0KPRlpa8f/obyyVAO1aYnJaovLJpqtE=; b=IpWgqOG2Vt9Dp4cFs190llJJMO MPYRZCaZuHmDB8y5euP+Vvth97bCcluJvy+45TvMpT7lx4H8gfZyloCa30lxZ/6EJe9nhQUm94I7V l654v7/uYyJPE5nQ+XJGCfOht7UFbQ4Ue3+PnQj90f+FAaqb1A/NIDNLNYM389+lPHvQB7k+kIhhs GwNoyDkY1pNnsECCPjjjRG9QMRvlBFGcVV6OrkmH7YCekVuzZ7tUp8qtdmQ4jllHvkGwsIAYgJqRP CWtOLXgeIXd1tqZOwLuMEtbRL2bVDbKLhQ7WPIk5xshTltLlOaDhrP7T2TFHMH3+lu+dedPrukKj+ 5vYnn4Fw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj5oq-0000000DA3l-0uj3; Tue, 27 Aug 2024 23:41:48 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj5o0-0000000D9vP-1fVj for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 23:40:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 77C8DA41F24; Tue, 27 Aug 2024 23:40:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF597C4AF48; Tue, 27 Aug 2024 23:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724802055; bh=uqrM2V2XUJLc4pgu/Aww4+b2GdKnuDt3PVEz7Sr5IpM=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=QzXIMASKT66GFa9TA9/DogHT9n4Q14c3Ln/9BGRg7+NKCqUBKgYfY0HH38bzgOvB4 etBHV3qp1B1wG0woKbGU8+dgboQCtVdt87nv1YrKxN7+/YpbEsteJ/xQ2U3ZlfwBlS O51ZidQ+codqrCbPFpYkgIMPRsLe7je+m2LQvlRKY39xl0XC5+UZ1zrbOqBAI+C8G8 97R6jSsV5IwI6p9uGCCpz/XBLDdEDf5iOX0Q88R/59lImai+6WMV+Ju3bOgbjt0dAv QpJ8uc7sTiAz8ShgLL9dxc6iFtj5GvRScQoGB9U5LiFJaX4mhef+iZjNxjLy0FeHsp gtoxy/DukxxJA== Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20240826123602.1872-1-hpausten@protonmail.com> <20240826123602.1872-8-hpausten@protonmail.com> <2024082655-cubicle-flashily-6ab3@gregkh> Subject: Re: [PATCH v3 7/9] uio: add Xilinx user clock monitor support From: Stephen Boyd Cc: Michael Turquette , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michal Simek , Shubhrajyoti Datta , Dave Ertman , Ira Weiny , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org To: Greg Kroah-Hartman , Harry Austen Date: Tue, 27 Aug 2024 16:40:52 -0700 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_164056_587991_D75F88CA X-CRM114-Status: GOOD ( 27.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Harry Austen (2024-08-27 12:08:52) > On Mon Aug 26, 2024 at 2:11 PM BST, Greg Kroah-Hartman wrote: > > On Mon, Aug 26, 2024 at 12:38:36PM +0000, Harry Austen wrote: > > > Xilinx clocking wizard IP core supports monitoring of up to four > > > optional user clock inputs, with a corresponding interrupt for > > > notification in change of clock state (stop, underrun, overrun or > > > glitch). Give userspace access to this monitor logic through use of t= he > > > UIO framework. > > > > > > Implemented as an auxiliary_driver to avoid introducing UIO dependency > > > to the main clock driver. > > > > > > Signed-off-by: Harry Austen > > > --- > > > drivers/uio/Kconfig | 8 ++++ > > > drivers/uio/Makefile | 1 + > > > drivers/uio/uio_xlnx_clk_mon.c | 71 ++++++++++++++++++++++++++++++++= ++ > > > 3 files changed, 80 insertions(+) > > > create mode 100644 drivers/uio/uio_xlnx_clk_mon.c > > > > > > diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig > > > index b060dcd7c6350..ca8a53de26a67 100644 > > > --- a/drivers/uio/Kconfig > > > +++ b/drivers/uio/Kconfig > > > @@ -164,4 +164,12 @@ config UIO_DFL > > > opae-sdk/tools/libopaeuio/ > > > > > > If you compile this as a module, it will be called uio_dfl. > > > + > > > +config UIO_XLNX_CLK_MON > > > + tristate "Xilinx user clock monitor support" > > > + depends on COMMON_CLK_XLNX_CLKWZRD > > > + help > > > + Userspace I/O interface to the user clock monitor logic within = the > > > + Xilinx Clocking Wizard IP core. > > > > Why do you want a UIO api for a clock device? What userspace code is > > going to access the hardware this way? Why not use the normal > > kernel/user apis instead? >=20 > I was just trying to provide userspace access to these _unexpected_ clock > status event indications (clock stopped, underrun, overrun or glitched) a= nd UIO Maybe unexpected events can be indicated through the EDAC subsystem, except that is usually about memory or cache errors, not device driver issues. > seemed like an easy way to do it and leave interrupt enablement and monit= oring > up to userspace. I'm not aware of any existing clock event notification > framework. Are you suggesting that such a generic event notification mech= anism > should be added to the clk subsystem? e.g. additional clk_ops callbacks e= tc.? >=20 I've been thinking of adding devcoredump support to clk drivers when they hit an error condition. The idea is it would be a coredump for the device register state when the clk driver detects an error. Maybe you can use devcoredump for this?