From patchwork Fri Nov 22 10:29:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180012 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp50849ilf; Fri, 22 Nov 2019 03:04:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxvEwcf8HfmKUWB81iAuYvl/i2GmwV64Je5/kDBdQAzPUV3Y/TNu4Vx3L3Sortokjx+RAPe X-Received: by 2002:aa7:c987:: with SMTP id c7mr316596edt.232.1574420690674; Fri, 22 Nov 2019 03:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574420690; cv=none; d=google.com; s=arc-20160816; b=bH9aUBUkmMF6OWaJWwKySSiCPllXAaT+14LCY6UNqnbDpNzMrgkKxDRnO8KJRVaad+ +iRdLC4wHERdZdteyoFEMhtkpatqb4K1HtRaQmPkIcEGEMUEmM0o6+YOQdNgdp19s+BT 7vZri8bou1FRsnVpscupDZT/ibf/YfSG1PqtXyigJyo/TCuWlDbfpEgSWvHIj2k32XWb /I7nfNbV/Rju3shqtXnLbtzzgXz0/kSVA2FOryu2f7YyJGEOG42MASs48TvJhzM0aBMO JFTWLyDVALImSBTvNqDo0mIgCocxfMRoVvPKXjrjC73amLJUDQTJOJLGDB4/Mql0F8Hd tEeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m9Kclga+T70M5NXjAzYOQb+s+nsLgsuzSHAo98PFJdE=; b=KHFp5uhp69Vq0n4z3tqqG2j7L5qlsaTd4LECkIJmmljjOAc+lHBz0Xp1TfGS18UVEf kbCVSDrwKkiOPWGiuRMUr/yzRg2iskEN/nmvqs0YoYH4a2/9S8smQ2wU5ac/frU65Zvf 4P79E5fLdlKkUYN5aOar3Q8LuMTUQrq3ObuW0ZBZMFC2cVJlvXvE02KhlMymIW+A/OKl zLwufrGnHQHSfn2QweAxiH4l7qUUMZnvkJNVZmVKtLmwgwmGjcEMPWg8IXjhxDfD93vT T0d1eYga4b6NslSuSFGYwzcnckp8PoqrffoUbl0sQOARRvX1fJw+wqDVDfk2v/PEvkYq k4cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c0xnZ6Nd; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oj24si650841ejb.177.2019.11.22.03.04.50; Fri, 22 Nov 2019 03:04:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c0xnZ6Nd; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731614AbfKVLEt (ORCPT + 15 others); Fri, 22 Nov 2019 06:04:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:60022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731592AbfKVLEs (ORCPT ); Fri, 22 Nov 2019 06:04:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91E7A207FC; Fri, 22 Nov 2019 11:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574420688; bh=B9AoKmD1xmcv4P7KtG1+SP2sJt/qlkpf6OAJSMxaA8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c0xnZ6Nd1JBitPGNQwRr1EWtD2d59mw+1i/trRhj3VjX3QWltGKXPSsQbhYYfZo1N 7tZxrZv1GwZYWLnbnGzzK59P+8PAj3/4fFYpBB8isvvUC/I3oXPUQwsnSay8DwGNQh QugeZlkGkzp2qsZeM3lzn738CHJCOtJFyOdkjBns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Sasha Levin Subject: [PATCH 4.19 192/220] pinctrl: gemini: Mask and set properly Date: Fri, 22 Nov 2019 11:29:17 +0100 Message-Id: <20191122100927.895075849@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100912.732983531@linuxfoundation.org> References: <20191122100912.732983531@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit d17f477c5bc6b4a5dd9f51ae263870da132a8e89 ] The code was written under the assumption that the regmap_update_bits() would mask the bits in the mask and set the bits in the value. It missed the points that it will not set bits in the value unless these are also masked in the mask. Set value bits that are not in the mask will simply be ignored. Fixes: 06351d133dea ("pinctrl: add a Gemini SoC pin controller") Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-gemini.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/pinctrl/pinctrl-gemini.c b/drivers/pinctrl/pinctrl-gemini.c index fa7d998e1d5a8..1e484a36ff07e 100644 --- a/drivers/pinctrl/pinctrl-gemini.c +++ b/drivers/pinctrl/pinctrl-gemini.c @@ -2184,7 +2184,8 @@ static int gemini_pmx_set_mux(struct pinctrl_dev *pctldev, func->name, grp->name); regmap_read(pmx->map, GLOBAL_MISC_CTRL, &before); - regmap_update_bits(pmx->map, GLOBAL_MISC_CTRL, grp->mask, + regmap_update_bits(pmx->map, GLOBAL_MISC_CTRL, + grp->mask | grp->value, grp->value); regmap_read(pmx->map, GLOBAL_MISC_CTRL, &after);