From patchwork Fri Apr 12 10:19:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 10897899 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 285121800 for ; Fri, 12 Apr 2019 10:20:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0675928E40 for ; Fri, 12 Apr 2019 10:20:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE98C28E6B; Fri, 12 Apr 2019 10:20:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D17928E47 for ; Fri, 12 Apr 2019 10:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ivYJpEB0dCazu3r1K+bxPIW4HD52iRvQbayDmZf+NOE=; b=mHsII7AWda9WjC nLM//gpMMePqishQoLAaGDpPqFwXRoK9M5BZtdLNmCFjj6eNkwUqHRTWt8yRJvoGLz9m/44zRL0X2 9XIBllvwxoQ2CnZXjtAHte/RSCyOz9ZNrQy8W90S1EQnpf/Ko/X78GdJYeW2rtWPRGUba3AnIW5/y ITwC274CHGYbk5U3tzLP984OT6IZhJkUU3B2u2ytvoPCiprOFYgS5Ma7yv76GQBg50V2qzFuxexbE EbyS+RIpj7CW7IgrOESvhosznhniyGRIww8Bpaho8kPlV9pBbxVkZq42V/nRdrTIrUj4vmxWvtc+x kafNqEuRT6bYwnToxt1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEtII-0005i8-6p; Fri, 12 Apr 2019 10:20:26 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEtHi-0003cg-3e for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2019 10:19:52 +0000 X-IronPort-AV: E=Sophos;i="5.60,340,1549954800"; d="scan'208";a="29792643" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 12 Apr 2019 03:19:48 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Fri, 12 Apr 2019 03:19:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TmfYvnqDDdveQXhLG7K4xfbnSATFnPRs+Ljzcnumuew=; b=ge+rXSdzI1M8Fln9v729V3w0IFMyPyCgZP6lgDIhxhFUlFC2rD+taLpjTCQeM+YTuIQVOtzSdO3kN0swmYKxTQC7pDC1SRgaDU8que0uymwwwKkegPQnWHuOsK05W9YDyAGNvJ/Jup/e12UBqK/6Iwo/aMRg02VtG6CsmkX67Ok= Received: from DM5PR11MB1242.namprd11.prod.outlook.com (10.168.108.8) by DM5PR11MB1947.namprd11.prod.outlook.com (10.175.88.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.16; Fri, 12 Apr 2019 10:19:46 +0000 Received: from DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::e0e3:1d51:9e3e:6dc]) by DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::e0e3:1d51:9e3e:6dc%3]) with mapi id 15.20.1792.016; Fri, 12 Apr 2019 10:19:46 +0000 From: To: , , , Subject: [PATCH 2/3] media: atmel: atmel-isc: fix INIT_WORK misplacement Thread-Topic: [PATCH 2/3] media: atmel: atmel-isc: fix INIT_WORK misplacement Thread-Index: AQHU8RlAswvvLxh+TkKT8iU+bXVupw== Date: Fri, 12 Apr 2019 10:19:46 +0000 Message-ID: <1555064098-19310-3-git-send-email-eugen.hristev@microchip.com> References: <1555064098-19310-1-git-send-email-eugen.hristev@microchip.com> In-Reply-To: <1555064098-19310-1-git-send-email-eugen.hristev@microchip.com> Accept-Language: ro-RO, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR06CA0111.eurprd06.prod.outlook.com (2603:10a6:803:8c::40) To DM5PR11MB1242.namprd11.prod.outlook.com (2603:10b6:3:14::8) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Eugen.Hristev@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d467acd5-cc23-456c-fb92-08d6bf30633a x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328)(7193020); SRVR:DM5PR11MB1947; x-ms-traffictypediagnostic: DM5PR11MB1947: x-microsoft-antispam-prvs: x-forefront-prvs: 0005B05917 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(39860400002)(136003)(376002)(199004)(189003)(105586002)(54906003)(102836004)(36756003)(50226002)(26005)(14454004)(2906002)(97736004)(66066001)(6486002)(6436002)(6506007)(386003)(305945005)(7736002)(2501003)(81166006)(5660300002)(8676002)(446003)(8936002)(81156014)(107886003)(256004)(486006)(4326008)(478600001)(76176011)(110136005)(106356001)(68736007)(316002)(86362001)(3846002)(71200400001)(52116002)(72206003)(2616005)(476003)(25786009)(6116002)(186003)(6512007)(71190400001)(99286004)(11346002)(2201001)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR11MB1947; H:DM5PR11MB1242.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: PAK1VIB696z5+4ANTKqPv7GAmGcfExry6MbeL7bn+rw5IZKiVBkiR422eShkIjwMLWMT5spDIkQRGSiBbcPWEbtsj9jUVdUL8Ur1yz3i75QxIa1Amsuk2FXSChD2AEUWTzkU63AIw4P3xyyXItrucEvkdILHxPwXTx6lW7axF/fBS9XcCuByeEICuYRRb3kpseX6Zez9RnkDcPUMH2ObKnk1kHSlSUCMrq9B6ns7Q+KqKWD+HUN0oFNDaTWK9IIdkBi5ZQQFSv9DbjTzTR67+u4bf+mHHO1WjkQzRj0MVJmj2v+I1r26PCn8RzBhYp3oiKjP8G5kUsc6XCFhMERdEL2qDGkfNN2E/Inaev3w0KyLNrGecwC1Zgxt1xD+/sJvNSUVmVZWH9irjtOLOb0UGNLn83mJVTvdwCvA2U1viPY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d467acd5-cc23-456c-fb92-08d6bf30633a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2019 10:19:46.7722 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1947 X-OriginatorOrg: microchip.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_031950_366352_48CD742E X-CRM114-Status: GOOD ( 11.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugen.Hristev@microchip.com, ksloat@aampglobal.com, mchehab@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eugen Hristev 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 --- drivers/media/platform/atmel/atmel-isc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index ea7520a..aef90db 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -1998,6 +1998,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"); @@ -2051,8 +2053,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) return ret; } - INIT_WORK(&isc->awb_work, isc_awb_work); - /* Register video device */ strscpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name)); vdev->release = video_device_release_empty;