Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2309397ybv; Mon, 24 Feb 2020 03:03:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzqxaAj3U7kiTEEkY9IhtGuArwNJsbIp+uwKmA67v0P7s21d/Bc6qFsv9v9qPYavqVW0h5o X-Received: by 2002:aca:cf94:: with SMTP id f142mr11817109oig.31.1582542230942; Mon, 24 Feb 2020 03:03:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582542230; cv=none; d=google.com; s=arc-20160816; b=MySIRwLJ/DlS629VOekz6zfFCrYAnAYcVGFECBR7K24Ue+u6ekaxvAZ7Bqtxlb96AI YcsFr4JmTiB7kicOTTJ9kB99XY2W4wLEziQAfUUL3CSP9JrXEJJ1ldr2OdbqapgrrMKH p2wCe7vwF4f62YS+b+Fzb+8G1dhNLzX81g5oor9jw/jIrKfNfeDxNJWo/QNgP5CV1Fvg H2fhHHZuEy9MnpfLnLT+2FzEHOb64Oxs6fuE1GWtPzkelVAwY/alfQUW0VZjD9/6A9Tn XgkWgnsflfMr+4tpTMmSgHaS2Owoeeu+4k7XkyL02I+GF8Na4TJcA42pQzopQhBVsgf/ 8YCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=xHt2MK1heAneZjk7lxOHA207z1mV+6niWv3tm6W4trM=; b=Wg1wmRgdPfIZNrw1yurQgQGrsxh34kEE8vyiNN1y+tmsrzoSj0uwY05KOabYGEwkLU Ny+X7dGhmrWlJxp4JbC3LqFBUBEHZYGOsNMSREUgVla0dCAzPf+3JsWMtWkhiL6RqGAF x6dgkHFUamvAvoxHWK6uzDNXFXhKu6mTjm5l/z4JqXk5j6QBXs/iBeJd8k0GmN6zv0lL +vvHGwM+vTcEpnPXRvVr3xGehxZsNDvp4W2+Kv6GbisCI/DgGD2b4vP/CLxfZd9EgGHY Y1LtNWd1Fk6aHcwSKr96MPPMdscuDiyZpwdaQw+c+1XbDurctr6K5YyQw8nhlE5KOwkS fR8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=oLgLtF9A; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=M6fHG36N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si6599344otk.234.2020.02.24.03.03.32; Mon, 24 Feb 2020 03:03:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=oLgLtF9A; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=M6fHG36N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727459AbgBXLCz (ORCPT + 99 others); Mon, 24 Feb 2020 06:02:55 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:48625 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726838AbgBXLCy (ORCPT ); Mon, 24 Feb 2020 06:02:54 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id C782F46F; Mon, 24 Feb 2020 06:02:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 24 Feb 2020 06:02:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=xHt2MK1heAneZjk7lxOHA207z1m V+6niWv3tm6W4trM=; b=oLgLtF9Af//57lWcVGNMlOihaz1k9FQCx+lIUsnnjQf XuLwscDFImI1pV3dttYo285rMu/FvYuFuZs6FcbZMZ41Ajxe0ZaXd11YM1Dv4xzR HyspdQnyE4KnGUlNBXHGPlm0rhVfZO3qLoS29RYcV/siui5UgAFe9iuJH2hPgIZc JmGK7VbeTWHTIgqq0ZqkHjqP/q0Kf/BnyXSu0fVj/K0BKRByJTljuRG2qhtyoqdP 0xRyeodSCVsshCMKRASEa6FheP4B7CCR6tdu4hVCUZN+/mwAsND79SZ7YFHj6Pap nVSs0Q6oRYtuAI5H1nZour18aCD0e1sAab1uqVVBjkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=xHt2MK 1heAneZjk7lxOHA207z1mV+6niWv3tm6W4trM=; b=M6fHG36NgdH8xdAdDANRO5 F1LkjzYHOossC9uRzvXexUPrRjreGhNVVj1ikQRFTUN0TlzIoflwTDwut0/k8nRq QgbITFTNV3W3yP2/mfGsykTkARfnRqEi5gW2Uq68OI4ZIg+DF24PjW8q/mlPMD9z v5g7MDRwFFD17fhrb28y2k89Yrk0T1MNRANtYwLyMMP/zpA2xQffh8mLwT1y5ec7 vH6lZmGM7HxevW2kzoJPZIRGK++KzpuJeHiYgdZ7hgboVDJfUXhB+MA+6LiqQLFF 4jssje7YzJi2vUCSf014B5Zsw1faGNPWm5Q3rRvPpgNSjKFpdxEhMHp2mL2IrZpg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrledtgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucfkphepledtrd ekledrieekrdejieenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 057D8328005E; Mon, 24 Feb 2020 06:02:49 -0500 (EST) Date: Mon, 24 Feb 2020 12:02:48 +0100 From: Maxime Ripard To: Ondrej Jirman Cc: linux-sunxi@googlegroups.com, Chen-Yu Tsai , Samuel Holland , Stephen Boyd , "moderated list:ARM/Allwinner sunXi SoC support" , open list Subject: Re: [PATCH v2] bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads Message-ID: <20200224110248.hpi3dhp3t7q56hmm@gilmour.lan> References: <20200221202728.1583768-1-megous@megous.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="srx47feia3nohrm4" Content-Disposition: inline In-Reply-To: <20200221202728.1583768-1-megous@megous.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --srx47feia3nohrm4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Feb 21, 2020 at 09:27:26PM +0100, Ondrej Jirman wrote: > When doing a 16-bit read that returns data in the MSB byte, the > RSB_DATA register will keep the MSB byte unchanged when doing > the following 8-bit read. sunxi_rsb_read() will then return > a result that contains high byte from 16-bit read mixed with > the 8-bit result. > > The consequence is that after this happens the PMIC's regmap will > look like this: (0x33 is the high byte from the 16-bit read) > > % cat /sys/kernel/debug/regmap/sunxi-rsb-3a3/registers > 00: 33 > 01: 33 > 02: 33 > 03: 33 > 04: 33 > 05: 33 > 06: 33 > 07: 33 > 08: 33 > 09: 33 > 0a: 33 > 0b: 33 > 0c: 33 > 0d: 33 > 0e: 33 > [snip] > > Fix this by masking the result of the read with the correct mask > based on the size of the read. There are no 16-bit users in the > mainline kernel, so this doesn't need to get into the stable tree. > > Signed-off-by: Ondrej Jirman > Acked-by: Chen-Yu Tsai Applied, thanks! Maxime --srx47feia3nohrm4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXlOtWAAKCRDj7w1vZxhR xZ3GAQDQc1KfI9aGFO2vdN8rwe58X/8JKWbnV1gWWOW6MvI39wEAzTL/pyT7Z9hY YnHiJd9rQY5Llx/U60FxMs+RfZ15wAY= =Ggtt -----END PGP SIGNATURE----- --srx47feia3nohrm4--