Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4916988pxb; Tue, 2 Nov 2021 18:52:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBGQAv8CRFQrxUySxJJfVMHW0d6UP3eC+go5Q0uL2NVpFLpk9eAt9/5WEpuN8Bs/5wILhh X-Received: by 2002:a6b:e903:: with SMTP id u3mr28098300iof.36.1635904366549; Tue, 02 Nov 2021 18:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635904366; cv=none; d=google.com; s=arc-20160816; b=i1nm7Qft5J231CqAjiUvSnS0hVoH2LcvC+bqhNAiYX6QaOa4EToM0m0xJjJg1Pp0xF 8NGgsabs+8sj2ENLtfI0OVeNlMaZMyAWhjD8NLMkKBZiZnF6339cJ2wP+jJrOyGHIafk ew+YGISC2GYIEXxTTU72EadmKQmLrCM98N7UqmSBfAanwcjxk68fe8aLoYVO0HL0csGW Jt7jJ7hnvp+qz5MdipC5Ua59Eh75q0ecrW01GqsnTYX4j/enmkyBQECMOd2riUH6OOZA l7NkAE0YF7fsXRThHmXyqbOZ90wLrcUzy/leVv9GQSEvSZjzMLH7hfIwpXIQ7yO7ymL8 S9Xw== 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=iIfhELKBA59uYTnqWLZdOTQFhHkJ8JIZdnz4Zyo8KZw=; b=Fl20Sxhin9yHgK8HPCdS73KOCtk86KufdTn1urGo2ri82IIiaAmYl/m1/EibvU6sw3 bNexTTH8nD2JUaUBVYYUIOLJ5778qLuPBkdEMgpjwzEVyOEmUQ6rSFFgKnFz1STtDSvt 82tWIWpfBw442fijS7jQubom7YE2K8/mrSHSp559Qf1HsimR/bGHvmt9WI1LE6I8fjSA M3/P0WJ5BL5UZTb/SaXSsGBRlGsWuxRXfdMnS1QgV+h57xwvHrdeABn37K8jl+qvURvx qeKX7ph9AubjSMxbl4wtXgt0/uTATtdtmufmR1+H2upYxLvVeK4J45QbW3Qz6fGhJZYU CSyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=SMxYX+Fj; 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 l7si1085513iln.132.2021.11.02.18.52.23; Tue, 02 Nov 2021 18:52:46 -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=SMxYX+Fj; 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 S231138AbhKCBtu (ORCPT + 99 others); Tue, 2 Nov 2021 21:49:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbhKCBtt (ORCPT ); Tue, 2 Nov 2021 21:49:49 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAF16C061714; Tue, 2 Nov 2021 18:47:13 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id b17so1096406qvl.9; Tue, 02 Nov 2021 18:47:13 -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=iIfhELKBA59uYTnqWLZdOTQFhHkJ8JIZdnz4Zyo8KZw=; b=SMxYX+FjngAizwzwGf0p+JkubhUWAXjRGqDCq5xJ87DyiD+8mXCwqkH/x3YfF5f29A xevwGdPchS1Fi5DrS3aexlrF5yG9gmA/jq6IJ1EjgqIBOD1whwOwinm0pghiUuVjdAP6 GKfcbgfSk7Xuh4KzSSzrACWz11mURursOpVtY= 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=iIfhELKBA59uYTnqWLZdOTQFhHkJ8JIZdnz4Zyo8KZw=; b=h0iqtE5ZmOgHyMLVxYtuwnoHwxjrVFp+p1QU7bIwNN8+6V8ix5w7HZCk7XkdE0Gh5q 3Oh6BJKn5/QlPiIXwIfVXkNwlnnPJyKufdPJqZPp9MOagwxVQH1i8EADvJUHWcuSs30D 6JNmNRWlnKGivXJ9PQilLrhtXU5s4inoQWEL21qTsVBDWit82+f3/XiJBzQRA4DJCaTL fpxiWmkm/ipgAHDXDIskqs/k0XgSXUqswQL+jfKntjEaYVNaYkXhLA+OlCSKW6O7AYBW LJOB7CWEcLsFL5SM2BE6slTmcbB8nC+HgPnGU+ESpiTC0RoAUJNe2B4aP4vCxDCGiSLU 8RiA== X-Gm-Message-State: AOAM530jOP9cG5KkjXW4cbV+6B6tJIQyIHZuE1mIFsymlhQyVdgTV7Wm Vm+c8RjLOaMQC0NnqUnYViQ/wXtF+yNaXV8yOlQ= X-Received: by 2002:a05:6214:5002:: with SMTP id jo2mr39450110qvb.27.1635904032986; Tue, 02 Nov 2021 18:47:12 -0700 (PDT) MIME-Version: 1.0 References: <20211103011357.22067-1-jammy_huang@aspeedtech.com> In-Reply-To: <20211103011357.22067-1-jammy_huang@aspeedtech.com> From: Joel Stanley Date: Wed, 3 Nov 2021 01:47:01 +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: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 > --- > 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 >