From patchwork Mon Dec 2 10:03:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180569 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4982564ile; Mon, 2 Dec 2019 02:04:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzhrUenR1s14Jfwca3G1DDDSqv15og9mwpFz/4QmBmBjYJGR9etU73//rNx/CzE9072KRZM X-Received: by 2002:a17:906:19d0:: with SMTP id h16mr12302423ejd.70.1575281046225; Mon, 02 Dec 2019 02:04:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575281046; cv=none; d=google.com; s=arc-20160816; b=D7pFr6cWfFTJp+/NdCh3dE9AqzghLmc4+G3avL1P7/hU4LkNMm83Sgf4E1WjNGFqCk eWnVJTuwtmFZpUV9QrgYXQ7F9XS3IhmwnNffOKGHCI40m7/k19llFuUO2XQHI90fwkpG FS1kPwEd7pIAlQKtef2bOyD3CDVlPwznti+j35KfgyoeDryeCbMcblyBYL3AKHqBjhff sxVY51SLo/8JZ2woxgggDOoL0XW4ttB8kt6HtQSCa8RVer+n+Ln+LBNKO0YM+eA6miIa cHMbG3FkHpogFEx46nZZRsbfKqpu9apqG8hSblEo8y8SgZ3HOQRbm7I4b/G0F21w9D7E Xlng== 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:to:from :dkim-signature; bh=wtROsbUjoLDB5bCQoEYMpQvwKrmALV6Kqcb0leG5CiM=; b=OXdE24wbBWclJAf1gYZOlVbr1hEaaVXeE3+EGJKb9ydVVWqxhA2xh7koPSx8Zv9Zvw wwB/T7Z18mv7I2YWGyUY3gdX7fVUQjLMU/fy/xexhAcuLz1NnnxuyWdzyXkUdMZUBDfX J8+MomW5mc5NZJf2/Im2JwTD6bBOpqvaS6bXxROP1LfpSWkF0nZQyWuspADvHjEhAipm vpypKEhXpvBEubwyY734UcPwp8NFInPAvG5Wpjv5UOoqwBJcR7CoI0X3XNpg/UniTEzT y8+pVDGM++IfsFtgCmCZCNp21N2WOkwl3OrWpbMaxY7so/5OZBPPSwtLykI7aIFXtF2U LtBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DSAhHkT4; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p21si21018960ejz.196.2019.12.02.02.04.04; Mon, 02 Dec 2019 02:04:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=@linaro.org header.s=google header.b=DSAhHkT4; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726838AbfLBKEA (ORCPT + 15 others); Mon, 2 Dec 2019 05:04:00 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51223 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbfLBKEA (ORCPT ); Mon, 2 Dec 2019 05:04:00 -0500 Received: by mail-wm1-f66.google.com with SMTP id g206so21091919wme.1 for ; Mon, 02 Dec 2019 02:03:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=wtROsbUjoLDB5bCQoEYMpQvwKrmALV6Kqcb0leG5CiM=; b=DSAhHkT4ABXACx+/YINknwIGxRO/Z6C9ZGgTY1Jp+bzKmgIig9ZZb45L9xTp7ea1hp /raeG28Q2hN3Y68iop02u6b74gAwagvMUui0AybmFKrTZn1Wf3rqR04iMID5622xeQuo /zpAQ0oqiEh/h6oulX4arXz1j+voAm8tLY/rsMe7ZoBWG6uhPwUUMmE/c28HULOecdvc XxJpCr8A83P3d5tFtU0rHa1B6r+Cmqffjde9qm3nGQZbWtqRv8Vh5Ey+6FWdiNFe6Ax9 qRpc07w/NFzrfpCESNCqb8TmkZZ69UAdgfUD3LbWORV3ZYS9Ib3yz5ciHhLyLGmTal0L YoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wtROsbUjoLDB5bCQoEYMpQvwKrmALV6Kqcb0leG5CiM=; b=nz8u57C1uylbs9IxGq4F767qGm4pZF+ybCUGySXCHs60qQvPIacudFT7aDAcDitIWb jyX5Sa/a22YZngz5Zsfp+D7Il8zTapE83qxoxumYsYym5Ehcw8w5dme6Ehl0k4ihqMj4 qFoFRusw2us9mLP9p08jvEr8d6zhvEzXCw/c0ggiVTHmX1yCbSBmjRTO38mFyj2q8llR GtmEia+DJTG9VkAEdxMTtSif6EtNaCfKZ6MgU7Nmr3pqULEWAwjUN8TTn6fTFwwAxOd6 6jJL8vSdMaLSp3Jc8qE9E/V1pax0bmf/SEIyk8+yCQ6Pud9IA5hri3OXDLrepKdzw7ae EImg== X-Gm-Message-State: APjAAAVzj0Ki4+mQq2IKXMDRqQeeIjXZanO77AaAbqYyZAmtP92JEW8S TrIf2veC1cmQ5REJsIAtx5Q/I+GXY7s= X-Received: by 2002:a1c:7306:: with SMTP id d6mr6903830wmb.164.1575281037159; Mon, 02 Dec 2019 02:03:57 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id h8sm22975665wrx.63.2019.12.02.02.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:03:56 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.14 08/14] media: atmel: atmel-isc: fix INIT_WORK misplacement Date: Mon, 2 Dec 2019 10:03:06 +0000 Message-Id: <20191202100312.1397-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202100312.1397-1-lee.jones@linaro.org> References: <20191202100312.1397-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eugen Hristev [ Upstream commit 79199002db5c571e335131856b3ff057ffd9f3c0 ] In case the completion function failes, unbind will be called which will call cancel_work for awb_work. This will trigger a WARN message from the workqueue. To avoid this, move the INIT_WORK call at the start of the completion function. This way the work is always initialized, which corresponds to the 'always canceled' unbind code. Fixes: 93d4a26c3d ("[media] atmel-isc: add the isc pipeline function") Signed-off-by: Eugen Hristev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Lee Jones --- drivers/media/platform/atmel/atmel-isc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.24.0 diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index 504d1ca0330e..0dea3cf2cb52 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -1555,6 +1555,8 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) struct vb2_queue *q = &isc->vb2_vidq; int ret; + INIT_WORK(&isc->awb_work, isc_awb_work); + ret = v4l2_device_register_subdev_nodes(&isc->v4l2_dev); if (ret < 0) { v4l2_err(&isc->v4l2_dev, "Failed to register subdev nodes\n"); @@ -1614,8 +1616,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) return ret; } - INIT_WORK(&isc->awb_work, isc_awb_work); - /* Register video device */ strlcpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name)); vdev->release = video_device_release_empty;