Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1057250imu; Wed, 9 Jan 2019 10:49:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4tw6gUdR6ri/16d1preQN41cJUysmCiNofs1FA1hpjH6M0xyzebSm/PM0fbVVtD7x0S55Y X-Received: by 2002:a62:d148:: with SMTP id t8mr7305231pfl.52.1547059789723; Wed, 09 Jan 2019 10:49:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547059789; cv=none; d=google.com; s=arc-20160816; b=S9/8iEIafV5QNyvmbK/Lef7QJhPo7vyhaTEL3b/4UdlfR+ISYh/OKTfHNygkKnw+4Q 8ahhlUhavGzwpqMzlmLmDJegtNvrk624wtlJJws7jNTbFbhr2POQMLx8LpHEu0fvvdsy x4rrZ7pROsa9xfdw0DckIAhVcuaNRiJD9ptAWlAsOYreLcA/auHOY6zlTwQlybynU0ZF 98hIAmluRMg/eLfSBH29O18Wkuracl8+dfIhEH5OrRtBy1kKcVsZTZ7GSvO6K2lwJJYw blOF/vR0fVeCa7ag+je5rt1RghU9OJutqJMQBoIssqmA43qQ9FVsCPCgWnwsFpUG1pwK gR8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HoUUAmONh6tfxEaWm8k8WBpdpdPeuNV9ZIsTcKwd+uE=; b=f2KzF2ADaMdmoGCqLw2fHdHnv7X8rwz2VVPTaopXFVCyFTDSGOUvM/P/oqFU9siGwz pBtAgmIcotgyZIOF+dpN3TNbN0dIprmQhTzRWu8CNcPFw+buuuZReiPLwu/1LhDR1OJI sNu+1kDbX3MCNKwDnpUgAQvn7iRnYcEYYZ+F/DMx9ulbL2B0zkTna9zusT8PEDjZqrQ7 1Q08htbJ+bayPI7ryuUrn2Y7NNYWUvYYn9aDAU9y60Mm0CRI9xRjSfUZ4I7WmJDNU2w9 F2lhLEQfmmTwMTKJpM1Kdj7wgzKVGeWYmLuvYYGr0iCz92usdwHoSfWFl5enb6efeKsw 8c+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=D0lRYUSt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si27502469pgd.189.2019.01.09.10.49.33; Wed, 09 Jan 2019 10:49:49 -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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=D0lRYUSt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727837AbfAISqP (ORCPT + 99 others); Wed, 9 Jan 2019 13:46:15 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:56436 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727241AbfAISqP (ORCPT ); Wed, 9 Jan 2019 13:46:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HoUUAmONh6tfxEaWm8k8WBpdpdPeuNV9ZIsTcKwd+uE=; b=D0lRYUSttmiOmBj2aHK6X4kKe 0Kd+C2Fr/6p6P7fVYg3Si2H26D0ufOSShgZ3dziQqWt51SszEjzfk4TGVc8+gTZw+SLL6/Mv3KFjy FTRd3QigPvQzLlx0+9XCmPwnpCwbAKWNGUC53VOeWeqX7he2uzCTje9UXn88aHfh43nV8=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1ghIrc-0000k9-Qu; Wed, 09 Jan 2019 18:46:04 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 55EFB1127528; Wed, 9 Jan 2019 18:46:04 +0000 (GMT) Date: Wed, 9 Jan 2019 18:46:04 +0000 From: Mark Brown To: Chen-Yu Tsai Cc: Code Kipper , Maxime Ripard , linux-sunxi , linux-arm-kernel , Liam Girdwood , linux-kernel , Linux-ALSA , "Andrea Venturi (pers)" Subject: Re: [PATCH v3 1/9] ASoC: sun4i-i2s: Adjust regmap settings Message-ID: <20190109184604.GJ10405@sirena.org.uk> References: <20181221152110.17982-1-codekipper@gmail.com> <20181221152110.17982-2-codekipper@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="x+WOirvrtTKur1pg" Content-Disposition: inline In-Reply-To: X-Cookie: VMS version 2.0 ==> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --x+WOirvrtTKur1pg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Dec 22, 2018 at 12:44:07AM +0800, Chen-Yu Tsai wrote: > On Fri, Dec 21, 2018 at 11:21 PM wrote: > > + regcache_cache_bypass(i2s->regmap, true); > > regmap_update_bits(i2s->regmap, SUN4I_I2S_FIFO_CTRL_REG, > > SUN4I_I2S_FIFO_CTRL_FLUSH_RX, > > SUN4I_I2S_FIFO_CTRL_FLUSH_RX); > > + regcache_cache_bypass(i2s->regmap, false); > IIRC the flush cache bit is self-clearing. So you likely want to mark > this register as volatile. If it is marked as volatile, then all access > to that register bypasses the cache, so the regcache_cache_bypass calls > are unneeded. Yes, that should be the case. > However, looking at the code, the write would seem to be ignored if the > regmap is in the cache_only state. We only set this when the bus clock > is disabled. Under such a condition, bypassing the cache and forcing a > write would be unwise, as the system either drops the write, or stalls > altogether. Right, access to a cache only register while the device is in cache only mode is not a great idea - the usual reason we're in cache only mode is that the device is in a state where I/O isn't going to work. One thing that can work for this if you need the register to be cached (but is a bit gross) is to do a write setting the self clearing bit then another immediately after resetting it back to the cleared state. That works OK for cases where the bit is a strobe and never retains state, though if the device isn't operational then needing to write to the register might indicate a bigger picture logic error (or it could be that the register map mixes random things into one register). --x+WOirvrtTKur1pg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlw2QWsACgkQJNaLcl1U h9Czcgf/WEsr/xgxGR1vWUvTZ6HNUj2DdVfl5O8Fqvyh5XNwHUGt4I8gueUJSoRL lRSRA1NqnXYhd1S27qKSWtJA4VgRg7bDT/SoD7PFAspmc4R8fZ9yPdKBqqTZB+yv KCwF2H/u/8LIhGVJtqTpEpmwkmQh+H3he6HLSnDaVRtaqiEQKzD/1gP5NGW5AJdL SgZsfpsGlefkKglwLqw62e2lnjjqShydhd5p9ciEO51Hc4rJzQgxYQYWTJwZ9jNK XjGkwyVghD8WtKoEAnwrd7l1JR//Hapv52wmq4oSZ83in8TNXracdM1djPxxizjW q6G62CFmh8On1d62dbYKwhdZxpQlvg== =Yhg0 -----END PGP SIGNATURE----- --x+WOirvrtTKur1pg--