Re: [PATCH] drm/i915/display: Change ret value type from int to long

2025-07-17 Thread Dan Carpenter
e); 543 if (err) { ^^^ This should be: if (err <= 0) { err = err ?: -ETIMEDOUT; SUBMIT_ERR(context, "wait for syncobj_in timed out"); It's a bit of a headache to return 0 or negavi

Re: [PATCH] drm/i915/display: Change ret value type from int to long

2025-07-14 Thread Dan Carpenter
we're just not running them! It's easy enough to warn about when we have: ret = dma_fence_wait_timeout(); and ret is an int. In Smatch I actually had hardcoded dma_fence_wait_timeout() as only returning up to INT_MAX because there were enough places which saved it as an int and it triggered false positives in callers where we knew the timeout was reasonable. regards, dan carpenter

[PATCH v2] drm/i915/selftests: Change mock_request() to return error pointers

2025-06-25 Thread Dan Carpenter
it would lead to a NULL pointer dereference. To fix this, change the mock_request() function to return error pointers and update all the callers to expect that. Fixes: 52c0fdb25c7c ("drm/i915: Replace global breadcrumbs with per-context interrupt tracking") Signed-off-by: Dan Carpente

Re: [PATCH] drm/i915/selftests: Fix error pointer vs NULL in __mock_request_alloc()

2025-06-18 Thread Dan Carpenter
On Mon, Jun 16, 2025 at 11:01:08AM -0400, Rodrigo Vivi wrote: > On Fri, Jun 06, 2025 at 12:04:49PM +0300, Dan Carpenter wrote: > > --- a/drivers/gpu/drm/i915/selftests/i915_request.c > > +++ b/drivers/gpu/drm/i915/selftests/i915_request.c > > @@ -290,7 +290,12 @@ struct sm

[PATCH] drm/i915/selftests: Fix error pointer vs NULL in __mock_request_alloc()

2025-06-06 Thread Dan Carpenter
global breadcrumbs with per-context interrupt tracking") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/selftests/i915_request.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftes

[PATCH] drm/i915/gsc: delete a stray tab in intel_gsc_fw_get_binary_info()

2025-03-15 Thread Dan Carpenter
This line is indented on tab too far. Delete the extra tab. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c

[bug report] drm/i915: Replace global breadcrumbs with per-context interrupt tracking

2025-03-11 Thread Dan Carpenter
L dereference. 386 387 if (err >= 0) 388 err = i915_sw_fence_await_dma_fence(wait, 389 &rq->fence, 390 0, regards, dan carpenter

Re: [PATCH v4 7/8] drm/i915/lobf: Add mutex for alpm update

2025-02-26 Thread Dan Carpenter
) compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter

Re: [PATCH next] drm/i915: Fix NULL vs IS_ERR() check in __shmem_writeback()

2025-02-07 Thread Dan Carpenter
On Fri, Feb 07, 2025 at 12:02:43PM +0100, Andi Shyti wrote: > Hi Dan, > > On Thu, Feb 06, 2025 at 11:17:02AM +0300, Dan Carpenter wrote: > > The filemap_lock_folio() function doesn't return NULL, it returns error > > pointers. > > > > Fixes: 25dd342f0cc8 (&q

[PATCH next] drm/i915: Fix NULL vs IS_ERR() check in __shmem_writeback()

2025-02-06 Thread Dan Carpenter
The filemap_lock_folio() function doesn't return NULL, it returns error pointers. Fixes: 25dd342f0cc8 ("drm/i915/gem: convert __shmem_writeback() to folios") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 de

Re: [bug report] drm/i915/dp: Get optimal link config to have best compressed bpp

2025-02-05 Thread Dan Carpenter
hanks! regards, dan carpenter

[bug report] drm/i915/dp: Get optimal link config to have best compressed bpp

2025-02-05 Thread Dan Carpenter
ut BPC for ICL+ is 8 */ 2164 return 8; This 8 becomes "8 * 3" in the caller. 2165 } regards, dan carpenter

Re: [PATCH v3 3/5] drm/i915/scaler: Compute scaling factors for pipe scaler

2025-01-08 Thread Dan Carpenter
tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202501080440.cxe0zhxj-...@intel.com/ smatch warnings: drivers/gpu/drm/i915/display/skl_scaler.c:451 intel_atomic_setup_scaler() error: uninitialized symbol 'hscale'. drivers/gp

Re: [PATCH v3 1/2] drm/display/dsc: Refactor DRM MST DSC Determination Policy

2024-11-07 Thread Dan Carpenter
: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202411071102.0cmtieio-...@intel.com/ smatch warnings: drivers/gpu/drm/display/drm_dp_mst_topology.c:6043 drm_dp_mst_dsc_aux_for_port() warn: variable dereferenced before check 'port' (see line 6033)

Re: [PATCH 6/9] drm/i915/display: iterare through channels if no feasible frequencies

2024-10-09 Thread Dan Carpenter
patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202410100801.8jzbrn3y-...@intel.com/ smatch warnings: drivers/gpu/drm/i915/display/intel_audio.c:789 intel_audio_compute_sad() error: uninitialized symbol

Re: [PATCH v4 3/3] drm/i915/display: Call panel_fitting from pipe_config

2024-10-01 Thread Dan Carpenter
-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202410010933.pzc3ug9p-...@intel.com/ New smatch warnings: drivers/gpu/drm/i915/display/intel_display.c:4792 intel_modeset_pipe_config() error: uninitialized symbol 'fixed_mode'. vim +/fixed_

Re: [PATCH] drm/display/dsc: Refactor MST DSC Determination Policy

2024-09-25 Thread Dan Carpenter
/202409231002.bmp89ipm-...@intel.com/config) compiler: microblaze-linux-gcc (GCC) 14.1.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https

