From patchwork Mon Dec 2 10:30:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180596 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012207ile; Mon, 2 Dec 2019 02:31:17 -0800 (PST) X-Google-Smtp-Source: APXvYqw5iWPlpOD3XVt+J5p+KMOrd7lr8af5SHYWw6i5lCaawN3skEFnXqPraO9Abu6RtyrMGR0T X-Received: by 2002:a17:906:3107:: with SMTP id 7mr58868859ejx.125.1575282677748; Mon, 02 Dec 2019 02:31:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282677; cv=none; d=google.com; s=arc-20160816; b=uBKjhGH1TpWUhIwhpJm+HgU2bct5+jI96S3dw5yiM0lLUgg1B0dPd/AN4nhX79xQ5k rGR/lRyw3WnEU/3WVcoqUi7aU22fIoIdG51orOiInduTxQC2/railt1UMhg5URJEn+JR PLhA/a6RdaUGoBPT5NMjT/Tt3PVV+/cJhtVUcAYzT3ne/2dkkplhKhr2u43iwMn9iIYZ Piasj1/G2K1Adv1h+n7qdmd8/VORBHuDDBJAIn+BzjlDHv9FqpAXF/6OraPrNzRb6gEm 6byEDx4EC1I9orvxgE+C55CE3B0Z/US1oonumSDiIt31cH43SKjgIQJcLin+v0R5UEUR Cygg== 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=R8AAvwaj+CXQP64zDDHz2NkHRoMaj2Fuj9qQc9YxRqk=; b=JhHQHpTn+DzVC3QXVr31YGyDzC6pdhQ7PuHigqAV97cUaE6NEGbbB8qzxcsfAym0tn 0Z86GCC9GE/YpYa2P6J8Ah2glNbqT6h18QHWj/jNnnKcZXD3gF8nhL+cE54SAkMnkYJy zHRYFLy/DciPXv0Kk7+YHXXifVVwtksAWbcesZnTN55oKKbOngah0/TE6XPDP3WYs2Of kQIWrgnqZ+yKPPq6Ihu+E3gjoOfgT8Kr+bf1a5zy4mTRyP94EXG984U0hkGK6e5AgPlz yHeybbMC3pZtgK4dIC6QTTsvDdcPAA0exELdy4UNfmbIuqBF/K0oSe0aVIsZ5Ntkrd55 a6nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ogc8ONl5; 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 e21si4015152edq.191.2019.12.02.02.31.17; Mon, 02 Dec 2019 02:31:17 -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=ogc8ONl5; 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 S1727366AbfLBKbR (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:17 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39499 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbfLBKbQ (ORCPT ); Mon, 2 Dec 2019 05:31:16 -0500 Received: by mail-wm1-f67.google.com with SMTP id s14so15818655wmh.4 for ; Mon, 02 Dec 2019 02:31:15 -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=R8AAvwaj+CXQP64zDDHz2NkHRoMaj2Fuj9qQc9YxRqk=; b=ogc8ONl5ioZV7aVelcXGrPpSCvjgc3g2Ooy9Pt4SC4ciKp43/jpvMIW4q8HsK5HF9z 5iFF6eN+6mjxPWOwlS5sH2FeQZLrcUPdvABC5u9fvqe6uQRct89CNjck4NVIX40UPkQU adeTW4UrBoV9Ci5v5AG8Ztat70aly8cuuOyjv55BJK66qjmpQzucTrCzB+wA48WxfkG2 roCZ/HwVA6l5Av4rHcI50FuqQchC8vNlEuo0T5Ujfq/L8O3VbdgDO1MCMqqTxsp0LAT6 yXs+d0U90uffrweyt6VdJvVy7pL5fsT3XIffkMNbD2f8RHw87zj6L0rEXt2+sn7DHp1i Rxtw== 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=R8AAvwaj+CXQP64zDDHz2NkHRoMaj2Fuj9qQc9YxRqk=; b=iapdwLuT1yyDyNAdxA6XOoO4EMAc0X3ts7JyBtVJQqinimHEcwJorVedA2ov1nNqj6 DXddjHZW7ZN5Y/6KhdT05jj92b07+NxOiFyhsY8ATrKzrJnn2c+NStgiJhkwiqYbdLdf PMIqpe5l0xNZkjur6CkVFD5yWMEOhgGe5uhfdVq7EmQgJm8mhmGQJ/e5F8uutQ+Wabtt fmU4eK3Uk5OUayum4oHav3nSP3CJgZ5pyJ+xFwPao7h+KIvD+nByzjuz36yXpyygI9g6 fzHB9Ggtl5d10Ul8FT8/9m8iITOTYVdXgZ/NggvfjdVrUIRHhtE8rvRCkUugozFxUHw7 jkEA== X-Gm-Message-State: APjAAAV/SpjeR+LtJC+FHPNdXC+/TAmfC2PtkR9v8W+oXdM6lyX1Vetf 4hcwj8Xzmuk0YISptbijYjrV3sH3sM8= X-Received: by 2002:a05:600c:290e:: with SMTP id i14mr27115656wmd.126.1575282674377; Mon, 02 Dec 2019 02:31:14 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:13 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 09/15] media: atmel: atmel-isc: fix INIT_WORK misplacement Date: Mon, 2 Dec 2019 10:30:44 +0000 Message-Id: <20191202103050.2668-9-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-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 f2b09ea107b1..1fd078257670 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -1895,6 +1895,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"); @@ -1948,8 +1950,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;