Commit graph

277 commits

Author SHA1 Message Date
Sakari Ailus
09ef952138 media: ipu6: isys: Set minimum height to 1
For image data generally 2 seems like a minimum height that surely won't
cause any issues, but some sensors have metadata the height of which is
just one line. Set the minimum height to 1.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-07-10 11:32:23 +02:00
Sakari Ailus
ff49672a28 media: ipu6: isys: Use correct pads for xlate_streams()
The pad argument to v4l2_subdev_state_xlate_streams() is incorrect, static
pad number is used for the source pad even though the pad number is
dependent on the stream. Fix it.

Fixes: 3a5c59ad92 ("media: ipu6: Rework CSI-2 sub-device streaming control")
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-07-10 11:32:23 +02:00
Hans de Goede
9316e398e2 media: ipu-bridge: Improve error logging when waiting for IVSC to become ready
The ipu-bridge code waits for the IVSC to become ready (on platforms with
an IVSC chip).

It does this by returning -EPROBE_DEFER, but it does not use
dev_err_probe() so no reason for deferring gets registered.

After 30 seconds the kernel logs a warning that the probe is still
deferred, which looks like this:

[   33.951709] pci 0000:00:14.3: deferred probe pending: (reason unknown)

Use dev_err_probe() when returning -EPROBE_DEFER to register the probe
deferral reason changing the error to:

deferred probe pending: waiting for IVSC to become ready

to help with debugging why drivers are not binding if the iVSC does
not become ready for some reason.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 09:06:21 +02:00
Hans de Goede
dd8bb4a2ec media: ipu-bridge: Add Onsemi MT9M114 HID to list of supported sensors
Add INT33F0 ACPI HID for the Onsemi MT9M114 sensor to the list of supported
sensors. This sensor is found on the Asus T100TA using this HID.

Tested-by: Hans de Goede <hdegoede@redhat.com> # Asus T100TA with MT9M114
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 09:06:21 +02:00
Hans de Goede
29d77da941 media: ipu-bridge: Add Toshiba T4KA3 HID to list of supported sensor
The Xiaomi Mi Pad 2 tablet uses a Toshiba T4KA3 sensor, using
a Xiaomi specific Hardware-ID of "XMMC0003" add this to the sensor-list
of the ipu-bridge code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 09:06:21 +02:00
Sakari Ailus
23983ae6fc media: ivsc: Remove Wentong's e-mail address
Remove Wentong's e-mail address from MODULE_AUTHOR() macro as the current
e-mail address is no longer valid.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 08:47:41 +02:00
Hans de Goede
0c92c49fc6 media: ivsc: Fix crash at shutdown due to missing mei_cldev_disable() calls
Both the ACE and CSI driver are missing a mei_cldev_disable() call in
their remove() function.

This causes the mei_cl client to stay part of the mei_device->file_list
list even though its memory is freed by mei_cl_bus_dev_release() calling
kfree(cldev->cl).

This leads to a use-after-free when mei_vsc_remove() runs mei_stop()
which first removes all mei bus devices calling mei_ace_remove() and
mei_csi_remove() followed by mei_cl_bus_dev_release() and then calls
mei_cl_all_disconnect() which walks over mei_device->file_list dereferecing
the just freed cldev->cl.

And mei_vsc_remove() it self is run at shutdown because of the
platform_device_unregister(tp->pdev) in vsc_tp_shutdown()

When building a kernel with KASAN this leads to the following KASAN report:

[ 106.634504] ==================================================================
[ 106.634623] BUG: KASAN: slab-use-after-free in mei_cl_set_disconnected (drivers/misc/mei/client.c:783) mei
[ 106.634683] Read of size 4 at addr ffff88819cb62018 by task systemd-shutdow/1
[ 106.634729]
[ 106.634767] Tainted: [E]=UNSIGNED_MODULE
[ 106.634770] Hardware name: Dell Inc. XPS 16 9640/09CK4V, BIOS 1.12.0 02/10/2025
[ 106.634773] Call Trace:
[ 106.634777]  <TASK>
...
[ 106.634871] kasan_report (mm/kasan/report.c:221 mm/kasan/report.c:636)
[ 106.634901] mei_cl_set_disconnected (drivers/misc/mei/client.c:783) mei
[ 106.634921] mei_cl_all_disconnect (drivers/misc/mei/client.c:2165 (discriminator 4)) mei
[ 106.634941] mei_reset (drivers/misc/mei/init.c:163) mei
...
[ 106.635042] mei_stop (drivers/misc/mei/init.c:348) mei
[ 106.635062] mei_vsc_remove (drivers/misc/mei/mei_dev.h:784 drivers/misc/mei/platform-vsc.c:393) mei_vsc
[ 106.635066] platform_remove (drivers/base/platform.c:1424)

Add the missing mei_cldev_disable() calls so that the mei_cl gets removed
from mei_device->file_list before it is freed to fix this.

Fixes: 78876f71b3 ("media: pci: intel: ivsc: Add ACE submodule")
Fixes: 29006e196a ("media: pci: intel: ivsc: Add CSI submodule")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 08:47:41 +02:00
Jason Chen
784e010ed1 media: ipu-bridge: Add support for additional link frequencies
Support two additional frequencies for the ov08x40 sensor using 2 lanes

Signed-off-by: Jason Chen <jason.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 08:47:41 +02:00
Laurent Pinchart
d0016b2a00 media: ipu3-cio2: Use V4L2 subdev active state
Replace storage of the active format in the cio2_queue structure with
usage of V4L2 subdev active state. This simplifies locking in the
driver, and drops usage of the deprecated subdev .open() internal
operation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Sakari Ailus: keep fmt_default non-static to keep clang happy.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 08:47:41 +02:00
Daniel Scally
484f8bec3d media: ipu-bridge: Add _HID for OV5670
The OV5670 is found on Dell 7212 tablets paired with an IPU3 ISP
and needs to be connected by the ipu-bridge. Add it to the list
of supported devices.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 08:47:41 +02:00
Hans de Goede
72da392727 media: ipu-bridge: Add link-frequency to the GC0310 entry
Add the missing link-frequency to the ipu_supported_sensors[] array's
Galaxy Core GC0310 entry.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-06-30 08:47:40 +02:00
Stanislaw Gruszka
034237ef15 media: intel/ipu6: Change deprecated lock comment
pre_streamon_queued is no longer used. The lock now is protecting active
and incoming lists.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-05-06 13:06:31 +02:00
Stanislaw Gruszka
c12bbc2820 media: intel/ipu6: Remove line_align
isys->line_align value is only used in one place and we can just use
the proper value directly there.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-05-06 13:06:31 +02:00
Stanislaw Gruszka
c139c1ac06 media: intel/ipu6: Remove pin_ready function pointer
We can call ipu6_isys_queue_buf_ready() directly. The only current
usage is pin_ready pointer is to check if pin was prepared before
IPU6_FW_ISYS_RESP_TYPE_PIN_DATA_READY interrupt, we can use queue
pointer for that purpose.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-05-06 13:06:31 +02:00
Stanislaw Gruszka
3e51d14286 media: intel/ipu6: Remove unused ipu6_isys_csi2_pdata
The pointer to ipu6_isys_csi2_pdata is not used.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-05-06 13:06:29 +02:00
Stanislaw Gruszka
0209916ebe media: intel/ipu6: Fix dma mask for non-secure mode
We use dma_get_mask() of auxdev device for calculate iova pfn limit.
This is always 32 bit mask as we do not initialize the mask (and we can
not do so, since dev->dev_mask is NULL anyways for auxdev).

Since we need 31 bit mask for non-secure mode use mmu_info->aperture_end
which is properly initialized to correct mask for both modes.

Fixes: daabc5c647 ("media: ipu6: not override the dma_ops of device in driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:35 +02:00
Stanislaw Gruszka
1284c96939 media: intel/ipu6: Minor dma_mask clenaup
Remove unused dma_mask field and ipu-dma.h includes.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:35 +02:00
Philipp Stanner
3bb6339e2a media: intel/ipu6: Replace deprecated PCI functions
pcim_iomap_table() and pcim_iomap_regions() have been deprecated.
Furthermore, the "name" parameter in pcim_iomap_regions() and its
successor, pcim_iomap_region(), should always reflect the driver name,
whereas currently it is the device's name.

Replace the deprecated functions with pcim_iomap_region() and pass the
actual driver name.

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:29 +02:00
Philipp Stanner
4e228c365d media: ipu3-cio2: Replace deprecated PCI functions
pcim_iomap_table() and pcim_iomap_regions() have been deprecated.

Replace them with pcim_iomap_region(), and pass the actual driver name
to that function.

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:28 +02:00
Dongcheng Yan
e0f6bc693b media: ipu-bridge: add ACPI HID for lt6911uxe bridge
Lontium lt6911uxe is a HDMI to CSI-2 bridge, without a fixed
link frequency.

Signed-off-by: Dongcheng Yan <dongcheng.yan@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:23 +02:00
Stanislaw Gruszka
1acf9fee6f media: intel/ipu6: Remove unused dev field from ipu6_isys_queue
With current code base dev is only written but never read. Remove it
as redundant.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:23 +02:00
Stanislaw Gruszka
95d1033c8d media: intel/ipu6: Abstract buf ready function
Extract values needed by ipu6_queue_buf_ready() function from fw abi
structure. This will allow to reuse same buf ready code when fw abi
change.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:22 +02:00
Stanislaw Gruszka
36b9d0521e media: intel/ipu6: Use timestamp value directly
Remove pointer for fw abi structure when setting frame sequence and
time, use timestamp value from the structure directly.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:22 +02:00
Stanislaw Gruszka
4fa1d8d81d media: intel/ipu6: Make two functions static
Make function used only in one file static and remove from header file.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:21 +02:00
Stanislaw Gruszka
adcdf4160a media: intel/ipu6: Add missing new line character in error message
End error message with new line.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:21 +02:00
Stanislaw Gruszka
94a6c188b8 media: intel/ipu6: Remove unused ipu6_isys_subdev_link_validate()
Remove unused declaration.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:21 +02:00
Stanislaw Gruszka
6ad57f8f86 media: intel/ipu6: Constify ipu6_buttress_ctrl structure
Make ipu6_buttress_ctrl constant since it is not modified any longer.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:20 +02:00
Stanislaw Gruszka
be1534a2e7 media: intel/ipu6: Remove ipu6_buttress_ctrl started field
We assign to ->started field but newer read back, the field can be removed.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:19 +02:00
Stanislaw Gruszka
c3d8e388ac media: intel/ipu6: Remove unused IPU6_BUS_NAME
Remove unused define.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:19 +02:00
Hao Yao
d471fb06b2 media: ipu6: Remove workaround for Meteor Lake ES2
There was a hardware bug which need IPU6 driver to disable the ATS. This
workaround is not needed anymore as the bug was fixed in hardware level.

Additionally, Arrow Lake has the same IPU6 PCI ID and x86 stepping but
does not have the bug. Removing the Meteor Lake workaround is also
required for the driver to function on Arrow Lake.

Signed-off-by: Hao Yao <hao.yao@intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Fixes: 25fedc0219 ("media: intel/ipu6: add Intel IPU6 PCI device driver")
Cc: stable@vger.kernel.org
[Sakari Ailus: Added tags and explanation of what is fixed.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-04-25 10:15:12 +02:00
Sakari Ailus
d89ad44197 media: ipu6: Drop unused ipu6_dma_get_sgtable()
ipu6_dma_get_sgtable() is now unused. Drop it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-03-04 13:35:32 +01:00
Bingbu Cao
6f0ab5d367 media: intel/ipu6: set the dev_parent of video device to pdev
The bus_info in v4l2_capability of IPU6 isys v4l2_dev is missing.
The driver didn't set the dev_parent of v4l2_dev, its parent is set
to its parent auxdev which is neither platform nor PCI device, thus
media_set_bus_info() will not set the bus_info of v4l2_capability, then
`v4l2-ctl --all` cannot show the bus_info.

This patch fixes it by setting the dev_parent of video_device and v4l2
framework can detect the device type and set the bus_info instead.

Fixes: 3c1dfb5a69 ("media: intel/ipu6: input system video nodes and buffer queues")
Cc: stable@vger.kernel.org
Signed-off-by: Hidenori Kobayashi <hidenorik@chromium.org>
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-03-04 13:35:31 +01:00
Sakari Ailus
e7bad98c20 media: v4l: Convert the users of v4l2_get_link_freq to call it on a pad
Call v4l2_get_link_freq() on a pad, instead of a control handler. This way
we can soon convert v4l2_get_link_freq() to be callable only on a pad and
remove the compatibility code.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Naushir Patuck <naush@raspberrypi.com> # rp1-cfe
Acked-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> # st-mipid02
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-02-15 15:22:58 +01:00
Sakari Ailus
56f697e3cd media: ivsc: csi: Obtain link frequency from the media pad
Support the use of the media pad for obtaining the link frequency.
Similarly, call the v4l2_get_link_freq() on the media pad, not on the
remote's control handler.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-02-15 15:22:55 +01:00
Sakari Ailus
55a163e6d9 media: intel/ipu6: Obtain link frequency from the remote subdev pad
Obtain the link frequency from the sub-device's pad instead of a control
handler. This allows obtaining it using the get_mbus_config() sub-device
pad op which is the only method supported by the IVSC driver.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-02-15 15:22:55 +01:00
Hans Verkuil
4100f206c5 media: pci: ipu6: drop vb2_ops_wait_prepare/finish
Since commit 88785982a1 ("media: vb2: use lock if wait_prepare/finish
are NULL") it is no longer needed to set the wait_prepare/finish
vb2_ops callbacks as long as the lock field in vb2_queue is set.

Since the vb2_ops_wait_prepare/finish callbacks already rely on that field,
we can safely drop these callbacks.

This simplifies the code and this is a step towards the goal of deleting
these callbacks.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2025-02-15 15:22:52 +01:00
Linus Torvalds
184a0997fb [GIT PULL for v6.14] media updates
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+QmuaPwR3wnBdVwACF8+vY7k4RUFAmeTNHEACgkQCF8+vY7k
 4RWHRA//UI8B/q+/WHzqC5CCtySIvrabFvhQOFPR1GBwPBoASS0JwGuVFZcsJbjV
 m6krBshs2OTwafVH8Sbxw6tlShG5hs7fe6hwhtokEnrL5uzfgYMxf7MpM0F2g8CR
 1zTow17A7TDeUhdYDTmVbdcOb9rj5oFJCEOVsQXNaAu2jsDBGVZ1P7iUZTwIeyT+
 r0uUzrlLylH4neIyXu6yBWXYCmXbQXtGHxkwe5GGxKMfqKwD83KK5gd4uUpiAyJe
 tKW+gzZa/ngJaCQ+cr+8/z270h2vXeNohhC3c6Kq+/6pZgyEwUgyDTXT4nYVsUdd
 1DeYiQekMUE3MwsKXPtFCyH3VGMvgMQK9fc+N10KC8wj+uCaqi59une8Yz3Ck89m
 tIE9R9EwBWiyAmSKEBVZAJJjOKi5TBC1lOw+RUUjnjwVG34gZhe/ML8IyWI8OcAH
 nEHb8BGwWHpoO7M5bmtzSbjAhgxzizzCclp1aEIzTlAbtC+1YXd96qJxzG5qjUrA
 uO0PvwghFjjiZKDU9Iwsk9q83VMCva3IX9pondmefC5OZvgR5xG/L6H5JfwRotOa
 XlRLj80/Pmn+PqvHxHJYqHkp9ujqiGbq6b0PJYU7FjiyghDGV7+urHuvmT+sdLo8
 +nzch/NbZDf2WFxENZOzAOSYKYbahcp3dqkiOwTU1Iu23ERkSws=
 =ktuX
 -----END PGP SIGNATURE-----

Merge tag 'media/v6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:

 - Sensor driver fixes

 - remove dead TI wl128x FM radio driver

 - Add support for the imx462 sensor at the IMX290 binding

 - V4L2 pixel data transmitter and receiver documentation improvements

 - Add support for MIPI Discovery and Configuration for C-PHY line
   orders

 - imx8-isi fixes and improvements

 - stm32: dcmipp: add core support for the stm32mp25

 - qcom: camss: Add sc7280 support

 - Various fixes and enhancements

* tag 'media/v6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (152 commits)
  media: nuvoton: Fix an error check in npcm_video_ece_init()
  media: dvb-usb-v2: af9035: fix ISO C90 compilation error on af9035_i2c_master_xfer
  media: platform: rzg2l-cru: rzg2l-video: Fix the comment in rzg2l_cru_start_streaming_vq()
  media: fix secfeed undefined when filter alloc fail
  media: dt-bindings: trivial white-space and example cleanup
  MAINTAINERS: repair file entry in MEDIA DRIVERS FOR STM32 - CSI
  media: solo6x10: Use const 'struct bin_attribute' callback
  media: saa7164: Remove unused values
  staging: media: imx: fix OF node leak in imx_media_add_of_subdevs()
  media: platform: exynos4-is: Remove unused __is_get_frame_size
  media: vidtv: Fix a null-ptr-deref in vidtv_mux_stop_thread
  media: mmp: Bring back registration of the device
  media: cec: include linux/debugfs.h and linux/seq_file.h where needed
  Revert "media: qcom: camss: Restructure camss_link_entities"
  media: venus: Remove unused hfi_core_ping()
  media: dt-bindings: qcom-venus: Deprecate video-decoder and video-encoder where applicable
  media: venus: Populate video encoder/decoder nodename entries
  media: venus: Add support for static video encoder/decoder declarations
  media: venus: match instance creation and destruction order
  media: venus: destroy hfi session after m2m_ctx release
  ...
2025-01-25 15:59:46 -08:00
Ricardo Ribalda
84524b1dad media: ipu-bridge: Remove unneeded conditional compilations
The ACPI headers have introduced implementations for some of their
functions when the kernel is not configured with ACPI.

Let's use them instead of our conditional compilation. It is easier to
maintain and less prone to errors.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://patch.msgid.link/20241216-fix-ipu-v5-7-3d6b35ddce7b@chromium.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-12-19 20:59:36 +01:00
Ricardo Ribalda
79f237bae9 ACPI: bus: change the prototype for acpi_get_physical_device_location
It generally is not OK to use acpi_status and/or AE_ error codes
without CONFIG_ACPI and they really only should be used in
drivers/acpi/ (and not everywhere in there for that matter).

So acpi_get_physical_device_location() needs to be redefined to return
something different from acpi_status (preferably bool) in order to be
used in !CONFIG_ACPI code.

Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://patch.msgid.link/20241216-fix-ipu-v5-1-3d6b35ddce7b@chromium.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-12-19 20:59:35 +01:00
Stanislaw Gruszka
733d41af75 media: intel/ipu6: move some boot messages to debug level
When ipu6 driver is waiting for the ivsc driver to probe,
which can fail or take long time, we can get plenty of ipu6
messages like this:

[   15.454049] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff
[   15.456600] intel-ipu6 0000:00:05.0: FW version: 20230925
[   15.458292] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff
[   15.461186] intel-ipu6 0000:00:05.0: FW version: 20230925
[   15.463616] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff
[   15.466490] intel-ipu6 0000:00:05.0: FW version: 20230925

Print them only when debugging is enabled to do not flood dmesg.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-12-19 12:50:15 +01:00
Stanislaw Gruszka
facb541ff0 media: intel/ipu6: remove cpu latency qos request on error
Fix cpu latency qos list corruption like below. It happens when
we do not remove cpu latency request on error path and free
corresponding memory.

[   30.634378] l7 kernel: list_add corruption. prev->next should be next (ffffffff9645e960), but was 0000000100100001. (prev=ffff8e9e877e20a8).
[   30.634388] l7 kernel: WARNING: CPU: 2 PID: 2008 at lib/list_debug.c:32 __list_add_valid_or_report+0x83/0xa0
<snip>
[   30.634640] l7 kernel: Call Trace:
[   30.634650] l7 kernel:  <TASK>
[   30.634659] l7 kernel:  ? __list_add_valid_or_report+0x83/0xa0
[   30.634669] l7 kernel:  ? __warn.cold+0x93/0xf6
[   30.634678] l7 kernel:  ? __list_add_valid_or_report+0x83/0xa0
[   30.634690] l7 kernel:  ? report_bug+0xff/0x140
[   30.634702] l7 kernel:  ? handle_bug+0x58/0x90
[   30.634712] l7 kernel:  ? exc_invalid_op+0x17/0x70
[   30.634723] l7 kernel:  ? asm_exc_invalid_op+0x1a/0x20
[   30.634733] l7 kernel:  ? __list_add_valid_or_report+0x83/0xa0
[   30.634742] l7 kernel:  plist_add+0xdd/0x140
[   30.634754] l7 kernel:  pm_qos_update_target+0xa0/0x1f0
[   30.634764] l7 kernel:  cpu_latency_qos_update_request+0x61/0xc0
[   30.634773] l7 kernel:  intel_dp_aux_xfer+0x4c7/0x6e0 [i915 1f824655ed04687c2b0d23dbce759fa785f6d033]

Reported-by: Genes Lists <lists@sapience.com>
Closes: https://lore.kernel.org/linux-media/c0e94be466b367f1a3cfdc3cb7b1a4f47e5953ae.camel@sapience.com/
Fixes: f50c4ca0a8 ("media: intel/ipu6: add the main input system driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-12-19 12:50:14 +01:00
Peter Zijlstra
cdd30ebb1b module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498f ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.

Scripted using

  git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
  do
    awk -i inplace '
      /^#define EXPORT_SYMBOL_NS/ {
        gsub(/__stringify\(ns\)/, "ns");
        print;
        next;
      }
      /^#define MODULE_IMPORT_NS/ {
        gsub(/__stringify\(ns\)/, "ns");
        print;
        next;
      }
      /MODULE_IMPORT_NS/ {
        $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
      }
      /EXPORT_SYMBOL_NS/ {
        if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
  	if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
  	    $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
  	    $0 !~ /^my/) {
  	  getline line;
  	  gsub(/[[:space:]]*\\$/, "");
  	  gsub(/[[:space:]]/, "", line);
  	  $0 = $0 " " line;
  	}

  	$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
  		    "\\1(\\2, \"\\3\")", "g");
        }
      }
      { print }' $file;
  done

Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 11:34:44 -08:00
Bingbu Cao
7af76aa153 media: ipu6: make the ipu6_mmu_unmap() as a void function
The DMA unmap API is not supposed to return value. Thus this patch
changes the ipu6_mmu_unmap() as a void function and DMA unmapping
didn't check the return value.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
[Sakari Ailus: Drop unnecessary returns.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:58 +01:00
Bingbu Cao
1faf84ff1c media: ipu6: optimize the IPU6 MMU unmapping flow
The MMU mapping flow is optimized for improve the performance, the
unmapping flow could also be optimized to follow same flow.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:58 +01:00
Bingbu Cao
f7c924aba3 media: ipu6: optimize the IPU6 MMU mapping flow
ipu6_mmu_map() operated on a per-page basis, it leads frequent
spin_lock/unlock() and clflush_cache_range() for each page, it
will cause inefficiencies especially when handling dma-bufs
with large number of pages. However, the pages are likely concentrated
pages by IOMMU DMA driver, IPU MMU driver can map the concentrated
pages into less entries in l1 table.

This change enhances ipu6_mmu_map() with batching process multiple
contiguous pages. It significantly reduces calls for spin_lock/unlock
and clflush_cache_range() and improve the performance.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:58 +01:00
Bingbu Cao
a14908a992 media: ipu6: move the l2_unmap() up before l2_map()
l2_map() and l2_unmap() are better to be grouped together.
l2_unmap() will soon be called from l2_map() for mapping
optimization.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com>
[Sakari Ailus: Rebase on debug print fixes on 32-bit.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:58 +01:00
Stanislaw Gruszka
23e0661de5 media: intel/ipu6: remove buttress ish structure
The buttress ipc ish structure is not effectively used on IPU6 - data
is nullified on init. Remove the ish structure and handing of related
interrupts to cleanup the code.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:58 +01:00
Stanislaw Gruszka
1429826883 media: intel/ipu6: do not handle interrupts when device is disabled
Some IPU6 devices have shared interrupts. We need to handle properly
case when interrupt is triggered from other device on shared irq line
and IPU6 itself disabled. In such case we get 0xffffffff from
ISR_STATUS register and handle all irq's cases, for what we are not
not prepared and usually hang the whole system.

To avoid the issue use pm_runtime_get_if_active() to check if
the device is enabled and prevent suspending it when we handle irq
until the end of irq. Additionally use synchronize_irq() in suspend

Fixes: ab29a2478e ("media: intel/ipu6: add IPU6 buttress interface driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com> # ThinkPad X1 Yoga Gen 8, ov2740
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:58 +01:00
Bingbu Cao
940ff4b41b media: ipu6: use PFN_UP() and sg_virt() for code simplicity
Use PFN_UP() and sg_virt() can be used to simplify the code.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:56 +01:00
Bingbu Cao
c8e9120c20 media: ipu6: remove architecture DMA ops dependency in Kconfig
IPU6 driver doesn't override the dma_ops of device now, it doesn't
depends on the ARCH_HAS_DMA_OPS, so remove the dependency in Kconfig.

Fixes: de6c85bf91 ("dma-mapping: clearly mark DMA ops as an architecture feature")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:56 +01:00