Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2876833rwb; Mon, 15 Aug 2022 13:07:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ZA0sfCbs8ajYkeEKGgV19JIPXOwFISyGwaBghny1MB8krmT6DVGIY9glt4Dlv3dz4CrcN X-Received: by 2002:a17:907:eaa:b0:730:c780:f71e with SMTP id ho42-20020a1709070eaa00b00730c780f71emr10824132ejc.770.1660594058573; Mon, 15 Aug 2022 13:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594058; cv=none; d=google.com; s=arc-20160816; b=tnrbePpE3i+03WXb72k+etLaqVlRUJID2kjvBKwiGk39RVkZiotb9Bmp2IDr1ALTAs CA+qfPnZ0MyxaMUhDfQtPgCEV1tmoKgZJXyQiWzTVG7tGpJxQOtxvMrf6WVrisSySJUL +sdqQwH13swzGli596mpDOgiltTtyqkIoQP6px2JSsEC/eVL/Tef20+svR2AMlbQYkUp tEEbdROsbLQRMOHxj66NuVqbgfZESWaHaj2mJd+IFXs1DpPXoaruQlAYbiOTqY7T7Zva puY7doiH5FWc0Cio8fnqVqRbCPOvrN7X8EA5MBLy/zJWuWPihcwTF464kSVMFvIWSzgH Nc0A== 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=SYupvwGRQTikO6O8MvD+LCdoQoJRiUcGcA+vhmjE8QA=; b=C/jcVpKt9vMch1uF4doNUvrMKztZYn0zb4ok0ObFDhi57oruzkORWNmMbtXpLslxLp 59mIod60FKu1viUdDda2d6Wfi9aT6s90nHkenZfaLiVn4Ge0zHTGj8riG1DknMDfFeLb p28b76rHAskLZBJJdpDuLPLLhT5flkPqOqQzk0k7vt8qH1tm2ohRMlK3Dp+CtrPTkJe8 WVVQOHZvKCQtKNsN4DxxDfKm2fG45GNnk8PCir3z5VvRphA8Ptn0djhiMz/Ma9Mv+gZL SSKlfk2BEC7WPqQgTPiCwX9zxIsPT0ciVIeIHw7zpfDX87g8tz3Z8ToFLNQVv1onYmMe mSsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nfc/ts6q"; 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 v15-20020a056402348f00b0043a10e5e81asi8676189edc.66.2022.08.15.13.07.12; Mon, 15 Aug 2022 13:07:38 -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="nfc/ts6q"; 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 S1344075AbiHOTPV (ORCPT + 99 others); Mon, 15 Aug 2022 15:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343860AbiHOTLJ (ORCPT ); Mon, 15 Aug 2022 15:11:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8AA742ACD; Mon, 15 Aug 2022 11:36:52 -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 3A924B8105D; Mon, 15 Aug 2022 18:36:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EB9FC433C1; Mon, 15 Aug 2022 18:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588610; bh=SsESgowbU490/ite9UQJ2/VF8eHcvsf//IiX5TmCguU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nfc/ts6qw0Ik6sZfiVTCkqozNTC4Obcx5fKFrWp1n+kAgFv+kAkBTBX/l4r2PLBJd +NfufzRoWawcTr16r63iH/9PlfONhz8vJrU0P6RDr7loi15QWDGfRqXhTe3nz+CcDU Z/csyi1C3py9qrJ5KzZCSA+8eO+ZQBt+93+ignrA= 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.15 428/779] clk: mediatek: reset: Fix written reset bit offset Date: Mon, 15 Aug 2022 20:01:12 +0200 Message-Id: <20220815180355.565929729@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 e562dc3c10a4..d311da574499 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