Re: [PATCH] drm/i915/display: Workaround for odd panning for planar yuv

2024-09-15 Thread Dan Carpenter
/20240915/202409151558.etiw5umu-...@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes

Re: [PATCH v10] drm/i915: WA context support for L3flush

2024-08-16 Thread Dan Carpenter
| Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202408170547.2jchhuar-...@intel.com/ New smatch warnings: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:4415 guc_kernel_context_pin() error: uninitialized symbol 'ret'. vim +/ret +4415 drivers/gpu/drm/i915/gt/uc/intel_guc_su

Re: [PATCH] drm/i915: Allow NULL memory region

2024-07-26 Thread Dan Carpenter
On Fri, Jul 26, 2024 at 09:17:20AM +0100, Tvrtko Ursulin wrote: > > On 25/07/2024 16:58, Dan Carpenter wrote: > > On Thu, Jul 25, 2024 at 08:48:35AM +0100, Tvrtko Ursulin wrote: > > > > > > Hi, > > > > > > On 12/07/2024 22:41, Jonathan Cavitt

Re: [PATCH] drm/i915: Allow NULL memory region

2024-07-25 Thread Dan Carpenter
On Thu, Jul 25, 2024 at 10:58:08AM -0500, Dan Carpenter wrote: > On Thu, Jul 25, 2024 at 08:48:35AM +0100, Tvrtko Ursulin wrote: > > > > Hi, > > > > On 12/07/2024 22:41, Jonathan Cavitt wrote: > > > Prevent a NULL pointer access in intel_memory_regions_hw_

Re: [PATCH] drm/i915: Allow NULL memory region

2024-07-25 Thread Dan Carpenter
ay. "I'm not lying" at the end. It should be the pointless patches which say, "I'm doing a pointless thing. Don't bother backporting." Most stable patch backports are done automatically and people have various tools and scripts to do that. If the tools don't handle this patch automatically then they are defective. regards, dan carpenter

Re: [PATCH] drm/i915: Allow NULL memory region

2024-07-17 Thread Dan Carpenter
event a NULL pointer access in intel_memory_regions_hw_probe. > > > > > > > > Fixes: 05da7d9f717b ("drm/i915/gem: Downgrade stolen lmem setup > > > > warning") > > > > Reported-by: Dan Carpenter > > > > Signed-off-by: Jonathan Cavitt >

Re: [PATCH] drm/i915: Allow NULL memory region

2024-07-17 Thread Dan Carpenter
On Wed, Jul 17, 2024 at 05:05:55PM +0200, Nirmoy Das wrote: > > On 7/12/2024 11:41 PM, Jonathan Cavitt wrote: > > Prevent a NULL pointer access in intel_memory_regions_hw_probe. > > > > Fixes: 05da7d9f717b ("drm/i915/gem: Downgrade stolen lmem setup warning&quo

[bug report] drm/i915/gem: Downgrade stolen lmem setup warning

2024-07-12 Thread Dan Carpenter
struct intel_memory_region *mem = i915->mm.regions[i]; 377 u64 region_size, io_size; regards, dan carpenter

Re: [PATCH] treewide: Fix common grammar mistake "the the"

2024-04-11 Thread Dan Carpenter
changes. > > Signed-off-by: Thorsten Blum > --- It's tricky to know which tree a patch like this would go through. We used to have a trivial tree for this stuff but I guess that didn't work. It's possible that it could go through linux-doc, but probably it has to go as a set

Re: [PATCH] drm/i915/guc: Remove bogus null check

2024-03-29 Thread Dan Carpenter
ot;Fixes:" should be used when a > bug is fixed, but not for harmless static analyzer reports. > > Besides, if we want to keep the Fixes tag we should also Cc > stable, i guess checkpatch.pl complains about it. > > (BTW, Cc'ed in this mail we have the inventor of the tag and he > can confirm after having had his morning coffee :-) ). > Good. I keep reminding people that I invented the Fixes tag because it is my proudest achievement. :) No. Only use Fixes tags for bug fixes. regards, dan carpenter

[drm-intel:for-linux-next-gt 1/4] drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:2680 guc_context_policy_init_v70() warn: variable dereferenced before check 'ce' (see line 2663)

2024-03-10 Thread Dan Carpenter
/20240310/202403101225.7ahejhzj-...@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes

[bug report] drm/i915/dp: Add support for DP tunnel BW allocation

2024-03-05 Thread Dan Carpenter
gt;display.dp_tunnel_mgr = tunnel_mgr; 797 798 return 0; 799 } regards, dan carpenter

Re: [PATCH 2/3] drm/i915/psr: Improve fast and IO wake lines calculation

2024-02-26 Thread Dan Carpenter
.org/0day-ci/archive/20240225/202402250758.kqbqxyrz-...@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan

[bug report] drm/i915: switch from drm_debug_printer() to device specific drm_dbg_printer()

2024-02-19 Thread Dan Carpenter
101 102 if (!rq) { ^^^ Previously we assumed "rq" could be NULL. 103 intel_engine_dump(engine, &p, 104 "%s heartbeat not ticking\n", regards, dan carpenter

Re: [PATCH 16/28] drm/i915/color: Create a transfer function color pipeline

2024-02-18 Thread Dan Carpenter
| Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202402180310.gmdixajx-...@intel.com/ New smatch warnings: drivers/gpu/drm/i915/display/intel_color.c:3867 intel_plane_tf_pipeline_init() error: 'colorop' dereferencing possible ERR_PTR() vim +/colorop +3867 drivers/gp

Re: [PATCH 4/6] drm/i915/psr: Silence period and lfps half cycle

2024-02-18 Thread Dan Carpenter
-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202402171830.n4hwr2id-...@intel.com/ smatch warnings: drivers/gpu/drm/i915/display/intel_psr.c:1253 _lnl_compute_aux_less_alpm_params() error: uninitialized symbol 'silence_period'. vim +/silence_pe

Re: [PATCH 3/5] drm/xe: store bind time pat index to xe_bo

2024-01-31 Thread Dan Carpenter
/0day-ci/archive/20240131/202401311604.1pllaxek-...@intel.com/config) compiler: sparc64-linux-gcc (GCC) 13.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan

[PATCH] drm/i915/gvt: Fix uninitialized variable in handle_mmio()

2024-01-26 Thread Dan Carpenter
. Fixes: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT-g") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gvt/handlers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handler

[bug report] drm/i915/gt: Use i915_vm_put on ppgtt_create error paths

2024-01-10 Thread Dan Carpenter
;base.pd); 276 277 mutex_destroy(&ppgtt->flush); 278 } regards, dan carpenter

Re: [Intel-gfx] [PATCH] drm/i915: Support FP16 compressed formats on MTL

2023-10-15 Thread Dan Carpenter
-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202310150454.s9qf86bl-...@intel.com/ smatch warnings: drivers/gpu/drm/i915/display/skl_universal_plane.c:2126 gen12_plane_format_mod_supported() warn: ignoring unreachable code. vim +2126 drivers/gpu/drm/i915/display/skl_universal_plane.c

[Intel-gfx] [bug report] drm/i915/dsb: Use DEwake to combat PkgC latency

2023-10-04 Thread Dan Carpenter
E_EXTENSION); 380 } 381 382 intel_de_write_fw(dev_priv, DSB_TAIL(pipe, dsb->id), 383 i915_ggtt_offset(dsb->vma) + tail); 384 } regards, dan carpenter

[Intel-gfx] [bug report] drm/i915: Move submission tasklet to i915_sched_engine

2023-10-04 Thread Dan Carpenter
0 i915_sched_engine_put(ve->base.sched_engine); 3661 intel_engine_free_request_pool(&ve->base); regards, dan carpenter

[Intel-gfx] [bug report] drm/i915/hdmi: Use connector->ddc everwhere

2023-09-26 Thread Dan Carpenter
4336 if (!connector || connector->base.status != connector_status_connected) ^ Checked too late. 4337 return 0; 4338 regards, dan carpenter

Re: [Intel-gfx] [PATCH v13 1/2] drm/i915: Add WABB blit for Wa_16018031267 / Wa_16018063123

2023-09-25 Thread Dan Carpenter
: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202309252243.l3lv6ixf-...@intel.com/ New smatch warnings: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:4181 guc_kernel_context_pin() error: uninitialized symbol 'ret'. vim +/ret +4181 drivers/gp

[Intel-gfx] [PATCH] drm/i915/gt: Prevent error pointer dereference

2023-09-13 Thread Dan Carpenter
Move the check for "if (IS_ERR(obj))" in front of the call to i915_gem_object_set_cache_coherency() which dereferences "obj". Otherwise it will lead to a crash. Fixes: 43aa755eae2c ("drm/i915/mtl: Update cache coherency setting for context structure") Signed-off-b

Re: [Intel-gfx] [PATCH v5 3/6] drm/i915/panelreplay: Initializaton and compute config for panel replay

2023-09-06 Thread Dan Carpenter
| Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202309060644.uwp5zw4i-...@intel.com/ smatch warnings: drivers/gpu/drm/i915/display/intel_dp.c:3779 intel_dp_vsc_sdp_pack() warn: was && intended here instead of ||? vim +3779 drivers/gpu/drm/i915

Re: [Intel-gfx] [PATCH v2] drm/i915/tv: avoid possible division by zero

2023-07-25 Thread Dan Carpenter
On Wed, Jul 26, 2023 at 09:21:50AM +0800, Su Hui wrote: > On 2023/7/25 13:51, Dan Carpenter wrote: > > The reason why the first five attempts had bugs is because we are > > trying to write it in the most complicated way possible, shifting by > > logical not what? > Wond

Re: [Intel-gfx] [PATCH v2] drm/i915/tv: avoid possible division by zero

2023-07-24 Thread Dan Carpenter
The reason why the first five attempts had bugs is because we are trying to write it in the most complicated way possible, shifting by logical not what? regards, dan carpenter diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 36b479b46b60

Re: [Intel-gfx] [PATCH] drm/i915/tv: avoid possible division by zero

2023-07-17 Thread Dan Carpenter
; > > + mode->clock = clock / (tv_mode->oversample != 1 ? > > + tv_mode->oversample >> !tv_mode->progressive : 1); > > Seems too smart to me, why not just: > mode->clock = clock / tv_mode->oversample; > if (!tv_mode->progressive) >     mode->clock <<= 1; This is nice. regards, dan carpenter

Re: [Intel-gfx] [PATCH 16/26] drm/i915/gvt: use array_size

2023-06-26 Thread Dan Carpenter
user doesn't > know that a truncation has happened. So that if we save from an > overflow here, we might encur to an unwanted access later when we > would start using the array for the size we think is allocated. SIZE_MAX allocations are guaranteed to fail, so the NULL check will still return -ENOMEM. > > kmalloc_array(), for example, returns NULL of there is a > multiplication overflow and I think that's a better behaviour, > although more drastic. It's the same either way. regards, dan carpenter

Re: [Intel-gfx] [PATCH] drm/i915/gsc: Fix error code in intel_gsc_uc_heci_cmd_submit_nonpriv()

2023-06-08 Thread Dan Carpenter
On Wed, Jun 07, 2023 at 06:44:54PM +, Teres Alexis, Alan Previn wrote: > On Tue, 2023-06-06 at 21:32 +0300, Dan Carpenter wrote: > > On Tue, Jun 06, 2023 at 06:07:19PM +, Teres Alexis, Alan Previn wrote: > > > That was my bad, i could have sword i'd fixed th

Re: [Intel-gfx] [PATCH] drm/i915/gsc: Fix error code in intel_gsc_uc_heci_cmd_submit_nonpriv()

2023-06-06 Thread Dan Carpenter
the fixes tag is significant. > The Fixes tag is correct. It's definitely a bug fix. (I invented the Fixes tag so technically that makes me the worlds #1 expert on Fixes tags). regards, dan carpenter

[Intel-gfx] [PATCH] drm/i915: Fix a NULL vs IS_ERR() bug

2023-06-06 Thread Dan Carpenter
The mmap_offset_attach() function returns error pointers, it doesn't return NULL. Fixes: eaee1c085863 ("drm/i915: Add a function to mmap framebuffer obj") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[Intel-gfx] [PATCH] drm/i915/gsc: Fix error code in intel_gsc_uc_heci_cmd_submit_nonpriv()

2023-06-06 Thread Dan Carpenter
This should return negative -EAGAIN instead of positive EAGAIN. Fixes: e5e1e6d28ebc ("drm/i915/pxp: Add MTL helpers to submit Heci-Cmd-Packet to GSC") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c | 2 +- 1 file changed, 1 insertion(+),

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Add some missing error propagation

2023-06-05 Thread Dan Carpenter
grep line to their scripts to solve that problem. Instead we were having the opposite discussion the other week where the bpf people didn't want to backport selftest stuff and Greg wanted to. https://lore.kernel.org/all/2023052647-tacking-wince-85c5@gregkh/ regards, dan carpenter

Re: [Intel-gfx] [PATCH 01/15] drm/i915/plane: warn on non-zero plane offset

2023-05-29 Thread Dan Carpenter
) compiler: gcc-11 (Debian 11.3.0-12) 11.3.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202305280453.8yzcms2i-...@intel.com/ smatch warnings: drivers/gpu/drm/i915/display

Re: [Intel-gfx] [PATCH v8 6/7] drm/i915/mtl: find the best QGV point for the SAGV configuration

2023-05-29 Thread Dan Carpenter
/config) compiler: gcc-11 (Debian 11.3.0-12) 11.3.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202305280253.ab8brv2w-...@intel.com/ New smatch warnings: drivers/gpu/drm/i915/display

Re: [Intel-gfx] [PATCH] drm/i915/selftests: fix an error code in copy()

2023-05-26 Thread Dan Carpenter
On Fri, May 26, 2023 at 02:58:01PM +0200, Andi Shyti wrote: > Hi Dan, > > On Fri, May 26, 2023 at 02:59:31PM +0300, Dan Carpenter wrote: > > Return the error code if i915_gem_object_create_internal() fails, > > instead of returning success. > > > > Fixes: cf58

[Intel-gfx] [bug report] drm/i915/selftests: Add a cancel request selftest that triggers a reset

2023-05-26 Thread Dan Carpenter
intel_context_put(ce); 906 out_spin: 907 igt_spinner_fini(&spin); 908 out_restore: 909 engine->props.preempt_timeout_ms = preempt_timeout_ms; 910 if (err) 911 pr_err("%s: %s error %d\n", __func__, engine->name, err); 912 return err; 913 } regards, dan carpenter

[Intel-gfx] [bug report] drm/i915/display: Handle GMD_ID identification in display code

2023-05-26 Thread Dan Carpenter
(i915); 848 out_pci_disable: 849 pci_disable_device(pdev); --> 850 i915_probe_error(i915, "Device initialization failed (%d)\n", ret); Oops. 851 return ret; 852 } regards, dan carpenter

[Intel-gfx] [PATCH] drm/i915/selftests: fix an error code in copy()

2023-05-26 Thread Dan Carpenter
Return the error code if i915_gem_object_create_internal() fails, instead of returning success. Fixes: cf586021642d ("drm/i915/gt: Pipelined page migration") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/selftest_migrate.c | 4 +++- 1 file changed, 3 insertions(+),

[Intel-gfx] [bug report] drm/i915: Remove I915_USER_PRIORITY_SHIFT

2023-05-26 Thread Dan Carpenter
m_object_create_internal(gt->i915, PAGE_SIZE); 1552 if (IS_ERR(obj)) { 1553 err = PTR_ERR(obj); 1554 goto err_ctx_lo; 1555 } 1556 regards, dan carpenter

[Intel-gfx] [bug report] drm/i915/selftests: Stop using kthread_stop()

2023-05-26 Thread Dan Carpenter
y_worker(data[n].worker); 416 } 417 kfree(data); 418 out_file: 419 fput(file); 420 return err; 421 } regards, dan carpenter

[Intel-gfx] [bug report] drm/i915: Use ttm mmap handling for ttm bo's.

2023-05-19 Thread Dan Carpenter
vma->vm_ops = obj->ops->mmap_ops; 1008 vma->vm_private_data = node->driver_private; ^^^^ Patch adds unchecked dereference. 1009 return 0; 1010 } regards, dan carpenter

[Intel-gfx] [bug report] drm/i915/pmu: Use functions common with sysfs to read actual freq

2023-03-28 Thread Dan Carpenter
2109 --> 2110 return intel_rps_get_cagf(rps, freq); Warning. 2111 } regards, dan carpenter

[Intel-gfx] [bug report] drm/i915/guc: Use GuC submission API version number

2023-03-24 Thread Dan Carpenter
INTEL_UC_FIRMWARE_ERROR); 820 --> 821 gt_probe_error(gt, "%s firmware %s: fetch failed %pe\n", 822intel_uc_fw_type_repr(uc_fw->type), uc_fw->file_selected.path, ERR_PTR(err)); 823 gt_info(gt, "%s firmware(s) can be downloaded from %s\n", 824 intel_uc_fw_type_repr(uc_fw->type), INTEL_UC_FIRMWARE_URL); 825 826 release_firmware(fw);/* OK even if fw is NULL */ 827 return err; 828 } regards, dan carpenter

Re: [Intel-gfx] [bug report] drm/i915/dmc: add i915_to_dmc() and dmc->i915 and use them

2023-03-10 Thread Dan Carpenter
On Thu, Mar 09, 2023 at 04:51:10PM +0200, Jani Nikula wrote: > On Thu, 09 Mar 2023, Dan Carpenter wrote: > > Hello Jani Nikula, > > > > This is a semi-automatic email about new static checker warnings. > > > > The patch 1b28c1c789d0: "drm/i915/dmc: add i9

[Intel-gfx] [bug report] drm/i915/dmc: add i915_to_dmc() and dmc->i915 and use them

2023-03-09 Thread Dan Carpenter
1160 goto out; 1161 1162 seq_printf(m, "version: %d.%d\n", DMC_VERSION_MAJOR(dmc->version), 1163 DMC_VERSION_MINOR(dmc->version)); Unchecked dereferences. 1164 regards, dan carpenter

[Intel-gfx] [bug report] drm/i915/mtl: Add hardware-level lock for steering

2023-02-08 Thread Dan Carpenter
l_engine_reset_bh(engine, NULL); ^^ Sleeping. 638 GEM_BUG_ON(rq->fence.error != -EIO); 639 640 engine_unlock_reset_tasklet(engine); preempt enabled again. 641 642 /* Check that we do not resubmit the held request */ regards, dan carpenter

[Intel-gfx] [bug report] drm/i915/guc: Suspend/resume implementation for new interface

2023-02-08 Thread Dan Carpenter
u, I'm too lazy to lift a finger to help so who am I to talk...) 657 } 658 659 /* Signal that the GuC isn't running. */ 660 intel_guc_sanitize(guc); 661 662 return 0; 663 } regards, dan carpenter

Re: [Intel-gfx] [bug report] drm/i915: Allow compaction upto SWIOTLB max segment size

2023-02-07 Thread Dan Carpenter
On Mon, Feb 06, 2023 at 04:59:36PM +, Tvrtko Ursulin wrote: > > On 06/02/2023 14:19, Dan Carpenter wrote: > > [ Ancient code but the warning showed up again because the function was > >renamed or something? - dan ] > > > > Hello Chris Wilson, > > &

[Intel-gfx] [bug report] drm/i915: Allow compaction upto SWIOTLB max segment size

2023-02-06 Thread Dan Carpenter
ur 187 * usual understanding of ENOMEM. 188 */ 189 if (ret == -ENOSPC) 190 ret = -ENOMEM; 191 192 return ret; 193 } regards, dan carpenter

Re: [Intel-gfx] [PATCH v2 11/17] drm/display/dp_mst: Add helpers to query for payload allocation errors

2023-02-02 Thread Dan Carpenter
, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/display/drm_dp_mst_topology.c:3316 drm_dp_add_payload_part1() warn: missing error code 'ret' vim +/ret +3316 drivers/gpu/drm/display/drm_dp_mst_

Re: [Intel-gfx] [PATCH v6] drm: Optimise for continuous memory allocation

2022-12-27 Thread Dan Carpenter
test robot | Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/drm_buddy.c:501 find_continuous_blocks() error: uninitialized symbol 'block'. vim +/block +501 drivers/gpu/drm/drm_buddy.c 8a257b57bc11a2 xinhui pan 2022-12-18 472 static struct drm_buddy_block * 8a257b57bc11a2

[Intel-gfx] [PATCH] drm/i915/uc: Fix double free bug

2022-12-01 Thread Dan Carpenter
The "fw" pointer is freed again in the clean up code at the end of the function. Set it to NULL here to prevent a double free. Fixes: 016241168dc5 ("drm/i915/uc: use different ggtt pin offsets for uc loads") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/uc/in

[Intel-gfx] [PATCH] drm/i915: unpin on error in intel_vgpu_shadow_mm_pin()

2022-11-21 Thread Dan Carpenter
Call intel_vgpu_unpin_mm() on this error path. Fixes: 418741480809 ("drm/i915/gvt: Adding ppgtt to GVT GEM context after shadow pdps settled.") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gvt/scheduler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/dr

Re: [Intel-gfx] [bug report] drm/i915/guc: Implement multi-lrc submission

2022-09-23 Thread Dan Carpenter
On Thu, Sep 22, 2022 at 01:01:48PM -0700, John Harrison wrote: > On 9/22/2022 07:26, Dan Carpenter wrote: > > Hello Matthew Brost, > > > > The patch 6b540bf6f143: "drm/i915/guc: Implement multi-lrc > > submission" from Oct 14, 2021, leads to the follow

[Intel-gfx] [bug report] drm/i915/guc: Implement multi-lrc submission

2022-09-22 Thread Dan Carpenter
915_request_guc_submit(rq); 749 750 out: 751 spin_unlock(&ce->guc_state.lock); --> 752 return err; 753 } regards, dan carpenter

[Intel-gfx] [PATCH] drm/i915: prevent integer overflow in query_engine_info()

2022-09-01 Thread Dan Carpenter
This code uses struct_size() but it stores the result in an int so the integer overflow checks are not effective. Record the types as size_t to prevent the size from being truncated. Fixes: bf3c50837506 ("drm/i915/query: Use struct_size() helper") Signed-off-by: Dan Carpenter --- I d

