From patchwork Fri Nov 22 10:29:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180019 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp63439ilf; Fri, 22 Nov 2019 03:13:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzSe6kZwYR3mj81CmNa1hSCMRjrNRWiVLCSQrJVIIa9x/yzB/JEVAp9eV9V0nUMeXiiIebb X-Received: by 2002:a17:906:c2d6:: with SMTP id ch22mr21944722ejb.262.1574421236678; Fri, 22 Nov 2019 03:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574421236; cv=none; d=google.com; s=arc-20160816; b=B46zil0OWG7VTi6AorRyLl7wbOQ/KkZPf73o8Aj4vm4xYoox/HILzd3riMXx16IRFg t1Mo8fgN42YpbOq2jvVQwQQiOJBzumaxIoIAiLghKz9mRD3YaG2iGu32ActcWsB8J0Xh h4NyLzGHWyjX6gZu772vbjJwXIzxDZ64qaBG00F6P+X6qIKFPXFvyOi2UJHSfgBkYLW6 b3HAihjz30ng0Zt58xJ3f1zczD2sfiUdXPpDs3j0apKLWsjNS8zDZzLWfmpE47YhneA/ nCdA1id3xHWQTEPTXAVoIOjg+ixyVobvkFWpoErt5/y5prBY/F4Ik5TMJdtqTs90l5yA nF1Q== 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=vDVArhvsaUjEmbhWfAlsh77EdfA/jkKziAziNW+k+h4=; b=wrKZEVqPcMwMUGe8BQWTwe3KENL7plu2JrLT9nRacQwKet7fcwz+qfUJi/HdlyWeJG II6HaTUypry+hWUA8KLchQO8KLLf+ZLgI6fr3liBHaUQ2+XPn9AAVs2JRG5dR4uhOQDq Vfk0ZnwxAW8kSiHqsG8trR7xkHt562pqUpBQwg9lqF2YOBg3dWVQx3rqZKNgpcIEBmn/ HqNBO6aSHf6vAOiSs8gcZ7uNtwVxWfvzwpGIgcEhGoqkWfCkmWUyW962433t55qIlObR /xeM+p7GCSIdQsSeOxfq0BQV+5eugvFpYpgnpw9v9SojDDq1YKoyUQXRBX0uNpMezulh 3c7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vPj6wGbV; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ch17si4055882ejb.184.2019.11.22.03.13.56; Fri, 22 Nov 2019 03:13:56 -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=pass header.i=@kernel.org header.s=default header.b=vPj6wGbV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730346AbfKVKyg (ORCPT + 26 others); Fri, 22 Nov 2019 05:54:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:40196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbfKVKyd (ORCPT ); Fri, 22 Nov 2019 05:54:33 -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 10EF620706; Fri, 22 Nov 2019 10:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574420071; bh=5ZZg/xigrTA2+oyrMBGTOMx97kcHllNc7EFKeSaV/nQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vPj6wGbVT9wKmO/kQ45Ay0l1k4eSSw+5RrXporQnB4c2QNg6jtXsK6X8n16aZjno3 eW8HwPrIllHm2EAWRVIecz48I0OBdO1rYbSE0ZuMF1E6zL2XM8ZQpMW3X6+8aOx4yX taOGaCR8aGFFba23jyyC2M3c/5ax/C41Zw5MJwUg= 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.14 105/122] pinctrl: gemini: Mask and set properly Date: Fri, 22 Nov 2019 11:29:18 +0100 Message-Id: <20191122100832.406597374@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100722.177052205@linuxfoundation.org> References: <20191122100722.177052205@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 39e6221e71000..05441dc2519d2 100644 --- a/drivers/pinctrl/pinctrl-gemini.c +++ b/drivers/pinctrl/pinctrl-gemini.c @@ -2164,7 +2164,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);