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=-0.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 E86B5C433E0 for ; Tue, 2 Jun 2020 15:46:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B2ABE20757 for ; Tue, 2 Jun 2020 15:46: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="H4DahYTF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fYWMOkvO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2ABE20757 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+infradead-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=bombadil.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=9yyPi3kmjpOJRJdJdq6cEs8KG3PQqqHKAbEYW0uCAxI=; b=H4DahYTFExmcofvtHde5yNJsf Q/PO5quBYbjE/Q0N/yXM/hDRZhlIsllPAqroBWGJpwhWoRw+7DwILtmIuxDZQwcsguhMzFXIKHVEj IjPxTGtyYG7slWLJz+UGNE6PHksTauCRaN0mStTtQTMa2B7P+R/Ta+G9OsiZTod8GArKb3fYMMBBQ 4M2U0SlGG6P4M4ADODl0yhv5WcLezccU2mhGOCwn9+B0t1PSmFB5lIQsxi9LiOkGNOHWtbZVkokgm 2yxzX5sY7FmidjLZvjflQikFvPnwbtuyY8oJWFowG+mQ5jvTHjP/NwpqFMrBolycnp7vZ1MUMPc8u R/Wop7Hpg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jg97n-0003p6-Ci; Tue, 02 Jun 2020 15:46:47 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jg97k-0003oF-1e for linux-arm-kernel@lists.infradead.org; Tue, 02 Jun 2020 15:46:45 +0000 Received: by mail-qv1-xf43.google.com with SMTP id p15so1978277qvr.9 for ; Tue, 02 Jun 2020 08:46:41 -0700 (PDT) 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=qzSEuCpyscmKEcqXp1a7EbLdA2hmWwk/OzqJUNtkEjE=; b=fYWMOkvOHbZel3XZmvxrN5Glw2gpYA1wRb8wfd7mkJlG3OO0PQYyYtwAdyUDVHSWRX GuvfsCuJyJ80lxs3We0lAJYHzMLQ4PyU8imyQvB53L2EYY9r72CEyoFZ2WTo0HwkmzDd 787UFM7zLfmhgQYYEu0CXW6prlVh0RrDsh9Dos4pF8AoypQb7dBUjIfNRrOj6fJZDtOL nwQfGSlGsl9YIO7RDBK8kVLGIGXNurmcRQImUI2D7DNYeTwfZKRzPpXkxI168UwrGddt j+Qybk/9l7xHzO8zYtMuZLrrdGgWKxiE7cm66AKK8FHw3hWPVmyNJqa1GQDOKpyzIGwo 5pYg== 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=qzSEuCpyscmKEcqXp1a7EbLdA2hmWwk/OzqJUNtkEjE=; b=fuui5euoeMARZ8WleDYGgYKT6rmO2qyri5C1a2qFkAp3aVNi+D0jesy4qiIei8q1HE iNuhpL8469c+UwR/eIALw9F9WfCXWE1dkSNzw1c0jyfTFm9B2prqDoUgsP8gPcNk7bZ+ SmmL8KqUqhcI9nOXyMFUidAs8EEBECwdeRF96/lzg95EynvW/hvAyl7Nuo6CBcqqBaG4 4UAk9/xGeHIXEngaVlk1eLZk+UXqpVxsoLI91Tu9kM90FoSxSgSQ2rsoGeX/SjemfkQr SNn3T781ynLMqA4SsOpEzcww1c26kdIb0/6i0I5lD+6IsP3vsyYfSX/mt1+RnWSqE3SV hmIA== X-Gm-Message-State: AOAM530mFtbAZ3Wkb9K9/rrXDxxPwAB26raLpzRGT/hIvv2adOrMZ7jZ N/9n0FccW09HNTvdIDWljOw= X-Google-Smtp-Source: ABdhPJw7LGOlr2xz60gu8um0AANDyr0R16BDgMgY1Hm2PlzxLQfK3UQtshToBzP2YwPv56kOjyJaSA== X-Received: by 2002:ad4:4b25:: with SMTP id s5mr11431931qvw.212.1591112801117; Tue, 02 Jun 2020 08:46:41 -0700 (PDT) Received: from shinobu (072-189-064-225.res.spectrum.com. [72.189.64.225]) by smtp.gmail.com with ESMTPSA id w94sm2899533qte.19.2020.06.02.08.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:40 -0700 (PDT) Date: Tue, 2 Jun 2020 11:46:26 -0400 From: William Breathitt Gray To: David Lechner Subject: Re: [PATCH v2 0/4] Introduce the Counter character device interface Message-ID: <20200602154626.GA5082@shinobu> References: <20200524172542.31ff6ac7@archlinux> <20200524175439.GA14300@shinobu> <20200531161813.658ffdfb@archlinux> <20200531171351.GA10597@shinobu> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200602_084644_106491_500D716D X-CRM114-Status: GOOD ( 14.17 ) 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, alexandre.torgue@st.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, fabrice.gasnier@st.com, syednwaris@gmail.com, linux-stm32@st-md-mailman.stormreply.com, Jonathan Cameron Content-Type: multipart/mixed; boundary="===============4325199289188018728==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4325199289188018728== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 02, 2020 at 10:18:07AM -0500, David Lechner wrote: > On 5/31/20 12:14 PM, William Breathitt Gray wrote: > > Yielding the following /dev/counter0 memory layout: > >=20 > > +------------+-----------------+------------+-------------------+ > > | Byte 0 | Byte 1 - Byte 8 | Byte 9 | Byte 10 - Byte 17 | > > +------------+-----------------+------------+-------------------+ > > | Boundary 0 | Count 0 | Boundary 1 | Count 1 | > > +------------+-----------------+------------+-------------------+ >=20 > A potential pitfall with this sort of packing is that some platforms > do not support unaligned access, so data would have to be "unpacked" > before it could be used. Since the user defines the format of this data, they could reorganize it to a more streamline alignment; for example: # echo "C0 C1 C0E0 C1E0" > counter0/chrdev_format Yielding the following /dev/counter0 memory layout instead: +-----------------+------------------+------------+------------+ | Byte 0 - Byte 7 | Byte 8 - Byte 15 | Byte 16 | Byte 17 | +-----------------+------------------+------------+------------+ | Count 0 | Count 1 | Boundary 0 | Boundary 1 | +-----------------+------------------+------------+------------+ In the future, we could also define a padding argument to give users more control over the exact offsets: # echo "C0E0 P7 C0 C1E0 P7 C1" > counter0/chrdev_format Yielding the following /dev/counter0 memory layout instead: +------------+-----------------+------------------+------------+ | Byte 0 | Byte 1 - Byte 7 | Byte 8 - Byte 15 | Byte 16 | +------------+-----------------+------------------+------------+ | Boundary 0 | Padding | Count 0 | Boundary 1 | +------------+-----------------+------------------+------------+ +-------------------+-------------------+ | Byte 17 - Byte 23 | Byte 24 - Byte 31 | +-------------------+-------------------+ | Padding | Count 1 | +-------------------+-------------------+ I not sure it's best to introduce padding support with this patchset given how much is already changing, but I don't anticipate packing alignment to be something difficult to support in the future with this interface. William Breathitt Gray --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAl7WdDsACgkQhvpINdm7 VJLCEhAArR5Z9rXla2JfgRiAGmqDThaapfbMiWbFcBbq6mdhn4a4+7+xcqkJIC+L kBzFsq8MLeKihP8osMCt2Oct25/39Ica1qQEa0CsrzQ8xA2hM1+6oKBeOICpbd9r HbPi2UlQajM63wey38/tJM3Nqwtz1ADdyNjXSHDXsUQTsx9GaB2pYD9qE1CkTGbU 9KDLIF7lX6olggVMKe9eyZY5MfsyeNVlGaMG/xZtaCehGCFDk9011mF5zVHrV9ya 79X5Gqm19BXFvnoEh2qbFkOMxUirIGEDZszdZtwMHKofYziL4QLAoSfEHrS/8GCL 8/SMpjuPi9WIMRA70htNgdsKEKsykx8d6rV8eASLIVqX8OrF4lfpTg7caWLWfVSM 2eRxRoyWICYfUPO5SMKKQoj+sBZxaM0GtgJecbt5Z5glRbYxODzkBHufffioIBU8 eNyA7mgtYi3ElWeQL2sxOV2UNHDwLzrouB2TBOM2ycNY7Mfo37tqt2MO7YdoGMi3 deUo9zeAgxbLyIx8YlDeQ1CdrSzAPpl3pPmkZG8zGf553Dyyww8AE+b87fyMcMkC gAx+JnFU4ujy9DRE9mlcavropCZt4BLCtOs7EW7JqqUDXxoCcSnKugOmbWwEA18q gcEbKztvUIOAelXICTgen8AqPt0nvI9R0/cF876yspBg/sw5e/I= =Uj3v -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe-- --===============4325199289188018728== 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 --===============4325199289188018728==--