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 'platform-drivers-x86-v5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:
"Highlights:

- asus-wmi bug-fixes

- intel-sdsu bug-fixes

- build (warning) fixes

- couple of hw-id additions"

* tag 'platform-drivers-x86-v5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform/x86/intel: pmc/core: change pmc_lpm_modes to static
platform/x86/intel/sdsi: Fix bug in multi packet reads
platform/x86/intel/sdsi: Poll on ready bit for writes
platform/x86/intel/sdsi: Handle leaky bucket
platform/x86: intel-uncore-freq: Prevent driver loading in guests
platform/x86: gigabyte-wmi: added support for B660 GAMING X DDR4 motherboard
platform/x86: dell-laptop: Add quirk entry for Latitude 7520
platform/x86: asus-wmi: Fix driver not binding when fan curve control probe fails
platform/x86: asus-wmi: Potential buffer overflow in asus_wmi_evaluate_method_buf()
tools/power/x86/intel-speed-select: fix build failure when using -Wl,--as-needed

+59 -21
+10 -5
drivers/platform/x86/asus-wmi.c
··· 371 371 372 372 switch (obj->type) { 373 373 case ACPI_TYPE_BUFFER: 374 - if (obj->buffer.length > size) 374 + if (obj->buffer.length > size) { 375 375 err = -ENOSPC; 376 - if (obj->buffer.length == 0) 376 + break; 377 + } 378 + if (obj->buffer.length == 0) { 377 379 err = -ENODATA; 380 + break; 381 + } 378 382 379 383 memcpy(ret_buffer, obj->buffer.pointer, obj->buffer.length); 380 384 break; ··· 2227 2223 2228 2224 err = fan_curve_get_factory_default(asus, fan_dev); 2229 2225 if (err) { 2230 - if (err == -ENODEV || err == -ENODATA) 2231 - return 0; 2232 - return err; 2226 + pr_debug("fan_curve_get_factory_default(0x%08x) failed: %d\n", 2227 + fan_dev, err); 2228 + /* Don't cause probe to fail on devices without fan-curves */ 2229 + return 0; 2233 2230 } 2234 2231 2235 2232 *available = true;
+13
drivers/platform/x86/dell/dell-laptop.c
··· 80 80 .kbd_led_not_present = true, 81 81 }; 82 82 83 + static struct quirk_entry quirk_dell_latitude_7520 = { 84 + .kbd_missing_ac_tag = true, 85 + }; 86 + 83 87 static struct platform_driver platform_driver = { 84 88 .driver = { 85 89 .name = "dell-laptop", ··· 339 335 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1018"), 340 336 }, 341 337 .driver_data = &quirk_dell_inspiron_1012, 338 + }, 339 + { 340 + .callback = dmi_matched, 341 + .ident = "Dell Latitude 7520", 342 + .matches = { 343 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 344 + DMI_MATCH(DMI_PRODUCT_NAME, "Latitude 7520"), 345 + }, 346 + .driver_data = &quirk_dell_latitude_7520, 342 347 }, 343 348 { } 344 349 };
+1
drivers/platform/x86/gigabyte-wmi.c
··· 148 148 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550I AORUS PRO AX"), 149 149 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M AORUS PRO-P"), 150 150 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M DS3H"), 151 + DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B660 GAMING X DDR4"), 151 152 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z390 I AORUS PRO WIFI-CF"), 152 153 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 AORUS ELITE"), 153 154 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 GAMING X"),
+1 -1
drivers/platform/x86/intel/pmc/core.h
··· 236 236 #define ADL_LPM_STATUS_LATCH_EN_OFFSET 0x1704 237 237 #define ADL_LPM_LIVE_STATUS_OFFSET 0x1764 238 238 239 - const char *pmc_lpm_modes[] = { 239 + static const char *pmc_lpm_modes[] = { 240 240 "S0i2.0", 241 241 "S0i2.1", 242 242 "S0i2.2",
+30 -14
drivers/platform/x86/intel/sdsi.c
··· 51 51 #define MBOX_TIMEOUT_US 2000 52 52 #define MBOX_TIMEOUT_ACQUIRE_US 1000 53 53 #define MBOX_POLLING_PERIOD_US 100 54 + #define MBOX_ACQUIRE_NUM_RETRIES 5 55 + #define MBOX_ACQUIRE_RETRY_DELAY_MS 500 54 56 #define MBOX_MAX_PACKETS 4 55 57 56 58 #define MBOX_OWNER_NONE 0x00 ··· 83 81 84 82 struct sdsi_mbox_info { 85 83 u64 *payload; 86 - u64 *buffer; 84 + void *buffer; 87 85 int size; 88 86 }; 89 87 ··· 165 163 total = 0; 166 164 loop = 0; 167 165 do { 168 - int offset = SDSI_SIZE_MAILBOX * loop; 169 - void __iomem *addr = priv->mbox_addr + offset; 170 - u64 *buf = info->buffer + offset / SDSI_SIZE_CMD; 166 + void *buf = info->buffer + (SDSI_SIZE_MAILBOX * loop); 171 167 u32 packet_size; 172 168 173 169 /* Poll on ready bit */ ··· 196 196 break; 197 197 } 198 198 199 - sdsi_memcpy64_fromio(buf, addr, round_up(packet_size, SDSI_SIZE_CMD)); 199 + sdsi_memcpy64_fromio(buf, priv->mbox_addr, round_up(packet_size, SDSI_SIZE_CMD)); 200 200 201 201 total += packet_size; 202 202 ··· 243 243 FIELD_PREP(CTRL_PACKET_SIZE, info->size); 244 244 writeq(control, priv->control_addr); 245 245 246 - /* Poll on run_busy bit */ 247 - ret = readq_poll_timeout(priv->control_addr, control, !(control & CTRL_RUN_BUSY), 246 + /* Poll on ready bit */ 247 + ret = readq_poll_timeout(priv->control_addr, control, control & CTRL_READY, 248 248 MBOX_POLLING_PERIOD_US, MBOX_TIMEOUT_US); 249 249 250 250 if (ret) ··· 263 263 { 264 264 u64 control; 265 265 u32 owner; 266 - int ret; 266 + int ret, retries = 0; 267 267 268 268 lockdep_assert_held(&priv->mb_lock); 269 269 ··· 273 273 if (owner != MBOX_OWNER_NONE) 274 274 return -EBUSY; 275 275 276 - /* Write first qword of payload */ 277 - writeq(info->payload[0], priv->mbox_addr); 276 + /* 277 + * If there has been no recent transaction and no one owns the mailbox, 278 + * we should acquire it in under 1ms. However, if we've accessed it 279 + * recently it may take up to 2.1 seconds to acquire it again. 280 + */ 281 + do { 282 + /* Write first qword of payload */ 283 + writeq(info->payload[0], priv->mbox_addr); 278 284 279 - /* Check for ownership */ 280 - ret = readq_poll_timeout(priv->control_addr, control, 281 - FIELD_GET(CTRL_OWNER, control) & MBOX_OWNER_INBAND, 282 - MBOX_POLLING_PERIOD_US, MBOX_TIMEOUT_ACQUIRE_US); 285 + /* Check for ownership */ 286 + ret = readq_poll_timeout(priv->control_addr, control, 287 + FIELD_GET(CTRL_OWNER, control) == MBOX_OWNER_INBAND, 288 + MBOX_POLLING_PERIOD_US, MBOX_TIMEOUT_ACQUIRE_US); 289 + 290 + if (FIELD_GET(CTRL_OWNER, control) == MBOX_OWNER_NONE && 291 + retries++ < MBOX_ACQUIRE_NUM_RETRIES) { 292 + msleep(MBOX_ACQUIRE_RETRY_DELAY_MS); 293 + continue; 294 + } 295 + 296 + /* Either we got it or someone else did. */ 297 + break; 298 + } while (true); 283 299 284 300 return ret; 285 301 }
+3
drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c
··· 212 212 const struct x86_cpu_id *id; 213 213 int ret; 214 214 215 + if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR)) 216 + return -ENODEV; 217 + 215 218 id = x86_match_cpu(intel_uncore_cpu_ids); 216 219 if (!id) 217 220 return -ENODEV;
+1 -1
tools/power/x86/intel-speed-select/Makefile
··· 42 42 $(ISST_IN): prepare FORCE 43 43 $(Q)$(MAKE) $(build)=intel-speed-select 44 44 $(OUTPUT)intel-speed-select: $(ISST_IN) 45 - $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ 45 + $(QUIET_LINK)$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ 46 46 47 47 clean: 48 48 rm -f $(ALL_PROGRAMS)