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 X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB422C433DB for ; Fri, 25 Dec 2020 17:32:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 854A1221FE for ; Fri, 25 Dec 2020 17:32:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 854A1221FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FdgofhM0kZoJixpH3vW04cTYu19dNSorGdzDjb5ctaE=; b=MECFN6b8Lpecql4Ac6YPvbE8o /AMcPzW3GIdtY4gjU2pMUjaRzcSLuQf7GmKDiSjpZc83FbDbNzIRILi/Zy2r3E/w7efqVJ4jWRly3 OfHVa/7y9DQAxslCoaoVlJNZEsj1RXNqQwrNRsUGhlkSal0mmdGuimfVe61na3mj6SDVuM0e81PV8 z8LME0EPcvh+Wu+YHZjYtx//1vfdt3of7/csZDxKUFDieHQHB1AwrjcBVwpCEPeydCeZ9ycp+J/6x Jy3hVv12k4t5C1eSyozy/QrioZPPvZipS72AkNBz8pVYvydWvuwn/Lh9fTPIH6rCe/yEvOvvu9gpq oFQcznSSA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksqux-0004gr-Uw; Fri, 25 Dec 2020 17:30:19 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksqur-0004gN-MW for linux-arm-kernel@lists.infradead.org; Fri, 25 Dec 2020 17:30:14 +0000 Received: by mail-qk1-x736.google.com with SMTP id b64so4291508qkc.12 for ; Fri, 25 Dec 2020 09:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6tNoeU4rdX0Rp7YesclVSlEoPPasvtmAb8rPCs2D1UA=; b=IIbk73+3Kn9m25AbiWeCyLcszXZliqbmEyDL1AOj0RVNhCQYa3sLxEQIqXZBW3Ypic DQ4wzgFr5B4rLcyjNdl29h0/7/ozhfpbDAocjKdrhtE2hO6WAEXbSpgu+JcR17vgO+sa rQhPpLky45RnexFX4O4NU7kW+Yu2yJBXHMJcLcGRrcFkuwEcTYEHk2G13VPL9sSen70j hSb/9en/J29uqP5MdAdokGjqlxKm4Dhuhv3vLtTcgjZkJhyIDqdlvQ02S5HhEn9hMPGO zktoLKSE4Re4ZHtqIBCUPKVtxs9/k+iyh7tTUzAe1vd+nBFPIspR9ejhvtS0sF/nfH/X gVbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6tNoeU4rdX0Rp7YesclVSlEoPPasvtmAb8rPCs2D1UA=; b=dSbdfFNyymN/3caoTg7zpTc7CySuBKh1Ctdai9jICSm/M/n7WQm2sjqgGz+UjsBluN PA3Verm35Wl9RjpuQfdCvw3cMir++3MOneuSoRT6l2w4swfhvGwmNzDk766pUletBI8O ZGOOQQAdoUeU3DjO8dV49vrM/nH4ajpN7GE7/wLUh2xVMsgOSlQlgwPNWSTew0yJN9ki JrUiaFtvxrPg3FVxNap5KAF1s0Vb1AOD4XWWucV3nVAAsqamHVCSmUaaIEf4h2Bg//+l au7j6Mj3jWhuE0hYuacAiBxc1XcRyhpJX+XgcmLhmtUYWH/76foWDeShO5BFdALpQMY/ bQgQ== X-Gm-Message-State: AOAM531HgJqNCMTQ2NNgTIZDgFiQvc1v+Laexo9Ie3tJphGQdyD+Xsqm jIQHgpE5Zk/mK/u9bAsHqvU= X-Google-Smtp-Source: ABdhPJw0R+1fIgZCorc4miRt0cUFZr5DYuK5D7K1Bsb8++9DlhiEtxJFg2kyayH/6OeJ0qRyV9381w== X-Received: by 2002:a37:a796:: with SMTP id q144mr35953703qke.38.1608917407683; Fri, 25 Dec 2020 09:30:07 -0800 (PST) Received: from shinobu (072-189-064-225.res.spectrum.com. [72.189.64.225]) by smtp.gmail.com with ESMTPSA id p34sm15771442qtd.62.2020.12.25.09.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Dec 2020 09:30:06 -0800 (PST) Date: Fri, 25 Dec 2020 12:30:04 -0500 From: William Breathitt Gray To: David Lechner Subject: Re: [PATCH v6 3/5] counter: Add character device interface Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201225_123013_783406_97117F54 X-CRM114-Status: GOOD ( 21.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kamel.bouhara@bootlin.com, gwendal@chromium.org, a.fatoum@pengutronix.de, mcoquelin.stm32@gmail.com, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, alexandre.belloni@bootlin.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, Dan Carpenter , fabrice.gasnier@st.com, syednwaris@gmail.com, linux-stm32@st-md-mailman.stormreply.com, jic23@kernel.org, alexandre.torgue@st.com Content-Type: multipart/mixed; boundary="===============7914776292546539467==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7914776292546539467== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Bi9bW/svyG+8ZjzL" Content-Disposition: inline --Bi9bW/svyG+8ZjzL Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi David, I agree with your suggested changes -- just a couple select comments following below. On Sun, Dec 13, 2020 at 05:58:26PM -0600, David Lechner wrote: > > +static int counter_add_watch(struct counter_device *const counter, > > + const unsigned long arg) > > +{ [...] > > + > > +dummy_component: > > + comp_node.component =3D watch.component; >=20 >=20 > In my experiments, I added a events_validate driver callback here to > validate each event as it is added. This way the user can know exactly > which event caused the problem rather than waiting for the event_config > callback. Yes, this is a good idea and I have use for this in the 104-quad-8 driver as well. I'm going to name this "watch_validate" however, because I need to validate the requested channel as well as the requested event here (both part of the struct counter_watch). > > diff --git a/include/linux/counter.h b/include/linux/counter.h > > index 3f3f8ba6c1b4..98cd7c035968 100644 > > --- a/include/linux/counter.h >=20 >=20 > >=20 > > +/** > > + * struct counter_event_node - Counter Event node > > + * @l: list of current watching Counter events > > + * @event: event that triggers > > + * @channel: event channel > > + * @comp_list: list of components to watch when event triggers > > + */ > > +struct counter_event_node { > > + struct list_head l; > > + u8 event; > > + u8 channel; > > + struct list_head comp_list; > > +}; > > + >=20 >=20 > Unless this is needed outside of the drivers/counter/ directory, I > would suggest putting it in drivers/counter/counter-chrdev.h instead > of include/linux/counter.h. The "events_list" member of the struct counter_device is a list of struct counter_event_node. The events_configure() callback should parse through this list to determine the current events configuration request. As such, driver authors will need this structure available via include/linux/counter.h so they can parse "events_list". William Breathitt Gray --Bi9bW/svyG+8ZjzL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAl/mIZwACgkQhvpINdm7 VJIZxxAAhAKczPADq8u05OkOAmgVD7IeT9cUBIB/XnT0VVSVX46G473g78mZwlsx qnfK1l4uDvwjAY+YFFKanUztxg/j60BzJOt9BK4NqWR4ic7J0FPj9i4YgN9J+9oo JmFSjqT8Abo7rEdB426yT9Fof9cBU/oPdOpNSufDNidrxXnTIOKnjA9odG/vgOzl mlXTQHs2glKeLrHIvJOnK7mwy3l11Ew2xhRvBEsMfbzXIYoOkVC8Ax146tHpqBVl hN/vCEU49+JCbZrSOk9EmtjRZ7DiF8AoV7GFUjqGWxkECKx1ov2WeR62DFhUJMvI qC/boNu0BZW2N8HgIvgsgKP0r/v0E+RuRFzcahpS/0YhsNh8fgEVfeIWS2ZaVXWT 7e4FZIOw4Vuk0E2DXw0rWRzvNCCstRsqY9fQ7ee1/WruCHRvZEeiifJADx7E7LBv XwQynYXOgFe1hxXFejwSTgTCMl5y25CaT8JVU8GLYgHYnPKkIVSsOJ5dUgTbRCOu RBbMgZbcBuB1tUy45SP6Rx8in4joA+AGAt6oj4kxrd+/+O2+uvUoNILqoYHAMyV6 EBP78O/sAHNObYnwVJNaM1Bc1VYIF7+pMjotOTtHmkZhs5Ac8qxXih4r+mIZgItu yGeJ9cG82fkziDp+TtNuYXsfLQQhxtdicKmAqzZeg5VSyGQWkQY= =vH3L -----END PGP SIGNATURE----- --Bi9bW/svyG+8ZjzL-- --===============7914776292546539467== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7914776292546539467==--