From patchwork Sun Oct 13 15:40:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13833845 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 70A57146A6C for ; Sun, 13 Oct 2024 15:41:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728834070; cv=none; b=l1Kwif1PkNEJ79ubXsXI9coa0vl2CNVVezsWoax8F/DvoyG43cCdzV1LHe4hZRDKLsKXcRo4sp4k17G3lkQwo+G5jn8Gnzr5qyaWMnymEalPFc5GeTO8iSHpPDbwAq8KkM/HApGn1d5iKAtpWcbn5d/6j989LooTKZJMzHHMVaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728834070; c=relaxed/simple; bh=3cazwMJtsoHsgyTdJwUQjHhmVBKMX8oJ8sMHpXzyn6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cRSs/NS/EiMArJUfnSp2poRJLxky6qkPem5HRkJjnXUGS1asIYy9gBUCWTRIp/BvDQotXIRj62w4sWS/I1k7rSRm9RnQf/af458dSocqD002VTgGLAoXg3vPKclJ968BYE+thWDbB8mPjrrghUnN6n8bw54ygTpBqky6Tz1LKJg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=SRN5pQFx; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SRN5pQFx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728834066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=myIZloc/IR0tcmVaTEShSRjZ134QHehFws73ciXiCZw=; b=SRN5pQFxHUUIhvu320HSRusqbwAoOdGpKkyr9SOr0iQ9dC8cTwMTie08HckuHQkweQJLN4 y/8kcHJK337/4ALPX9uSaD6nLViBhSrf0NE4X6akRNmw264Fz81GvNsAVuF3W2MpS+avGy UcKKFH+QM3KGczDRUXbmdYKMFghWKeA= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-33-uyWBOKFOPcm0eE8GjQ4FfQ-1; Sun, 13 Oct 2024 11:41:05 -0400 X-MC-Unique: uyWBOKFOPcm0eE8GjQ4FfQ-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 98B6219560A2; Sun, 13 Oct 2024 15:41:03 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.70]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 10B3219560AE; Sun, 13 Oct 2024 15:41:00 +0000 (UTC) From: Hans de Goede To: Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Mauro Carvalho Chehab , Kate Hsuan , Robert Mast , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 1/4] media: atomisp: Fix WARN_ON() in vb2_start_streaming() triggering Date: Sun, 13 Oct 2024 17:40:53 +0200 Message-ID: <20241013154056.12532-2-hdegoede@redhat.com> In-Reply-To: <20241013154056.12532-1-hdegoede@redhat.com> References: <20241013154056.12532-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 If atomisp fails to start the stream the buffers must be returned to the VB2_BUF_STATE_QUEUED state before returning an error from atomisp_start_streaming(). This fixes the following WARN_ON(): [ 250.313554] WARNING: CPU: 3 PID: 2178 at drivers/media/common/videobuf2/videobuf2-core.c:1801 vb2_start_streaming+0xcb/0x150 [videobuf2_common] Signed-off-by: Hans de Goede --- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index d7e8a9871522..47d8a17379b0 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -881,8 +881,10 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) mutex_lock(&isp->mutex); ret = atomisp_pipe_check(pipe, false); - if (ret) + if (ret) { + atomisp_flush_video_pipe(pipe, VB2_BUF_STATE_QUEUED, true); goto out_unlock; + } /* * When running a classic v4l2 app after a media-controller aware @@ -895,6 +897,7 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) mutex_unlock(&isp->media_dev.graph_mutex); if (ret) { dev_err(isp->dev, "Error starting mc pipeline: %d\n", ret); + atomisp_flush_video_pipe(pipe, VB2_BUF_STATE_QUEUED, true); goto out_unlock; } From patchwork Sun Oct 13 15:40:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13833846 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 6E5A3143890 for ; Sun, 13 Oct 2024 15:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728834072; cv=none; b=bSH4vlThu5I3Jk/uwIyUZQgnKnUix+u7P23+5fKfss88a3aIMxgSpgET7XH8mjrSU5XbEEPF5BnZzh9Ta5FmgsaxtXAyLM7tg6u9lh5by/pSl8Wa+wltl/V01yQ+vbYyoeKs698eWlCAf4lL4tmR0GdalL+vBMwZFz4SAf4EFnA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728834072; c=relaxed/simple; bh=yrFD90V6Cn5fCqvrrgjt7ea/S+600jiTu00Ob6Vji7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oCS8UEOjLY+T1hMpBfOJf8WYAWMvuptLl3/9BT+JyZk/O/v8//dQpFPBpINJE6ygITuuLLcx7MSyLr2u6vP9+y/xXCqCxsRc0egx+PnZV0LU1DmRJ7CNNM8Ia7SZuXKl/p0+GRigp+75RFaAfFGs3LQXZaXXe/LpTOlk0Z3K1tg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PXSCRS2s; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PXSCRS2s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728834069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M3SLJSXP7e4kGfBeIUTiQpLJl1uIykNaue+2p3v0dQs=; b=PXSCRS2sWfDWf61EkTZMgcR6ZrLxNUrh2QS49rG9Pkl0gOxyM0k2wNWH4elmXF+t6I+8aH lkSaNcJKuDjnKiWrRpZwPJijnoejl/o6AcnxalLbV6VNchH05OU9xpZFsvC4uMeDUrrmBu YejkC9GFnqZvz1pPyZ5M8D8mZ515MwM= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-510-Fg-sDn55NnmttP5LBw3VOA-1; Sun, 13 Oct 2024 11:41:07 -0400 X-MC-Unique: Fg-sDn55NnmttP5LBw3VOA-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4AEE119560B0; Sun, 13 Oct 2024 15:41:06 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.70]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0631F19560AA; Sun, 13 Oct 2024 15:41:03 +0000 (UTC) From: Hans de Goede To: Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Mauro Carvalho Chehab , Kate Hsuan , Robert Mast , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 2/4] media: atomisp: mt9m114: Disable V4L2_CID_3A_LOCK control Date: Sun, 13 Oct 2024 17:40:54 +0200 Message-ID: <20241013154056.12532-3-hdegoede@redhat.com> In-Reply-To: <20241013154056.12532-1-hdegoede@redhat.com> References: <20241013154056.12532-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 The V4L2_CID_3A_LOCK control is causing v4l2_ctrl_new_custom() to fail with -ERANGE. It would be better to fix this control but this entire driver is going to be replaced with the drivers/media/i2c/mt9m114 standard v4l2 driver. This quick fix gets things going for now until the driver is replaced. Signed-off-by: Hans de Goede --- drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index 918ea4fa9f6b..b0b740dd3ca3 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -1224,6 +1224,7 @@ static struct v4l2_ctrl_config mt9m114_controls[] = { .def = 0, .flags = 0, }, +#if 0 /* Causes v4l2_ctrl_new_custom() to fail with -ERANGE, disable for now */ { .ops = &ctrl_ops, .id = V4L2_CID_3A_LOCK, @@ -1235,6 +1236,7 @@ static struct v4l2_ctrl_config mt9m114_controls[] = { .def = 0, .flags = 0, }, +#endif }; static int mt9m114_detect(struct mt9m114_device *dev, struct i2c_client *client) From patchwork Sun Oct 13 15:40:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13833847 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 DB5BF1482ED for ; Sun, 13 Oct 2024 15:41:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728834074; cv=none; b=eG9j6mksUzCjVBmyoutwOxHmDDm3iwzMVDBBQ6/oOMylAu0ALl/lQ3mfcIJerRND9DCj91EYBxC6UKwWmY3anEXmSIFzH9AwE0vaNmNcSCW5lf3vnth/9mlMzRpv2y9c2fol1QZO3UfJGKHbuUcaW098XosmCdIiW5Eat1CwbtM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728834074; c=relaxed/simple; bh=OOd9rgHIIWHZo+d9xSlAkUbBCkL9qEIOTHTSVpxKOu0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ff+IAUPhfXUK0Yurv53Q5EFAPnbo4V6rRQxDNfnD9XIHtZR9YJFvOc5MVnCEjWGhiAYMWLYbJxBbz/cAFcoYqeJSbFEVU0/pSSKDGIErCc9K88LCdcx4dyDlQZC05zCNupabVargGqaZtCrgCDbSZ5VN0vdDg33F6pRiDET1oF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=iIQsClJF; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iIQsClJF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728834071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TaLMKjq7VTsIaWf+6+uA8TU8YvBwNEuYElA3Ml/v4LM=; b=iIQsClJFWB4xViSaMo/MxPxjIc+mDiqn3RQTV0/nHc69g4tiLCdXXCPlkX20okQcFuhHs+ A08Fth0n+An/K4jaX4PCPjfp+k6jrxOUI0pI7UEOlMq5iVMlHxw48XuOO6m74ZNNppXyHe /mG6+bTLyl2Fp3Wbx9rcq3mS7JLaao4= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-477-Gd3tzlboN6ao3FAoWPDDew-1; Sun, 13 Oct 2024 11:41:10 -0400 X-MC-Unique: Gd3tzlboN6ao3FAoWPDDew-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0EA7019560AA; Sun, 13 Oct 2024 15:41:09 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.70]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AE80019560AA; Sun, 13 Oct 2024 15:41:06 +0000 (UTC) From: Hans de Goede To: Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Mauro Carvalho Chehab , Kate Hsuan , Robert Mast , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 3/4] media: atomisp: mt9m114: Add missing mutex_init() call Date: Sun, 13 Oct 2024 17:40:55 +0200 Message-ID: <20241013154056.12532-4-hdegoede@redhat.com> In-Reply-To: <20241013154056.12532-1-hdegoede@redhat.com> References: <20241013154056.12532-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 The input_lock was not being initialized, fix this. Also switch to devm_kzalloc() for the main driver data struct, so that devm_mutex_init() can be used for this. Signed-off-by: Hans de Goede --- drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index b0b740dd3ca3..1a67f93a53d7 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "../include/linux/atomisp_gmin_platform.h" #include @@ -1527,7 +1528,6 @@ static void mt9m114_remove(struct i2c_client *client) v4l2_device_unregister_subdev(sd); media_entity_cleanup(&dev->sd.entity); v4l2_ctrl_handler_free(&dev->ctrl_handler); - kfree(dev); } static int mt9m114_probe(struct i2c_client *client) @@ -1538,10 +1538,14 @@ static int mt9m114_probe(struct i2c_client *client) void *pdata; /* Setup sensor configuration structure */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL); if (!dev) return -ENOMEM; + ret = devm_mutex_init(&client->dev, &dev->input_lock); + if (ret) + return ret; + v4l2_i2c_subdev_init(&dev->sd, client, &mt9m114_ops); pdata = gmin_camera_platform_data(&dev->sd, ATOMISP_INPUT_FORMAT_RAW_10, @@ -1550,14 +1554,12 @@ static int mt9m114_probe(struct i2c_client *client) ret = mt9m114_s_config(&dev->sd, client->irq, pdata); if (!pdata || ret) { v4l2_device_unregister_subdev(&dev->sd); - kfree(dev); return ret; } ret = atomisp_register_i2c_module(&dev->sd, pdata); if (ret) { v4l2_device_unregister_subdev(&dev->sd); - kfree(dev); /* Coverity CID 298095 - return on error */ return ret; } From patchwork Sun Oct 13 15:40:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13833848 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 53ABA1474D9 for ; Sun, 13 Oct 2024 15:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728834078; cv=none; b=HTMPJVKb5SsR7IekJK3w5AR4rLL/rGGGgQfC0ea1e2D9j86cy5vp4lFT908qvGomWAGh2tBdEXuXsE6sZ8afazfhJM8voAXL2HWnGnb999nrnmyxMvK7d0LVvPc10DsBxWYC9kxkdn40JTnstTcyblYYPp0iY3/5y/nZ13rWMAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728834078; c=relaxed/simple; bh=xG9LCXw1pL/9MIbtVaMsg8Kj1UVI+uhqwJaGwmF9m7w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I9yO/qe4aLsMtiCCUUqXJnXaFfUtDerDxoVrZvLlyeHWSymYuU6jMG88pMPUKJDu06uF5yOgoM6kgHQ6OyAp2158WWGBaOwLwtSa9rl71laY3YYp0P+5v2EqmxW06hB85UWgHv/IR75FZehlR2efmzNLSZYFqXoFmt/mXj9zqbo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=UCrddo/Y; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UCrddo/Y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728834076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uhUkJYLDXF80tVlJU0WIahMtJ/wu9t7rdx3rs8/W9Nc=; b=UCrddo/Y4RAq2C/ROqvOV223Rbf25toooD5XZsVGS+fbKKT/i6hGlL/GAtK5VAj6iiv1OM xqNjxUOmuBUW5vXyjIM6pVS5wlXXtXD2E2zRcvtaVM4IC0kG8USJq5BV978UEM9y1Nzkkp ohNdRegroxBkY8rwgsT7X4DQkseuGZA= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-47-mmuebRVsPxiEn5xgrdExKw-1; Sun, 13 Oct 2024 11:41:13 -0400 X-MC-Unique: mmuebRVsPxiEn5xgrdExKw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E258819560A2; Sun, 13 Oct 2024 15:41:11 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.70]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 71A5819560AA; Sun, 13 Oct 2024 15:41:09 +0000 (UTC) From: Hans de Goede To: Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Mauro Carvalho Chehab , Kate Hsuan , Robert Mast , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 4/4] media: atomisp: mt9m114: Fix fmt->code not getting set on try_fmt Date: Sun, 13 Oct 2024 17:40:56 +0200 Message-ID: <20241013154056.12532-5-hdegoede@redhat.com> In-Reply-To: <20241013154056.12532-1-hdegoede@redhat.com> References: <20241013154056.12532-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Fix mt9m114_set_fmt() not setting format.format.code when called with format.which == V4L2_SUBDEV_FORMAT_TRY. This fixes atomisp failing to start streaming with the mt9m114 on an Asus T100TA because of __media_pipeline_start() returning -EPIPE. Signed-off-by: Hans de Goede --- drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index 1a67f93a53d7..7cf543986b91 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -665,6 +665,7 @@ static int mt9m114_set_fmt(struct v4l2_subdev *sd, fmt->width = res->width; fmt->height = res->height; + fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; if (format->which == V4L2_SUBDEV_FORMAT_TRY) { *v4l2_subdev_state_get_format(sd_state, 0) = *fmt;