Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4920011pxb; Tue, 2 Nov 2021 18:57:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKyRLB+ncwVZJgVOYBgm59QU9IQXSIYnocBbKxW/UxZC4AiShvfN8JfgTKbZyae65CO2Ty X-Received: by 2002:a92:c0cb:: with SMTP id t11mr19235569ilf.154.1635904624749; Tue, 02 Nov 2021 18:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635904624; cv=none; d=google.com; s=arc-20160816; b=1KRpfkpRIS9ni6mNwVk+ojGFv0loJxilDLpd4Y6Mzxtjz3nU32SRDJr6CAXNHwpGcc 9r2lfIlWWCMLpL5orFTtKzRrJME3hGSpK9WP6dFOaKLbEU40P/pDu1M5CPvrG+7IW3IB IGKQObFXvl345tu9Qxtzg4GWUwHxbpZbLTqbfVues2xDXNltWTLSrGX+2+AzaZc/rvIt 50dcLQitY7CbyIn0OrhJqiBS12ceFZKoRElWacJbtpitsVwDtNMlL7MC8j/n7Dwz6GMH P/WqzErh3uaaYO5jsTl7CqqXkKwvW2jwzPhUhhaMpY7cASQdFh9ZX3uMjcDA2yWFDisw DeCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gFLcv2iNn7US3zrzasnPKO6AXCRPJ7gLb5jCvOGUADY=; b=YmVMMY8yeYkWLIwOLmvcMUb4iWZOHFkCmGH/U+VBoKgd2q5zwVJoW9IuZFm7lPBQ0s qsb04wiADl/V7ullgEkCWOIoM2RlgSgDfp2Cdj/OAV3zFPk/9LSmtcRNQiVDwMSDXFBT dkZ2WQubahp7YQstinulaUwsZv3DOiPR7X1wTPO7QK8kCHIYj4lOFzj3+PmPir5tRhwT 2vyJRPIDOD9/jQX634i6H5B6k9McqZR4kcxypoXP6oBJbQB7k3vm99pZ3Zm479AE353E p5f9Kyt6MZ6AvBR0iH7Q3vDhblw0+ju3G7IH3yxfUjaCiAm4k3r/kvq39U8i6YeY8P9c WYUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=jcXf+Ciu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si1313005ilx.26.2021.11.02.18.56.42; Tue, 02 Nov 2021 18:57:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=jcXf+Ciu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231127AbhKCB4U (ORCPT + 99 others); Tue, 2 Nov 2021 21:56:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbhKCB4T (ORCPT ); Tue, 2 Nov 2021 21:56:19 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CE93C061714; Tue, 2 Nov 2021 18:53:43 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id a24so1125820qvb.5; Tue, 02 Nov 2021 18:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gFLcv2iNn7US3zrzasnPKO6AXCRPJ7gLb5jCvOGUADY=; b=jcXf+Ciuvaj6v+ls6ZTfBbuy40OoXomKmlu/Ez5YnrrwxsRcn7jKAexUfD92xaKAMZ X56CskUI//poNj06E/w2ktPXhlxzFnou/XirhfFWpL9cT0JmkD77jhPObpDRGrJfV+Tc 4AvuRnDMzTBUIfM8bsX2RvisklPuE4XwySge0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gFLcv2iNn7US3zrzasnPKO6AXCRPJ7gLb5jCvOGUADY=; b=qhJc0epKFTqcMZWusiXDHouWbDFPeHPGFlXW6nDIJD0yFhDo+VnmP1ClLvP4SpsHBb TgPhrovfxVqnLT8tdg5kWaucIFS2mCXAGtyB73Zrab6M3J9q+MeBOrWKXT4ibwb2IlEB F6kPnyrf9nozbjEjfUKzJLUHjzzEzMs9ImMK1Iy1WIuzH6jhwYGzVt2s929dLfgKV7ey U51lcUMis67styjKYkwaKccjgFTcDPTrkurE8gfEaAY9/B/OBlFp04rwJvqm666NGu2Y klisHp9+KuMxPReg3JelIWW76O7BqPrW/OhT8oeK2DVa0UcqWrKXM1EraDPHe5QjMbaq vE8Q== X-Gm-Message-State: AOAM5328JNF/jxxROcJOjL5C+mgAu2iEBQ5Rx5HOy+4caEJvvaxSDFqT B0nTM7S+xA5g7uGhOPjhy1D7+pqn2sWv5CiMXag= X-Received: by 2002:a0c:edb0:: with SMTP id h16mr29696762qvr.17.1635904422404; Tue, 02 Nov 2021 18:53:42 -0700 (PDT) MIME-Version: 1.0 References: <20211103011357.22067-1-jammy_huang@aspeedtech.com> In-Reply-To: From: Joel Stanley Date: Wed, 3 Nov 2021 01:53:30 +0000 Message-ID: Subject: Re: [PATCH v2] media: aspeed: fix mode-detect always time out at 2nd run To: Jammy Huang Cc: Eddie James , Mauro Carvalho Chehab , Andrew Jeffery , linux-media@vger.kernel.org, OpenBMC Maillist , Linux ARM , linux-aspeed , Linux Kernel Mailing List , Paul Menzel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Nov 2021 at 01:47, Joel Stanley wrote: > > On Wed, 3 Nov 2021 at 01:13, Jammy Huang wrote: > > > > aspeed_video_get_resolution() will try to do res-detect again if the > > timing got in last try is invalid. But it will always time out because > > VE_SEQ_CTRL_TRIG_MODE_DET is only cleared after 1st mode-detect. > > > > To fix the problem, just clear VE_SEQ_CTRL_TRIG_MODE_DET before setting > > it in aspeed_video_enable_mode_detect(). > > > > Signed-off-by: Jammy Huang > > Acked-by: Paul Menzel > > Reviewed-by: Joel Stanley When applying, can we please have this tag added: Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Cheers, Joel > > > --- > > v2: > > - update commit message > > --- > > drivers/media/platform/aspeed-video.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c > > index 5ffbabf884eb..fea5e4d0927e 100644 > > --- a/drivers/media/platform/aspeed-video.c > > +++ b/drivers/media/platform/aspeed-video.c > > @@ -518,6 +518,10 @@ static void aspeed_video_enable_mode_detect(struct aspeed_video *video) > > aspeed_video_update(video, VE_INTERRUPT_CTRL, 0, > > VE_INTERRUPT_MODE_DETECT); > > > > + /* Disable mode detect in order to re-trigger */ > > + aspeed_video_update(video, VE_SEQ_CTRL, > > + VE_SEQ_CTRL_TRIG_MODE_DET, 0); > > + > > /* Trigger mode detect */ > > aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_TRIG_MODE_DET); > > } > > @@ -809,10 +813,6 @@ static void aspeed_video_get_resolution(struct aspeed_video *video) > > return; > > } > > > > - /* Disable mode detect in order to re-trigger */ > > - aspeed_video_update(video, VE_SEQ_CTRL, > > - VE_SEQ_CTRL_TRIG_MODE_DET, 0); > > - > > aspeed_video_check_and_set_polarity(video); > > > > aspeed_video_enable_mode_detect(video); > > -- > > 2.25.1 > >