Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3477640imu; Fri, 18 Jan 2019 11:04:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN6f1SLk84NGsyCxLko3+KAIcwWgqvKxJy4xJrXI+spHuWoqQSwcgvxOM9FyJZEB1Ktasf/m X-Received: by 2002:a65:6491:: with SMTP id e17mr18730969pgv.418.1547838246506; Fri, 18 Jan 2019 11:04:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547838246; cv=none; d=google.com; s=arc-20160816; b=Wr5GLcSbqv7dTj/Cm/Xs4GmvpmhJ7guHQ4Xt9sFBwx8OyCLCdQ9c4yHiSYu0gWn3qf Oh7H0PJkFiL95I6MXSpJVM74a+zC5q6LfY/NDVSxK6tWaEFKBo/9mfUGygC8HcUCnTva vIkKY8n8ixjVvhLIETfNUWY1Td8ID1atGtPvrBjX5nWBRQ7UShSASSpRfX+YT7LGZIyZ f1M8G/apJHRFLBn/ne+V6MyCA1fQSnc08Pdwi3oU5Bc0WwuiyFS3eIRm0eK99flq1QUL eQMvA9MPbCNC5ZoTAyJYSbwntddJjfDcFvYg6yJZA/JYirRw2aAZQJ/H457W3Z7zMl02 2NhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=o2aBihmd7kCS/IVyvwHcJEqsYBV/JMJi5NSNOXEgv4A=; b=pNP700lT338QHabD/mMp98yrpdAjUNKE2q7wgi9OF79AG5z8xt87M5KIEH1c96MKPu Dwotc5NMxjWZqWUenpMFeQ1bjDn8OCTahugHUCfUq5lnZlVi5ZJady74llvDkO+f/3yP f+7m14DvWGqOxjzWgy0G2SNC6nmrWYGEwzcZUbevtjp2par6zKzdaAm7RlLC8cXLcqMH x6j1uafx4omLRGyI/LdmfUsPxFQFffPPnAb4gdRfdjmGMBFdx8R7O/dR+JxzOx2H8UeZ Cio7gbdQ54TFUa544uN+GbSEhYWzq39UilptZtOub9i3ld896tdO9b443533YKx0EPdq cymA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tXGZ3AD1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i96si5302878plb.188.2019.01.18.11.03.50; Fri, 18 Jan 2019 11:04:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tXGZ3AD1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729308AbfARTBo (ORCPT + 99 others); Fri, 18 Jan 2019 14:01:44 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:33029 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728583AbfARTBn (ORCPT ); Fri, 18 Jan 2019 14:01:43 -0500 Received: by mail-wm1-f66.google.com with SMTP id r24so1628643wmh.0; Fri, 18 Jan 2019 11:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=o2aBihmd7kCS/IVyvwHcJEqsYBV/JMJi5NSNOXEgv4A=; b=tXGZ3AD1uewX/gkWlTNNLm2/qjJk40/HlKu7T3b5hToJ3gndB6XlsgDvcU0EVv/Wfc c6KP9BFVovCKcxm1yXXnqRtP3TS4DCMi47r2Agnkj1OZKebaI/2N8+OR/DuLpqN7tUUw EXxCE9wwz2GXxsM6UnK6uOGWYlw56iR9qFYC0cwK4n2ex3afnTnHfnDAglwJaS9NYsro OGas3G9kIDDfnDwhTaoVwzyTTg98NvdTLtMc7GriibzccJ0r8VAuT03aIHoKnBeD3fGU FH4Pf7CBBPCPLnXbdH7RbxsU36xdAC/VYJgKXWFKyPySxPe09cE83bTnqabBMKMQnivi YLQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=o2aBihmd7kCS/IVyvwHcJEqsYBV/JMJi5NSNOXEgv4A=; b=VXjow91VBEpFgJ3f7UhhKGw2jDWo4yAKKp36WYjvrFwyfXZuDLhLnpjfQdCLIargQ0 VHH/OYTm5mKmBp6lDHgia/rQhLU0/EMSRaDT4W7eH5T2vtwsuasRmm8oa2fYtN15tgL5 wmra2s+Ycyantml09TUIiBvlmHZobYhsJaBb8fjXODLBTsm85HqXZj1FU1j/ijidqik/ KCYBXPbufpDP3EgL3HV3AK81ml66IMkknGbgw2qL9CIEDpIZrDcbLMp4dyrWl2PpFwcK PA7iJydY5uTGnkeAE5I7KvjJcwkvIklEKh9N7natCF1rMGRAR06XoYgAgp0JIO/UVGyv pdSQ== X-Gm-Message-State: AJcUukdpbku/EcG38/9HTESLjzBDrDOeGjCp4NY+uY/3FA2RIBHlMpXN uHd1J7dtayZzVGY0Yb2wAUwjhIBN X-Received: by 2002:a1c:e345:: with SMTP id a66mr16368663wmh.12.1547838100050; Fri, 18 Jan 2019 11:01:40 -0800 (PST) Received: from [172.30.88.68] (sjewanfw1-nat.mentorg.com. [139.181.7.34]) by smtp.gmail.com with ESMTPSA id o9sm27557988wmh.3.2019.01.18.11.01.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 11:01:39 -0800 (PST) Subject: Re: [PATCH v2 1/2] media: imx: csi: Disable CSI immediately after last EOF To: Philipp Zabel , linux-media@vger.kernel.org Cc: stable@vger.kernel.org, Mauro Carvalho Chehab , Greg Kroah-Hartman , "open list:STAGING SUBSYSTEM" , open list References: <20190117204912.28456-1-slongerbeam@gmail.com> <20190117204912.28456-2-slongerbeam@gmail.com> <1547807043.3375.3.camel@pengutronix.de> From: Steve Longerbeam Message-ID: <56b43909-136b-fce0-e743-26cd6afd0eea@gmail.com> Date: Fri, 18 Jan 2019 11:01:35 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1547807043.3375.3.camel@pengutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/18/19 2:24 AM, Philipp Zabel wrote: > On Thu, 2019-01-17 at 12:49 -0800, Steve Longerbeam wrote: >> Disable the CSI immediately after receiving the last EOF before stream >> off (and thus before disabling the IDMA channel). >> >> This fixes a complete system hard lockup on the SabreAuto when streaming >> from the ADV7180, by repeatedly sending a stream off immediately followed >> by stream on: >> >> while true; do v4l2-ctl -d4 --stream-mmap --stream-count=3; done >> >> Eventually this either causes the system lockup or EOF timeouts at all >> subsequent stream on, until a system reset. >> >> The lockup occurs when disabling the IDMA channel at stream off. Disabling >> the CSI before disabling the IDMA channel appears to be a reliable fix for >> the hard lockup. >> >> Fixes: 4a34ec8e470cb ("[media] media: imx: Add CSI subdev driver") >> >> Reported-by: Gaƫl PORTAY >> Signed-off-by: Steve Longerbeam >> Cc: stable@vger.kernel.org >> --- >> Changes in v2: >> - restore an empty line >> - Add Fixes: and Cc: stable >> --- >> drivers/staging/media/imx/imx-media-csi.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c >> index e18f58f56dfb..e0f6f88e2e70 100644 >> --- a/drivers/staging/media/imx/imx-media-csi.c >> +++ b/drivers/staging/media/imx/imx-media-csi.c >> @@ -681,6 +681,8 @@ static void csi_idmac_stop(struct csi_priv *priv) >> if (ret == 0) >> v4l2_warn(&priv->sd, "wait last EOF timeout\n"); >> >> + ipu_csi_disable(priv->csi); >> + > Can you add a short comment why this call is here? Since now > csi_idmac_stop is kind of a misnomer and symmetry with csi(_idmac)_start > is broken, I think this is a bit un-obvious. Yeah. I think a cleaner, more symmetric solution would be to split up csi_idmac_stop. > > Also note that now the error path of csi_start() will now call > ipu_csi_disable() while the CSI is disabled. This happens to work > because that just calls ipu_module_disable(), which is not refcounted. Thanks for catching. Splitting up csi_idmac_stop will fix this. Working on that. Steve > >> devm_free_irq(priv->dev, priv->eof_irq, priv); >> devm_free_irq(priv->dev, priv->nfb4eof_irq, priv); >> >> @@ -793,9 +795,9 @@ static void csi_stop(struct csi_priv *priv) >> /* stop the frame interval monitor */ >> if (priv->fim) >> imx_media_fim_set_stream(priv->fim, NULL, false); >> + } else { >> + ipu_csi_disable(priv->csi); >> } >> - >> - ipu_csi_disable(priv->csi); > Reviewed-by: Philipp Zabel > > regards > Philipp