Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3607997pxb; Mon, 24 Jan 2022 13:24:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWVWshFXAmLVC2BAXoTb2vOOt0WVeHo6CAmGSv57K/DvVOEYCWVu2xZjI1w+cMxpz7UdNc X-Received: by 2002:a17:902:a40f:b0:14b:4656:7afc with SMTP id p15-20020a170902a40f00b0014b46567afcmr8082115plq.54.1643059490776; Mon, 24 Jan 2022 13:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059490; cv=none; d=google.com; s=arc-20160816; b=hjQaNUMD4sIT6hYywoIfjEbLe+8qdjjhS4QwimhoU+vrjzobOpmJeMl0RU9PTY5JwD PMljd2x7Ifh35S/o+glvBSZNgIEowhyWpn2U9UQH6yQGQkN/BNigql/0sHzCtf0RwKfF rs0NyALs+e0eyuTfQRVB7Nly4GVI6hSfQHFqYbaZP1aAa0wmSLWibSISnrcP9j8cYTgF mzHfZnyK/TuyECUd15faXLiVUrFgxQUna5+8JpSh9q5FDVm+ovncmtSOE5QCvOzcXXZ6 WdEWIkX+tcFi1FTwONxjQxpk/YlZFpohMaW5fkV1vJNEmoTM4iqJPcMkAsU+4SZiDyz2 U2gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BH/qWDmz88rUj4FOL1pYHpfG9lY334RQuh80rK56ucQ=; b=MgDyaAOmR22mo1qQmTkvWOVUNY8DYzZ7ktdC91avw4fSjib8+GNyjcbIU6dJUxuTAO DGkdschcsZ9qF8J1Flc3Etwn49vy4/xVWrgI2dU0z0/JfNRP3M5NhBjMqz0Pc+y0kuNi 0HGr+rYZzTuyEFUEp2HNgMWapyqpx2RE2j+7bFXt4QYY38j8Bv7J9enaby3o55UqP7xE P9QfdfC9w983ghwSjtE8+vZ1ZhldG22J3sT9Gsh2I6/kqrYKexescTCjYYLH+xYGPXqO bcmypaCEdaAqYmpN6pw85EjVR7nzRGpdOQZNABkr7kiiiMhlD3TC/OdwXrrqtqjcj4pf PJYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m4RcX5T7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ij15si12134392plb.239.2022.01.24.13.24.38; Mon, 24 Jan 2022 13:24:50 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=m4RcX5T7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443235AbiAXU4b (ORCPT + 99 others); Mon, 24 Jan 2022 15:56:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348495AbiAXUdd (ORCPT ); Mon, 24 Jan 2022 15:33:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6510C07E2A4; Mon, 24 Jan 2022 11:46:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 53F9D614BB; Mon, 24 Jan 2022 19:46:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AB7FC340E5; Mon, 24 Jan 2022 19:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643053566; bh=nkRbVp2W10K033deshM2ceJteFE6A6KthK5vUO20h1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m4RcX5T7eP7DrQh29Q5oSSF4NcGcRVZN3eyv8u2I89JegiLwl8ASuEN7cCSl6QgaY ceXzorXhbyDwH3JZ565zYB8498EY9Pi+2UmVtwi3m3dlp4C6oVGqvNBizUt6fqUBD1 QWHiMWbKzoRTCMkWeGZ7H1yf3w3hmu+HR+o0I/E0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jammy Huang , Paul Menzel , Joel Stanley , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 075/563] media: aspeed: fix mode-detect always time out at 2nd run Date: Mon, 24 Jan 2022 19:37:20 +0100 Message-Id: <20220124184026.991814372@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184024.407936072@linuxfoundation.org> References: <20220124184024.407936072@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jammy Huang [ Upstream commit 62cea52ad4bead0ae4be2cfe1142eb0aae0e9fbd ] 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(). Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Signed-off-by: Jammy Huang Acked-by: Paul Menzel Reviewed-by: Joel Stanley Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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 7bb6babdcade0..23c41c545c536 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -500,6 +500,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); } @@ -786,10 +790,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.34.1