From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756257AbeAHMIF (ORCPT + 1 other); Mon, 8 Jan 2018 07:08:05 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:58992 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644AbeAHMIE (ORCPT ); Mon, 8 Jan 2018 07:08:04 -0500 Date: Mon, 8 Jan 2018 12:08:01 +0000 From: Mark Brown To: "Andrew F. Davis" Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] regcache: flat: Add valid bit to this cache type Message-ID: <20180108120801.GD11698@sirena.org.uk> References: <20180107232234.11064-1-afd@ti.com> <20180107232234.11064-3-afd@ti.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OaZoDhBhXzo6bW1J" Content-Disposition: inline In-Reply-To: <20180107232234.11064-3-afd@ti.com> X-Cookie: We are what we are. User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: --OaZoDhBhXzo6bW1J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 07, 2018 at 05:22:34PM -0600, Andrew F. Davis wrote: > Other regmap cache types (LZO, RBtree) report back un-successful register > lookups when a value has not been previously written into the cache. This > allows regmap core to perform a real un-cached lookup to fetch the value. > The Flat type cache does not and so all read succeed reporting zero for t= he > registers value, even when the actual value is not known. > We fix this by changing the flat cache element type to a struct > containing both the register's value and a bool signifying if this value > is an actual cached value or not. This also opens up a path to implement > additional regcache_ops such as "sync" and "drop" that rely on such > validity information. The reason we don't do this for the flat cache is that its whole purpose is to be as fast as possible in order to make it easier for MMIO devices. = =20 Things that can take the hit of extra complexity should just use a rbtree cache since if the registers are all bunched together it rapidly becomes effectively the same data structure anyway. Unless you really know why you're using a flat cache you probably shouldn't. --OaZoDhBhXzo6bW1J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlpTXyAACgkQJNaLcl1U h9C7Gwf/fJJS+EXV27wxkuHhHd+8wDCVrcPHx9lbJgINZl+lTe1j2zyidpUcLx3X O/dW2LjDzPokk+Y04PffqiwhqDZVTzd96JZMyWSR9u08Q5CxteH6/RfDS2BlnvvQ EnVbgDa1JCg6eslUDdYyot3dbvH8HAnSUi1WydYVO6L/Y6b+HblkbNP9BjLlw+H6 hWijj+9Svhh9FC9LAJPsk50VHD0HsA7f0OAeek+gcpXK0ZPp9OzylAZ0WlTv28ka YIsoRqOejMdLAJVJAxcWTSfvb++bO+L1Rv0zpkyDjxdLtg+1CXLpqRuTxkTwkHKw kyZk9ntcmxeYyz7lZXmr13cuyWvVKQ== =ajmK -----END PGP SIGNATURE----- --OaZoDhBhXzo6bW1J--