Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3519632rwa; Tue, 23 Aug 2022 06:09:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR5C7OFRzSRofH+p+soxzewfHr1cH6bj12Ki6nCYIUtEjwd/65ENoeUmUwN3MV7L4d3BiFhg X-Received: by 2002:a62:ed08:0:b0:537:17a6:57aa with SMTP id u8-20020a62ed08000000b0053717a657aamr1067603pfh.6.1661260191584; Tue, 23 Aug 2022 06:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661260191; cv=none; d=google.com; s=arc-20160816; b=IaLvQJo6eM1iD5a3DOc2DTn3yu5/gL1RuMtmx5fwIik6SRLa71R0wj9qmhXxWj3+QB ACsBe3LQuXcievfRgf2GI3GI67X5AYeIIQcOiwgnVh/Jxh61hiOAu5xyPQonAumVuyvR VpsrkXHG+vX8b6LlLxeivr7FIZVOJYkIvBoMr2ywmZVF5GkJFvdXcAftkMfp2EUSb5cC tufbjJwQU2J8eOXeY0/QkucxwVaecdiQhd/4EKvDGg9XadUFmGiwvxIsScuA+m5QSx8i QujL57K11NORkKga9SJv90R+66pxxIZlIm/XFBsZHapkE58jFGhOeliNOkvhJklAhkN5 N9Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5CKCn46NZ3AVQ58c8WiWie4diYdGwV79tlydZNOH4II=; b=Z5KJq0AxLb+U/he8uAGEZXrVAxAh+qGOBt/mxNI6iGK1g0BFQSo1lN1WUm4UGXUOk4 /VmeYrRD7N5rwJttHbkoN8Rof5SB0UGD6CW6QHmpoml8/buRgp2yYprtRxXeq4dez4eE D8/t6j4hH73ETQH4dQeFGv2ClHi8Oxa6pDZgLQv8zZiwQtSkveVbNZbcw/1LgnRkMB4L TI+QVKDfcKbMuN+xchW8+ECpv/2/gnJBVMG09lqnEVDg6GXIjYjp3i1405HPoNJ3vspO eLHaS8YpRe4LE7BIIqtbeShVJP2Z6ggksMNV5Ts75+8TDPZig5iIN40qHZIpndtwaBvw OzVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uBdKoM8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oc3-20020a17090b1c0300b001fb1a260c60si8646663pjb.170.2022.08.23.06.09.40; Tue, 23 Aug 2022 06:09:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uBdKoM8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242489AbiHWLdH (ORCPT + 99 others); Tue, 23 Aug 2022 07:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358213AbiHWL1d (ORCPT ); Tue, 23 Aug 2022 07:27:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2411C2F9E; Tue, 23 Aug 2022 02:25:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 55992B81C85; Tue, 23 Aug 2022 09:25:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C072EC433C1; Tue, 23 Aug 2022 09:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246713; bh=hzkemkVpECEz8P8+g1ZXBJ+D0VCbFxbSR+3zAHrHpjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uBdKoM8GbUiY8OsDozjNZwc2pUieKZwVmBaya/bb+rRXgxIelmEho/AKDaBZlAxBL rZeLV/U8a0PjzkWEqMsdNCkpIdIMqAD1fqa6iG28NQ3JZCDHIPhB1aKLLYOweuaVD1 BIkAi1JsZfW+U0EVbPy8iliHGtOCWS7ANuNvSUu8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rex-BC Chen , Chen-Yu Tsai , AngeloGioacchino Del Regno , "=?UTF-8?q?N=C3=ADcolas=20F . =20R . =20A . =20Prado?=" , Stephen Boyd , Sasha Levin Subject: [PATCH 5.4 165/389] clk: mediatek: reset: Fix written reset bit offset Date: Tue, 23 Aug 2022 10:24:03 +0200 Message-Id: <20220823080122.517733269@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rex-BC Chen [ Upstream commit edabcf71d100fd433a0fc2d0c97057c446c33b2a ] Original assert/deassert bit is BIT(0), but it's more resonable to modify them to BIT(id % 32) which is based on id. This patch will not influence any previous driver because the reset is only used for thermal. The id (MT8183_INFRACFG_AO_THERM_SW_RST) is 0. Fixes: 64ebb57a3df6 ("clk: reset: Modify reset-controller driver") Signed-off-by: Rex-BC Chen Reviewed-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: NĂ­colas F. R. A. Prado Tested-by: NĂ­colas F. R. A. Prado Link: https://lore.kernel.org/r/20220523093346.28493-3-rex-bc.chen@mediatek.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/mediatek/reset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c index cb939c071b0c..89916acf0bc3 100644 --- a/drivers/clk/mediatek/reset.c +++ b/drivers/clk/mediatek/reset.c @@ -25,7 +25,7 @@ static int mtk_reset_assert_set_clr(struct reset_controller_dev *rcdev, struct mtk_reset *data = container_of(rcdev, struct mtk_reset, rcdev); unsigned int reg = data->regofs + ((id / 32) << 4); - return regmap_write(data->regmap, reg, 1); + return regmap_write(data->regmap, reg, BIT(id % 32)); } static int mtk_reset_deassert_set_clr(struct reset_controller_dev *rcdev, @@ -34,7 +34,7 @@ static int mtk_reset_deassert_set_clr(struct reset_controller_dev *rcdev, struct mtk_reset *data = container_of(rcdev, struct mtk_reset, rcdev); unsigned int reg = data->regofs + ((id / 32) << 4) + 0x4; - return regmap_write(data->regmap, reg, 1); + return regmap_write(data->regmap, reg, BIT(id % 32)); } static int mtk_reset_assert(struct reset_controller_dev *rcdev, -- 2.35.1