From patchwork Wed Jan 28 04:06:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zefan Li X-Patchwork-Id: 43874 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 85BAA23FFF for ; Wed, 28 Jan 2015 05:34:54 +0000 (UTC) Received: by mail-we0-f198.google.com with SMTP id q59sf9758222wes.1 for ; Tue, 27 Jan 2015 21:34:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=zjhWSskz7yZYm+6LatpN/Z1UdgyhHWpvZfNSfomWcr0=; b=ONcfQ5q3prddfB6LoHUf7y8PEEwsFm3gqNLl0DFGOgmH2P++O10we94n9rchSrkIMO fEJEZVDKetgoXb0gK4Oupt42CevvTZ2ycEdg2d18rjbREguwsI2QkLJKNui54ummYGey HVvt9YTuZhQuorypPL7VSlk0a/0HDR2ut6T7bbkZwtkq/Tb4mcdsnqGJa1lFQ+Wzsejy wSYW3BqQWJkLhS7SloVM/6GRknQvtVtvNRxHIbtZtuh2G9LNVQtDludThwGzB84CjBFj v72/Kd/1SK5WJR9CqfG6ObDELev4q/Nb92DwG0kDrSAAKYOLr2A46UYQyetBXMilccqp B5kw== X-Gm-Message-State: ALoCoQkab7O1IRxo064XfaPP9cdI4Kyr2hQ0qlfb/T9s6k22VC91VRdvhRRUhU7mGh4QaGjRY+Wl X-Received: by 10.194.178.234 with SMTP id db10mr187836wjc.2.1422423293546; Tue, 27 Jan 2015 21:34:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.121.35 with SMTP id lh3ls125122lab.12.gmail; Tue, 27 Jan 2015 21:34:53 -0800 (PST) X-Received: by 10.152.8.1 with SMTP id n1mr5574827laa.47.1422423293393; Tue, 27 Jan 2015 21:34:53 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id jd8si3238509lbc.99.2015.01.27.21.34.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 21:34:53 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id p9so16818485lbv.8 for ; Tue, 27 Jan 2015 21:34:53 -0800 (PST) X-Received: by 10.152.3.70 with SMTP id a6mr5720046laa.71.1422423293289; Tue, 27 Jan 2015 21:34:53 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1324710lbj; Tue, 27 Jan 2015 21:34:52 -0800 (PST) X-Received: by 10.66.194.129 with SMTP id hw1mr2588417pac.143.1422423291589; Tue, 27 Jan 2015 21:34:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qd7si4354148pdb.124.2015.01.27.21.34.50; Tue, 27 Jan 2015 21:34:51 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760207AbbA1EN3 (ORCPT + 28 others); Tue, 27 Jan 2015 23:13:29 -0500 Received: from mail.kernel.org ([198.145.29.136]:36609 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759122AbbA1EN0 (ORCPT ); Tue, 27 Jan 2015 23:13:26 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 231802027D; Wed, 28 Jan 2015 04:13:25 +0000 (UTC) Received: from localhost.localdomain (unknown [183.247.163.231]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C391E202B8; Wed, 28 Jan 2015 04:13:22 +0000 (UTC) From: lizf@kernel.org To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Mark Brown , Zefan Li Subject: [PATCH 3.4 02/91] regmap: Fix handling of volatile registers for format_write() chips Date: Wed, 28 Jan 2015 12:06:11 +0800 Message-Id: <1422418236-12852-4-git-send-email-lizf@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422418050-12581-1-git-send-email-lizf@kernel.org> References: <1422418050-12581-1-git-send-email-lizf@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Brown 3.4.105-rc1 review patch. If anyone has any objections, please let me know. ------------------ commit 5844a8b9d98ec11ce1d77610daacf3f0a0e14715 upstream. A previous over-zealous factorisation of code means that we only treat registers as volatile if they are readable. For most devices this is fine since normally most registers can be read and volatility implies readability but for format_write() devices where there is no readback from the hardware and we use volatility to mean simply uncacheability this means that we end up treating all registers as cacheble. A bigger refactoring of the code to clarify this is in order but as a fix make a minimal change and only check readability when checking volatility if there is no format_write() operation defined for the device. Signed-off-by: Mark Brown Tested-by: Lars-Peter Clausen Signed-off-by: Zefan Li --- drivers/base/regmap/regmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index ca72d1f..e554542 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -48,7 +48,7 @@ bool regmap_readable(struct regmap *map, unsigned int reg) bool regmap_volatile(struct regmap *map, unsigned int reg) { - if (!regmap_readable(map, reg)) + if (!map->format.format_write && !regmap_readable(map, reg)) return false; if (map->volatile_reg)