Skip to contentSkip to conversation

Trivial style fixes

PATCH In review Andi Shyti 5 participants 16 messages Mar 14, 2025 – Mar 20, 2025

Subsystems (2)
lore
Share & tools
lore

Andi Shyti

author
#0 lore raw

cover Trivial style fixes

Hi

Browsing through my endless list of branches I found a few with random cleanups that I fix while rading the code. They tend to be forgotten over the time and never sent. This time I decided to send them. And I have plenty more :-)

Andi

Andi Shyti (4):
drm/i915/gt: Fix typos in comments
drm/i915/gt: Fix SPDX license format
drm/i915/gt: Remove trailing blank lines
drm/i915/gt: Use proper sleeping functions for timeouts shorter than

    20ms
 drivers/gpu/drm/i915/gt/intel_gtt.c     | 1 -
 drivers/gpu/drm/i915/gt/intel_lrc.c     | 1 -
 drivers/gpu/drm/i915/gt/intel_migrate.c | 2 +-
 drivers/gpu/drm/i915/gt/intel_mocs.c    | 1 -
 drivers/gpu/drm/i915/gt/intel_reset.c   | 2 +-
 drivers/gpu/drm/i915/gt/intel_wopcm.h   | 3 +--
 drivers/gpu/drm/i915/gt/selftest_rc6.c  | 3 ++-
 drivers/gpu/drm/i915/gt/selftest_tlb.c  | 2 +-
 8 files changed, 6 insertions(+), 9 deletions(-)
Signature · 1 line
2.47.2
author
#1 lore raw

PATCH 1/4 drm/i915/gt: Fix typos in comments

upto -> up to
acknowledgement -> acknowledgment

---
 drivers/gpu/drm/i915/gt/intel_migrate.c | 2 +-
 drivers/gpu/drm/i915/gt/intel_reset.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_migrate.c +1 -1
index aff5aca591e6..86927e0c76e2 100644
@@ -643,7 +643,7 @@ calculate_chunk_sz(struct drm_i915_private *i915, bool src_is_lmem,
 {
 	if (ccs_bytes_to_cpy && !src_is_lmem)
 		/*
-		 * When CHUNK_SZ is passed all the pages upto CHUNK_SZ
+		 * When CHUNK_SZ is passed all the pages up to CHUNK_SZ
 		 * will be taken for the blt. in Flat-ccs supported
 		 * platform Smem obj will have more pages than required
 		 * for main memory hence limit it to the required size
drivers/gpu/drm/i915/gt/intel_reset.c +1 -1
index dbdcfe130ad4..82e8df40f5b1 100644
@@ -162,7 +162,7 @@ static int i915_do_reset(struct intel_gt *gt,
 	struct pci_dev *pdev = to_pci_dev(gt->i915->drm.dev);
 	int err;
 
-	/* Assert reset for at least 50 usec, and wait for acknowledgement. */
+	/* Assert reset for at least 50 usec, and wait for acknowledgment */
 	pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
 	udelay(50);
 	err = _wait_for_atomic(i915_in_reset(pdev), 50000, 0);
Signature · 1 line
2.47.2
#2 lore raw

Re: [PATCH 1/4] drm/i915/gt: Fix typos in comments

Hi

Quoted 2 lines · Andi Shyti

upto -> up to
acknowledgement -> acknowledgment

Both spellings are correct.

Signature · 2 lines
Best regards,
Sebastian
author
#3 lore raw

Re: [PATCH 1/4] drm/i915/gt: Fix typos in comments

Hi Sebastian,

Quoted 4 lines · Sebastian Brzezinka
Quoted 2 lines · Andi Shyti

upto -> up to
acknowledgement -> acknowledgment

Both spellings are correct.

thanks a lot for checking this, you are right! The former is UK english and we don't change it. I will drop this patch as it's not worth sending a patch for such a small change.

Thanks for looking into it and for your review.
Andi

author
#4 lore raw

PATCH 2/4 drm/i915/gt: Fix SPDX license format

In reply to Andi Shyti

Header files need to declare the SPDX under /* ... */ style comments at the beginning of the file.

---
 drivers/gpu/drm/i915/gt/intel_wopcm.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_wopcm.h +1 -2
index 17d6aa86008a..d2038b6de5e7 100644
@@ -1,6 +1,5 @@
+/* SPDX-License-Identifier: MIT */
 /*
- * SPDX-License-Identifier: MIT
- *
  * Copyright © 2017-2018 Intel Corporation
  */
 
Signature · 1 line
2.47.2
#5 lore raw

Re: [PATCH 2/4] drm/i915/gt: Fix SPDX license format

Hi Andi

Quoted 1 line

Header files need to declare the SPDX under /* ... */ style

All files modified in this patch series start with:
// SPDX-License-Identifier: MIT
rather than:
/* SPDX-License-Identifier: MIT */

As a note:

:~/linux/drm-tip/drivers/gpu/drm/i915$ rg "// SPDX-License-Identifier: " | wc -l
242
:~/linux/drm-tip/drivers/gpu/drm/i915$ rg "/* SPDX-License-Identifier: " | wc -l
696

are those styles interchangable or is one preferred over the other? I am just curious seeing both are being used.

Best Regards,
Krzysztof

author
#6 lore raw

Re: [PATCH 2/4] drm/i915/gt: Fix SPDX license format

Quoted 6 lines · Krzysztof Karas
Quoted 1 line

Header files need to declare the SPDX under /* ... */ style

All files modified in this patch series start with:
// SPDX-License-Identifier: MIT
rather than:
/* SPDX-License-Identifier: MIT */

Quoted 8 lines

As a note:

:~/linux/drm-tip/drivers/gpu/drm/i915$ rg "// SPDX-License-Identifier: " | wc -l
242
:~/linux/drm-tip/drivers/gpu/drm/i915$ rg "/* SPDX-License-Identifier: " | wc -l
696

are those styles interchangable or is one preferred over the other? I am just curious seeing both are being used.

It's an ugly mess that for some reason people have accepted from the beginning. The SPDX license has a different format for .c and .h file :/

Andi

#7 lore raw

RE: [PATCH 2/4] drm/i915/gt: Fix SPDX license format

HI Andi,

Quoted 15 lines · Krzysztof Karas
Quoted 14 lines
Quoted 1 line

Header files need to declare the SPDX under /* ... */ style

All files modified in this patch series start with:
// SPDX-License-Identifier: MIT
rather than:
/* SPDX-License-Identifier: MIT */

As a note:

:~/linux/drm-tip/drivers/gpu/drm/i915$ rg "// SPDX-License-Identifier:
" | wc -l
242
:~/linux/drm-tip/drivers/gpu/drm/i915$ rg "/* SPDX-License-Identifier:
" | wc -l
696
Quoted 7 lines
Quoted 2 lines

are those styles interchangable or is one preferred over the other? I am just curious seeing both are being used.

It's an ugly mess that for some reason people have accepted from the beginning. The SPDX license has a different format for .c and .h file :/

Andi

A similar change is required in selftests/mock_timeline.h header also.

As per https://docs.kernel.org/process/license-rules.html,
for ASM files also required this style: /* SPDX-License-Identifier: <SPDX License Expression> */

There are two asm files hsw.asm and ivb.asm under i915/gt/shaders/clear_kernel. It will be better if we update the license style in asm files as well.

Regards,
Nitin

author
#8 lore raw

PATCH 3/4 drm/i915/gt: Remove trailing blank lines

In reply to Andi Shyti

Remove useless blank lines before and after the brackets.

---
 drivers/gpu/drm/i915/gt/intel_gtt.c  | 1 -
 drivers/gpu/drm/i915/gt/intel_lrc.c  | 1 -
 drivers/gpu/drm/i915/gt/intel_mocs.c | 1 -
 3 files changed, 3 deletions(-)
drivers/gpu/drm/i915/gt/intel_gtt.c +0 -1
index 30b128b1fde7..afbc5c769308 100644
@@ -176,7 +176,6 @@ static void clear_vm_list(struct list_head *list)
 			i915_vma_destroy_locked(vma);
 			i915_gem_object_put(obj);
 		}
-
 	}
 }
 
