From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30929C433F5 for ; Thu, 30 Sep 2021 19:43:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2865619E0 for ; Thu, 30 Sep 2021 19:43:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E2865619E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zv2+b2h0t9aLDU8edAOr/ady2I0ta5WCwMMYHXu2Mo4=; b=hfDfv4Q4dirV2X S6z1pz3XOxQcIdB+XndRd5XdD7ZQvNfX2yCUcmWrOTgZQQSdjoa7BuXG194IdIlA1L3Vmiu2wq1H2 kCX7HEGm+i4FtftojPfaT98Vmu7xa7OvMuuErWloYUiR6hjjDYSYVjwC6Ph49BBGT6SjupktSImg7 PzqWqGKaF/VjSJlo5ARzbZPUs3na/CEr2JdMWXsiURYV0ASkNGmLLo5f9hBPzsVeRuSQjoGIxzisq hXEea7PYVWV9GV18/yzj3FJia0qkJiLIo2OEppuKGaUjP7YmCzz4HX9HiPjkKdPaZvq777b+pO9w6 7sn6AxZXicdaoPRZ4UyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mW1vY-00Ftml-HR; Thu, 30 Sep 2021 19:41:08 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mW1vT-00FtiN-9Y for linux-arm-kernel@lists.infradead.org; Thu, 30 Sep 2021 19:41:05 +0000 Received: by mail-wr1-x431.google.com with SMTP id m22so6427423wrb.0 for ; Thu, 30 Sep 2021 12:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Hx/tBsdkeGhZxG52QWJPz9Kz/HAe/yuuGxlrpK5+Bs0=; b=pGEwkWuKW4obTzm9tbCH+Qhm6GafqSky9gPfAPfj9/ZynrhBmRHqkwF+H9EGA74sZ+ e65f5loIGlF2z9PQbnab4xRbb3yDQJ/km66crhkHwhTxN1awrIBZNo3u0ERqhPwovU9V kwegr6/GU7a9cg+KQ7u51n6TXjbYmROF3vCM4TlVy6iwZ60hnen/i7qJMO9rDoaz9kuJ TVZulsdDjJ+zcSoGoLkBHB6sLJrs862Qc2Lg43bki0ztoRX7zWsp7EDGcY5JubxtwWcq SBlIX2ZRI0c8idL5Vi1z3XNjCaSY1JOPkyx4pqHbKKIJJu94y6LGa5TWmR8Wb9mZLGSB MHgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Hx/tBsdkeGhZxG52QWJPz9Kz/HAe/yuuGxlrpK5+Bs0=; b=K+UzVOQb/HmeMZNnr3m/PiC7e0QplsKwuzJmUD9gFJZlxq6nK2TeBZXZAOmsfyxSfb RmxpIpoXAQ0fmbp063bI4tFkRvz+ueKLMl8FHheaISa7xDOC2QV69cnIo8QjH9wyzwch RdTa5vxsUrpJBTC6l5KqoilwMz2yzi+h8K0mHkAqbwBe4FxpizVbfUzMzp8ZZIYSMMCH SYzCljVWZn5SRK1WUxSG2J0PhVI+hBILmow0OJA1DnIcKPnGU36n+sezHEBRE87NuKZr qkaFPos+trWuaoWyt+lUB9/BHQkJXfe/s5OmpWCCidC8vrmhcjBxH+c6DxEFbNNCljCG LVEA== X-Gm-Message-State: AOAM531kKlhgfH7YE20AiTqwvQaaZAdnpvmZgJCOiWAmLIAfLU2ZIyR3 hbvdxmqd/8Tdf9FH1cijVLWexOPW+rJS6Q== X-Google-Smtp-Source: ABdhPJzTZR4PaIT012/kW9Ejx5+BIO/rLhQdspCqmIHaZLLOGMEi/OxAq8Ai70Wk9pA9FTsQaeEIBw== X-Received: by 2002:adf:cf10:: with SMTP id o16mr8056065wrj.12.1633030859457; Thu, 30 Sep 2021 12:40:59 -0700 (PDT) Received: from blmsp ([2a02:2454:3e6:c900::97e]) by smtp.gmail.com with ESMTPSA id l124sm5576156wml.8.2021.09.30.12.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 12:40:59 -0700 (PDT) Date: Thu, 30 Sep 2021 21:40:58 +0200 From: Markus Schneider-Pargmann To: Sean Wang , Herbert Xu , Matt Mackall Cc: linux-mediatek@lists.infradead.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] hwrng: mediatek - Force runtime pm ops for sleep ops Message-ID: <20210930194058.oe5vlqlelilekdde@blmsp> References: <20210930191242.2542315-1-msp@baylibre.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210930191242.2542315-1-msp@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210930_124103_366279_6657D740 X-CRM114-Status: GOOD ( 23.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Thu, Sep 30, 2021 at 09:12:42PM +0200, Markus Schneider-Pargmann wrote: > Currently mtk_rng_runtime_suspend/resume is called for both runtime pm > and system sleep operations. > > This is wrong as these should only be runtime ops as the name already > suggests. Currently freezing the system will lead to a call to > mtk_rng_runtime_suspend even if the device currently isn't active. This > leads to a clock warning because it is disabled/unprepared although it > isn't enabled/prepared currently. > > This patch fixes this by only setting the runtime pm ops and forces to > call the runtime pm ops from the system sleep ops as well if active but > not otherwise. > > Signed-off-by: Markus Schneider-Pargmann Fixes: 81d2b34508c6 (hwrng: mtk - add runtime PM support) Sorry, forgot to add this line in the commit message. I can add it for the next version. Best, Markus > --- > drivers/char/hw_random/mtk-rng.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/char/hw_random/mtk-rng.c b/drivers/char/hw_random/mtk-rng.c > index 8ad7b515a51b..6c00ea008555 100644 > --- a/drivers/char/hw_random/mtk-rng.c > +++ b/drivers/char/hw_random/mtk-rng.c > @@ -166,8 +166,13 @@ static int mtk_rng_runtime_resume(struct device *dev) > return mtk_rng_init(&priv->rng); > } > > -static UNIVERSAL_DEV_PM_OPS(mtk_rng_pm_ops, mtk_rng_runtime_suspend, > - mtk_rng_runtime_resume, NULL); > +static const struct dev_pm_ops mtk_rng_pm_ops = { > + SET_RUNTIME_PM_OPS(mtk_rng_runtime_suspend, > + mtk_rng_runtime_resume, NULL) > + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, > + pm_runtime_force_resume) > +}; > + > #define MTK_RNG_PM_OPS (&mtk_rng_pm_ops) > #else /* CONFIG_PM */ > #define MTK_RNG_PM_OPS NULL > -- > 2.33.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel