From patchwork Fri Oct 17 08:09:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38840 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3412520C5D for ; Fri, 17 Oct 2014 08:13:16 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf181924lbg.1 for ; Fri, 17 Oct 2014 01:13:15 -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: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=PLwJVYZym8If1WXVCPvHO54zYkFEIV4mF3mFb326Vo4=; b=D+wx0yBgmOaKhFx+23j8ZuQVEtk/6qxdcmrlrAr9ODzc/PdkeVKG5KJm59SVx5zeoe UAAmHdwJ69WWlRYuQGzEs29ZzxdqGaoKq1c18NWi/5Tu6mTHR9yh8i0wWj40CVgb72f+ 0WBFcuwNRC5AWUDJBmiNuZiT6Vz7+Hcawi2wnBIkLuMYikGTyqywQxap353FX8Ux1N+c z2hHWLXWrjNyyZaduowNW8Y5TPo/ius97HfwFv1/ymaTmRA6ASGSEXiQqgzbe3cGs5tl Llj5vVi66Cjm6RImKAdlKVeJy4WBCJ8g4TGKgxdu+9+Yv/fJs32lnKwKO0E0FkwySeTE /hnw== X-Gm-Message-State: ALoCoQmxVfvZhjNu/WCGiJ3x0T7UR7rVFKbnUv1XM76nyF82/wRPkhyArz5X4mFumFtEb5wzcS4o X-Received: by 10.112.55.10 with SMTP id n10mr157841lbp.14.1413533595073; Fri, 17 Oct 2014 01:13:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.167 with SMTP id uf7ls232758lac.100.gmail; Fri, 17 Oct 2014 01:13:15 -0700 (PDT) X-Received: by 10.152.243.8 with SMTP id wu8mr6971122lac.21.1413533594994; Fri, 17 Oct 2014 01:13:14 -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 ce7si877539lbc.71.2014.10.17.01.13.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 01:13:14 -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 z11so254085lbi.27 for ; Fri, 17 Oct 2014 01:13:14 -0700 (PDT) X-Received: by 10.152.29.8 with SMTP id f8mr7060701lah.56.1413533594924; Fri, 17 Oct 2014 01:13:14 -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 c5csp184152lbz; Fri, 17 Oct 2014 01:13:14 -0700 (PDT) X-Received: by 10.67.3.36 with SMTP id bt4mr6679411pad.99.1413533576961; Fri, 17 Oct 2014 01:12:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si482018pdp.169.2014.10.17.01.12.56 for ; Fri, 17 Oct 2014 01:12:56 -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 S1753656AbaJQIMx (ORCPT + 1 other); Fri, 17 Oct 2014 04:12:53 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36192 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753556AbaJQIMl (ORCPT ); Fri, 17 Oct 2014 04:12:41 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4FDE0ADBF; Fri, 17 Oct 2014 08:11:56 +0000 (UTC) Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1Xf2df-0000DV-Bz; Fri, 17 Oct 2014 10:11:55 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Mark Brown , Jiri Slaby Subject: [PATCH 3.12 078/197] regmap: Fix handling of volatile registers for format_write() chips Date: Fri, 17 Oct 2014 10:09:54 +0200 Message-Id: <03d0cb29f14ec811567fd9c838c8a085c7980e69.1413533329.git.jslaby@suse.cz> X-Mailer: git-send-email 2.1.1 In-Reply-To: <7d97f39bc813aa9f11fe03d602885f81de07007c.1413533329.git.jslaby@suse.cz> References: <7d97f39bc813aa9f11fe03d602885f81de07007c.1413533329.git.jslaby@suse.cz> In-Reply-To: References: 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 3.12-stable 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: 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)