Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3088594rwb; Mon, 15 Aug 2022 17:51:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR6myGGn/qyDrtUeCFQ6o4s1DZR5Ko9Yud/Yj1nuU5HhjhzOwA3qHXlBkZ+8Hq/I/RIM9Cfo X-Received: by 2002:a17:907:7355:b0:738:5087:9a64 with SMTP id dq21-20020a170907735500b0073850879a64mr4744760ejc.295.1660611060285; Mon, 15 Aug 2022 17:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611060; cv=none; d=google.com; s=arc-20160816; b=kpwL8Zi0Ayl+2l+IswbU7KnZA7zJ2b24vcNZrb+3JVE8Q8Yw4+EQopYPhAPJS/z9FK ul9MYeNDl5/70GgnWsSQv0CymIbHDtum2rNOn7Fsdn6FmHhZ9etQcMAx+sAXzA6kqjJV zm6JLma4C+284kKwC+ZUlKGxB8NDynv58eZvZmxsg9Ti4oZaMucxJ4ytwhlUbRrQ7uZQ GuIaCDO81mztgGnhM3em/DzFN+DDGuzUsUydEN4+fYdkChtVfe7+2l6WLd8N58/dwnnn bx3LntJyi6frJ/E3CgsaT20r5JqR5XnnoHO9IL1hJ5DjUHXZGilbNmlHLDGF1M824n4o agiw== 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=pKNPsDdQjr6eJYNCkZH75YxLzV8h/UmFJONOG78dG8HAWB3qsoO6uqFvVtvD8iI1GA MHOmvFn49SBIgSX0NHGwJtGob4GHtLzUurDzPegaTFKIqEwscKIxXiRumk2cDaSkIVhK CH1jZmOYKhfOr+uhNj+RV88un/y+jnaAFkVjboGpWsWU8t3IpqkaC6HS2KBcOZ2FPx39 ro+7bxsBGBaIOU0eg6qPeyy0OOv0TRVwR2KZTUrsoah92nyIAv0Ir62AxS7rJYPcP6+b JJXC68FQN3s6RqtOUpeSu6bJHeSyWorPAq8nyX6wAYPI7KYUi7Ko6fEebNNVOmXqxC63 6IFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dW/RJrT6"; 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 wz14-20020a170906fe4e00b007385dfb42c7si3083886ejb.565.2022.08.15.17.50.34; Mon, 15 Aug 2022 17:51:00 -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="dW/RJrT6"; 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 S1352132AbiHPAPe (ORCPT + 99 others); Mon, 15 Aug 2022 20:15:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353599AbiHPAGK (ORCPT ); Mon, 15 Aug 2022 20:06:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D660A1705F0; Mon, 15 Aug 2022 13:28:24 -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 E6E5EB8119E; Mon, 15 Aug 2022 20:28:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33020C433C1; Mon, 15 Aug 2022 20:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595301; bh=DzPOh5HBa5hS4q8TybX16QGzzaKpFJOkCzER+G1iOI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dW/RJrT6a5RzjiyMDU3cqI6RFBnA6gDSG0cSOhyYEE/CvpxCettGDcTIXeV1sMNor ojfH9VhhzJyorY1gaEe06ElXipwAJfyVYs55fIaVCUoFEu0Awuts4+mnLfDM0NBOkn +Ht3u9oLcrpJIys2hqasyl7kgcAz1bnmilyquu6A= 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.19 0720/1157] clk: mediatek: reset: Fix written reset bit offset Date: Mon, 15 Aug 2022 20:01:16 +0200 Message-Id: <20220815180508.291158851@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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