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

Pull x86 platform driver fixes from Hans de Goede:
"The most noteworthy change in here is the addition of Ilpo Järvinen as
co-maintainer of platform-drivers-x86. Ilpo will be helping me with
platform-drivers-x86 maintenance going forward and you can expect
pull-requests from Ilpo in the future.

Other then that there is a set of Intel SCU IPC fixes and a
thinkpad_acpi locking fix"

* tag 'platform-drivers-x86-v6.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
MAINTAINERS: Add x86 platform drivers patchwork
MAINTAINERS: Add myself into x86 platform driver maintainers
platform/x86: thinkpad_acpi: Take mutex in hotkey_resume
platform/x86: intel_scu_ipc: Fail IPC send if still busy
platform/x86: intel_scu_ipc: Don't override scu in intel_scu_ipc_dev_simple_command()
platform/x86: intel_scu_ipc: Check status upon timeout in ipc_wait_for_interrupt()
platform/x86: intel_scu_ipc: Check status after timeout in busy_loop()

+46 -26
+4
MAINTAINERS
··· 13616 13616 13617 13617 MELLANOX HARDWARE PLATFORM SUPPORT 13618 13618 M: Hans de Goede <hdegoede@redhat.com> 13619 + M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> 13619 13620 M: Mark Gross <markgross@kernel.org> 13620 13621 M: Vadim Pasternak <vadimp@nvidia.com> 13621 13622 L: platform-driver-x86@vger.kernel.org ··· 14211 14210 14212 14211 MICROSOFT SURFACE HARDWARE PLATFORM SUPPORT 14213 14212 M: Hans de Goede <hdegoede@redhat.com> 14213 + M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> 14214 14214 M: Mark Gross <markgross@kernel.org> 14215 14215 M: Maximilian Luz <luzmaximilian@gmail.com> 14216 14216 L: platform-driver-x86@vger.kernel.org ··· 23425 23423 23426 23424 X86 PLATFORM DRIVERS 23427 23425 M: Hans de Goede <hdegoede@redhat.com> 23426 + M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> 23428 23427 M: Mark Gross <markgross@kernel.org> 23429 23428 L: platform-driver-x86@vger.kernel.org 23430 23429 S: Maintained 23430 + Q: https://patchwork.kernel.org/project/platform-driver-x86/list/ 23431 23431 T: git git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git 23432 23432 F: drivers/platform/olpc/ 23433 23433 F: drivers/platform/x86/
+40 -26
drivers/platform/x86/intel_scu_ipc.c
··· 19 19 #include <linux/init.h> 20 20 #include <linux/interrupt.h> 21 21 #include <linux/io.h> 22 + #include <linux/iopoll.h> 22 23 #include <linux/module.h> 23 24 #include <linux/slab.h> 24 25 ··· 232 231 /* Wait till scu status is busy */ 233 232 static inline int busy_loop(struct intel_scu_ipc_dev *scu) 234 233 { 235 - unsigned long end = jiffies + IPC_TIMEOUT; 234 + u8 status; 235 + int err; 236 236 237 - do { 238 - u32 status; 237 + err = readx_poll_timeout(ipc_read_status, scu, status, !(status & IPC_STATUS_BUSY), 238 + 100, jiffies_to_usecs(IPC_TIMEOUT)); 239 + if (err) 240 + return err; 239 241 240 - status = ipc_read_status(scu); 241 - if (!(status & IPC_STATUS_BUSY)) 242 - return (status & IPC_STATUS_ERR) ? -EIO : 0; 243 - 244 - usleep_range(50, 100); 245 - } while (time_before(jiffies, end)); 246 - 247 - return -ETIMEDOUT; 242 + return (status & IPC_STATUS_ERR) ? -EIO : 0; 248 243 } 249 244 250 245 /* Wait till ipc ioc interrupt is received or timeout in 10 HZ */ ··· 248 251 { 249 252 int status; 250 253 251 - if (!wait_for_completion_timeout(&scu->cmd_complete, IPC_TIMEOUT)) 252 - return -ETIMEDOUT; 254 + wait_for_completion_timeout(&scu->cmd_complete, IPC_TIMEOUT); 253 255 254 256 status = ipc_read_status(scu); 257 + if (status & IPC_STATUS_BUSY) 258 + return -ETIMEDOUT; 259 + 255 260 if (status & IPC_STATUS_ERR) 256 261 return -EIO; 257 262 ··· 263 264 static int intel_scu_ipc_check_status(struct intel_scu_ipc_dev *scu) 264 265 { 265 266 return scu->irq > 0 ? ipc_wait_for_interrupt(scu) : busy_loop(scu); 267 + } 268 + 269 + static struct intel_scu_ipc_dev *intel_scu_ipc_get(struct intel_scu_ipc_dev *scu) 270 + { 271 + u8 status; 272 + 273 + if (!scu) 274 + scu = ipcdev; 275 + if (!scu) 276 + return ERR_PTR(-ENODEV); 277 + 278 + status = ipc_read_status(scu); 279 + if (status & IPC_STATUS_BUSY) { 280 + dev_dbg(&scu->dev, "device is busy\n"); 281 + return ERR_PTR(-EBUSY); 282 + } 283 + 284 + return scu; 266 285 } 267 286 268 287 /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */ ··· 296 279 memset(cbuf, 0, sizeof(cbuf)); 297 280 298 281 mutex_lock(&ipclock); 299 - if (!scu) 300 - scu = ipcdev; 301 - if (!scu) { 282 + scu = intel_scu_ipc_get(scu); 283 + if (IS_ERR(scu)) { 302 284 mutex_unlock(&ipclock); 303 - return -ENODEV; 285 + return PTR_ERR(scu); 304 286 } 305 287 306 288 for (nc = 0; nc < count; nc++, offset += 2) { ··· 454 438 int err; 455 439 456 440 mutex_lock(&ipclock); 457 - if (!scu) 458 - scu = ipcdev; 459 - if (!scu) { 441 + scu = intel_scu_ipc_get(scu); 442 + if (IS_ERR(scu)) { 460 443 mutex_unlock(&ipclock); 461 - return -ENODEV; 444 + return PTR_ERR(scu); 462 445 } 463 - scu = ipcdev; 446 + 464 447 cmdval = sub << 12 | cmd; 465 448 ipc_command(scu, cmdval); 466 449 err = intel_scu_ipc_check_status(scu); ··· 499 484 return -EINVAL; 500 485 501 486 mutex_lock(&ipclock); 502 - if (!scu) 503 - scu = ipcdev; 504 - if (!scu) { 487 + scu = intel_scu_ipc_get(scu); 488 + if (IS_ERR(scu)) { 505 489 mutex_unlock(&ipclock); 506 - return -ENODEV; 490 + return PTR_ERR(scu); 507 491 } 508 492 509 493 memcpy(inbuf, in, inlen);
+2
drivers/platform/x86/thinkpad_acpi.c
··· 4116 4116 { 4117 4117 tpacpi_disable_brightness_delay(); 4118 4118 4119 + mutex_lock(&hotkey_mutex); 4119 4120 if (hotkey_status_set(true) < 0 || 4120 4121 hotkey_mask_set(hotkey_acpi_mask) < 0) 4121 4122 pr_err("error while attempting to reset the event firmware interface\n"); 4123 + mutex_unlock(&hotkey_mutex); 4122 4124 4123 4125 tpacpi_send_radiosw_update(); 4124 4126 tpacpi_input_send_tabletsw();