From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: Hans de Goede <hdegoede@redhat.com>,
Daniel Scally <dan.scally@ideasonboard.com>,
Bingbu Cao <bingbu.cao@intel.com>
Subject: [PATCH 2/2] media: ipu-bridge: Poll for IVSC CSI device
Date: Mon, 12 Feb 2024 11:19:17 +0200 [thread overview]
Message-ID: <20240212091917.342715-3-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20240212091917.342715-1-sakari.ailus@linux.intel.com>
The MEI CSI device is created as MEI boots up. This often takes place
after the IPU6 driver probes, in which case the IPU6 driver returned
-EPROBE_DEFER. The MEI CSI driver also returns -EPROBE_DEFER if the
firmware nodes created by the IPU bridge (via IPU6 driver) aren't in
place.
If no other drivers are being probed after this point, neither IPU6 nor
MEI CSI drivers will be re-probed. Address this (hopefully temporarily) by
polling MEI CSI device in the IPU bridge initialisation.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/pci/intel/ipu-bridge.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
index b2cf80d62ba2..45c39bd93d74 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -4,6 +4,7 @@
#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/i2c.h>
+#include <linux/iopoll.h>
#include <linux/mei_cl_bus.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
@@ -138,17 +139,21 @@ static struct device *ipu_bridge_get_ivsc_csi_dev(struct acpi_device *adev)
/* IVSC device on platform bus */
dev = bus_find_device(&platform_bus_type, NULL, adev,
ipu_bridge_match_ivsc_dev);
- if (dev) {
- snprintf(name, sizeof(name), "%s-%pUl", dev_name(dev), &uuid);
+ if (!dev)
+ return NULL;
- csi_dev = device_find_child_by_name(dev, name);
+ snprintf(name, sizeof(name), "%s-%pUl", dev_name(dev), &uuid);
- put_device(dev);
+ /*
+ * FIXME: instantiate MEI CSI software nodes outside the IPU bridge (or
+ * call IPU bridge from MEI CSI). Wait up to 60 seconds here.
+ */
+ read_poll_timeout(device_find_child_by_name, csi_dev, csi_dev,
+ 20000, 60000000, false, dev, name);
- return csi_dev;
- }
+ put_device(dev);
- return NULL;
+ return csi_dev;
}
static int ipu_bridge_check_ivsc_dev(struct ipu_sensor *sensor,
--
2.39.2
next prev parent reply other threads:[~2024-02-12 9:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 9:19 [PATCH 0/2] IPU bridge improvements for IPU6 Sakari Ailus
2024-02-12 9:19 ` [PATCH 1/2] media: ipu-bridge: Add ov01a10 in Dell XPS 9315 Sakari Ailus
2024-02-12 9:26 ` Dan Scally
2024-02-12 9:19 ` Sakari Ailus [this message]
2024-02-12 10:28 ` [PATCH 2/2] media: ipu-bridge: Poll for IVSC CSI device Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240212091917.342715-3-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=bingbu.cao@intel.com \
--cc=dan.scally@ideasonboard.com \
--cc=hdegoede@redhat.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox