Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1289250pxj; Fri, 4 Jun 2021 10:27:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0QeTjhlOXXsOFMJA8MBsoelh4FZhK0BBbdz+dLzZgxtcuhGU/dQSylFkJqXxtmMoDGIsG X-Received: by 2002:a17:906:5299:: with SMTP id c25mr5265995ejm.85.1622827624544; Fri, 04 Jun 2021 10:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622827624; cv=none; d=google.com; s=arc-20160816; b=JD8QP3zrFpTZBRj+bSRkbMvm34S8zRc+qGeK3OEsxbzhcAQ8Guxvy6iJEhGb9lGwF3 sUqRdqZDVKDrpKHsLHo4o8SCyi8AZbaMKLNLwSmYqG2FtqjGMjywF2o4MVEZlcxDgMGc p+VEngX/C7Pc+Snr0Yb8FusLt4PMTWn8TR8dHUafUemImW+mBN8dWQ/5iD79lb93FUVZ 5W+JZ7+q0DkEDtHuCQDwgrombVIGBPtWl1jHuzia4f5Ykfg1BLVxhGzY3HoivUJ174Qh 3jC9Z4GnbkKi4zqgPR9THAEukFlFsbHikQacoGVFsIH8Y7zMJetEuHZQB/aY444t1BAy Ma+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=UM6thj+r1jZWEbBe+0CxIb3CcoS41Q6jOxhUX3Zbb6w=; b=kpbQV6swwc1RUewi5bg9hFiypl1KLwm0/BYahXOyZH670Q5ht1GzjIUjeB3p/BZFGr mpoQLpNrJKj6KqTSE18F8vLUOGxlFpHfyOap7lmAuvR4cR9eP7Z2dUVBG4UoD7nMF27u FEnqJjUfm/tQZIXMKwlzDTEhznZdwQ0GTqasPJH5GmkNr9/uEWmCiorB1PNl+zEPiX1b efldWfbQRsXkR2X70liXd2p3UhEXIEAnc3D6iWWSybLAeAhWQWHmWK7d3b36mgFtXIlJ i3Pvr0dF1SsUfsSc1pWqMUre7BtuYN2/98r8ikC9s+gRBpm7Az+Jhmu5x4f0fTIaZuCY R8NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eNOpONJy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l22si4875793edw.387.2021.06.04.10.26.41; Fri, 04 Jun 2021 10:27:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eNOpONJy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbhFDR1O (ORCPT + 99 others); Fri, 4 Jun 2021 13:27:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:53936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbhFDR1N (ORCPT ); Fri, 4 Jun 2021 13:27:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E9F9613F8; Fri, 4 Jun 2021 17:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622827527; bh=Ge2xUBkqY1RmkZ+sBVqn1MFf14FqwyBIugyJ21jW0YY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eNOpONJyOx9rKm+0Fd6iJwylBCekLtIePB+5aKBrUCVRWJlJMg5Wv8x40sTL2U3X8 bacplF6WoZS70B9O/Uu6JO7afNQq+wiX0oHYusDaCuRU9wT4ObVXblq47EwkPPV73d XrgLiMLIMadgPla7OMiPolSTZqTq806bRqIjuXm1ZRuCjomNTCXCdIA6unqJ/B3Q+A fNT0LIXSb6eBCX8cW3yRwPG28QJxrvKr8T2wIDqyqW1jITezGO7s0/71DCZSepelSS k9vURd4h3rXUETk7zFtSkjo7IAIVqOtfPb7kk2nVIRNwjn0VjHwnFDK7L7WX2IZ2Jk Qw/ty5qucMz+Q== Date: Fri, 4 Jun 2021 18:25:15 +0100 From: Mark Brown To: Sander Vanheule Cc: Andrew Lunn , Greg Kroah-Hartman , "Rafael J . Wysocki" , Andy Shevchenko , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/2] Clause-22/Clause-45 MDIO regmap support Message-ID: <20210604172515.GG4045@sirena.org.uk> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0z5c7mBtSy1wdr4F" Content-Disposition: inline In-Reply-To: X-Cookie: There is a fly on your nose. User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0z5c7mBtSy1wdr4F Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 03, 2021 at 08:25:08PM +0200, Sander Vanheule wrote: > 1. I've opted to just ignore any bits that lie beyond the allowed address > width. Would it be cleaner to raise an error instead? It doesn't *really* matter, enforcement is probably a bit better as it might catch bugs. > 2. Packing of the clause-45 register addresses (16 bit) and adressed device > type (5 bit) is the same as in the mdio subsystem, resulting in a 21 bit > address. Is this an appropriate way to pack this information into one > address for the regmap interface? Either that or pass the type in when instantiating the regmap (it sounds like it should be the same for all registers on the device?). > The reasoning behind (1) is to allow the regmap user to use extra bits > as a way to virtually extend the address space. Note that this actually > results in aliasing. This can be useful if the data read from to a > register doesn't have the same meaning as the data written to it > (e.g. GPIO pin input and output data). An alternative solution to this > would be some concept of "aliased registers" in regmap -- like volatile or > precious registers. I think these registers are in practice going to either need to be volatile (how most of them work at the minute) or otherwise handled in regmap (eg, the page support we've got). Having two different names for the same register feels like it's asking for bugs if any of the higher level functions of regmap get used. --0z5c7mBtSy1wdr4F Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmC6YfoACgkQJNaLcl1U h9BM/gf/TAz/WHlHWY9nNa8nT1K/6WBUU8bmREMGRvZV6m4tNBSs+HJ4v5K7eTxj PUtztJvTbZLktgDltlA3tzECyTWG4HAwxtv3LTcTLbgGoK5aHo8oneSQOViXP6Nq lrY757bQaqfvLX3LlVRB/Y5Is0I8v6nKcJow027m5FEqIJaH20h1FC92dHpRHbGt KbAF8YcAfh1xc1PDNq4dpLs7CtbU0Yqw81e4y31Urmfn7PYCWnSYYMZ8U3Zl194H RbZigaAPbs2ZDt9itzxoNIGTpPfFfeMoZdi2Y5zXnQjkJVc6qJqpj2mAn07FUtHa Hw17KSw2W+hSF2OGVrRGIpxO/Q0B0A== =m3n3 -----END PGP SIGNATURE----- --0z5c7mBtSy1wdr4F--