Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp489138pxb; Mon, 8 Nov 2021 17:13:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDnqArELLHSG+TVw4ytI85DYKebhJYtFB6Lf2sjyzp4PWVrFGi1tZgUm7v+NanKpaLxo7C X-Received: by 2002:a05:6402:438f:: with SMTP id o15mr4621387edc.235.1636420410670; Mon, 08 Nov 2021 17:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636420410; cv=none; d=google.com; s=arc-20160816; b=DAtI9Fs7cJxjfaCFuQ9tcifMDHKd+qoPsoc+S4FFdpbuzReiP0wser+r51WeWWKpye f/lWHTKG/ckm7l16vqR08qSk84pF856nHtHTaOiq782SaatCa7LW+HUNHadyRRYWqdsv AeJ++zeSuSQmul9c8R3gLDUbSHwncY0jAWC8rZJWJX3lfR3h9UqGuW/ZByGRjId1D7UY ByUT/BoTJMD8pENQy1meTYLi4Lkm9cDCQxgkCta+0auJ8saXK2ymJ9OcC2JynzaOKSWX 1mMTRXxWpPWhq/yj1s3JK2JHGU6xNS5T6+qWbjboyXXIm3y3AVSIbJdB7A1/iCpVgksG CVOw== 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=NC64Ol19oOtu2i1GOdD/z6CS5C8FxiGRFJogjJcLKyY=; b=oLV9ylaDGRjs65k1PZOTJyepvF6K48jVE2hO8bwWNqDwJbuWhBhmFTuu2C48UdBkqr JZZICjVu3YDczUv+1sSmPzOlVP2jj251HIplLub2/reYuKbH6ql4N2u1/AyKPWWlrpu/ EQ9R1XSiJUBTXmx0gvG9c+SmmmEBJY8PZ1lfearVGxIp6n5tpn/uGNV3nUMu9uW9lkc2 rluG7fbZR9vCGW8pkp/ypaxQyuvgmsQ7sGc8+VVjTrxSSeZq+iWwpe3hdHYXTlI48TBr M+8SA1mhwzkUPLpzN1tjKQjZFZUHEjXaCyq9ZbZC2cSF3GDaUXXmH+z9D4DfZWRlLf9O vuBw== 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 h24si31869869ejt.376.2021.11.08.17.12.56; Mon, 08 Nov 2021 17:13:30 -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; 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 S241385AbhKIAoI (ORCPT + 99 others); Mon, 8 Nov 2021 19:44:08 -0500 Received: from twspam01.aspeedtech.com ([211.20.114.71]:35930 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235551AbhKIAoH (ORCPT ); Mon, 8 Nov 2021 19:44:07 -0500 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 1A90H9Vf049014; Tue, 9 Nov 2021 08:17:09 +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; Tue, 9 Nov 2021 08:40:23 +0800 Message-ID: <326116c0-acd2-ccc2-d803-486df9c1fa3a@aspeedtech.com> Date: Tue, 9 Nov 2021 08:40:23 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH] media: aspeed: Fix signal status not updated immediately Content-Language: en-US To: Paul Menzel CC: "eajames@linux.ibm.com" , "mchehab@kernel.org" , "joel@jms.id.au" , "andrew@aj.id.au" , "linux-media@vger.kernel.org" , "openbmc@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" , "linux-aspeed@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" References: <20211108061155.14479-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 1A90H9Vf049014 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Paul, Thanks for your help. I will update in the next patch. On 2021/11/8 下午 03:57, Paul Menzel wrote: > Dear Jammy, > > > Am 08.11.21 um 07:11 schrieb Jammy Huang: > > Maybe for the commit message summary: > > media: aspeed: Update signal status immediately to ensure sane hw state > > >> If res-chg, VE_INTERRUPT_MODE_DETECT_WD irq will be raised. But >> v4l2_input_status wont't be updated to no-signal immediately until > won’t > >> aspeed_video_get_resolution() in aspeed_video_resolution_work(). >> >> During the period of time, aspeed_video_start_frame() could be called >> because it doesn't know signal is unstable now. If it goes with >> aspeed_video_init_regs() of aspeed_video_irq_res_change() simultaneously >> , it will mess up hw state. > Please do not start a line with a comma, for example, put the comma on > the line above. > >> To fix this problem, v4l2_input_status will be updated to no-signal > … status is updated _ (Present tense in commit messages.) > >> immediately for VE_INTERRUPT_MODE_DETECT_WD irq. >> >> Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") >> Signed-off-by: Jammy Huang >> --- >> drivers/media/platform/aspeed-video.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c >> index 1ade264a8b69..3facd7ecc1a1 100644 >> --- a/drivers/media/platform/aspeed-video.c >> +++ b/drivers/media/platform/aspeed-video.c >> @@ -762,6 +762,8 @@ static void aspeed_video_irq_res_change(struct aspeed_video *video, ulong delay) >> set_bit(VIDEO_RES_CHANGE, &video->flags); >> clear_bit(VIDEO_FRAME_INPRG, &video->flags); >> >> + video->v4l2_input_status = V4L2_IN_ST_NO_SIGNAL; >> + >> aspeed_video_off(video); >> aspeed_video_on(video); >> aspeed_video_bufs_done(video, VB2_BUF_STATE_ERROR); >> @@ -1889,7 +1891,6 @@ static void aspeed_video_resolution_work(struct work_struct *work) >> struct delayed_work *dwork = to_delayed_work(work); >> struct aspeed_video *video = container_of(dwork, struct aspeed_video, >> res_work); >> - u32 input_status = video->v4l2_input_status; >> >> /* Exit early in case no clients remain */ >> if (test_bit(VIDEO_STOPPED, &video->flags)) >> @@ -1902,8 +1903,7 @@ static void aspeed_video_resolution_work(struct work_struct *work) >> aspeed_video_get_resolution(video); >> >> if (video->detected_timings.width != video->active_timings.width || >> - video->detected_timings.height != video->active_timings.height || >> - input_status != video->v4l2_input_status) { >> + video->detected_timings.height != video->active_timings.height) { >> static const struct v4l2_event ev = { >> .type = V4L2_EVENT_SOURCE_CHANGE, >> .u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION, >> > Acked-by: Paul Menzel > > > Kind regards, > > Paul -- Best Regards Jammy