From patchwork Mon Oct 13 13:49:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38656 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B4FFB2039B for ; Mon, 13 Oct 2014 13:52:11 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id w7sf4216092lbi.6 for ; Mon, 13 Oct 2014 06:52:10 -0700 (PDT) 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=7Xw6LX/F26jlZFfe84EeIlbNhHspFdx+rvYk353/ckg=; b=Htr7YAc4uupsbhh2pvvX0tESC6owPuGjwxFNTqVgX7T3F69caY7U+aGvTk+PFHl260 3jWn9E8ME4ClN3KLAEHQspmH5gsR2AF0qt/SN9uu5AchopJHAhEARKyKDSt5NZ+ZfXnC TPVVxWBnooaNbaxVgNwj9bHNwbvTYzhXpuoVoLzO3tXch0XvnvMgNWXK29RzlxTB0weE NK4gI/mUK06mpTMLB11MJ4AJ8IUl7ABvNLXNgGifvEL/Z1gcyDELITV6honEGzZ9LxlY 0CzzntyqFi9eJxCSvR8iTYILFkc97pRIxaPnrefxRokSA3ocs6UX3UZtfDW53XC2/OTd FTWQ== X-Gm-Message-State: ALoCoQlAPsyVCRRUdyGk1MSeOiNE3JT/HMbuzn2ExZ6IL0y9mi0vdGfb818nT4Za04vnqCvCHvh2 X-Received: by 10.181.28.169 with SMTP id jp9mr195910wid.6.1413208330272; Mon, 13 Oct 2014 06:52:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.178 with SMTP id az18ls441177lab.96.gmail; Mon, 13 Oct 2014 06:52:10 -0700 (PDT) X-Received: by 10.112.149.105 with SMTP id tz9mr24298194lbb.5.1413208330142; Mon, 13 Oct 2014 06:52:10 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx.google.com with ESMTPS id kf3si22318630lbc.68.2014.10.13.06.52.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 06:52:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id z11so6312719lbi.41 for ; Mon, 13 Oct 2014 06:52:10 -0700 (PDT) X-Received: by 10.152.22.42 with SMTP id a10mr24383814laf.56.1413208330066; Mon, 13 Oct 2014 06:52:10 -0700 (PDT) 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.84.229 with SMTP id c5csp217884lbz; Mon, 13 Oct 2014 06:52:09 -0700 (PDT) X-Received: by 10.70.44.137 with SMTP id e9mr3609498pdm.122.1413208280035; Mon, 13 Oct 2014 06:51:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si10368565pat.185.2014.10.13.06.51.19 for ; Mon, 13 Oct 2014 06:51:20 -0700 (PDT) Received-SPF: none (google.com: stable-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 S1754743AbaJMNvM (ORCPT + 1 other); Mon, 13 Oct 2014 09:51:12 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:57216 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754740AbaJMNuI (ORCPT ); Mon, 13 Oct 2014 09:50:08 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1Xdg0g-0003uV-G1; Mon, 13 Oct 2014 15:50:02 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Mark Brown , Jiri Slaby Subject: [patch added to the 3.12 stable tree] regmap: Fix handling of volatile registers for format_write() chips Date: Mon, 13 Oct 2014 15:49:40 +0200 Message-Id: <1413208201-14602-69-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1413208201-14602-1-git-send-email-jslaby@suse.cz> References: <1413208201-14602-1-git-send-email-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.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.182 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 This patch has been added to the 3.12 stable tree. If you have any objections, please let us 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: Jiri Slaby --- 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 7d689a15c500..18ea82c9146c 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -114,7 +114,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)