Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2940879rwb; Mon, 15 Aug 2022 14:30:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4bR4vSoOB6MsNQHehpnn58tuZAnlRAH8MrwsOtJ2qSsFSTFicye4oL79YhabZ4xvZphJWO X-Received: by 2002:a63:d317:0:b0:427:567b:847c with SMTP id b23-20020a63d317000000b00427567b847cmr9452135pgg.4.1660599017766; Mon, 15 Aug 2022 14:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660599017; cv=none; d=google.com; s=arc-20160816; b=Oe0zrrwCHNjBG1TY42HE+SxJg1k64bXFgNW2H14R9rOlHjNm0KwTq6X8PMa3wEXwRO fZbfMcrMHX/TEftv5ZTmQKidyv6xz7iqty3yyaVO3JhtcN8IVhAlJue2fg+MK0tQpR/b iW1dGJ8T232wMmMkRWJAzcrqMxiiTcvAZrzsoejC6MDDJsRbd1/14whcxsTwXzQ4DcXu AuBqc/uxdABV4IGHgTovw0PqFMkmZlx/x6tdLqSw1AX5WAnFpQcYoTzDXog8AmnxKxo5 ok8K+hQLcCSO1HaXAgSKeT9aHAVSJphukVlEF9hU5aKrDAnf+ewAUk/ajzoH/2yg+b78 tRKw== 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=SBqU/asJrNWrICl5G0QQAuAZfbwxq1KR7FZq08GdJhU=; b=MFicxhmX0rAijgdpMPWBYQrE16tq1c3eDVUW1kGU89Ywgt+01ZLe6PbSCmyZJb1Lq9 yAOqIO1K/iWAhj4dvBvNXvYKW5jkKzhpxyI2hiLyHWU05iFCFeg+AYuZvoZ3fm0Ops8S y2StCXdzGL13ZZgQIdJK4g2ljMPE0I9QyhtBkw/OvfpNPxPOZ3NharuS8cYgnclHDvcx DH/VGxesIvJ6z0kx2aZuAHfagrIwvu7kwiVlkmSdRrphZEzeAuV1nnULMAyX/gOi6jdv ZIxdrmh4k0/mJ/wCNENu/AxR+kmy4pKjPg146fufPrI8YJDoOoQHztnk39969M5iYI+C 01cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D07ijHMn; 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 y14-20020a17090aca8e00b001f3185e3a9asi13527745pjt.112.2022.08.15.14.30.06; Mon, 15 Aug 2022 14:30:17 -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=D07ijHMn; 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 S1346863AbiHOV2r (ORCPT + 99 others); Mon, 15 Aug 2022 17:28:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244917AbiHOVU3 (ORCPT ); Mon, 15 Aug 2022 17:20:29 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DBE0E42E5; Mon, 15 Aug 2022 12:22:11 -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 sin.source.kernel.org (Postfix) with ESMTPS id 616DCCE12C4; Mon, 15 Aug 2022 19:22:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AF1CC433D6; Mon, 15 Aug 2022 19:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591327; bh=HrKKffI5O2JNEYG9R4zavF2S4ypNCV02Z8F8Qh6fPuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D07ijHMnnmnej9RY2GaXxhqqLZS6ArYTy7t6/ocX74I7+RnwUb6vw313b1oI/8DMd 8WJX9J9MFqQKl1oiMTwykk7jBmL0oG9OfvBZ3V9KCHmEzin0GyCk36xrZDl6ZsI4KY 5iMOhe9iT0/gjPUmxDPGzxpXUDc+1B95pWpeS6Dc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Biju Das , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.18 0545/1095] clk: renesas: rzg2l: Fix reset status function Date: Mon, 15 Aug 2022 19:59:04 +0200 Message-Id: <20220815180452.097609847@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=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: Biju Das [ Upstream commit 02c96ed9e4cd1f47bfcd10296fec6b0b69d6b3c6 ] As per RZ/G2L HW(Rev.1.10) manual, reset monitor register value 0 means reset signal is not applied (deassert state) and 1 means reset signal is applied (assert state). reset_control_status() expects a positive value if the reset line is asserted. But rzg2l_cpg_status function returns zero for asserted state. This patch fixes the issue by adding double inverted logic, so that reset_control_status returns a positive value if the reset line is asserted. Fixes: ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC") Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220531071657.104121-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- drivers/clk/renesas/rzg2l-cpg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c index 486d0656c58a..1068058a3865 100644 --- a/drivers/clk/renesas/rzg2l-cpg.c +++ b/drivers/clk/renesas/rzg2l-cpg.c @@ -744,7 +744,7 @@ static int rzg2l_cpg_status(struct reset_controller_dev *rcdev, unsigned int reg = info->resets[id].off; u32 bitmask = BIT(info->resets[id].bit); - return !(readl(priv->base + CLK_MRST_R(reg)) & bitmask); + return !!(readl(priv->base + CLK_MRST_R(reg)) & bitmask); } static const struct reset_control_ops rzg2l_cpg_reset_ops = { -- 2.35.1