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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3DC8C433DF for ; Tue, 13 Oct 2020 23:17:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A24E821582 for ; Tue, 13 Oct 2020 23:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602631078; bh=UQ1kTWTCvomm7q0TZd9VPzHpHgnguOcIZu5JIN7IRpY=; h=In-Reply-To:References:Subject:From:Cc:To:Date:List-ID:From; b=mx4h/aywkjptoD8vrVxSQc5iMNozQicZ2jQlzJVkNY0P/GsXJC+YEQ9eHXt1Sci2M 8tA7wrRUC9EX7tYD2e2g8kaGJi9itS6NLCHmUGmVcZqPnC678T+6omUhPYhiJRTxVU z8VuBRjxmoZAw+/7aeXjpgtv9jLn6KhmHj/CECIs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388680AbgJMXR5 (ORCPT ); Tue, 13 Oct 2020 19:17:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:48192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbgJMXR5 (ORCPT ); Tue, 13 Oct 2020 19:17:57 -0400 Received: from kernel.org (unknown [104.132.1.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8A7520B1F; Tue, 13 Oct 2020 23:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602631077; bh=UQ1kTWTCvomm7q0TZd9VPzHpHgnguOcIZu5JIN7IRpY=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=DFcN8qVOV4J2yI4znV6kmlilndnh2Ne6YdgO13yzegnqrxHEX1N40a2B2r1ZtCVu0 cBmQBzxX9ApPMcKW2Yygot3ZUIgCN5Io0+IqvUeEWBD31eENWsRuWbwYrPJeNPNmGF c/SIgXvCS5TFk63eACfY14qL/LqPVkf8QcXTwA3Y= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20200915123818.13272-1-paul@crapouillou.net> <20200915123818.13272-3-paul@crapouillou.net> <20200924202237.GJ1223313@ravnborg.org> Subject: Re: [PATCH 2/3] drm/ingenic: Reset pixclock rate when parent clock rate changes From: Stephen Boyd Cc: David Airlie , Daniel Vetter , od@zcrc.me, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org To: Michael Turquette , Paul Cercueil , Sam Ravnborg Date: Tue, 13 Oct 2020 16:17:55 -0700 Message-ID: <160263107570.310579.5439811142598502777@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Paul Cercueil (2020-09-25 05:29:12) > >> +static int ingenic_drm_update_pixclk(struct notifier_block *nb, > >> + unsigned long action, > >> + void *data) > >> +{ > >> + struct ingenic_drm *priv =3D drm_nb_get_priv(nb); > >> + > >> + switch (action) { > >> + case PRE_RATE_CHANGE: > >> + mutex_lock(&priv->clk_mutex); > >> + priv->update_clk_rate =3D true; > >> + drm_crtc_wait_one_vblank(&priv->crtc); > >> + return NOTIFY_OK; > >> + default: > >> + mutex_unlock(&priv->clk_mutex); > > Any risk the POST_RATE_CHANGE or ABORT_RATE_CHANGE may go missing so=20 > > we > > fail to unlock the mutex? > > I think not but wanted to make sure you had thought about it. >=20 > My assumption was that you always get POST_RATE_CHANGE or=20 > ABORT_RATE_CHANGE. But I am not 100% sure about that. >=20 > Michael, Stephen: is it safe to assume that I will always get notified=20 > with POST_RATE_CHANGE or ABORT_RATE_CHANGE, after I got notified with=20 > PRE_RATE_CHANGE? >=20 I think one or the other will happen. Of course, the notifiers are sort of shunned so if you can avoid using notifiers entirely it would be better. 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F5CCC43457 for ; Tue, 13 Oct 2020 23:18:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 B8C8121582 for ; Tue, 13 Oct 2020 23:17:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="DFcN8qVO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8C8121582 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A54D66E982; Tue, 13 Oct 2020 23:17:58 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A56F6E982 for ; Tue, 13 Oct 2020 23:17:57 +0000 (UTC) Received: from kernel.org (unknown [104.132.1.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8A7520B1F; Tue, 13 Oct 2020 23:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602631077; bh=UQ1kTWTCvomm7q0TZd9VPzHpHgnguOcIZu5JIN7IRpY=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=DFcN8qVOV4J2yI4znV6kmlilndnh2Ne6YdgO13yzegnqrxHEX1N40a2B2r1ZtCVu0 cBmQBzxX9ApPMcKW2Yygot3ZUIgCN5Io0+IqvUeEWBD31eENWsRuWbwYrPJeNPNmGF c/SIgXvCS5TFk63eACfY14qL/LqPVkf8QcXTwA3Y= MIME-Version: 1.0 In-Reply-To: References: <20200915123818.13272-1-paul@crapouillou.net> <20200915123818.13272-3-paul@crapouillou.net> <20200924202237.GJ1223313@ravnborg.org> Subject: Re: [PATCH 2/3] drm/ingenic: Reset pixclock rate when parent clock rate changes From: Stephen Boyd To: Michael Turquette , Paul Cercueil , Sam Ravnborg Date: Tue, 13 Oct 2020 16:17:55 -0700 Message-ID: <160263107570.310579.5439811142598502777@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, od@zcrc.me, linux-clk@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Quoting Paul Cercueil (2020-09-25 05:29:12) > >> +static int ingenic_drm_update_pixclk(struct notifier_block *nb, > >> + unsigned long action, > >> + void *data) > >> +{ > >> + struct ingenic_drm *priv = drm_nb_get_priv(nb); > >> + > >> + switch (action) { > >> + case PRE_RATE_CHANGE: > >> + mutex_lock(&priv->clk_mutex); > >> + priv->update_clk_rate = true; > >> + drm_crtc_wait_one_vblank(&priv->crtc); > >> + return NOTIFY_OK; > >> + default: > >> + mutex_unlock(&priv->clk_mutex); > > Any risk the POST_RATE_CHANGE or ABORT_RATE_CHANGE may go missing so > > we > > fail to unlock the mutex? > > I think not but wanted to make sure you had thought about it. > > My assumption was that you always get POST_RATE_CHANGE or > ABORT_RATE_CHANGE. But I am not 100% sure about that. > > Michael, Stephen: is it safe to assume that I will always get notified > with POST_RATE_CHANGE or ABORT_RATE_CHANGE, after I got notified with > PRE_RATE_CHANGE? > I think one or the other will happen. Of course, the notifiers are sort of shunned so if you can avoid using notifiers entirely it would be better. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel