Message ID | 42695db9edcf5e6b5ddebab59338eb88a5abcebe.1725285495.git.hverkuil-cisco@xs4all.nl (mailing list archive) |
---|---|
State | New |
Delegated to: | Hans Verkuil |
Headers |
Received: from ny.mirrors.kernel.org ([147.75.199.223]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <linux-media+bounces-17366-patchwork=linuxtv.org@vger.kernel.org>) id 1sl7gI-00058U-0D for patchwork@linuxtv.org; Mon, 02 Sep 2024 14:05:22 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C04BA1C21A96 for <patchwork@linuxtv.org>; Mon, 2 Sep 2024 14:05:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9188F21018A; Mon, 2 Sep 2024 14:05:07 +0000 (UTC) X-Original-To: linux-media@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B3FE20FAA7 for <linux-media@vger.kernel.org>; Mon, 2 Sep 2024 14:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725285907; cv=none; b=L0dyd/3tmU6pW3nXZ44OlqZgYoQnbrhhtA+0qJJ0IaPqOLFVB4PO7v8ah/5UkTrsW1t7/KhiExWDC6WuqcYRPQtQrnnKGmwQy1NIYY6qpnfoNsCbHpuPrLhgK6J2+UrMPfKfxYu7CMaTPs6hq9t0xcJCfl+TfdZ9Fv17NLOWZq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725285907; c=relaxed/simple; bh=qocQgFApmNTAlylByfp1CdkP9lXyqE5m88bQtMAdCt0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lR60lLLewSzDoofkzyQqg1MiBLFipgCUhZ9nUXsWR7xL8ys5yIp61MDb7W8nHlkltLSeCgLcCFp/Ux3SkM9xDmMoJGVhszYAsBpqa4hgXPlHn+wjRnUo0TWDdrl3isnYDIPPKO49c37BOArm2pzMoJE95XhcdlNlFXchV4uqPH8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13A44C4CEC2; Mon, 2 Sep 2024 14:05:05 +0000 (UTC) From: Hans Verkuil <hverkuil-cisco@xs4all.nl> To: linux-media@vger.kernel.org Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>, Matt Ranostay <matt@ranostay.sg> Subject: [PATCH 7/9] media: video-i2c: set lock before calling vb2_queue_init() Date: Mon, 2 Sep 2024 16:04:53 +0200 Message-Id: <42695db9edcf5e6b5ddebab59338eb88a5abcebe.1725285495.git.hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1725285495.git.hverkuil-cisco@xs4all.nl> References: <cover.1725285495.git.hverkuil-cisco@xs4all.nl> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: <linux-media.vger.kernel.org> List-Subscribe: <mailto:linux-media+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-media+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-LSpam-Score: -5.3 (-----) X-LSpam-Report: No, score=-5.3 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DMARC_NONE=0.898,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_VALIDITY_CERTIFIED=-3,RCVD_IN_VALIDITY_RPBL=1.31,RCVD_IN_VALIDITY_SAFE=-2,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no |
Series |
media: vb2: prepare for vb2_ops_wait_prepare/finish removal
|
|
Commit Message
Hans Verkuil
Sept. 2, 2024, 2:04 p.m. UTC
The vb2_queue_init() will expect the vb2_queue lock pointer to be set in
the future. So for those drivers that set the lock later, move it up to
before the vb2_queue_init() call.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Matt Ranostay <matt@ranostay.sg>
---
drivers/media/i2c/video-i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Sent with Proton Mail secure email. On Monday, September 2nd, 2024 at 22:04, Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote: > The vb2_queue_init() will expect the vb2_queue lock pointer to be set in > the future. So for those drivers that set the lock later, move it up to > before the vb2_queue_init() call. > > Signed-off-by: Hans Verkuil hverkuil-cisco@xs4all.nl > LGTM Acked-by: Matt Ranostay <matt@ranostay.sg> > Cc: Matt Ranostay matt@ranostay.sg > > --- > drivers/media/i2c/video-i2c.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c > index 56dbe07a1c99..ffb3d9d61a74 100644 > --- a/drivers/media/i2c/video-i2c.c > +++ b/drivers/media/i2c/video-i2c.c > @@ -798,13 +798,13 @@ static int video_i2c_probe(struct i2c_client *client) > queue->min_queued_buffers = 1; > > queue->ops = &video_i2c_video_qops; > > queue->mem_ops = &vb2_vmalloc_memops; > > + queue->lock = &data->queue_lock; > > > ret = vb2_queue_init(queue); > if (ret < 0) > goto error_unregister_device; > > data->vdev.queue = queue; > > - data->vdev.queue->lock = &data->queue_lock; > > > snprintf(data->vdev.name, sizeof(data->vdev.name), > > "I2C %d-%d Transport Video", > -- > 2.34.1
Hi Hans, Thank you for the patch. On Mon, Sep 02, 2024 at 04:04:53PM +0200, Hans Verkuil wrote: > The vb2_queue_init() will expect the vb2_queue lock pointer to be set in > the future. So for those drivers that set the lock later, move it up to > before the vb2_queue_init() call. > > Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> > Cc: Matt Ranostay <matt@ranostay.sg> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/video-i2c.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c > index 56dbe07a1c99..ffb3d9d61a74 100644 > --- a/drivers/media/i2c/video-i2c.c > +++ b/drivers/media/i2c/video-i2c.c > @@ -798,13 +798,13 @@ static int video_i2c_probe(struct i2c_client *client) > queue->min_queued_buffers = 1; > queue->ops = &video_i2c_video_qops; > queue->mem_ops = &vb2_vmalloc_memops; > + queue->lock = &data->queue_lock; > > ret = vb2_queue_init(queue); > if (ret < 0) > goto error_unregister_device; > > data->vdev.queue = queue; > - data->vdev.queue->lock = &data->queue_lock; > > snprintf(data->vdev.name, sizeof(data->vdev.name), > "I2C %d-%d Transport Video",
diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index 56dbe07a1c99..ffb3d9d61a74 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -798,13 +798,13 @@ static int video_i2c_probe(struct i2c_client *client) queue->min_queued_buffers = 1; queue->ops = &video_i2c_video_qops; queue->mem_ops = &vb2_vmalloc_memops; + queue->lock = &data->queue_lock; ret = vb2_queue_init(queue); if (ret < 0) goto error_unregister_device; data->vdev.queue = queue; - data->vdev.queue->lock = &data->queue_lock; snprintf(data->vdev.name, sizeof(data->vdev.name), "I2C %d-%d Transport Video",