Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'peci-next-6.11-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/iwi/linux into char-misc-next

Iwona writes:

Update peci-next for v6.11-rc1

* peci, hwmon
- Update peci subsystem to use new Intel CPU model defines.

* aspeed
- Clear clock_divider before setting it.

* tag 'peci-next-6.11-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/iwi/linux:
peci: aspeed: Clear clock_divider value before setting it
peci, hwmon: Switch to new Intel CPU model defines

+43 -31
+4 -4
drivers/hwmon/peci/cputemp.c
··· 360 360 int ret; 361 361 362 362 /* Get the RESOLVED_CORES register value */ 363 - switch (peci_dev->info.model) { 364 - case INTEL_FAM6_ICELAKE_X: 365 - case INTEL_FAM6_ICELAKE_D: 366 - case INTEL_FAM6_SAPPHIRERAPIDS_X: 363 + switch (peci_dev->info.x86_vfm) { 364 + case INTEL_ICELAKE_X: 365 + case INTEL_ICELAKE_D: 366 + case INTEL_SAPPHIRERAPIDS_X: 367 367 ret = peci_ep_pci_local_read(peci_dev, 0, reg->bus, reg->dev, 368 368 reg->func, reg->offset + 4, &data); 369 369 if (ret)
+1
drivers/peci/controller/peci-aspeed.c
··· 351 351 clk_aspeed_peci_find_div_values(this_rate, &msg_timing, &clk_div_exp); 352 352 353 353 val = readl(aspeed_peci->base + ASPEED_PECI_CTRL); 354 + val &= ~ASPEED_PECI_CTRL_CLK_DIV_MASK; 354 355 val |= FIELD_PREP(ASPEED_PECI_CTRL_CLK_DIV_MASK, clk_div_exp); 355 356 writel(val, aspeed_peci->base + ASPEED_PECI_CTRL); 356 357
+2 -3
drivers/peci/core.c
··· 163 163 static const struct peci_device_id * 164 164 peci_bus_match_device_id(const struct peci_device_id *id, struct peci_device *device) 165 165 { 166 - while (id->family != 0) { 167 - if (id->family == device->info.family && 168 - id->model == device->info.model) 166 + while (id->x86_vfm != 0) { 167 + if (id->x86_vfm == device->info.x86_vfm) 169 168 return id; 170 169 id++; 171 170 }
+7 -14
drivers/peci/cpu.c
··· 294 294 295 295 static const struct peci_device_id peci_cpu_device_ids[] = { 296 296 { /* Haswell Xeon */ 297 - .family = 6, 298 - .model = INTEL_FAM6_HASWELL_X, 297 + .x86_vfm = INTEL_HASWELL_X, 299 298 .data = "hsx", 300 299 }, 301 300 { /* Broadwell Xeon */ 302 - .family = 6, 303 - .model = INTEL_FAM6_BROADWELL_X, 301 + .x86_vfm = INTEL_BROADWELL_X, 304 302 .data = "bdx", 305 303 }, 306 304 { /* Broadwell Xeon D */ 307 - .family = 6, 308 - .model = INTEL_FAM6_BROADWELL_D, 305 + .x86_vfm = INTEL_BROADWELL_D, 309 306 .data = "bdxd", 310 307 }, 311 308 { /* Skylake Xeon */ 312 - .family = 6, 313 - .model = INTEL_FAM6_SKYLAKE_X, 309 + .x86_vfm = INTEL_SKYLAKE_X, 314 310 .data = "skx", 315 311 }, 316 312 { /* Icelake Xeon */ 317 - .family = 6, 318 - .model = INTEL_FAM6_ICELAKE_X, 313 + .x86_vfm = INTEL_ICELAKE_X, 319 314 .data = "icx", 320 315 }, 321 316 { /* Icelake Xeon D */ 322 - .family = 6, 323 - .model = INTEL_FAM6_ICELAKE_D, 317 + .x86_vfm = INTEL_ICELAKE_D, 324 318 .data = "icxd", 325 319 }, 326 320 { /* Sapphire Rapids Xeon */ 327 - .family = 6, 328 - .model = INTEL_FAM6_SAPPHIRERAPIDS_X, 321 + .x86_vfm = INTEL_SAPPHIRERAPIDS_X, 329 322 .data = "spr", 330 323 }, 331 324 { }
+1 -2
drivers/peci/device.c
··· 100 100 if (ret) 101 101 return ret; 102 102 103 - device->info.family = peci_x86_cpu_family(cpu_id); 104 - device->info.model = peci_x86_cpu_model(cpu_id); 103 + device->info.x86_vfm = IFM(peci_x86_cpu_family(cpu_id), peci_x86_cpu_model(cpu_id)); 105 104 106 105 ret = peci_get_revision(device, &revision); 107 106 if (ret)
+2 -4
drivers/peci/internal.h
··· 66 66 /** 67 67 * struct peci_device_id - PECI device data to match 68 68 * @data: pointer to driver private data specific to device 69 - * @family: device family 70 - * @model: device model 69 + * @x86_vfm: device vendor-family-model 71 70 */ 72 71 struct peci_device_id { 73 72 const void *data; 74 - u16 family; 75 - u8 model; 73 + u32 x86_vfm; 76 74 }; 77 75 78 76 extern const struct device_type peci_device_type;
+24
include/linux/peci-cpu.h
··· 6 6 7 7 #include <linux/types.h> 8 8 9 + /* Copied from x86 <asm/processor.h> */ 10 + #define X86_VENDOR_INTEL 0 11 + 12 + /* Copied from x86 <asm/cpu_device_id.h> */ 13 + #define VFM_MODEL_BIT 0 14 + #define VFM_FAMILY_BIT 8 15 + #define VFM_VENDOR_BIT 16 16 + #define VFM_RSVD_BIT 24 17 + 18 + #define VFM_MODEL_MASK GENMASK(VFM_FAMILY_BIT - 1, VFM_MODEL_BIT) 19 + #define VFM_FAMILY_MASK GENMASK(VFM_VENDOR_BIT - 1, VFM_FAMILY_BIT) 20 + #define VFM_VENDOR_MASK GENMASK(VFM_RSVD_BIT - 1, VFM_VENDOR_BIT) 21 + 22 + #define VFM_MODEL(vfm) (((vfm) & VFM_MODEL_MASK) >> VFM_MODEL_BIT) 23 + #define VFM_FAMILY(vfm) (((vfm) & VFM_FAMILY_MASK) >> VFM_FAMILY_BIT) 24 + #define VFM_VENDOR(vfm) (((vfm) & VFM_VENDOR_MASK) >> VFM_VENDOR_BIT) 25 + 26 + #define VFM_MAKE(_vendor, _family, _model) ( \ 27 + ((_model) << VFM_MODEL_BIT) | \ 28 + ((_family) << VFM_FAMILY_BIT) | \ 29 + ((_vendor) << VFM_VENDOR_BIT) \ 30 + ) 31 + /* End of copied code */ 32 + 9 33 #include "../../arch/x86/include/asm/intel-family.h" 10 34 11 35 #define PECI_PCS_PKG_ID 0 /* Package Identifier Read */
+2 -4
include/linux/peci.h
··· 59 59 * struct peci_device - PECI device 60 60 * @dev: device object to register PECI device to the device model 61 61 * @info: PECI device characteristics 62 - * @info.family: device family 63 - * @info.model: device model 62 + * @info.x86_vfm: device vendor-family-model 64 63 * @info.peci_revision: PECI revision supported by the PECI device 65 64 * @info.socket_id: the socket ID represented by the PECI device 66 65 * @addr: address used on the PECI bus connected to the parent controller ··· 72 73 struct peci_device { 73 74 struct device dev; 74 75 struct { 75 - u16 family; 76 - u8 model; 76 + u32 x86_vfm; 77 77 u8 peci_revision; 78 78 u8 socket_id; 79 79 } info;