Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3759665imu; Fri, 18 Jan 2019 17:06:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN6VWs2hF46kwRGii0IemIYf84cMeksPv4S5LdD061gKJfnFIZOaRqE/IPulroieg2esrwez X-Received: by 2002:a62:5b83:: with SMTP id p125mr21679079pfb.116.1547860005635; Fri, 18 Jan 2019 17:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547860005; cv=none; d=google.com; s=arc-20160816; b=RBbKpksgbPvagzrvHsLe9Tb6NtMCR/zIKt9tn8rshMgBLRwtua0Lns+3uQONG7tWSP 07dNhJVd033+wQfpa3ta2tvcfrE4XlRLPX/rhbNkhDsiJbozpksMpQ/d8bi1MuKPotSn lPoh34sMrhOUlRIsbqtu2XJr0MlKKwDkmcCiwqO/olxhRQuHBeTj2TWX2SJhNDddtXmU uK4Uju1sohoPU3jSADfWAOrkaEyAKY18uqitY1dFVeNXAJCAq7O+BaPCzDBi2y6HgHND CYZohOY17oEJCivy4CcT1OKN8c1mrO4wxe2icpvG+9MuBFsQX9Jo4MP9etvBR2TczDJQ QMIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DR6wQrOYCRD76/XALXGYcBsHpWArVMALpXWgTdCxRPU=; b=uFNPoBEntUFYpHrAPLA+DLMjJ8FeSKKCEly11z/FETm1PIP3+OndL7hnbZbhTT98UR G6JosS4akeSfaoL8U20vle4ccBxAYlACt8qsFUZnPzQSq/XyxMkpoqymj/khvkr8MxrN 0gzYtytXwclmPfWNQkOXniDd1YHOlq2q6q6dz7LVWcIoVO5bZdwYL/Vp9PdhaDH024lx 7Gy9fzFbcI00W0CFZNK0eti4TwtHJQc8ZGK9TFZ05oUGTtcll/2nj4ktYMecw5AYeCBX rms5No+nhsG/qRNEDfs64gJWf0rjGXyS82ILWhx170vMF8d/wmjo5Jy6jV2zDkuGUUND grkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XKlWFYjR; 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 c3si5522113pls.73.2019.01.18.17.06.27; Fri, 18 Jan 2019 17:06:45 -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=XKlWFYjR; 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 S1727375AbfASBFI (ORCPT + 99 others); Fri, 18 Jan 2019 20:05:08 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:44256 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbfASBFH (ORCPT ); Fri, 18 Jan 2019 20:05:07 -0500 Received: by mail-pl1-f195.google.com with SMTP id e11so7053896plt.11; Fri, 18 Jan 2019 17:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DR6wQrOYCRD76/XALXGYcBsHpWArVMALpXWgTdCxRPU=; b=XKlWFYjRaCmTAQuh5EggygwHVM9RMNkaw2jstdar/lhRFWtXt30mMRQwr7zbZNNIBQ m0dkIOi69fg1/k66MubV80ylgqLmUTOT7drPXucmuSB/idrxcj3/54SGGcedPTuLERkq uTEIN1Ess3e0kcKTRaaMLVOqVMjL/nmebn47dmtRULLwzuN+YAAr34rZSEgFYkzUSL5C wM7zpLEM5rjdsTs5B0LQdpNs5ddP0pHXzc0s1G/f/HAGR2RPiB/SsNBWyKl3izMZETEA gnneJ031IMAUHxUw44O/8AlJDfwpEtN+5G9buT0MkMoLzRtRkxnqJKmD9pN1gEwLeH5A N9Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DR6wQrOYCRD76/XALXGYcBsHpWArVMALpXWgTdCxRPU=; b=AuOGehDGuLIMb6N7nYq4geIir9pnBa+G3J1vsoDntGmtD8TDvc8TAOzStGUCriKmEw U7AfSYS4wy+Q3KlQr5rchB4PM+FqaM1EfP/lNAvl0fjzvxxBdL4njgaBzNtZi6b5vkpz 5sjWaCbxZoaT4wACijXQvsXB4tPJpW+2nZl8D73AXYZbz44hR/JSF35io4IxwIq2ZnKx 5doFP2Yc90YpCtdcLwPmpFrCkV05nT3xyhnCXgr4Ykxa6MNC4boEeAwhZEYrExMvpf7a FFZvSIRT8mLtehLIwhJuIL8NLlIEZ6jgCrebKgjtkR1wXb4m0Ab4P9STZkKrEumddjuy i/Tg== X-Gm-Message-State: AJcUukdR1qktBrGP0k0NTrbhnKye6fsZbVzEWd5cA74q7H8YxjDkfQ02 GRz6MERkQxlheSOLBOTF4RamvEje98g= X-Received: by 2002:a17:902:9a81:: with SMTP id w1mr20407109plp.19.1547859905751; Fri, 18 Jan 2019 17:05:05 -0800 (PST) Received: from majic.sklembedded.com (c-73-202-231-77.hsd1.ca.comcast.net. [73.202.231.77]) by smtp.googlemail.com with ESMTPSA id w128sm7955307pfw.79.2019.01.18.17.05.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 17:05:05 -0800 (PST) From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Gael PORTAY , Peter Seiderer , Steve Longerbeam , stable@vger.kernel.org, Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 1/2] media: imx: csi: Disable SMFC before disabling IDMA channel Date: Fri, 18 Jan 2019 17:04:56 -0800 Message-Id: <20190119010457.2623-2-slongerbeam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190119010457.2623-1-slongerbeam@gmail.com> References: <20190119010457.2623-1-slongerbeam@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Disable the SMFC before disabling the IDMA channel, instead of after, in csi_idmac_unsetup(). 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. Stopping the video data stream entering the IDMA channel before disabling the channel itself appears to be a reliable fix for the hard lockup. That can be done either by disabling the SMFC or the CSI before disabling the channel. Disabling the SMFC before the channel is the easiest solution, so do that. Fixes: 4a34ec8e470cb ("[media] media: imx: Add CSI subdev driver") Suggested-by: Peter Seiderer Reported-by: Gaƫl PORTAY Signed-off-by: Steve Longerbeam Cc: stable@vger.kernel.org --- Changes in v3: - switch from disabling the CSI before the channel to disabling the SMFC before the channel. Changes in v2: - restore an empty line - Add Fixes: and Cc: stable --- drivers/staging/media/imx/imx-media-csi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index e18f58f56dfb..8610027eac97 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -560,8 +560,8 @@ static int csi_idmac_setup_channel(struct csi_priv *priv) static void csi_idmac_unsetup(struct csi_priv *priv, enum vb2_buffer_state state) { - ipu_idmac_disable_channel(priv->idmac_ch); ipu_smfc_disable(priv->smfc); + ipu_idmac_disable_channel(priv->idmac_ch); csi_idmac_unsetup_vb2_buf(priv, state); } -- 2.17.1