intel-gfx@lists.freedesktop.org

2022-08-30 Thread Dan Carpenter
-ci/archive/20220830/202208301957.ulaot2oy-...@intel.com/config) compiler: gcc-11 (Debian 11.3.0-5) 11.3.0 If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:497

[Intel-gfx] [PATCH v2] drm/i915/selftests: fix a couple IS_ERR() vs NULL tests

2022-07-08 Thread Dan Carpenter
The shmem_pin_map() function doesn't return error pointers, it returns NULL. Fixes: be1cb55a07bf ("drm/i915/gt: Keep a no-frills swappable copy of the default context state") Signed-off-by: Dan Carpenter Reviewed-by: Matthew Auld --- v2: Correct the Fixes tag. Add Matthew&#x

Re: [Intel-gfx] [PATCH] drm/i915/selftests: fix a couple IS_ERR() vs NULL tests

2022-07-08 Thread Dan Carpenter
On Fri, Jul 08, 2022 at 10:02:34AM +0100, Matthew Auld wrote: > On 08/07/2022 09:40, Dan Carpenter wrote: > > The shmem_pin_map() function doesn't return error pointers, it returns > > NULL. > > > > Fixes: a0d3fdb628b8 ("drm/i915/gt: Split logical ring c

[Intel-gfx] [PATCH] drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist()

2022-07-08 Thread Dan Carpenter
The shmem_pin_map() function returns NULL, it doesn't return error pointers. Fixes: 97ea656521c8 ("drm/i915/gvt: Parse default state to update reg whitelist") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gvt/cmd_parser.c | 6 +++--- 1 file changed, 3 insertions(

[Intel-gfx] [PATCH] drm/i915/selftests: fix a couple IS_ERR() vs NULL tests

2022-07-08 Thread Dan Carpenter
The shmem_pin_map() function doesn't return error pointers, it returns NULL. Fixes: a0d3fdb628b8 ("drm/i915/gt: Split logical ring contexts from execlist submission" Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/selftest_lrc.c | 8 1 file changed, 4 i

[Intel-gfx] [PATCH] drm/i915: Fix error code in icl_compute_combo_phy_dpll()

2022-06-23 Thread Dan Carpenter
This function is supposed to return zero or negative error codes but it accidentally returns true on failure. Fixes: 92a020747d6c ("drm/i915: Split shared dpll .get_dplls() into compute and get phases") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/display/intel_dpll_mgr.c

[Intel-gfx] [bug report] drm/i915/migrate: Evict and restore the flatccs capable lmem obj

2022-05-05 Thread Dan Carpenter
s_bytes_to_cpy && (!it_ccs.sg || 883 !sg_dma_len(it_ccs.sg) { 884 err = -EINVAL; 885 break; 886 } 887 888 cond_resched(); 889 } while (1); 890 891 out_ce: 892 return err; 893 } regards, dan carpenter

Re: [Intel-gfx] [PATCH 0/6] Remove usage of list iterator past the loop body

2022-03-07 Thread Dan Carpenter
ly other places which rely on the old behavior. In an ideal world, with the new API the compiler would warn about uninitialized variables, but unfortunately that warning is disabled by default so we still have to rely on kbuild/Clang/Smatch to find the bugs. But hopefully the new API encourages people to write clearer code so it prevents bugs in the long run. regards, dan carpenter

