From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757454AbdACDyn (ORCPT ); Mon, 2 Jan 2017 22:54:43 -0500 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]:53756 "EHLO smtp.csie.ntu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755509AbdACDyi (ORCPT ); Mon, 2 Jan 2017 22:54:38 -0500 MIME-Version: 1.0 In-Reply-To: <20161214174053.qsm6umlgtdivevwt@sirena.org.uk> References: <20161123031616.10114-1-wens@csie.org> <20161123031616.10114-3-wens@csie.org> <20161209112018.GL3625@dell.home> <20161213164742.4ztisstxifatlm5a@sirena.org.uk> <20161214174053.qsm6umlgtdivevwt@sirena.org.uk> From: Chen-Yu Tsai Date: Tue, 3 Jan 2017 11:54:08 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] mfd: axp20x: Fix AXP806 access errors on cold boot To: Mark Brown Cc: Chen-Yu Tsai , Lee Jones , linux-kernel , linux-arm-kernel , linux-sunxi Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 15, 2016 at 1:40 AM, Mark Brown wrote: > On Wed, Dec 14, 2016 at 09:52:31PM +0800, Chen-Yu Tsai wrote: > >> What this patch does is make sure the registers match, to guarantee >> access, and then reinitialize the regmap cache to get rid of any >> stale data. > > So what you're saying is that previous writes may have been ignored? Sorry for the late reply. Yes, any previous reads and writes may have been ignored. I'm not sure if regmap cache prefetches any registers. Last I checked it didn't. >> > If the chip has been reset then you'd want to reset the cache too. I've >> > no idea if that's needed here or not though, it depends what happens to >> > the global state of the chip when this reconfiguration happens. > >> It is not a reset in the general sense. I suppose a better way would >> be to do an explicit write to the register first, then initialize >> the regmap. I'd have to export the write function from the RSB bus >> driver first though. > > Surely just doing a write immediately after initializing the regmap > would have the same effect? That'd ensure that the hardware has the > desired value before there are any other writes. But I might be missing > something here. So I just tested this. Dropping both the regcache_sync_region() and regmap_reinit_cache() is ok. I'll send a revised patch. ChenYu