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.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 7301CC433E7 for ; Thu, 8 Oct 2020 08:10:48 +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 07FE92083B for ; Thu, 8 Oct 2020 08:10:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="o5MYOr/d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07FE92083B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz 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=ca6Is/UIrG92lFlwMoBCielOfhlmaY79PXpyvCMpv6k=; b=o5MYOr/d4NgLgpbMvlTAEAJ2u 0SkUyEbze2ArDR8p1pvCK8BSvet6ol4cPpHbLC+UaGL7ll3FBToBQ6IivZxZ5oXY31+kPF3cOk6bq jpoKqUnBZZEbkHWmhUWxEL5fw4sj7OckeDytJOgGQrlKSU3cB7+0jZXWGVffZdo7L8ERqvzUDXRIM hSKnj6GQZxsBuEy3XZGXGfNKPie9kLs7eFFV7tMULJ3ZnAiK/lb8R/azr99UkjhR0D9Ic+SPBSeYD LWTSVBTx7eG7FQ0PNDKGuzH0I0xrJkI13GdQ9JS9iMHH3xKAQfbMz0/XH0RHbFGbYFK/gBNso0PtO 0p5EO2bqQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQQzE-0002Qv-4X; Thu, 08 Oct 2020 08:09:16 +0000 Received: from jabberwock.ucw.cz ([46.255.230.98]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQQzB-0002QV-JR for linux-arm-kernel@lists.infradead.org; Thu, 08 Oct 2020 08:09:14 +0000 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 7D1C01C0BA3; Thu, 8 Oct 2020 10:09:11 +0200 (CEST) Date: Thu, 8 Oct 2020 10:09:09 +0200 From: Pavel Machek To: William Breathitt Gray Subject: Re: [PATCH v5 4/5] docs: counter: Document character device interface Message-ID: <20201008080909.GA31561@amd> References: <54190f9875b81b6aa5483a7710b084053a44abb8.1601170670.git.vilhelm.gray@gmail.com> MIME-Version: 1.0 In-Reply-To: <54190f9875b81b6aa5483a7710b084053a44abb8.1601170670.git.vilhelm.gray@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201008_040913_785706_58676715 X-CRM114-Status: GOOD ( 12.05 ) 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, david@lechnology.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, mcoquelin.stm32@gmail.com, syednwaris@gmail.com, linux-stm32@st-md-mailman.stormreply.com, jic23@kernel.org, alexandre.torgue@st.com Content-Type: multipart/mixed; boundary="===============0629395576773129840==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0629395576773129840== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > + int main(void) > + { > + struct pollfd pfd =3D { .events =3D POLLIN }; > + struct counter_event event_data[2]; > + > + pfd.fd =3D open("/dev/counter0", O_RDWR); > + > + ioctl(pfd.fd, COUNTER_SET_WATCH_IOCTL, watches); > + ioctl(pfd.fd, COUNTER_SET_WATCH_IOCTL, watches + 1); > + ioctl(pfd.fd, COUNTER_LOAD_WATCHES_IOCTL); > + > + for (;;) { > + poll(&pfd, 1, -1); Why do poll, when you are doing blocking read? > + read(pfd.fd, event_data, sizeof(event_data)); Does your new chrdev always guarantee returning complete buffer? If so, should it behave like that? Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl9+ySUACgkQMOfwapXb+vKILgCdGWcMSFTNlT8BzJiXCxl8XH94 G+kAn1mYy8F8mA++sLAit6PznfuXTwgX =pq8O -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP-- --===============0629395576773129840== 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 --===============0629395576773129840==--