[AS7327-56X] Upgrade kernel from 4.14 to 6.12#203
Open
vincentchiang-ec wants to merge 1 commit into
Open
Conversation
Bring in the AS7327-56X platform from support_new_platform_and_sync and
port it to kernel 6.12 LTS.
### Config
- modules/PKG.yml, modules/builds/Makefile: 4.14 -> 6.12
- platform-config r0.yml: *kernel-4-14 -> *kernel-6-12
### Build layout
- modules/builds/ uses KMODULES := src (was \$(wildcard *.c))
Several .c export symbols (cpld_read/write, fpga_pcie_*, at24_read_eeprom)
consumed by sibling modules; without a shared src/ build dir each .c is
compiled in its own tmp dir and modpost cannot resolve the EXPORT_SYMBOLs.
### Driver API (4.14 -> 6.12)
- i2c_driver.probe is single-arg now; pull the device id with
i2c_client_get_device_id(client) where needed.
- i2c_driver.remove and platform_driver.remove return void.
- hwmon_device_register_with_info(chip=NULL) returns -EINVAL on 6.12.
psu.c grows a stub hwmon_chip_info; thermal_bmc.c switches to
hwmon_device_register_with_groups which fits its sysfs-only use.
- class_create lost its owner argument in 6.4 (fpga.c).
- access_ok lost VERIFY_READ/WRITE in 5.0 (fpga.c). The bare unsigned
long ioctl argument also needs an explicit (const void __user *) cast
to satisfy the stricter prototype check.
- pci_channel_state is no longer an enum tag in 6.12; switch the PCI
error handler to pci_channel_state_t (fpga.c).
- I2C_CLASS_SPD was removed; drop it from the i2c_adapter class mask
(the controller does not actually decode SPD).
- i2c_new_dummy was removed in 5.7; switch to i2c_new_dummy_device,
which returns ERR_PTR (cleanup uses IS_ERR_OR_NULL now).
- <linux/platform_data/at24.h> was removed in 5.5; inline the small
struct + AT24_FLAG_* macros the driver actually consumes into
at24_as7327_56x.c.
### IDPROM / SPD collision
- Kernel 6.12 i2c-i801 now auto-instantiates a kernel-owned i2c_client
named "ee1004" at every populated DDR4 SPD address (0x50 + slot), and
the IDPROM EEPROM on this platform is wired to i2c-0 0x50. The SPD
scan therefore claims the slot before the platform's
new_i2c_device('accton_24c64', 0x50, 0) call, leaves the device
unbound (no driver matches "ee1004"), and onlpdump shows no system
info. The kernel-owned device cannot be removed from userspace.
Workaround: alias "ee1004" onto the 24c64 (8KByte, ADDR16) IDPROM
layout in at24_as7327_56x's id_table so our driver binds to the
pre-existing client and exposes the eeprom sysfs file. Verified on
DUT: TLV header decodes, MAC/Product/Serial all populated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the AS7327-56X platform onto kernel 6.12 LTS. The platform sources were carried over from
support_new_platform_and_sync(which still targeted 4.14) and ported in-place; nothing else on this branch moves.Config
modules/PKG.yml,modules/builds/Makefile:KERNELSswitched toonl-kernel-6.12-lts-x86-64-allplatform-config/r0/.../x86-64-accton-as7327-56x-r0.yml: kernel anchor*kernel-4-14→*kernel-6-12Build layout
.cfrommodules/builds/intomodules/builds/src/with an explicit Kbuild (obj-m += ...).tools/scripts/kmodbuild.shbuilds each top-level.cin its ownmktemp -d, alone withobj-m := <single>.o, so cross-moduleEXPORT_SYMBOLs (cpld_read/write consumed by leds/psu/psu_bmc, fpga_pcie_read/write, at24_read_eeprom) fail modpost. Thesrc/layout puts the whole tree in one tmp dir so Module.symvers is shared. Same convention as as5835-54x / as7816-64x.Driver API (4.14 → 6.12)
cpld.c,psu.c,at24_as7327_56x.c:i2c_driver.probe()is single-arg; pull the device id viai2c_client_get_device_id(client)where the body still needsid->driver_data.cpld.c,psu.c,at24_as7327_56x.c:i2c_driver.remove()returnsvoid.leds.c,psu_bmc.c,thermal_bmc.c:platform_driver.remove()returnsvoid.psu.c:hwmon_device_register_with_info(chip=NULL)returns-EINVALon 6.12. Add a stubhwmon_chip_info(is_visible → 0, HWMON_C_REGISTER_TZ) so the real attrs still come from the existingattribute_group.thermal_bmc.c: same NULL-chip problem; switched tohwmon_device_register_with_groups()which is a better fit for the sysfs-only use here.fpga.c:class_create()lost its owner argument in 6.4.access_ok()lostVERIFY_READ/WRITEin 5.0; also cast the bareunsigned longioctl arg to(const void __user *)for the stricter prototype check.enum pci_channel_stateis no longer a valid enum tag in 6.12; usepci_channel_state_t.I2C_CLASS_SPDwas removed; drop it from the adapter class mask.at24_as7327_56x.c:i2c_new_dummy()was removed in 5.7; switch toi2c_new_dummy_device()(returns ERR_PTR — error-cleanup usesIS_ERR_OR_NULL).<linux/platform_data/at24.h>was removed in 5.5; inline the smallat24_platform_datastruct +AT24_FLAG_*macros this driver actually consumes.IDPROM ↔ kernel SPD-scan collision
Kernel 6.12
i2c-i801now callsi2c_register_spd()at probe time, which walks DMI memory-device records and, for every populated DDR4 slot, registers a kernel-owned i2c_client namedee1004at0x50 + sloton the i801 SMBus. On AS7327-56X the IDPROM EEPROM is wired to i2c-00x50, so the SPD scan claims the slot first; the userspacenew_i2c_device('accton_24c64', 0x50, 0)then silently fails (address busy) and the device stays unbound — noeepromsysfs file,onlpdumpshows blankSystem Information. The kernel-owned client is not inadap->userspace_clients, sodelete_devicecannot remove it (delete_device: Can't find device in list).Fix: add an
ee1004alias toat24_as7327_56x'sid_table, mapped to the sameAT24_DEVICE_MAGIC(65536/8, AT24_FLAG_ADDR16)flags asaccton_24c64. The platform driver then binds to the pre-existing kernel-instantiated client, nvmem exposes the standardeepromfile, and ONIE TLV decode works as usual. Safe to keep platform-local becauseat24_as7327_56x.koonly auto-loads on this platform.Verification (DUT, fresh
onie-nos-install)uname -r→6.12.73-OpenNetworkLinuxSystem Informationdecodes the full TLV: Product7327-56X-O-AC-F, Serial732756X2545006, MAC94:ef:97:a5:2c:c0, VendorAccton, ONIE Version, Manufacture date.PRESENT,UNPLUGGED, caps=0 (no AC). psu @ 2: full readings, Vin=227V / Vout=12V / Pout=106W.