Repository navigation
ambarella s3l: enable CONFIG_QUOTA so vendor iav.ko loads - #2778
openipc-ai wants to merge 1 commit into
Conversation
The S3L SDK's iav.ko is prebuilt with MODVERSIONS off and hardcodes the kernel's struct offsets. It reads inode->i_cdev at offset 272, but without CONFIG_QUOTA the stock kernel's struct inode has it at 264: QUOTA adds i_dquot[2] (8 bytes) ahead of it. Enabling CONFIG_QUOTA aligns the struct so iav_open() follows i_cdev to the right cdev and the driver initialises instead of dereferencing a bogus context.
PR Summary by QodoAlign S3L inode layout with vendor iav.ko using CONFIG_QUOTA
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Kernel ABI fix rests on an unverified struct offset
|
|
Measured on current master (with #2763's CONFIG_LBDAF=y), using a throwaway module built against the S3L kernel:
LBDAF makes sector_t/blkcnt_t 64-bit, which already moves i_cdev from 264 to 272. QUOTA's i_dquot[MAXQUOTAS] sits The 264 in the description matches a kernel without LBDAF, i.e. before #2763. I'd close this one. |
|
@DeathCamel58 you're right, and I can confirm it. Closing this, since #2763 already fixed the same offset and this PR would now break it. Offsets from a probe compiled against
The shipped QUOTA was one way to reach The green checks here don't catch this, because the kernel builds and the modules load either way. The failure only appears at the first |
The S3L SDK's prebuilt
iav.kois built with MODVERSIONS off and hardcodesthe kernel's struct offsets. It reads
inode->i_cdevat offset 272, butwithout
CONFIG_QUOTAthe stock kernel'sstruct inodeplacesi_cdevat264 -- enabling QUOTA inserts
i_dquot[MAXQUOTAS](2 pointers, 8 bytes)ahead of it and lines the two up.
With QUOTA off,
iav_open()followsi_cdevto the wrong place and thedriver comes up with a bogus context (the
/dev/iavioctls then fail);CONFIG_QUOTA=yfixes that and the driver initialises normally.The added lines mirror the kernel's
oldconfigexpansion for QUOTA (same setthe other OpenIPC boards that enable it carry). No functional quota use --
this is purely to match the ABI the shipped
iav.kowas compiled against.