Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3020455rwb; Mon, 15 Aug 2022 16:17:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR7PUGWnK9JUI0weSMIfuTamuiF2DPO8MiQV2AK/vj9l51ogLWblPUZstZx32NuaxqmcdRwH X-Received: by 2002:a63:d607:0:b0:427:bc0c:55c8 with SMTP id q7-20020a63d607000000b00427bc0c55c8mr8948073pgg.402.1660605454365; Mon, 15 Aug 2022 16:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605454; cv=none; d=google.com; s=arc-20160816; b=E69XqmOc0PKDTH7rjWtu9w0QsUH6mN54pfNmHcOvG+mL6eJ+eLm7hfWgO616BidFOY W/EmaUGdG6fVOUqSrmGaKYdqwbVaSwJ7mK4ULWMtV/J/IvxD/7D9DzsQyccPGxdkYF6Z GTUrah8wnDEMb3oGgSq/Pac32uNGYUT2w7G++CzEle6DVqbx0pn/c3UUgzaeUNG2y4ca 9DU7boRS/9hpjJO/0Pdbhg1RBNbT4N8OeaJJ0XaPVSPPKlYkhtkzNG7d4xlu63gWBRlz SjIpMxNO55/c2wehRhe9OxYJdOveocc9pMkhHNRCsxNgDgROulooK6yzmweC5/tkWE9e QDig== 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=2IixFEMghtdA5KKDVQhSctgQD0WfnQxdej6poScSbLo=; b=xaMaiJLLyXt8QPDsai+2c9wcNKYYT2RCiCgnTD8mxSvRroqUsaahr+2yVfkBZeFeaH x5qzXmkFu3ETykoEXAqCOd11reNW4R7ls2R8Tge8A38BI+L15+iWhNtKBF3dVWO91RmN shT3kOEyEEIa0A6xUSh8HiqDErs2XMFAagrAx3MINQq2bIyTbRr2+6fwnyKsAIc/8/Cl wYjzEVCjCYIIyK2D4rU22CpTUr2A6c5nATTTEcyLOurtq+XENbSeGdog1452ZilTe+S/ bdhW0AlGFo5FUTriPEpEBxWn+m13C/PGS0EvQUdB7jRMbSYy2GG+wvOVfQhXTJFmGCpc h4iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LSIgtur3; 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 h9-20020a636c09000000b004299f0754adsi950080pgc.407.2022.08.15.16.17.23; Mon, 15 Aug 2022 16:17:34 -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=LSIgtur3; 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 S1349295AbiHOVpK (ORCPT + 99 others); Mon, 15 Aug 2022 17:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349519AbiHOVlU (ORCPT ); Mon, 15 Aug 2022 17:41:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3E6A5B07B; Mon, 15 Aug 2022 12:29:09 -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 C9B8DB81122; Mon, 15 Aug 2022 19:29:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25C49C433C1; Mon, 15 Aug 2022 19:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591746; bh=DzPOh5HBa5hS4q8TybX16QGzzaKpFJOkCzER+G1iOI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LSIgtur3FehTsbP/x4L9cU7FG95UTI0dB2bDOgmPaJ6pAav4tYPriSTdIVxWbmwr6 90QEgqg2yShWDN9qgjJcsvDypg746mvjZMXkCd3CHyWFJbt3kKvo4G7GQpwXz8jmn6 0UvgqlxqCvNdmTuPmskd/vV1z89XTpRb5oc27QLU= 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.18 0675/1095] clk: mediatek: reset: Fix written reset bit offset Date: Mon, 15 Aug 2022 20:01:14 +0200 Message-Id: <20220815180457.294286178@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 bcec4b89f449..834d26e9bdfd 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