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=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable 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 3A847C43460 for ; Thu, 29 Apr 2021 07:13:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E98536044F for ; Thu, 29 Apr 2021 07:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239454AbhD2HOj (ORCPT ); Thu, 29 Apr 2021 03:14:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:33790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232075AbhD2HO1 (ORCPT ); Thu, 29 Apr 2021 03:14:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 177EF6141E; Thu, 29 Apr 2021 07:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619680421; bh=58tmw40R8d7hq0bYQ7ucYztt+FsoRTyGxT8Or5otJ0Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=u57bft8gaxqZ58WFZiZsaUCAj2+SFYgQnW+zHQWeVoDKQuNe28Ui9nkShXq8gVFJP CxAeWwIPITWLcLLSYO5a8o1543Vr7+nNrZWBDirk+efgJkiDxpcY4TllSycRwVeHqg D5XQknT64m26ahQWr9FzltYNllvJes0t6xG92DVAzgEcUYHABn0wodLonRFrXo+4WZ 5gby7lVxrfSdnbgxKvu763v6/b6KwHgoB5P54m1Hq6INKRHT4092QQMLAxJBZggXG6 C4dTCZbYAp6DMa/E3SHwqVrYbvqocLq0CDv4pM58sLQpLqyduPUhwBWODkU91qqkXU 1Q14nXullZdgg== Date: Thu, 29 Apr 2021 09:13:35 +0200 From: Mauro Carvalho Chehab To: Ezequiel Garcia Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Greg Kroah-Hartman , Mauro Carvalho Chehab , Philipp Zabel , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v4 79/79] media: hantro: do a PM resume earlier Message-ID: <20210429091335.2b563ab5@coco.lan> In-Reply-To: References: <569838d406dde80dcc64989a663882817a54cbb2.1619621413.git.mchehab+huawei@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, 28 Apr 2021 14:17:50 -0300 Ezequiel Garcia escreveu: > Hi Mauro, >=20 > Thanks a lot for taking care of this. >=20 > On Wed, 2021-04-28 at 16:52 +0200, Mauro Carvalho Chehab wrote: > > The device_run() first enables the clock and then > > tries to resume PM runtime, checking for errors. > >=20 > > Well, if for some reason the pm_runtime can not resume, > > it would be better to detect it beforehand. > >=20 > > So, change the order inside device_run(). > >=20 > > Signed-off-by: Mauro Carvalho Chehab =20 >=20 > Clocks could be behind power-domains, IIRC, so this change > is fixing that. >=20 > However, this has ever been a problem for this driver, > so I don't think it makes sense to bother with Fixes tag. I would prefer to move this patch to the first part of this series, together with other fixes, rebasing it to apply cleanly before the pm_runtime_resume_and_get() patch, with: Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver") This way, people that could be interested on backporting it will be capable to apply it as is to stable Kernel releases that came with this driver. >=20 > Reviewed-by: Ezequiel Garcia >=20 > Thanks, > Ezequiel >=20 > > --- > > =C2=A0drivers/staging/media/hantro/hantro_drv.c | 8 ++++---- > > =C2=A01 file changed, 4 insertions(+), 4 deletions(-) > >=20 > > diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/stagin= g/media/hantro/hantro_drv.c > > index 25fa36e7e773..67de6b15236d 100644 > > --- a/drivers/staging/media/hantro/hantro_drv.c > > +++ b/drivers/staging/media/hantro/hantro_drv.c > > @@ -160,14 +160,14 @@ static void device_run(void *priv) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0src =3D hantro_get_src_= buf(ctx); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dst =3D hantro_get_dst_= buf(ctx); > > =C2=A0 > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ret =3D clk_bulk_enable(ctx-= >dev->variant->num_clocks, ctx->dev->clocks); > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ret) > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0goto err_cancel_job; > > - > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ret =3D pm_runtime_resu= me_and_get(ctx->dev->dev); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ret < 0) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0goto err_cancel_job; > > =C2=A0 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ret =3D clk_bulk_enable(ctx-= >dev->variant->num_clocks, ctx->dev->clocks); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ret) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0goto err_cancel_job; > > + > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0v4l2_m2m_buf_copy_metad= ata(src, dst, true); > > =C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ctx->codec_ops->run(ctx= ); =20 >=20 >=20 Thanks, Mauro