From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755018AbbCFRgZ (ORCPT ); Fri, 6 Mar 2015 12:36:25 -0500 Received: from smtp-out-088.synserver.de ([212.40.185.88]:1039 "EHLO smtp-out-086.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751418AbbCFRgW (ORCPT ); Fri, 6 Mar 2015 12:36:22 -0500 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 6996 Message-ID: <54F9E597.2050301@metafoo.de> Date: Fri, 06 Mar 2015 18:36:23 +0100 From: Lars-Peter Clausen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: Daniel Baluta CC: Mark Brown , Linux Kernel Mailing List Subject: Re: Using regmap_update_bits to update a write only register References: <20150305175356.GB21293@sirena.org.uk> <20150306112142.GG21293@sirena.org.uk> <54F9A171.5000107@metafoo.de> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/06/2015 06:26 PM, Daniel Baluta wrote: [...] > I can reproduce the problem with: > > static struct reg_default xxx_reg_defaults[] = { > { XXX_REG_CTRL0, 0x00 }, > { XXX_REG_CTRL1, 0x00 }, > { XXX_REG_STATUS, 0x00 }, > }; > > but, not if the reg default definition is: > > static struct reg_default xxx_reg_defaults[] = { > { XXX_REG_STATUS, 0x00 }, > { XXX_REG_CTRL0, 0x00 }, > { XXX_REG_CTRL1, 0x00 }, > }; > > Is this normal? That's a rhetorical question, right? It might be that there is a bug when growing a rbblock to the left. It probably went unnoticed because everybody has their reg defaults ordered in ascending order. Try to put a few debug printks into regcache_rbtree_write() and regcache_rbtree_insert_to_block() to see what exactly is going on when a new register is inserted into the block. How do base_reg and top_reg change. - Lars