drivers/gpu/drm/i915/gt/intel_lrc.c +0 -1
index 51847a846002..c481b56fa67d 100644
@@ -751,7 +751,6 @@ static int lrc_ring_indirect_offset(const struct intel_engine_cs *engine)
 
 static int lrc_ring_cmd_buf_cctl(const struct intel_engine_cs *engine)
 {
-
 	if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
 		/*
 		 * Note that the CSFE context has a dummy slot for CMD_BUF_CCTL
drivers/gpu/drm/i915/gt/intel_mocs.c +0 -1
index cf41d325712e..5dd8121f4b15 100644
@@ -314,7 +314,6 @@ static const struct drm_i915_mocs_entry icl_mocs_table[] = {
 };
 
 static const struct drm_i915_mocs_entry dg1_mocs_table[] = {
-
 	/* UC */
 	MOCS_ENTRY(1, 0, L3_1_UC),
 	/* WB - L3 */
Signature · 1 line
2.47.2
Reviewed-by on v1 3/4
#9 lore raw

RE: [PATCH 3/4] drm/i915/gt: Remove trailing blank lines

Hi Andi,

Quoted 55 lines

-----Original Message-----
From: Intel-gfx <[email protected]> On Behalf Of Andi Shyti
Sent: Friday, March 14, 2025 7:42 AM
To: intel-gfx <[email protected]>
Cc: Andi Shyti <[email protected]>; Andi Shyti <[email protected]>
Subject: [PATCH 3/4] drm/i915/gt: Remove trailing blank lines

Remove useless blank lines before and after the brackets.

---
drivers/gpu/drm/i915/gt/intel_gtt.c | 1 - drivers/gpu/drm/i915/gt/intel_lrc.c |
1 - drivers/gpu/drm/i915/gt/intel_mocs.c | 1 -

 3 files changed, 3 deletions(-)
drivers/gpu/drm/i915/gt/intel_gtt.c +0 -1
index 30b128b1fde7..afbc5c769308 100644
@@ -176,7 +176,6 @@ static void clear_vm_list(struct list_head *list)
 			i915_vma_destroy_locked(vma);
 			i915_gem_object_put(obj);
 		}
-
 	}
 }
 
drivers/gpu/drm/i915/gt/intel_lrc.c +0 -1
index 51847a846002..c481b56fa67d 100644
@@ -751,7 +751,6 @@ static int lrc_ring_indirect_offset(const struct
 intel_engine_cs *engine)
 
 static int lrc_ring_cmd_buf_cctl(const struct intel_engine_cs *engine)  {
-
 	if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
 		/*
 		 * Note that the CSFE context has a dummy slot for

CMD_BUF_CCTL diff --git a/drivers/gpu/drm/i915/gt/intel_mocs.c b/drivers/gpu/drm/i915/gt/intel_mocs.c
index cf41d325712e..5dd8121f4b15 100644

drivers/gpu/drm/i915/gt/intel_mocs.c +0 -2
@@ -314,7 +314,6 @@ static const struct drm_i915_mocs_entry
 icl_mocs_table[] = {  };
 
 static const struct drm_i915_mocs_entry dg1_mocs_table[] = {
-
 	/* UC */
 	MOCS_ENTRY(1, 0, L3_1_UC),
 	/* WB - L3 */
--
Quoted 1 line

2.47.2

The patch looks good to me.

author
#10 lore raw

PATCH 4/4 drm/i915/gt: Use proper sleeping functions for timeouts shorter than 20ms

In reply to Andi Shyti

msleep is very unprecise for timeouts shorter than 20 milliseconds and most probably will sleep longer. Use uslee_range() instead.

---
 drivers/gpu/drm/i915/gt/selftest_rc6.c | 3 ++-
 drivers/gpu/drm/i915/gt/selftest_tlb.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/selftest_rc6.c +2 -1
index 908483ab0bc8..99de5d85a096 100644
@@ -60,7 +60,8 @@ int live_rc6_manual(void *arg)
 
 	/* Force RC6 off for starters */
 	__intel_rc6_disable(rc6);
-	msleep(1); /* wakeup is not immediate, takes about 100us on icl */
+	/* wakeup is not immediate, takes about 100us on icl */
+	usleep_range(1000, 2000);
 
 	res[0] = rc6_residency(rc6);
 
drivers/gpu/drm/i915/gt/selftest_tlb.c +1 -1
index 3941f2d6fa47..69ed946a39e5 100644
@@ -143,7 +143,7 @@ pte_tlbinv(struct intel_context *ce,
 	if (ce->engine->class == OTHER_CLASS)
 		msleep(200);
 	else
-		msleep(10);
+		usleep_range(10000, 20000);
 
 	if (va == vb) {
 		if (!i915_request_completed(rq)) {
Signature · 1 line
2.47.2
Reviewed-by on v1 4/4
#11 lore raw

RE: [PATCH 4/4] drm/i915/gt: Use proper sleeping functions for timeouts shorter than 20ms

Hi Andi,

Quoted 6 lines

Subject: [PATCH 4/4] drm/i915/gt: Use proper sleeping functions for timeouts shorter than 20ms

msleep is very unprecise for timeouts shorter than 20 milliseconds and most probably will sleep longer. Use
uslee_range() instead.

Typo:
%s/uslee_range()/usleep_range()

With typo fix, the patch looks good to me.

Quoted 38 lines
---
 drivers/gpu/drm/i915/gt/selftest_rc6.c | 3 ++-
drivers/gpu/drm/i915/gt/selftest_tlb.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/selftest_rc6.c +2 -1
index 908483ab0bc8..99de5d85a096 100644
@@ -60,7 +60,8 @@ int live_rc6_manual(void *arg)
 
 	/* Force RC6 off for starters */
 	__intel_rc6_disable(rc6);
-	msleep(1); /* wakeup is not immediate, takes about 100us on icl */
+	/* wakeup is not immediate, takes about 100us on icl */
+	usleep_range(1000, 2000);
 
 	res[0] = rc6_residency(rc6);
 
drivers/gpu/drm/i915/gt/selftest_tlb.c +1 -2
index 3941f2d6fa47..69ed946a39e5 100644
@@ -143,7 +143,7 @@ pte_tlbinv(struct intel_context *ce,
 	if (ce->engine->class == OTHER_CLASS)
 		msleep(200);
 	else
-		msleep(10);
+		usleep_range(10000, 20000);
 
 	if (va == vb) {
 		if (!i915_request_completed(rq)) {
--

2.47.2

#12 lore raw

✗ Fi.CI.CHECKPATCH: warning for Trivial style fixes

In reply to Andi Shyti
== Series Details ==

== Series Details ==

Series: Trivial style fixes
URL : https://patchwork.freedesktop.org/series/146278/
State : warning

== Summary ==

Error: dim checkpatch failed
6f2c9455289e drm/i915/gt: Fix typos in comments
-:6: WARNING:TYPO_SPELLING: 'upto' may be misspelled - perhaps 'up to'? #6:
upto -> up to
^^^^

-:7: WARNING:TYPO_SPELLING: 'acknowledgement' may be misspelled - perhaps 'acknowledgment'? #7:
acknowledgement -> acknowledgment
^^^^^^^^^^^^^^^

total: 0 errors, 2 warnings, 0 checks, 16 lines checked
485bc8f3e0be drm/i915/gt: Fix SPDX license format
d9992d83cb54 drm/i915/gt: Remove trailing blank lines
958dca2127ae drm/i915/gt: Use proper sleeping functions for timeouts shorter than 20ms -:7: WARNING:TYPO_SPELLING: 'unprecise' may be misspelled - perhaps 'imprecise'? #7:
msleep is very unprecise for timeouts shorter than 20

               ^^^^^^^^^

total: 0 errors, 1 warnings, 0 checks, 17 lines checked

Reviewed-by on the v1 series
#15 lore raw
In reply to Andi Shyti

Hi Andi,

Quoted 6 lines

Hi

Browsing through my endless list of branches I found a few with random cleanups that I fix while rading the code. They tend to be forgotten over the time and never sent. This time I decided to send them.

The patches look good:

on the whole series.

Quoted 1 line

And I have plenty more :-)

Can't wait! :)

Best Regards,
Krzysztof