Skip to contentSkip to conversation

media: vsp1: tidyup VI6_HGT_LBn_H() macro

PATCH In review Kuninori Morimoto 6 participants 11 messages Dec 11, 2019 – Feb 12, 2020 2 messages not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): redmine.issue-245033.20191211005426.161918957b73008d@dm.renesas.com

#2 lore raw

PATCH 1/1 media: vsp1: tidyup VI6_HGT_LBn_H() macro

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

---
 drivers/media/platform/vsp1/vsp1_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vsp1/vsp1_regs.h +1 -1
index 5c67ff9..fe3130d 100644
@@ -706,7 +706,7 @@
 #define VI6_HGT_HUE_AREA_LOWER_SHIFT	16
 #define VI6_HGT_HUE_AREA_UPPER_SHIFT	0
 #define VI6_HGT_LB_TH			0x3424
-#define VI6_HGT_LBn_H(n)		(0x3438 + (n) * 8)
+#define VI6_HGT_LBn_H(n)		(0x3428 + (n) * 8)
 #define VI6_HGT_LBn_V(n)		(0x342c + (n) * 8)
 #define VI6_HGT_HISTO(m, n)		(0x3450 + (m) * 128 + (n) * 4)
 #define VI6_HGT_MAXMIN			0x3750
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#3 lore raw

Hi Morimoto-san,

Thank you for the patch,

Quoted 11 lines · Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")
Quoted 2 lines

Otherwise,

Yes I can clearly see that this offset is marked as H'3428 at page 32-39 within the Gen3 datasheet.

Quoted 18 lines
---
 drivers/media/platform/vsp1/vsp1_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vsp1/vsp1_regs.h +1 -1
index 5c67ff9..fe3130d 100644
@@ -706,7 +706,7 @@
 #define VI6_HGT_HUE_AREA_LOWER_SHIFT	16
 #define VI6_HGT_HUE_AREA_UPPER_SHIFT	0
 #define VI6_HGT_LB_TH			0x3424
-#define VI6_HGT_LBn_H(n)		(0x3438 + (n) * 8)
+#define VI6_HGT_LBn_H(n)		(0x3428 + (n) * 8)
 #define VI6_HGT_LBn_V(n)		(0x342c + (n) * 8)
 #define VI6_HGT_HISTO(m, n)		(0x3450 + (m) * 128 + (n) * 4)
 #define VI6_HGT_MAXMIN			0x3750
Reviewed-by
#4 lore raw

Hello,

Quoted 3 lines · Kieran Bingham

Hi Morimoto-san,

Thank you for the patch,

Likewise :-)

Quoted 10 lines · Kuninori Morimoto
Quoted 9 lines

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440
Quoted 6 lines
Quoted 2 lines

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes tag. Kieran, would that be OK with you ?

Quoted 9 lines
Quoted 2 lines

Otherwise,

Yes I can clearly see that this offset is marked as H'3428 at page 32-39 within the Gen3 datasheet.

and taken in my branch.

Quoted 17 lines
Quoted 17 lines
---
 drivers/media/platform/vsp1/vsp1_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vsp1/vsp1_regs.h +1 -1
index 5c67ff9..fe3130d 100644
@@ -706,7 +706,7 @@
 #define VI6_HGT_HUE_AREA_LOWER_SHIFT	16
 #define VI6_HGT_HUE_AREA_UPPER_SHIFT	0
 #define VI6_HGT_LB_TH			0x3424
-#define VI6_HGT_LBn_H(n)		(0x3438 + (n) * 8)
+#define VI6_HGT_LBn_H(n)		(0x3428 + (n) * 8)
 #define VI6_HGT_LBn_V(n)		(0x342c + (n) * 8)
 #define VI6_HGT_HISTO(m, n)		(0x3450 + (m) * 128 + (n) * 4)
 #define VI6_HGT_MAXMIN			0x3750
Signature · 3 lines
Regards,

Laurent Pinchart
#5 lore raw

Hi Laurent,

+Greg, +Sasha to opine on the merit of whether this should go to stable trees (for my future learning and understanding more so than this specific case)

Quoted 21 lines · Laurent Pinchart

Hello,

Quoted 3 lines · Kieran Bingham

Hi Morimoto-san,

Thank you for the patch,

Likewise :-)

Quoted 12 lines · Kuninori Morimoto
Quoted 11 lines

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

s/fixup/fixes/

Quoted 7 lines
Quoted 3 lines

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes

I'm sorry - I'm not sure I can agree here, Do you know that no one will use this macro when they back port the HGT functionality to an LTSI kernel?

We know the Renesas BSP uses LTSI kernels, and the very nature of the fact that this typo has been spotted by the Renesas BSP team suggests that they are indeed looking at/using this functionality ...

(Ok, so maybe they will thus apply the fix themselves, but that's not my point, and if they 'have' to apply the fix - it should be in stable?)

It feels a bit presumptuous to state that we shouldn't fix this because /we/ don't utilise it yet, when this issue is in mainline regardless ...

Quoted 1 line

tag. Kieran, would that be OK with you ?

I would suspect that the work Sasha does would potentially pick this up anyway; automatically even without the tag?
(Especially with the keyword fixup/fixes in the commit message)

If I've misunderstood the purpose of the stable trees here, then please let me know.

Maybe it's more pragmatic to only fix features that are used, but it seems to me like a bug is a bug ... and if it's there, it should be fixed?

And I don't think that this is a particularly high 'expense' to the stable trees?

--
Kieran

Quoted 31 lines
Quoted 9 lines
Quoted 2 lines

Otherwise,

Yes I can clearly see that this offset is marked as H'3428 at page 32-39 within the Gen3 datasheet.

and taken in my branch.

Quoted 17 lines
Quoted 17 lines
---
 drivers/media/platform/vsp1/vsp1_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vsp1/vsp1_regs.h +1 -1
index 5c67ff9..fe3130d 100644
@@ -706,7 +706,7 @@
 #define VI6_HGT_HUE_AREA_LOWER_SHIFT	16
 #define VI6_HGT_HUE_AREA_UPPER_SHIFT	0
 #define VI6_HGT_LB_TH			0x3424
-#define VI6_HGT_LBn_H(n)		(0x3438 + (n) * 8)
+#define VI6_HGT_LBn_H(n)		(0x3428 + (n) * 8)
 #define VI6_HGT_LBn_V(n)		(0x342c + (n) * 8)
 #define VI6_HGT_HISTO(m, n)		(0x3450 + (m) * 128 + (n) * 4)
 #define VI6_HGT_MAXMIN			0x3750
#6 lore raw

Hi Kieran,

Quoted 5 lines · Kieran Bingham

Hi Laurent,

+Greg, +Sasha to opine on the merit of whether this should go to stable trees (for my future learning and understanding more so than this specific case)

Good idea, I can learn too :-)

Quoted 25 lines · Laurent Pinchart
Quoted 19 lines · Kieran Bingham
Quoted 3 lines

Hi Morimoto-san,

Thank you for the patch,

Likewise :-)

Quoted 12 lines · Kuninori Morimoto
Quoted 11 lines

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

s/fixup/fixes/

Quoted 2 lines
Quoted 2 lines

I think this deserves a fixes tag:

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes

I'm sorry - I'm not sure I can agree here, Do you know that no one will use this macro when they back port the HGT functionality to an LTSI kernel?

Before backporting it, it would have to be implemented :-) HGT support is in mainline, but not support for the HGT LB (Letter Box) isn't. There's no plan I'm aware of to implement this feature at the moment. I assume that, if and when that feature will be implemented and backported, this patch could be backported as well.

Quoted 56 lines

We know the Renesas BSP uses LTSI kernels, and the very nature of the fact that this typo has been spotted by the Renesas BSP team suggests that they are indeed looking at/using this functionality ...

(Ok, so maybe they will thus apply the fix themselves, but that's not my point, and if they 'have' to apply the fix - it should be in stable?)

It feels a bit presumptuous to state that we shouldn't fix this because /we/ don't utilise it yet, when this issue is in mainline regardless ...

Quoted 1 line

tag. Kieran, would that be OK with you ?

I would suspect that the work Sasha does would potentially pick this up anyway; automatically even without the tag?
(Especially with the keyword fixup/fixes in the commit message)

If I've misunderstood the purpose of the stable trees here, then please let me know.

Maybe it's more pragmatic to only fix features that are used, but it seems to me like a bug is a bug ... and if it's there, it should be fixed?

And I don't think that this is a particularly high 'expense' to the stable trees?

Quoted 31 lines
Quoted 9 lines
Quoted 2 lines

Otherwise,

Yes I can clearly see that this offset is marked as H'3428 at page 32-39 within the Gen3 datasheet.

and taken in my branch.

Quoted 17 lines
Quoted 17 lines
---
 drivers/media/platform/vsp1/vsp1_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vsp1/vsp1_regs.h +1 -1
index 5c67ff9..fe3130d 100644
@@ -706,7 +706,7 @@
 #define VI6_HGT_HUE_AREA_LOWER_SHIFT	16
 #define VI6_HGT_HUE_AREA_UPPER_SHIFT	0
 #define VI6_HGT_LB_TH			0x3424
-#define VI6_HGT_LBn_H(n)		(0x3438 + (n) * 8)
+#define VI6_HGT_LBn_H(n)		(0x3428 + (n) * 8)
 #define VI6_HGT_LBn_V(n)		(0x342c + (n) * 8)
 #define VI6_HGT_HISTO(m, n)		(0x3450 + (m) * 128 + (n) * 4)
 #define VI6_HGT_MAXMIN			0x3750
Signature · 3 lines
Regards,

Laurent Pinchart
#7 lore raw
In reply to Kieran Bingham
Quoted 47 lines · Kieran Bingham

Hi Laurent,

+Greg, +Sasha to opine on the merit of whether this should go to stable trees (for my future learning and understanding more so than this specific case)

Quoted 21 lines · Laurent Pinchart

Hello,

Quoted 3 lines · Kieran Bingham

Hi Morimoto-san,

Thank you for the patch,

Likewise :-)

Quoted 12 lines · Kuninori Morimoto
Quoted 11 lines

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

s/fixup/fixes/

Quoted 7 lines
Quoted 3 lines

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes

I'm sorry - I'm not sure I can agree here, Do you know that no one will use this macro when they back port the HGT functionality to an LTSI kernel?

We know the Renesas BSP uses LTSI kernels, and the very nature of the fact that this typo has been spotted by the Renesas BSP team suggests that they are indeed looking at/using this functionality ...

Quoted 5 lines

(Ok, so maybe they will thus apply the fix themselves, but that's not my point, and if they 'have' to apply the fix - it should be in stable?)

It feels a bit presumptuous to state that we shouldn't fix this because /we/ don't utilise it yet, when this issue is in mainline regardless ...

Nothing should be in the kernel tree that is not already used by something in that specific kernel tree. We don't care about out-of-tree code, and especially for stable kernel patches, it does not matter in the least.

If you have out-of-tree code, you are on your own here, sorry.

So no, no backporting of stuff that no one actually uses in the codebase itself.

thanks,

greg k-h

#8 lore raw

Hi Greg, Laurent, Sasha,

Quoted 51 lines · Greg Kroah-Hartman
Quoted 50 lines · Kieran Bingham

Hi Laurent,

+Greg, +Sasha to opine on the merit of whether this should go to stable trees (for my future learning and understanding more so than this specific case)

Quoted 21 lines · Laurent Pinchart

Hello,

Quoted 3 lines · Kieran Bingham

Hi Morimoto-san,

Thank you for the patch,

Likewise :-)

Quoted 12 lines · Kuninori Morimoto
Quoted 11 lines

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

s/fixup/fixes/

Quoted 7 lines
Quoted 3 lines

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes

I'm sorry - I'm not sure I can agree here, Do you know that no one will use this macro when they back port the HGT functionality to an LTSI kernel?

We know the Renesas BSP uses LTSI kernels, and the very nature of the fact that this typo has been spotted by the Renesas BSP team suggests that they are indeed looking at/using this functionality ...

(Ok, so maybe they will thus apply the fix themselves, but that's not my point, and if they 'have' to apply the fix - it should be in stable?)

Quoted 7 lines
Quoted 2 lines

It feels a bit presumptuous to state that we shouldn't fix this because /we/ don't utilise it yet, when this issue is in mainline regardless ...

Nothing should be in the kernel tree that is not already used by something in that specific kernel tree. We don't care about out-of-tree code, and especially for stable kernel patches, it does not matter in the least.

So perhaps this patch should actually remove this macro rather than fix it?

Quoted 4 lines

If you have out-of-tree code, you are on your own here, sorry.

So no, no backporting of stuff that no one actually uses in the codebase itself.

Ok understood, It was really the 'the macro exists in the kernel, but is wrong' part that got me.

Along with the fact that we now have various automated machinery that would likely pick this patch up and backport it anyway?

(Sasha, is that assumption accurate? Or would you/your system have identified that this macro is not used?)

--
Kieran

Quoted 5 lines

thanks,

greg k-h

#9 lore raw

Hi Kieran,

Quoted 45 lines · Kieran Bingham
Quoted 44 lines · Greg Kroah-Hartman
Quoted 42 lines · Kieran Bingham

+Greg, +Sasha to opine on the merit of whether this should go to stable trees (for my future learning and understanding more so than this specific case)

Quoted 5 lines · Laurent Pinchart
Quoted 4 lines · Kieran Bingham
Quoted 3 lines · Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The address of VSP2_VI6_HGT_LBx_H are
VSP2_VI6_HGT_LB0_H : 0x3428
VSP2_VI6_HGT_LB1_H : 0x3430
VSP2_VI6_HGT_LB2_H : 0x3438
VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

s/fixup/fixes/

Quoted 7 lines
Quoted 3 lines

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes

I'm sorry - I'm not sure I can agree here, Do you know that no one will use this macro when they back port the HGT functionality to an LTSI kernel?

We know the Renesas BSP uses LTSI kernels, and the very nature of the fact that this typo has been spotted by the Renesas BSP team suggests that they are indeed looking at/using this functionality ...

(Ok, so maybe they will thus apply the fix themselves, but that's not my point, and if they 'have' to apply the fix - it should be in stable?)

It feels a bit presumptuous to state that we shouldn't fix this because /we/ don't utilise it yet, when this issue is in mainline regardless ...

Quoted 6 lines
Quoted 4 lines

Nothing should be in the kernel tree that is not already used by something in that specific kernel tree. We don't care about out-of-tree code, and especially for stable kernel patches, it does not matter in the least.

So perhaps this patch should actually remove this macro rather than fix it?

IMHO removing all unused register and register bit definitions from drivers would not improve them. On the contrary.
These also serve as a kind of documentation, as low-level documentation about the hardware is not always available publicly.

Quoted 7 lines
Quoted 4 lines

If you have out-of-tree code, you are on your own here, sorry.

So no, no backporting of stuff that no one actually uses in the codebase itself.

Ok understood, It was really the 'the macro exists in the kernel, but is wrong' part that got me.

There is a difference between code that is not used, and register definitions.

Quoted 5 lines

Along with the fact that we now have various automated machinery that would likely pick this patch up and backport it anyway?

(Sasha, is that assumption accurate? Or would you/your system have identified that this macro is not used?)

IMHO the real danger lies in not backporting this, and forgetting to backport this fix when future code that does use this definition is backported.
This may happen +5 years from now, and the feature may be backported to a 10-year old LTS(i) kernel, causing subtle issues in your 8 year old car...

Basically we can do 4 things:
1. Fix the buggy definition, and not backport the fix,
=> may trigger the issue above.
2. idem, but backport the fix,
3. Remove the buggy definition, and not backport the removal, => may trigger the issue above, if people miss-backport the re-addition. => people may just revert the removal when they need the definition.
4. idem, but backport the removal.

      => same as 3.

So I am in favor of fixing the buggy definition, with a Fixes tag, so stable will pick it up, and anyone else (if any not using LTS) can look for Fixes tags and know what fixes to backport.

Of course, all of this can be avoided by using the One Way Of Linux ;-)
https://society.oftrolls.com/@geert/102984898449908163

Just my 2€c.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#10 lore raw

Hello,

Quoted 89 lines · Geert Uytterhoeven
Quoted 44 lines · Kieran Bingham
Quoted 43 lines · Greg Kroah-Hartman
Quoted 41 lines · Kieran Bingham

+Greg, +Sasha to opine on the merit of whether this should go to stable trees (for my future learning and understanding more so than this specific case)

Quoted 5 lines · Laurent Pinchart
Quoted 4 lines · Kieran Bingham
Quoted 3 lines · Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The address of VSP2_VI6_HGT_LBx_H are
VSP2_VI6_HGT_LB0_H : 0x3428
VSP2_VI6_HGT_LB1_H : 0x3430
VSP2_VI6_HGT_LB2_H : 0x3438
VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

s/fixup/fixes/

Quoted 7 lines
Quoted 3 lines

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes

I'm sorry - I'm not sure I can agree here, Do you know that no one will use this macro when they back port the HGT functionality to an LTSI kernel?

We know the Renesas BSP uses LTSI kernels, and the very nature of the fact that this typo has been spotted by the Renesas BSP team suggests that they are indeed looking at/using this functionality ...

(Ok, so maybe they will thus apply the fix themselves, but that's not my point, and if they 'have' to apply the fix - it should be in stable?)

It feels a bit presumptuous to state that we shouldn't fix this because /we/ don't utilise it yet, when this issue is in mainline regardless ...

Quoted 6 lines
Quoted 4 lines

Nothing should be in the kernel tree that is not already used by something in that specific kernel tree. We don't care about out-of-tree code, and especially for stable kernel patches, it does not matter in the least.

So perhaps this patch should actually remove this macro rather than fix it?

IMHO removing all unused register and register bit definitions from drivers would not improve them. On the contrary.
These also serve as a kind of documentation, as low-level documentation about the hardware is not always available publicly.

Quoted 7 lines
Quoted 4 lines

If you have out-of-tree code, you are on your own here, sorry.

So no, no backporting of stuff that no one actually uses in the codebase itself.

Ok understood, It was really the 'the macro exists in the kernel, but is wrong' part that got me.

There is a difference between code that is not used, and register definitions.

Quoted 5 lines

Along with the fact that we now have various automated machinery that would likely pick this patch up and backport it anyway?

(Sasha, is that assumption accurate? Or would you/your system have identified that this macro is not used?)

IMHO the real danger lies in not backporting this, and forgetting to backport this fix when future code that does use this definition is backported.
This may happen +5 years from now, and the feature may be backported to a 10-year old LTS(i) kernel, causing subtle issues in your 8 year old car...

Basically we can do 4 things:
1. Fix the buggy definition, and not backport the fix,
=> may trigger the issue above.
2. idem, but backport the fix,
3. Remove the buggy definition, and not backport the removal, => may trigger the issue above, if people miss-backport the re-addition. => people may just revert the removal when they need the definition.
4. idem, but backport the removal.

      => same as 3.
Quoted 8 lines

So I am in favor of fixing the buggy definition, with a Fixes tag, so stable will pick it up, and anyone else (if any not using LTS) can look for Fixes tags and know what fixes to backport.

Of course, all of this can be avoided by using the One Way Of Linux ;-)
https://society.oftrolls.com/@geert/102984898449908163

Just my 2€c.

You 2¢ resulted in the Fixed: line being added to the patch in my tree :-)

Signature · 3 lines
Regards,

Laurent Pinchart
#11 lore raw
In reply to Kieran Bingham
Quoted 69 lines · Kieran Bingham

Hi Greg, Laurent, Sasha,

Quoted 51 lines · Greg Kroah-Hartman
Quoted 50 lines · Kieran Bingham

Hi Laurent,

+Greg, +Sasha to opine on the merit of whether this should go to stable trees (for my future learning and understanding more so than this specific case)

Quoted 21 lines · Laurent Pinchart

Hello,

Quoted 3 lines · Kieran Bingham

Hi Morimoto-san,

Thank you for the patch,

Likewise :-)

Quoted 12 lines · Kuninori Morimoto
Quoted 11 lines

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

s/fixup/fixes/

Quoted 7 lines
Quoted 3 lines

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes

I'm sorry - I'm not sure I can agree here, Do you know that no one will use this macro when they back port the HGT functionality to an LTSI kernel?

We know the Renesas BSP uses LTSI kernels, and the very nature of the fact that this typo has been spotted by the Renesas BSP team suggests that they are indeed looking at/using this functionality ...

(Ok, so maybe they will thus apply the fix themselves, but that's not my point, and if they 'have' to apply the fix - it should be in stable?)

Quoted 7 lines
Quoted 2 lines

It feels a bit presumptuous to state that we shouldn't fix this because /we/ don't utilise it yet, when this issue is in mainline regardless ...

Nothing should be in the kernel tree that is not already used by something in that specific kernel tree. We don't care about out-of-tree code, and especially for stable kernel patches, it does not matter in the least.

So perhaps this patch should actually remove this macro rather than fix it?

Quoted 4 lines

If you have out-of-tree code, you are on your own here, sorry.

So no, no backporting of stuff that no one actually uses in the codebase itself.

Quoted 8 lines

Ok understood, It was really the 'the macro exists in the kernel, but is wrong' part that got me.

Along with the fact that we now have various automated machinery that would likely pick this patch up and backport it anyway?

(Sasha, is that assumption accurate? Or would you/your system have identified that this macro is not used?)

No, it would have likely just backported it.

The right thing to do is to just remove the macro if no one is using it.

Signature · 2 lines
Thanks,
Sasha
#12 lore raw
In reply to Laurent Pinchart

Hi Laurent

Quoted 25 lines
Quoted 8 lines
Quoted 8 lines

From: Kuninori Morimoto <[email protected]>

The address of VSP2_VI6_HGT_LBx_H are

	VSP2_VI6_HGT_LB0_H : 0x3428
	VSP2_VI6_HGT_LB1_H : 0x3430
	VSP2_VI6_HGT_LB2_H : 0x3438
	VSP2_VI6_HGT_LB3_H : 0x3440
Quoted 6 lines
Quoted 2 lines

Thus, VI6_HGT_LBn_H() macro should start from 0x3420 instead of 0x3430. This patch fixup it.

I think this deserves a fixes tag:

Fixes 26e0ca22c3b8 ("[media] v4l: Renesas R-Car VSP1 driver")

Given that this macro is not used, we could argue that it doesn't fix anything yet :-) I'd rather avoid having this backported to stable kernels as it's not useful to have it there, and thus not add a Fixes tag. Kieran, would that be OK with you ?

Quoted 5 lines
Quoted 2 lines

Otherwise,

Quoted 8 lines
Quoted 4 lines

Yes I can clearly see that this offset is marked as H'3428 at page 32-39 within the Gen3 datasheet.

and taken in my branch.

My understanding is that this patch is applied to your branch, but, is it correct ?
I still can't find it at linus/master and/or linux-next/master

Thank you for your help !!
Best regards
---
Kuninori Morimoto