Re: [Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Dan Carpenter
.c index ddf5737c63d9..c9dffa5c40a2 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3771,6 +3771,9 @@ EXPORT_SYMBOL(kmem_cache_free_bulk); * * Don't free memory not originally allocated by kmalloc() * or you will run into trouble. + * + * CHECKER information + * frees: $0 */ void kfree(const void *objp) { regards, dan carpenter

Re: [Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Dan Carpenter
^^^ 425 426 for (port = 0; port < r8a66597->max_root_hub; port++) { 427 if (r8a66597->root_hub[port].dev == dev) { ^^^ 428 r8a66597->root_hub[port].dev = NULL; 429 break; 430 } 431 } Printing the freed pointer in debug code is another thing people do. regards, dan carpenter

Re: [Intel-gfx] [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Dan Carpenter
On Mon, Feb 28, 2022 at 10:20:28AM -0800, Joe Perches wrote: > On Mon, 2022-02-28 at 14:24 +0300, Dan Carpenter wrote: > > > a multi-line indent gets curly braces for readability even though > > it's not required by C. And then both sides would get curly braces. > &

Re: [Intel-gfx] [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Dan Carpenter
een what is a related part of a patch is a bit vague and some maintainers will ask you to add or subtract from a patch depending on their individual tastes. I don't really have an exact answer, but I felt like this patch needs to be subtracted from. Especially if there is a whole chunk of the patch which can be removed, then to me, that obviously should be in a different patch. regards, dan carpenter

Re: [Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-02-28 Thread Dan Carpenter
dev_name(&_phy->dev)); > BUG(); > } > } else { > - sas_port_create_link(port, phy); > - list_add_tail(&phy->port_siblings, &port->phy_list); > + s

Re: [Intel-gfx] [PATCH 6/6] treewide: remove check of list iterator against head past the loop body

2022-02-28 Thread Dan Carpenter
nse, but it's out of date now. Just delete it. > - if (group && &group->list == &rcd->tid_group_list.list) > + if (!group) > goto bail_eagain; > group = list_prepare_entry(group, &rcd->tid_group_list.list, > list); regards, dan carpenter

Re: [Intel-gfx] [PATCH 3/6] treewide: fix incorrect use to determine if list is empty

2022-02-28 Thread Dan Carpenter
-- > drivers/media/pci/saa7134/saa7134-alsa.c | 4 ++-- > drivers/perf/xgene_pmu.c | 13 +++-- > 3 files changed, 11 insertions(+), 10 deletions(-) These are all bug fixes. 1) Send them as 3 separate patches. 2) Add Fixes tags. regards, dan carpenter

Re: [Intel-gfx] [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Dan Carpenter
break; > + } > } > - if (&req->req != _req) { > + if (!req) { > ep->stopped = stopped; > spin_unlock_irqrestore(&ep->dev->lock, flags); > return -EINVAL; > @@ -954,7 +957,6 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request > *_req) > dev_dbg(ep->dev->dev, "unlink (%s) pio\n", _ep->name); > net2272_done(ep, req, -ECONNRESET); > } > - req = NULL; Another unrelated change. These are all good changes but send them as separate patches. > ep->stopped = stopped; > > spin_unlock_irqrestore(&ep->dev->lock, flags); regards, dan carpenter

[Intel-gfx] [bug report] drm/i915: Use vma resources for async unbinding

2022-02-27 Thread Dan Carpenter
work->vma_res = i915_vma_resource_get(vma->resource); If "vma->resource" is NULL here then it leads to a crash in i915_vma_resource_get(). 488 work->cache_level = cache_level; 489 work->flags = bind_flags; 490 regards, dan carpenter

[Intel-gfx] [bug report] drm/i915: Extract intel_bw_check_data_rate()

2022-02-25 Thread Dan Carpenter
^^ But now that relationship is not so clear so it causes a Smatch warning. 923 if (ret) 924 return ret; 925 926 data_rate = intel_bw_data_rate(dev_priv, new_bw_state); 927 data_rate = DIV_ROUND_UP(data_rate, 1000); 928 regards, dan carpenter

Re: [Intel-gfx] [PATCH] drm/i915: delete shadow "ret" variable

2022-01-27 Thread Dan Carpenter
On Fri, Jan 28, 2022 at 07:20:02AM +0100, Thomas Hellström wrote: > On Thu, 2022-01-27 at 17:26 -0500, Rodrigo Vivi wrote: > > On Thu, Jan 27, 2022 at 11:51:15AM +0300, Dan Carpenter wrote: > > > This "ret" declaration shadows an existing "ret" variable

[Intel-gfx] [PATCH] drm/i915: delete shadow "ret" variable

2022-01-27 Thread Dan Carpenter
This "ret" declaration shadows an existing "ret" variable at the top of the function. Delete it. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/i915_vma.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i

[Intel-gfx] [PATCH] drm/i915/selftests: fix some error codes in __cancel_reset()

2022-01-27 Thread Dan Carpenter
There were two error paths in __cancel_reset() which return success instead of a negative error code as expected. Fixes: 4e6835466771 ("drm/i915/selftests: Add a cancel request selftest that triggers a reset") Signed-off-by: Dan Carpenter --- >From static analysis. I am not 1

[Intel-gfx] [PATCH] drm/i915/overlay: Prevent divide by zero bugs in scaling

2022-01-24 Thread Dan Carpenter
g() error: potential divide by zero bug '/ rec->dst_width'. Prevent this by ensuring that the dst height and width are non-zero. Fixes: 02e792fbaadb ("drm/i915: implement drmmode overlay support v4") Signed-off-by: Dan Carpenter --- >From static analysis. Not

[Intel-gfx] [bug report] drm/i915/gt: Replace direct submit with direct call to tasklet

2021-12-10 Thread Dan Carpenter
mp;engine->sched_engine->tasklet); 1622 clear_and_wake_up_bit(bit, lock); 1623 } 1624 local_bh_enable(); 1625 } regards, dan carpenter

[Intel-gfx] [bug report] drm/i915: Add support for moving fence waiting

2021-11-28 Thread Dan Carpenter
cache_level, ^^ This older code dereferences it without checking. 1016 flags, work); 1017 if (err) regards, dan carpenter

  1   2   3   4   >