Skip to contentSkip to conversation

media: staging/ipu7: use 64-bit math macro for post delay calculation

PATCH In review [email protected] 2 participants 2 messages Jul 8, 2025 – Jul 9, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 media: staging/ipu7: use 64-bit math macro for post delay calculation

From: Bingbu Cao <[email protected]>

When build ipu7 driver with i386 config, it will report error:
ERROR: modpost: "__udivdi3" [../intel-ipu7-isys.ko] undefined!

This patch fix the problem by using correct math macro to implement the 64-bit value division instead of C divide operator.

---
 drivers/staging/media/ipu7/ipu7-isys-csi-phy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/media/ipu7/ipu7-isys-csi-phy.c +1 -3
index 4407750c7f40..007c8dbcb8a8 100644
@@ -815,9 +815,7 @@ static void ipu7_isys_cphy_config(struct ipu7_isys *isys, u8 id, u8 lanes,
 		dwc_phy_write_mask(isys, id, reg + 0x400 * i,
 				   deass_thresh, 0, 7);
 
-	delay_thresh =
-		((224U - (9U * 7U)) * 1000U) / (5U * mbps) - 7U;
-
+	delay_thresh = div64_u64((224U - 9U * 7U) * 1000U, 5U * mbps) - 7U;
 	if (delay_thresh < 1)
 		delay_thresh = 1;
 
Signature · 1 line
2.34.1
maintainer
#1 lore raw

Hi Bingbu,

Quoted 5 lines · On Tue, Jul 08, 2025 at 10:58:37AM +0800, [email protected] wrote:

From: Bingbu Cao <[email protected]>

When build ipu7 driver with i386 config, it will report error:
ERROR: modpost: "__udivdi3" [../intel-ipu7-isys.ko] undefined!

Quoted 7 lines

This patch fix the problem by using correct math macro to implement the 64-bit value division instead of C divide operator.

I opted to take another patch from Arnd <[email protected]> that addresses another problem as well. The actual value could even be u16 but u64 is being used...

Signature · 3 lines
Regards,

Sakari Ailus