From patchwork Sun Oct 16 06:15:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 615618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB8F5C433FE for ; Sun, 16 Oct 2022 06:15:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229739AbiJPGP4 (ORCPT ); Sun, 16 Oct 2022 02:15:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiJPGPy (ORCPT ); Sun, 16 Oct 2022 02:15:54 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1877B36DD3 for ; Sat, 15 Oct 2022 23:15:54 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 224CF987; Sun, 16 Oct 2022 08:15:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665900952; bh=LllqCoqFfQqVNyBPCvOG9ktBZpUQHAHCKoItxeNKK9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWwdk9HQrJFVRNt3MR6xgrD5rCpYwX3ygMw3GYr5XIoZzyIaSG3+t45Bro80Aflh0 dQWFALLt/qt8HOjsaqkSzsUsb7G4BfhvHShpvEI/cN4OCDCMVOhgQlJe/KzieIKW/T /e0ADGAduM6D2MrhQNjmoxLwy5iT5t6CgmfoGEh4= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Sakari Ailus , Manivannan Sadhasivam , Alexander Stein , Dave Stevenson Subject: [PATCH v2 02/20] media: i2c: imx290: Use device lock for the control handler Date: Sun, 16 Oct 2022 09:15:05 +0300 Message-Id: <20221016061523.30127-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221016061523.30127-1-laurent.pinchart@ideasonboard.com> References: <20221016061523.30127-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The link frequency and pixel rate controls are set without holding the control handler lock, resulting in kernel warnings. As the value of those controls depend on the format, the simplest fix is to use the device lock for the control handler. Signed-off-by: Laurent Pinchart Reviewed-by: Alexander Stein --- drivers/media/i2c/imx290.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index 99f2a50d39a4..d97a5fb1d501 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -1043,6 +1043,7 @@ static int imx290_probe(struct i2c_client *client) imx290_entity_init_cfg(&imx290->sd, NULL); v4l2_ctrl_handler_init(&imx290->ctrls, 4); + imx290->ctrls.lock = &imx290->lock; v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops, V4L2_CID_GAIN, 0, 72, 1, 0);