Skip to content

[AS7327-56X] Upgrade kernel from 4.14 to 6.12#203

Open
vincentchiang-ec wants to merge 1 commit into
accton:support_linux_6.12from
vincentchiang-ec:as7327-56x/upgrade-kernel-6.12
Open

[AS7327-56X] Upgrade kernel from 4.14 to 6.12#203
vincentchiang-ec wants to merge 1 commit into
accton:support_linux_6.12from
vincentchiang-ec:as7327-56x/upgrade-kernel-6.12

Conversation

@vincentchiang-ec

Copy link
Copy Markdown

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: KERNELS switched to onl-kernel-6.12-lts-x86-64-all
  • platform-config/r0/.../x86-64-accton-as7327-56x-r0.yml: kernel anchor *kernel-4-14*kernel-6-12

Build layout

  • Moved every .c from modules/builds/ into modules/builds/src/ with an explicit Kbuild (obj-m += ...). tools/scripts/kmodbuild.sh builds each top-level .c in its own mktemp -d, alone with obj-m := <single>.o, so cross-module EXPORT_SYMBOLs (cpld_read/write consumed by leds/psu/psu_bmc, fpga_pcie_read/write, at24_read_eeprom) fail modpost. The src/ 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 via i2c_client_get_device_id(client) where the body still needs id->driver_data.
  • cpld.c, psu.c, at24_as7327_56x.c: i2c_driver.remove() returns void.
  • leds.c, psu_bmc.c, thermal_bmc.c: platform_driver.remove() returns void.
  • psu.c: hwmon_device_register_with_info(chip=NULL) returns -EINVAL on 6.12. Add a stub hwmon_chip_info (is_visible → 0, HWMON_C_REGISTER_TZ) so the real attrs still come from the existing attribute_group.
  • thermal_bmc.c: same NULL-chip problem; switched to hwmon_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() lost VERIFY_READ/WRITE in 5.0; also cast the bare unsigned long ioctl arg to (const void __user *) for the stricter prototype check.
    • PCI error handler argument: enum pci_channel_state is no longer a valid enum tag in 6.12; use pci_channel_state_t.
    • I2C_CLASS_SPD was removed; drop it from the adapter class mask.
  • at24_as7327_56x.c:
    • i2c_new_dummy() was removed in 5.7; switch to i2c_new_dummy_device() (returns ERR_PTR — error-cleanup uses IS_ERR_OR_NULL).
    • <linux/platform_data/at24.h> was removed in 5.5; inline the small at24_platform_data struct + AT24_FLAG_* macros this driver actually consumes.

IDPROM ↔ kernel SPD-scan collision

Kernel 6.12 i2c-i801 now calls i2c_register_spd() at probe time, which walks DMI memory-device records and, for every populated DDR4 slot, registers a kernel-owned i2c_client named ee1004 at 0x50 + slot on the i801 SMBus. On AS7327-56X the IDPROM EEPROM is wired to i2c-0 0x50, so the SPD scan claims the slot first; the userspace new_i2c_device('accton_24c64', 0x50, 0) then silently fails (address busy) and the device stays unbound — no eeprom sysfs file, onlpdump shows blank System Information. The kernel-owned client is not in adap->userspace_clients, so delete_device cannot remove it (delete_device: Can't find device in list).

Fix: add an ee1004 alias to at24_as7327_56x's id_table, mapped to the same AT24_DEVICE_MAGIC(65536/8, AT24_FLAG_ADDR16) flags as accton_24c64. The platform driver then binds to the pre-existing kernel-instantiated client, nvmem exposes the standard eeprom file, and ONIE TLV decode works as usual. Safe to keep platform-local because at24_as7327_56x.ko only auto-loads on this platform.

Verification (DUT, fresh onie-nos-install)

  • uname -r6.12.73-OpenNetworkLinux
  • onlpdump System Information decodes the full TLV: Product 7327-56X-O-AC-F, Serial 732756X2545006, MAC 94:ef:97:a5:2c:c0, Vendor Accton, ONIE Version, Manufacture date.
  • thermal × 10 PRESENT (PSU-1 thermal-{1,2,3} correctly FAILED while PSU-1 is unplugged).
  • led × 4 PRESENT.
  • psu @ 1: PRESENT,UNPLUGGED, caps=0 (no AC). psu @ 2: full readings, Vin=227V / Vout=12V / Pout=106W.
  • fan × 8 chassis PRESENT,F2B; PSU-1 fan PRESENT,FAILED.
  • SFP probe matches plugged ports (0, 7, 49); port 49 QSFP shows TX_DISABLE.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant