Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4568pxb; Tue, 2 Nov 2021 22:06:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmqrKfbprEhXWvKnFKbf4xBdzaDib7W97jMA329bYSN4j4rrbPKCUogr6DVwFscM9TgQ10 X-Received: by 2002:a5d:8e13:: with SMTP id e19mr9036898iod.169.1635916013801; Tue, 02 Nov 2021 22:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635916013; cv=none; d=google.com; s=arc-20160816; b=lvLbgCSyKzEuUstI2geLJ8an9FpOyjCKnPD3SLVZ00Qt54Tqlt8AGeH88DFUiEtsl/ YkNFXNBKrLUGT+/2bawABg13y3CUgS7eiYKEc5K+zJSfEAYBRF1fQ3VLGWebQBDI9XML rt0nh9EGEZNterKkCYDIbGo6Y0d96aD4dH1L9cC8/52nOlSEVjzXsZRV6ooYvJ7fCXT2 A/eQDfSIZJRWMTBoOrddcwXdatPwnJWhqvjio37Rti38svNFDJyke9UlSa3GqeqiURuS cuZSxhFMf99ibOqfCyW+cqvcCc2qtpRCOi9cU6n03GDlCefF6uzDXt/ha0DydnktPCEh gZow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=V13v59zcuRHwjBb3RPjgoc+/iaDHCyMbc5/kok8oaW0=; b=cKCia+ch9klX2loCt/qNcasrj0eU7Sh1mTNbzCKQa7r3zf/fBi0UTnGYbnwk4F+QbG hTkf9f/lVZxYHC9Xq0pV36AGZGkU1FkGc/bXbZIJ4pteEpC/gWPvm4TgMjs/LdORRRgP IwG4gpIxkX6OxxkYtTArbPQHPjSIv5E8ijAHqJkBZHOlCrROoFNqVfQtSKtpXzDgehAo HqOyayI1a2A32MXeW7UJufuaEDVKKp4X1ZjR3xSmuT2xxGvu635TqQXSzIyK1DK2iOyU Q7+IH9kGGvHR5YJAAMZiFIzAsCkDlHjzDMnTABchEuXyezzNlrIttLznulH4hurcgk12 DAXw== ARC-Authentication-Results: i=1; mx.google.com; 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 q13si2026569ilv.125.2021.11.02.22.06.26; Tue, 02 Nov 2021 22:06:53 -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; 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 S230076AbhKCFFS (ORCPT + 99 others); Wed, 3 Nov 2021 01:05:18 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:10104 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbhKCFFR (ORCPT ); Wed, 3 Nov 2021 01:05:17 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 1A34dkWW071525; Wed, 3 Nov 2021 12:39:46 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from [192.168.2.115] (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Nov 2021 13:02:37 +0800 Message-ID: <3a40bb81-2c6e-47e3-fb85-e615aecd129a@aspeedtech.com> Date: Wed, 3 Nov 2021 13:02:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v2] media: aspeed: fix mode-detect always time out at 2nd run Content-Language: en-US To: Joel Stanley 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 References: <20211103011357.22067-1-jammy_huang@aspeedtech.com> From: Jammy Huang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.2.115] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 1A34dkWW071525 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Joel, Sure. Thanks for your reminder. On 2021/11/3 上午 09:53, Joel Stanley wrote: > 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 >>> -- Best Regards Jammy