From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EBE09C05027 for ; Mon, 23 Jan 2023 09:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:Reply-To:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=H0ev2sp5oOmUxb6BdYIoEzbbJQMMt4TL7bygwzLaTgM=; b=yflabKnUOYjZCoZWWpL3Drby6j 28PK3jvP7QOc2S/kQrLYQVeJy6eQyAEV35MSPkc0C2KertN6oEYhYmvvejU51XO9bMeS0qso9JDeU FZm7MVybeH68LjEL2UeB4TFnFtlQyCpmt5r2EWoQHpfbz/yAd0hMt0JnoYEfYFU08sdR6OQcFBjJ0 ojxVcjjHo2+U/Kw2XCmHy3pAerviNiGv+6fLOcFnPDQOPrYBGQyKhIjPIRVCwVZ6SCApgt6OcAkgI cMU1l47lOGtbafvVb1w5b7oxJxgBcG9bc4gRCVUtYZzKhIKGrj/0dthj02ZHO+66TDOY8aFtrmQQ6 2dSupZxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJtQu-00GZsy-Jw; Mon, 23 Jan 2023 09:48:08 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJtQr-00GZpc-6E for linux-arm-kernel@lists.infradead.org; Mon, 23 Jan 2023 09:48:06 +0000 Received: by mail-wm1-x32e.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so10161332wmb.2 for ; Mon, 23 Jan 2023 01:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=iIfSs1QU1y62hh19vUyf32vrywpZMGQTYBDrvO1iiAw=; b=SgDrQSwGjXxTU2UClar2sLKGiAclP9O53rWoeJS/htmHdHmj221R1PfCZvV6sxhIoM scZnK8u5Fdu++gqz0qBCFSrK8mAAy5IlNSbApeKcNbbBtydSs8h0XPMlMdR2wQ9fc327 smRhFO1m+aKBuYbA6906CKaewlaoExJxuRrJazRjmq9evys+5Hx+KZchZKGmuP4zZfJs BhHGYp3fXsjvdZiCRuOrLUYAOdC4UHUtnpmCoknonMdD7vDSaYQnxYWTegPJ0bA+xSNN BQjVmTifXvQoK6mmzJFGaRTQS79LcU0U8KO7DZW0pfEYqd5MCg/Wz4tjHkO1bVkQMiO5 bCpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iIfSs1QU1y62hh19vUyf32vrywpZMGQTYBDrvO1iiAw=; b=p0D7EVHe/pgKar9foNdKCSbBsKT4uDbD3FfMa7LkwEggQIfZ91NxEZ2UHnzPFDYoto MVCft8O5Pp4FD2AM9gRij6svzimP7d+shzS/hGRq5dwDkjeS0cvGacgZBMkMMNISMOLQ J88j71w4woapx1vfP/RXK0T6DurDxXl0Y/Pu+HhU0gX1LS55GAWtqG2jaIAS4FPtKllR eEZC5yLx79K+vRTQYXM5Tx2VimRh2qxRXFliZVqZfYna2PozWTVJZwpIRj3MI1/mWJ01 ra/68ZLTfpxQ3pKswe1gD9EMXaQh7EQJ+HRMIE+12kFvCCMzlzEifKSNcGYI7KCn6Sk0 SIqQ== X-Gm-Message-State: AFqh2koIOZ7AeAG+8OwLOISD8DfLLfAuDvsBeulEXZMrCspTfSmwJWCU wmItKsPGh/rM7Li3ZsNbBioO7Q== X-Google-Smtp-Source: AMrXdXstCCqiov4SnLO9YPRF6ilbaVnOwBM7iOZselENPe8gfNIr7OzYice+0ciH9jM+ocDeKZ2tgA== X-Received: by 2002:a05:600c:21c4:b0:3da:fcf1:d4cc with SMTP id x4-20020a05600c21c400b003dafcf1d4ccmr23134268wmj.30.1674467278075; Mon, 23 Jan 2023 01:47:58 -0800 (PST) Received: from [192.168.7.111] (679773502.box.freepro.com. [212.114.21.58]) by smtp.gmail.com with ESMTPSA id ba9-20020a0560001c0900b002b57bae7174sm4078111wrb.5.2023.01.23.01.47.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Jan 2023 01:47:57 -0800 (PST) Message-ID: <3a3d9fc5-0f61-8da7-dc4c-7b57b0272230@linaro.org> Date: Mon, 23 Jan 2023 10:47:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 From: Neil Armstrong Subject: Re: [PATCH] media: meson: vdec: esparser: check parsing state with hardware write pointer Content-Language: en-US To: Christian Hewitt , Mauro Carvalho Chehab , Greg Kroah-Hartman , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Neil Armstrong References: <20230123094300.2816812-1-christianshewitt@gmail.com> Organization: Linaro Developer Services In-Reply-To: <20230123094300.2816812-1-christianshewitt@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230123_014805_290869_7B7CBDA2 X-CRM114-Status: GOOD ( 17.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: neil.armstrong@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 23/01/2023 10:43, Christian Hewitt wrote: > From: Neil Armstrong > > Also check the hardware write pointer to check if ES Parser has stalled. > > Signed-off-by: Neil Armstrong > Signed-off-by: Christian Hewitt > --- > drivers/staging/media/meson/vdec/esparser.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c > index df5956c6141d..41b705f999b2 100644 > --- a/drivers/staging/media/meson/vdec/esparser.c > +++ b/drivers/staging/media/meson/vdec/esparser.c > @@ -300,6 +300,7 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf) > u32 num_dst_bufs = 0; > u32 offset; > u32 pad_size; > + u32 wp, wp2; > > /* > * When max ref frame is held by VP9, this should be -= 3 to prevent a > @@ -354,15 +355,21 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf) > } > > pad_size = esparser_pad_start_code(core, vb, payload_size); > + wp = amvdec_read_parser(core, PARSER_VIDEO_WP); > ret = esparser_write_data(core, phy, payload_size + pad_size); > + wp2 = amvdec_read_parser(core, PARSER_VIDEO_WP); > > if (ret <= 0) { > - dev_warn(core->dev, "esparser: input parsing error\n"); > - amvdec_remove_ts(sess, vb->timestamp); > - v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR); > amvdec_write_parser(core, PARSER_FETCH_CMD, 0); > > - return 0; > + if (ret < 0 || wp2 == wp) { > + dev_err(core->dev, "esparser: input parsing error ret %d (%x <=> %x)\n", > + ret, wp, wp2); > + amvdec_remove_ts(sess, vb->timestamp); > + v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR); > + > + return 0; > + } > } > > atomic_inc(&sess->esparser_queued_bufs); It's weird, but: Acked-by: Neil Armstrong Thanks Christian for handling those changes Neil _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel