43387 Commits

Author SHA1 Message Date
kondors1995
373d5574ec Merge branch 'linux-4.14.y' of https://github.com/openela/kernel-lts into 15.0 2024-10-20 18:10:19 +03:00
Andi Shyti
3ccfe379ca drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
commit 8bdd9ef7e9b1b2a73e394712b72b22055e0e26c3 upstream.

Calculating the size of the mapped area as the lesser value
between the requested size and the actual size does not consider
the partial mapping offset. This can cause page fault access.

Fix the calculation of the starting and ending addresses, the
total size is now deduced from the difference between the end and
start addresses.

Additionally, the calculations have been rewritten in a clearer
and more understandable form.

Fixes: c58305af18 ("drm/i915: Use remap_io_mapping() to prefault all PTE in a single pass")
Reported-by: Jann Horn <jannh@google.com>
Co-developed-by: Chris Wilson <chris.p.wilson@linux.intel.com>
Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: <stable@vger.kernel.org> # v4.9+
Reviewed-by: Jann Horn <jannh@google.com>
Reviewed-by: Jonathan Cavitt <Jonathan.cavitt@intel.com>
[Joonas: Add Requires: tag]
Requires: 60a2066c5005 ("drm/i915/gem: Adjust vma offset for framebuffer mmap offset")
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240802083850.103694-3-andi.shyti@linux.intel.com
(cherry picked from commit 97b6784753da06d9d40232328efc5c5367e53417)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3e06073d24807f04b4694108a8474decb7b99e60)
[Vegard: resolve conflict due to missing commit
 a65adaf8a834504a4acdc0deca7fa790771add8a ("drm/i915: Track user GTT
 faulting per-vma") from v4.15 and commit 73ebd503034c1abe ("drm/i915:
 make mappable struct resource centric") which motivates the start ->
 mappable_base and iomap -> mappable changes. Remove 'goto err_fence' as
 we have nothing else to do on failure; it should be OK to leave the GEM
 object on the mm's userfaultfd list.]
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:56 +00:00
Chris Wilson
827a69923a drm/i915: Try GGTT mmapping whole object as partial
If the whole object is already pinned by HW for use as scanout, we will
fail to move it to the mappable region and so must resort to using a
partial VMA covering the whole object.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104513
Fixes: aa136d9d72 ("drm/i915: Convert partial ggtt vma to full ggtt if it spans the entire object")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180630090509.469-1-chris@chris-wilson.co.uk
(cherry picked from commit 7e7367d3bc6cf27dd7e007e7897fcebfeff1ee8b)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:56 +00:00
Thomas Zimmermann
e391c9f51f drm/mgag200: Set DDC timeout in milliseconds
commit ecde5db1598aecab54cc392282c15114f526f05f upstream.

Compute the i2c timeout in jiffies from a value in milliseconds. The
original values of 2 jiffies equals 2 milliseconds if HZ has been
configured to a value of 1000. This corresponds to 2.2 milliseconds
used by most other DRM drivers. Update mgag200 accordingly.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Fixes: 414c453106 ("mgag200: initial g200se driver (v2)")
Cc: Dave Airlie <airlied@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jocelyn Falempe <jfalempe@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v3.5+
Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-2-tzimmermann@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7db72e8e538e10afefe589d6203ffb4f5a1cbd9a)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:56 +00:00
Lucas Stach
5dfe0cc24e drm/bridge: analogix_dp: properly handle zero sized AUX transactions
commit e82290a2e0e8ec5e836ecad1ca025021b3855c2d upstream.

Address only transactions without any data are valid and should not
be flagged as short transactions. Simply return the message size when
no transaction errors occured.

CC: stable@vger.kernel.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240318203925.2837689-1-l.stach@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 52f05898629b25fc382754d837be624205ce67f8)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:56 +00:00
Douglas Anderson
9f77a8ee77 drm/bridge: analogix_dp: Properly log AUX CH errors
The code in analogix_dp_transfer() that was supposed to print out:
  AUX CH error happened

Was actually dead code. That's because the previous check (whether
the interrupt status indicated any errors) would have hit for all
errors anyway.

Let's combine the two error checks so we can actually see AUX CH
errors.  We'll also downgrade the message to a warning since some of
these types of errors might be expected for some displays.  If this
gets too noisy we can downgrade again to debug.

Cc: 征增 王 <wzz@rock-chips.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180423105003.9004-20-enric.balletbo@collabora.com
(cherry picked from commit 71cef82434640fb5d219365a568c859944fedb80)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:56 +00:00
Lin Huang
a413584fad drm/bridge: analogix_dp: Reset aux channel if an error occurred
AUX errors are caused by many different reasons. We may not know what
happened in aux channel on failure, so let's reset aux channel if some
errors occurred.

Cc: 征增 王 <wzz@rock-chips.com>
Cc: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180423105003.9004-13-enric.balletbo@collabora.com
(cherry picked from commit d44ba84433a2e42aa14fc5b9cc228050f0783e5c)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:55 +00:00
Lin Huang
d5775da332 drm/bridge: analogix_dp: Check AUX_EN status when doing AUX transfer
We should check AUX_EN bit to confirm the AUX CH operation is completed.

Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: zain wang <wzz@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180423105003.9004-3-enric.balletbo@collabora.com
(cherry picked from commit c2021db1905ed5b4480882836d8d3631ca786869)
[Vegard: added #include <linux/iopoll.h>.]
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:30 +00:00
Ian Forbes
4aff76137e drm/vmwgfx: Fix overlay when using Screen Targets
[ Upstream commit cb372a505a994cb39aa75acfb8b3bcf94787cf94 ]

This code was never updated to support Screen Targets.
Fixes a bug where Xv playback displays a green screen instead of actual
video contents when 3D acceleration is disabled in the guest.

Fixes: c8261a961e ("vmwgfx: Major KMS refactoring / cleanup in preparation of screen targets")
Reported-by: Doug Brown <doug@schmorgal.com>
Closes: https://lore.kernel.org/all/bd9cb3c7-90e8-435d-bc28-0e38fee58977@schmorgal.com
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Tested-by: Doug Brown <doug@schmorgal.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240719163627.20888-1-ian.forbes@broadcom.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 6f4bc8b021d3436e5dda88350d8e0ac3c8df400f)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:27 +00:00
Ma Ke
2c7d6f35ae drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes
commit 2df7aac81070987b0f052985856aa325a38debf6 upstream.

In psb_intel_lvds_get_modes(), the return value of drm_mode_duplicate() is
assigned to mode, which will lead to a possible NULL pointer dereference
on failure of drm_mode_duplicate(). Add a check to avoid npd.

Cc: stable@vger.kernel.org
Fixes: 89c78134cc ("gma500: Add Poulsbo support")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240709092011.3204970-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 13b5f3ee94bdbdc4b5f40582aab62977905aedee)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:23 +00:00
Ma Ke
d92238c8b1 drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes
commit cb520c3f366c77e8d69e4e2e2781a8ce48d98e79 upstream.

In cdv_intel_lvds_get_modes(), the return value of drm_mode_duplicate()
is assigned to mode, which will lead to a NULL pointer dereference on
failure of drm_mode_duplicate(). Add a check to avoid npd.

Cc: stable@vger.kernel.org
Fixes: 6a227d5fd6 ("gma500: Add support for Cedarview")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240709113311.37168-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f392c36cebf4c1d6997a4cc2c0f205254acef42a)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:23 +00:00
Lucas Stach
fa7e07d7eb drm/etnaviv: fix DMA direction handling for cached RW buffers
[ Upstream commit 58979ad6330a70450ed78837be3095107d022ea9 ]

The dma sync operation needs to be done with DMA_BIDIRECTIONAL when
the BO is prepared for both read and write operations.

Fixes: a8c21a5451 ("drm/etnaviv: add initial etnaviv DRM driver")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit c7c74c8256206ffc27212ada1f998f5a05b8c54f)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-10 10:27:21 +00:00
kondors1995
478461a998 Merge branch 'linux-4.14.y' of https://github.com/openela/kernel-lts into 15.0 2024-09-07 12:22:53 +03:00
Alex Deucher
27967cf836 drm/amdgpu/atomfirmware: silence UBSAN warning
commit d0417264437a8fa05f894cabba5a26715b32d78e upstream.

This is a variable sized array.

Link: https://lists.freedesktop.org/archives/amd-gfx/2024-June/110420.html
Tested-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 385b615c95df14df68ca8322245c13a9389392f6)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-23 16:50:05 +00:00
Ma Ke
c300d28e40 drm/nouveau: fix null pointer dereference in nouveau_connector_get_modes
commit 80bec6825b19d95ccdfd3393cf8ec15ff2a749b4 upstream.

In nouveau_connector_get_modes(), the return value of drm_mode_duplicate()
is assigned to mode, which will lead to a possible NULL pointer
dereference on failure of drm_mode_duplicate(). Add a check to avoid npd.

Cc: stable@vger.kernel.org
Fixes: 6ee738610f ("drm/nouveau: Add DRM driver for NVIDIA GPUs")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240627074204.3023776-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9baf60323efa992b7c915094529f0a1882c34e7e)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-23 16:50:05 +00:00
EmanuelCN
480ce9e4a7 drivers: gpu: drm: Do not affine pm qos requests to prime core
*This was accidentally readded when i rebased techpack/display and drm.
2024-08-14 17:58:14 +03:00
kondors1995
ebe2649ab6 Merge remote-tracking branch 'openela/linux-4.14.y' into 14.0-matrix 2024-08-11 18:42:43 +03:00
Ma Ke
e2f974a4f1 drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_hd_modes
commit 6d411c8ccc0137a612e0044489030a194ff5c843 upstream.

In nv17_tv_get_hd_modes(), the return value of drm_mode_duplicate() is
assigned to mode, which will lead to a possible NULL pointer dereference
on failure of drm_mode_duplicate(). The same applies to drm_cvt_mode().
Add a check to avoid null pointer dereference.

Cc: stable@vger.kernel.org
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240625081029.2619437-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ffabad4aa91e33ced3c6ae793fb37771b3e9cb51)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-08 15:52:21 +00:00
Ma Ke
2dc9769a95 drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_ld_modes
commit 66edf3fb331b6c55439b10f9862987b0916b3726 upstream.

In nv17_tv_get_ld_modes(), the return value of drm_mode_duplicate() is
assigned to mode, which will lead to a possible NULL pointer dereference
on failure of drm_mode_duplicate(). Add a check to avoid npd.

Cc: stable@vger.kernel.org
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240625081828.2620794-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9289cd3450d1da3e271ef4b054d4d2932c41243e)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-08 15:52:21 +00:00
Alex Deucher
90340ac06e drm/amdgpu: fix UBSAN warning in kv_dpm.c
[ Upstream commit f0d576f840153392d04b2d52cf3adab8f62e8cb6 ]

Adds bounds check for sumo_vid_mapping_entry.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3392
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 4ad7d49059358ceadd352b4e2511425bdb68f400)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-08 15:52:20 +00:00
Alex Deucher
cc96770672 drm/radeon: fix UBSAN warning in kv_dpm.c
commit a498df5421fd737d11bfd152428ba6b1c8538321 upstream.

Adds bounds check for sumo_vid_mapping_entry.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 07e8f15fa16695cf4c90e89854e59af4a760055b)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-08 15:52:18 +00:00
Jani Nikula
126c475927 drm/exynos/vidi: fix memory leak in .get_modes()
commit 38e3825631b1f314b21e3ade00b5a4d737eb054e upstream.

The duplicated EDID is never freed. Fix it.

Cc: stable@vger.kernel.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 540ca99729e28dbe902b01039a3b4bd74520a819)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-08 15:52:16 +00:00
Adam Miotk
b4722a9d95 drm/bridge/panel: Fix runtime warning on panel bridge release
[ Upstream commit ce62600c4dbee8d43b02277669dd91785a9b81d9 ]

Device managed panel bridge wrappers are created by calling to
drm_panel_bridge_add_typed() and registering a release handler for
clean-up when the device gets unbound.

Since the memory for this bridge is also managed and linked to the panel
device, the release function should not try to free that memory.
Moreover, the call to devm_kfree() inside drm_panel_bridge_remove() will
fail in this case and emit a warning because the panel bridge resource
is no longer on the device resources list (it has been removed from
there before the call to release handlers).

Fixes: 67022227ff ("drm/bridge: Add a devm_ allocator for panel bridge.")
Signed-off-by: Adam Miotk <adam.miotk@arm.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240610102739.139852-1-adam.miotk@arm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 3e0daaf28639c6fd22e96eb2f8772ad40e922ee7)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-08 15:52:15 +00:00
Justin Green
43f9acac76 drm/mediatek: Add 0 size check to mtk_drm_gem_obj
[ Upstream commit 1e4350095e8ab2577ee05f8c3b044e661b5af9a0 ]

Add a check to mtk_drm_gem_init if we attempt to allocate a GEM object
of 0 bytes. Currently, no such check exists and the kernel will panic if
a userspace application attempts to allocate a 0x0 GBM buffer.

Tested by attempting to allocate a 0x0 GBM buffer on an MT8188 and
verifying that we now return EINVAL.

Fixes: 119f517362 ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
Signed-off-by: Justin Green <greenjustin@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240307180051.4104425-1-greenjustin@chromium.org/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 79078880795478d551a05acc41f957700030d364)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-07-08 08:15:04 +00:00
SK00RUPA
e0b9e449c2 Merge tag 'v4.14.347-openela' into 14.0
This is the 4.14.347 OpenELA-Extended LTS stable release
2024-06-04 17:36:34 +02:00
SK00RUPA
d4959529f7 Merge tag 'v4.14.346-openela' into 14.0
This is the 4.14.346 OpenELA-Extended LTS stable release
2024-06-04 17:36:16 +02:00
SK00RUPA
29a1ff2b6d Merge tag 'v4.14.345-openela' into 14.0
This is the 4.14.345 OpenELA-Extended LTS stable release
2024-06-04 17:31:52 +02:00
Zack Rusin
9804a24b7a drm/vmwgfx: Fix invalid reads in fence signaled events
commit a37ef7613c00f2d72c8fc08bd83fb6cc76926c8c upstream.

Correctly set the length of the drm_event to the size of the structure
that's actually used.

The length of the drm_event was set to the parent structure instead of
to the drm_vmw_event_fence which is supposed to be read. drm_read
uses the length parameter to copy the event to the user space thus
resuling in oob reads.

Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Fixes: 8b7de6aa84 ("vmwgfx: Rework fence event action")
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-23566
Cc: David Airlie <airlied@gmail.com>
CC: Daniel Vetter <daniel@ffwll.ch>
Cc: Zack Rusin <zack.rusin@broadcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: <stable@vger.kernel.org> # v3.4+
Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Reviewed-by: Martin Krastev <martin.krastev@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240425192748.1761522-1-zack.rusin@broadcom.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2f527e3efd37c7c5e85e8aa86308856b619fa59f)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-06-03 12:47:30 +00:00
xinhui pan
3e99e112aa drm/amdgpu: validate the parameters of bo mapping operations more clearly
[ Upstream commit 6fef2d4c00b5b8561ad68dd2b68173f5c6af1e75 ]

Verify the parameters of
amdgpu_vm_bo_(map/replace_map/clearing_mappings) in one common place.

Fixes: dc54d3d174 ("drm/amdgpu: implement AMDGPU_VA_OP_CLEAR v2")
Cc: stable@vger.kernel.org
Reported-by: Vlad Stolyarov <hexed@google.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit d4da6b084f1c5625937d49bb6722c5b4aef11b8d)
[Vegard: fix trivial conflict in context due to missing commit
 73fb16e7ebee12953de32a7a2552e0cf2bf74ebf ("drm/amdgpu: add support for
 per VM BOs v2") + add overflow.h include that otherwise gets pulled in
 indirectly by 3b3b1a29eb89b upstream.]
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>

tmp
2024-05-31 12:56:47 +00:00
Chia-I Wu
5dd0e09eea amdgpu: validate offset_in_bo of drm_amdgpu_gem_va
[ Upstream commit 9f0bcf49e9895cb005d78b33a5eebfa11711b425 ]

This is motivated by OOB access in amdgpu_vm_update_range when
offset_in_bo+map_size overflows.

v2: keep the validations in amdgpu_vm_bo_map
v3: add the validations to amdgpu_vm_bo_map/amdgpu_vm_bo_replace_map
    rather than to amdgpu_gem_va_ioctl

Fixes: 9f7eb5367d ("drm/amdgpu: actually use the VM map parameters")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 6fef2d4c00b5 ("drm/amdgpu: validate the parameters of bo mapping operations more clearly")
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 82aace80cfaab778245bd2f9e31b67953725e4d0)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-05-31 12:56:47 +00:00
Rajneesh Bhardwaj
06da784dbd drm/amdgpu: restrict bo mapping within gpu address limits
[ Upstream commit 8b80d74bdb2285d3022b349c8451eb16535f7906 ]

Have strict check on bo mapping since on some systems, such as A+A or
hybrid, the cpu might support 5 level paging or can address memory above
48 bits but gpu might be limited by hardware to just use 48 bits. In
general, this applies to all asics where this limitation can be checked
against their max_pfn range. This restricts the range to map bo within
pratical limits of cpu and gpu for shared virtual memory access.

Reviewed-by: Oak Zeng <oak.zeng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 6fef2d4c00b5 ("drm/amdgpu: validate the parameters of bo mapping operations more clearly")
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 605134e35a72a8cf1ff1cf433664a2b4a4924488)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-05-31 12:56:47 +00:00
Mikhail Kobuk
cfe1ce1274 drm: nv04: Fix out of bounds access
[ Upstream commit cf92bb778eda7830e79452c6917efa8474a30c1e ]

When Output Resource (dcb->or) value is assigned in
fabricate_dcb_output(), there may be out of bounds access to
dac_users array in case dcb->or is zero because ffs(dcb->or) is
used as index there.
The 'or' argument of fabricate_dcb_output() must be interpreted as a
number of bit to set, not value.

Utilize macros from 'enum nouveau_or' in calls instead of hardcoding.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 2e5702aff3 ("drm/nouveau: fabricate DCB encoder table for iMac G4")
Fixes: 670820c0e6 ("drm/nouveau: Workaround incorrect DCB entry on a GeForce3 Ti 200.")
Signed-off-by: Mikhail Kobuk <m.kobuk@ispras.ru>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240411110854.16701-1-m.kobuk@ispras.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit c2b97f26f081ceec3298151481687071075a25cb)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-05-31 12:30:39 +00:00
Arnd Bergmann
f67ff0072a nouveau: fix function cast warning
[ Upstream commit 185fdb4697cc9684a02f2fab0530ecdd0c2f15d4 ]

Calling a function through an incompatible pointer type causes breaks
kcfi, so clang warns about the assignment:

drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c:73:10: error: cast from 'void (*)(const void *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
   73 |         .fini = (void(*)(void *))kfree,

Avoid this with a trivial wrapper.

Fixes: c39f472e9f ("drm/nouveau: remove symlinks, move core/ to nvkm/ (no code changes)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240404160234.2923554-1-arnd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 7b30bcac7f8bd82dcb9ee61d04926d286060a19f)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-05-31 10:46:18 +00:00
Jani Nikula
e08287742d drm/vc4: hdmi: do not return negative values from .get_modes()
[ Upstream commit abf493988e380f25242c1023275c68bd3579c9ce ]

The .get_modes() hooks aren't supposed to return negative error
codes. Return 0 for no modes, whatever the reason.

Cc: Maxime Ripard <mripard@kernel.org>
Cc: stable@vger.kernel.org
Acked-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/dcda6d4003e2c6192987916b35c7304732800e08.1709913674.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 6206e70d5faa5a9e8a3250683ebee1637d3559fa)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-05-30 09:00:39 +00:00
Jani Nikula
133f1b251a drm/imx/ipuv3: do not return negative values from .get_modes()
[ Upstream commit c2da9ada64962fcd2e6395ed9987b9874ea032d3 ]

The .get_modes() hooks aren't supposed to return negative error
codes. Return 0 for no modes, whatever the reason.

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: stable@vger.kernel.org
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/311f6eec96d47949b16a670529f4d89fcd97aefa.1709913674.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 749e6b3a2dfc9d393874e7a6cc7fed6eeda97ee0)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-05-30 09:00:39 +00:00
kondors1995
1dc18a5da0 Merge remote-tracking branch 'openela/linux-4.14.y' into 14.0 2024-05-12 12:26:07 +03:00
Yangtao Li
5bf51969ad drm/tegra: dpaux: Fix incorrect return value of platform_get_irq
[ Upstream commit 2a1ca44b654346cadfc538c4fb32eecd8daf3140 ]

When platform_get_irq fails, we should return dpaux->irq
instead of -ENXIO.

Fixes: 6b6b604215 ("drm/tegra: Add eDP support")
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230710032355.72914-13-frank.li@vivo.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-05-06 14:36:39 +00:00
Tan Zhongjun
067937ca47 drm/tegra: Remove superfluous error messages around platform_get_irq()
[ Upstream commit d12919bb5da571ec50588ef97683d37e36dc2de5 ]

The platform_get_irq() prints error message telling that interrupt is
missing,hence there is no need to duplicated that message in the
drivers.

Signed-off-by: Tan Zhongjun <tanzhongjun@yulong.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Stable-dep-of: 2a1ca44b6543 ("drm/tegra: dpaux: Fix incorrect return value of platform_get_irq")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-05-06 14:36:39 +00:00
Sultan Alsawaf
5f89616288 drm: Convert CPU-invariant uninterruptible waits to TASK_IDLE
These waits are invariant with respect to CPU frequency, so make them use
TASK_IDLE in order to not contribute to load avg.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
[Tashar02: Adapt to msm-5.4]
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
2024-04-21 22:19:50 +03:00
kondors1995
af30df53ee treeweide: Revert Pixel 8 cass backports
Someting caused issues with media playback

Squashed commit of the following:

commit 9b42dfb148a86d279550e50e7374c799a03a5a6f
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:41 2024 +0300

    Revert "sched/fair: Clean up calc_cfs_shares()"

    This reverts commit 09f624912f.

commit 8acb165e9e42219646fd3e6d6c3f51a6f702a686
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:32 2024 +0300

    Revert "sched/fair: Add comment to calc_cfs_shares()"

    This reverts commit f9d3ffd696.

commit 423c42eb6eb17ad7f3f33cdab7fdf1ff0f98dc79
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:32 2024 +0300

    Revert "sched/fair: Cure calc_cfs_shares() vs. reweight_entity()"

    This reverts commit 82b9ddd10d.

commit 1093143c06279c2d89b3241ac3e5abf339f7abcd
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:31 2024 +0300

    Revert "sched/fair: Remove se->load.weight from se->avg.load_sum"

    This reverts commit 8afedeb608.

commit 4504e6b8c2119e092e831879cbd9c6adaea2713a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:31 2024 +0300

    Revert "sched: remove rt_rq utilization tracking for now"

    This reverts commit ca1bdfe9c2.

commit db5377a1b2868ffc6d3f33225353c33398e1de7b
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:30 2024 +0300

    Revert "sched/fair: Change update_load_avg() arguments"

    This reverts commit 561a960285.

commit d099da1d8854cbbdb8fca1c4eaf4f692f940a6c7
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:30 2024 +0300

    Revert "sched/fair: Move enqueue migrate handling"

    This reverts commit 4fe3a618af.

commit 9b8f11264e1bd21ecfd69b6c77e88d9893e20a98
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:29 2024 +0300

    Revert "sched/fair: Rename {en,de}queue_entity_load_avg()"

    This reverts commit 86597c5bf2.

commit 382d23f36c9c5430b0f96cbf379ded416bc1f330
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:29 2024 +0300

    Revert "sched/fair: Introduce {en,de}queue_load_avg()"

    This reverts commit 04ee68d87c.

commit 7d7c60a4d4ceb493f40703bf596ac949df31dd33
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:28 2024 +0300

    Revert "sched/fair: More accurate reweight_entity()"

    This reverts commit ec54bd1f93.

commit afcd60d3ee87de1d4f069acc713e2097d9b40be8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:28 2024 +0300

    Revert "sched/fair: Use reweight_entity() for set_user_nice()"

    This reverts commit 0d5a173dfd.

commit af78e8c698df9201648634d7dd1e4804494a765d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:27 2024 +0300

    Revert "sched/fair: Rewrite cfs_rq->removed_*avg"

    This reverts commit 7b0d11dc5a.

commit 2a44c05e1f96b14f80ea578b386af04eb24e5aac
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:27 2024 +0300

    Revert "sched/fair: Rewrite PELT migration propagation"

    This reverts commit dc3a4b3e44.

commit a876ca5f4b2937b8adc90b3f502376d45a891d54
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:26 2024 +0300

    Revert "sched/fair: Propagate an effective runnable_load_avg"

    This reverts commit 017d4c0519.

commit 8a0c9809f3fbabc583a485af142b40f0b9945a6d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:26 2024 +0300

    Revert "sched/fair: Implement synchonous PELT detach on load-balance migrate"

    This reverts commit c240cbcefb.

commit 8d002da6ccedb08096a371826525e0e21587f469
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Align PELT windows between cfs_rq and its se"

    This reverts commit 2b669872a6.

commit ceb6db696fe8210e0dc9ce1643fcea314ae84d68
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Implement more accurate async detach"

    This reverts commit a5dce93362.

commit d6afb5da3f6ccc3c426ec6cef2c4b955b0127f79
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Calculate runnable_weight slightly differently"

    This reverts commit 49af7a9c70.

commit 302db79364ce3cdd41e9b33f48a0d5a8c9818ded
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:24 2024 +0300

    Revert "sched/fair: Update calc_group_*() comments"

    This reverts commit 245ba7cfcb.

commit 61ec8d04a966c839f3f204e99e5006a1e42c816a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:23 2024 +0300

    Revert "sched/pelt: Move PELT related code in a dedicated file"

    This reverts commit 05c4270dbb.

commit 494151c770c9afcf2f4231029bb35d337385c5f8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:23 2024 +0300

    Revert "sched/rt: Add rt_rq utilization tracking"

    This reverts commit 1efbd97f33.

commit ee00f39c0c36fc5c7d17b9fc8f7a273acd537efe
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:22 2024 +0300

    Revert "sched: fix build"

    This reverts commit bead5679af.

commit c85ab7e00b755f7b0b008d0657ecc805755248e1
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:22 2024 +0300

    Revert "sched/dl: Add dl_rq utilization tracking"

    This reverts commit 1f48d4df0e.

commit d99ffef9a8069efde7bb85869280025b60519db6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:21 2024 +0300

    Revert "sched/irq: Add IRQ utilization tracking"

    This reverts commit d1c9480337.

commit 2be20e582bf3129e9b572f6b39cef311d0fe3d15
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:20 2024 +0300

    Revert "sched/schedutil: add `schedutil_freq_util()`"

    This reverts commit f3e8cb0f44.

commit b495ca0e67d581fc7cc7d250d26d36fdeb8181c4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:20 2024 +0300

    Revert "FROMLIST: sched: Relocate arch_scale_cpu_capacity"

    This reverts commit 844d670403.

commit 33c4a0dc0cfb20c02cdb705770f888343d11a1a0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:19 2024 +0300

    Revert "sched: cpufreq: add map_util_freq()"

    This reverts commit 1f9df50075.

commit d2fedfac7610b0121e6338a8c64ac7414b5b5965
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:19 2024 +0300

    Revert "sched/pelt: Add support to track thermal pressure"

    This reverts commit 17e0388043.

commit afe91b6a918674b387deeb5ec201a3b7fd720c48
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:18 2024 +0300

    Revert "sched/topology: Add callback to read per CPU thermal pressure"

    This reverts commit 69693e21cc.

commit 760f1b0c528c1d2d8fe62be335d98caa74671f51
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:17 2024 +0300

    Revert "drivers/base/arch_topology: Add infrastructure to store and update instantaneous thermal pressure"

    This reverts commit 25a4c1f1a7.

commit 38dc404537a51df485fc1001a440d66f9e5bdfe3
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:17 2024 +0300

    Revert "arm64/topology: Populate arch_scale_thermal_pressure() for arm64 platforms"

    This reverts commit 27a4d5d4ed.

commit 9c1479b093688b09dcf386f019b34203c6dc1367
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:16 2024 +0300

    Revert "arm/topology: Populate arch_scale_thermal_pressure() for ARM platforms"

    This reverts commit 97e866391b.

commit 67039c6e35777ef753590f15f07190b9296a309c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:16 2024 +0300

    Revert "sched/fair: Enable periodic update of average thermal pressure"

    This reverts commit 7ab5e58f6e.

commit 2a53cfee36bed22116d35da58ea944d5448910d8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:15 2024 +0300

    Revert "BACKPORT: thermal: cpu_cooling: Update thermal pressure in case of a maximum frequency capping"

    This reverts commit 7d4b5af102.

commit 618bb2f007c30c047bd72ec4764f4da321041382
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:14 2024 +0300

    Revert "UPSTREAM: thermal: cpu_cooling: Update also offline CPUs per-cpu thermal_pressure"

    This reverts commit ee683c1595.

commit 57938e1686bc19a3455355bde6df5b339db46b1b
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:14 2024 +0300

    Revert "sched/fair: Enable tuning of decay period"

    This reverts commit a00583df62.

commit a06182dc6401475c7eb31aed0965d13ebc6881d1
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:13 2024 +0300

    Revert "init: Enable SCHED_THERMAL_PRESSURE by default"

    This reverts commit dcf24600af.

commit 9e5796f48feeb87d2dd5966d4bdffa2c78fd559d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:12 2024 +0300

    Revert "sched:schedutil: Reland at @65b6f06b6a"

    This reverts commit f1a3787c1f.

commit 5a99475c6807fbd3f6a4b88fe18ef9853de5dbb8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:12 2024 +0300

    Revert "thermal: cpu_cooling: fix backport"

    This reverts commit 84c18edb67.

commit 78ecfc16e24ee2da5b6f39a30c67d1134c60ee55
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:11 2024 +0300

    Revert "thermal/cpu-cooling, sched/core: Move the arch_set_thermal_pressure() API to generic scheduler code"

    This reverts commit b5c0f9489d.

commit 7df5eb08365aad663f6aff85e47dd87e986b4bd6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:10 2024 +0300

    Revert "sched/cass: Fix CPU selection when no candidate CPUs are idle"

    This reverts commit 545493ec2d.

commit ee830b6597ce40cc38dee0486ba5b6628eee86a5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:10 2024 +0300

    Revert "sched/cass: Clean up local variable scope in cass_best_cpu()"

    This reverts commit 03bd4ff101.

commit 298863d627468afad930e3483f8f594af047f149
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:09 2024 +0300

    Revert "sched/cass:checkout to kerneltoast/android_kernel_google_zuma@63f0b82d3"

    This reverts commit 5d04a85007.

commit 5caf8ee3242cc9e531093620e9d0edf34d2d9bd5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:09 2024 +0300

    Revert "sched/cass: Perform runqueue selection for RT tasks too"

    This reverts commit 9752c4351d.

commit 99b278beedd77cf50fd59af702712b84dfdb6358
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:08 2024 +0300

    Revert "sched/cass: Fix suboptimal task placement when uclamp is used"

    This reverts commit e6b365c5b5.

commit 3b36702eb33d772c3730bdba422c84b2750d0d8e
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:07 2024 +0300

    Revert "sched/cass: Only treat sync waker CPU as idle if there's one task running"

    This reverts commit d12d7eee39.

commit 3037abe8c3c25cfc906ad34ea4155874167835cc
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:07 2024 +0300

    Revert "sched/cass: Eliminate redundant calls to smp_processor_id()"

    This reverts commit f686c22d10.

commit 8bef770149584f5336390367ce20ac8e0991e523
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:06 2024 +0300

    Revert "sched/cass:Adapt for our sources"

    This reverts commit 15e0e548dd.

commit cf47e4130be6df5b4581451dcf712c14ef545044
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:05 2024 +0300

    Revert "sched/fair: Set migration cost to zero to leverage DynamIQ Shared Unit"

    This reverts commit 553243db2f.

commit 9a02852fc864ea71b5d426b5b7aceeba8c72281c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:05 2024 +0300

    Revert "sbalance: Allow IRQs to be moved off of excluded CPUs"

    This reverts commit cba4cee059.

commit 072fd97abf76bca1587d5a6a183125d8c2667c49
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:04 2024 +0300

    Revert "sbalance: Use a deferrable timer to avoid waking idle CPUs"

    This reverts commit 9efd9574cd.

commit d788e1caba4bf5bc5d3a81d2a96cfbd4d3b51381
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:03 2024 +0300

    Revert "sbalance: Use non-atomic cpumask_clear_cpu() variant"

    This reverts commit 11502f0b2b.

commit be608ef254b24bc0f5a807676bc2aa37a75c0c41
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:03 2024 +0300

    Revert "sbalance: Fix systemic issues caused by flawed IRQ statistics"

    This reverts commit dca8268454.

commit d99703fa29615b4a9f5b051742cd2f64ad65ef53
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:02 2024 +0300

    Revert "cpufreq: schedutil: Use the frequency below the target if they're close"

    This reverts commit 9a7a26c904.

commit 1cf28ec326ca586bd9b5a555e777c0ce49a9371c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:02 2024 +0300

    Revert "raphael_defconfig: Reduce IRQ_SBALANCE_POLL_MSEC to default 3000"

    This reverts commit ab033d4dca.

commit 53ce1242f7c643c525b239c464ba61cfcef3f5ea
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:01 2024 +0300

    Revert "Revert "cpufreq: schedutil: Use the frequency below the target if they're close""

    This reverts commit 217db388c4.

commit 63f8122b844e194bc197c2a17a11871651017af6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:00 2024 +0300

    Revert "Revert "cpufreq: schedutil: Extend limit tunables to prime""

    This reverts commit 056441ef45.

commit 09c2c5be085b6c10a6ab974b84404badc85ff393
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:00 2024 +0300

    Revert "Revert "cpufreq: schedutil: Expose limit tunables cluster-wise""

    This reverts commit d4c03145b6.

commit f3473acea98f745b142608e182b163c08110affe
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:59 2024 +0300

    Revert "raphael_defconfig:Exclude core 3 from IRQ balancing"

    This reverts commit 1b7085aae6.

commit b7ce57d5f7480430cb9e530a3a7206f2dd6456e5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:58 2024 +0300

    Revert "cpufreq: schedutil: Use the frequency below the target if they're close"

    This reverts commit b64b535bea.

commit c99a62857fd75daafe6a6a76fdfe20242fb59d9d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:57 2024 +0300

    Revert "cpufreq: schedutil: Set default up/down rate limits to 500/1000 us"

    This reverts commit 2dff5ad0ff.

commit f505c93a25bc5d741b52e2e219ddd86fd9022976
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:57 2024 +0300

    Revert "cpufreq: schedutil: Protect default up/down rate limits"

    This reverts commit d0164cdf9a.

commit b5b279845790b0b072e3abf3886d5430434d30f4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:56 2024 +0300

    Revert "drm: Convert CPU-invariant uninterruptible waits to TASK_IDLE"

    This reverts commit a252ff2d01.

commit 9575adb91c2880a5dbeff1fec93aac44295f939a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:55 2024 +0300

    Revert "pm_qos: Use SRCU notifier chains"

    This reverts commit 29d5065905.

commit 644abfbbd422a8f6aa9902839cfee155b3496c24
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:55 2024 +0300

    Revert "sched/completion: Expose wait_for_common*() to drivers"

    This reverts commit 483d30a710.

commit 1fc08c6cd803c0c24421d5d992ea4b16357aeb92
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:51 2024 +0300

    Revert "treewide: Fix warnings"

    This reverts commit abfb9659df.
2024-04-21 22:19:43 +03:00
kondors1995
bcaa6a3480 Merge remote-tracking branch 'openela/linux-4.14.y' into 14.0 2024-04-21 22:19:28 +03:00
Hsin-Yi Wang
f754e826a4 drm/mediatek: Fix a null pointer crash in mtk_drm_crtc_finish_page_flip
[ Upstream commit c958e86e9cc1b48cac004a6e245154dfba8e163b ]

It's possible that mtk_crtc->event is NULL in
mtk_drm_crtc_finish_page_flip().

pending_needs_vblank value is set by mtk_crtc->event, but in
mtk_drm_crtc_atomic_flush(), it's is not guarded by the same
lock in mtk_drm_finish_page_flip(), thus a race condition happens.

Consider the following case:

CPU1                              CPU2
step 1:
mtk_drm_crtc_atomic_begin()
mtk_crtc->event is not null,
                                  step 1:
                                  mtk_drm_crtc_atomic_flush:
                                  mtk_drm_crtc_update_config(
                                      !!mtk_crtc->event)
step 2:
mtk_crtc_ddp_irq ->
mtk_drm_finish_page_flip:
lock
mtk_crtc->event set to null,
pending_needs_vblank set to false
unlock
                                  pending_needs_vblank set to true,

                                  step 2:
                                  mtk_crtc_ddp_irq ->
                                  mtk_drm_finish_page_flip called again,
                                  pending_needs_vblank is still true
                                  //null pointer

Instead of guarding the entire mtk_drm_crtc_atomic_flush(), it's more
efficient to just check if mtk_crtc->event is null before use.

Fixes: 119f517362 ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240223212404.3709690-1-hsinyi@chromium.org/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit accdac6b71d5a2b84040c3d2234f53a60edc398e)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:33 +00:00
Srinivasan Shanmugam
d7fb1c3d48 drm/amdgpu: Fix missing break in ATOM_ARG_IMM Case of atom_get_src_int()
[ Upstream commit 7cf1ad2fe10634238b38442a851d89514cb14ea2 ]

Missing break statement in the ATOM_ARG_IMM case of a switch statement,
adds the missing break statement, ensuring that the program's control
flow is as intended.

Fixes the below:
drivers/gpu/drm/amd/amdgpu/atom.c:323 atom_get_src_int() warn: ignoring unreachable code.

Fixes: d38ceaf99e ("drm/amdgpu: add core driver (v4)")
Cc: Jammy Zhou <Jammy.Zhou@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 5a2b18dbec88b972d570994483f188cb59586609)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:33 +00:00
Fedor Pchelkin
964b1a6dfa drm/tegra: put drm_gem_object ref on error in tegra_fb_create
[ Upstream commit 32e5a120a5105bce01561978ee55aee8e40ac0dc ]

Inside tegra_fb_create(), drm_gem_object_lookup() increments ref count of
the found object. But if the following size check fails then the last
found object's ref count should be put there as the unreferencing loop
can't detect this situation.

Found by Linux Verification Center (linuxtesting.org).

Fixes: de2ba664c3 ("gpu: host1x: drm: Add memory manager and fb")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231215093356.12067-1-pchelkin@ispras.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit d674e78da934afd2ce5935eff08cf5361a9a27ac)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:33 +00:00
AngeloGioacchino Del Regno
bbb93685c7 drm/mediatek: dsi: Fix DSI RGB666 formats and definitions
[ Upstream commit fae6f815505301b92d9113764f4d76d0bfe45607 ]

The register bits definitions for RGB666 formats are wrong in multiple
ways: first, in the DSI_PS_SEL bits region, the Packed 18-bits RGB666
format is selected with bit 1, while the Loosely Packed one is bit 2,
and second - the definition name "LOOSELY_PS_18BIT_RGB666" is wrong
because the loosely packed format is 24 bits instead!

Either way, functions mtk_dsi_ps_control_vact() and mtk_dsi_ps_control()
do not even agree on the DSI_PS_SEL bit to set in DSI_PSCTRL: one sets
loosely packed (24) on RGB666, the other sets packed (18), and the other
way around for RGB666_PACKED.

Fixing this entire stack of issues is done in one go:
 - Use the correct bit for the Loosely Packed RGB666 definition
 - Rename LOOSELY_PS_18BIT_RGB666 to LOOSELY_PS_24BIT_RGB666
 - Change ps_bpp_mode in mtk_dsi_ps_control_vact() to set:
    - Loosely Packed, 24-bits for MIPI_DSI_FMT_RGB666
    - Packed, 18-bits for MIPI_DSI_FMT_RGB666_PACKED

Fixes: 2e54c14e31 ("drm/mediatek: Add DSI sub driver")
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240215085316.56835-3-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit a5e660dba9ff73531053664e20dd858d880adbdb)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:32 +00:00
Nikita Zhandarovich
38f97031f0 drm/radeon/ni: Fix wrong firmware size logging in ni_init_microcode()
[ Upstream commit c4891d979c7668b195a0a75787967ec95a24ecef ]

Clean up a typo in pr_err() erroneously printing NI MC 'rdev->mc_fw->size'
during SMC firmware load. Log 'rdev->smc_fw->size' instead.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 6596afd48a ("drm/radeon/kms: add dpm support for btc (v3)")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 1c35795b90f4dce0605ace7eef9ae1bd1282ebf2)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:32 +00:00
Alex Bee
9514fc6546 drm/rockchip: inno_hdmi: Fix video timing
[ Upstream commit 47a145c03484d33e65d773169d5ca1b9fe2a492e ]

The controller wants the difference between *total and *sync_start in the
HDMI_VIDEO_EXT_*DELAY registers. Otherwise the signal is very unstable for
certain non-VIC modes. See downstream commit [0].

[0] https://github.com/rockchip-linux/kernel/commit/8eb559f2502c

Fixes: 412d4ae6b7 ("drm/rockchip: hdmi: add Innosilicon HDMI support")
Co-developed-by: Zheng Yang <zhengyang@rock-chips.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
Signed-off-by: Alex Bee <knaerzche@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20231222174220.55249-4-knaerzche@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit c031022829a91114cb2bd531c38de99184957b6d)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:30 +00:00
Christophe JAILLET
8f0f744ebf drm/tegra: dsi: Fix missing pm_runtime_disable() in the error handling path of tegra_dsi_probe()
[ Upstream commit 5286a9fc280c45b6b307ee1b07f7a997e042252c ]

If an error occurs after calling pm_runtime_enable(), pm_runtime_disable()
should be called as already done in the remove function.

Fixes: ef8187d752 ("drm/tegra: dsi: Implement runtime PM")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ee4a15c9cd4b574a55cd67c30d2411239ba2cee9.1693667005.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit d7e898d13a867014352f0daf98f8a0155c67a3c9)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:30 +00:00
Christophe JAILLET
beef7ea176 drm/tegra: dsi: Fix some error handling paths in tegra_dsi_probe()
[ Upstream commit 830c1ded356369cd1303e8bb87ce3fea6e744de8 ]

If an error occurs after calling tegra_output_probe(),
tegra_output_remove() should be called as already done in the remove
function.

Fixes: dec727399a ("drm/tegra: Add DSI support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/16820073278d031f6c474a08d5f22a255158585e.1693667005.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 0cb8749a621cdd291dc8976bbc245029124d402a)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:30 +00:00
Cai Huoqing
a7f3189387 drm/tegra: dsi: Make use of the helper function dev_err_probe()
[ Upstream commit fc75e4fcbd1e4252a0481ebb23cd4516c127a8e2 ]

When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, the error value
gets printed.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Stable-dep-of: 830c1ded3563 ("drm/tegra: dsi: Fix some error handling paths in tegra_dsi_probe()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 4003d399dd34bd9a80fcf78a3feb3140eb82b2b8)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:30 +00:00