Merge branches 'acpi-ec', 'acpi-battery' and 'acpi-pmic'

* acpi-ec:
ACPI / EC: Call acpi_walk_dep_device_list() after installing EC opregion handler
ACPI / EC: Add GPE reference counting debugging messages.
ACPI / EC: Cleanup logging/debugging splitter support.

* acpi-battery:
ACPI / battery: make warning greppable

* acpi-pmic:
ACPI/PMIC: Fix typo in MODULE_DESCRIPTION in intel_pmic_crc.c

+90 -39
+2 -2
drivers/acpi/battery.c
··· 530 530 battery->rate_now != ACPI_BATTERY_VALUE_UNKNOWN && 531 531 (s16)(battery->rate_now) < 0) { 532 532 battery->rate_now = abs((s16)battery->rate_now); 533 - printk_once(KERN_WARNING FW_BUG "battery: (dis)charge rate" 534 - " invalid.\n"); 533 + printk_once(KERN_WARNING FW_BUG 534 + "battery: (dis)charge rate invalid.\n"); 535 535 } 536 536 537 537 if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)
+87 -36
drivers/acpi/ec.c
··· 137 137 static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */ 138 138 139 139 /* -------------------------------------------------------------------------- 140 + * Logging/Debugging 141 + * -------------------------------------------------------------------------- */ 142 + 143 + /* 144 + * Splitters used by the developers to track the boundary of the EC 145 + * handling processes. 146 + */ 147 + #ifdef DEBUG 148 + #define EC_DBG_SEP " " 149 + #define EC_DBG_DRV "+++++" 150 + #define EC_DBG_STM "=====" 151 + #define EC_DBG_REQ "*****" 152 + #define EC_DBG_EVT "#####" 153 + #else 154 + #define EC_DBG_SEP "" 155 + #define EC_DBG_DRV 156 + #define EC_DBG_STM 157 + #define EC_DBG_REQ 158 + #define EC_DBG_EVT 159 + #endif 160 + 161 + #define ec_log_raw(fmt, ...) \ 162 + pr_info(fmt "\n", ##__VA_ARGS__) 163 + #define ec_dbg_raw(fmt, ...) \ 164 + pr_debug(fmt "\n", ##__VA_ARGS__) 165 + #define ec_log(filter, fmt, ...) \ 166 + ec_log_raw(filter EC_DBG_SEP fmt EC_DBG_SEP filter, ##__VA_ARGS__) 167 + #define ec_dbg(filter, fmt, ...) \ 168 + ec_dbg_raw(filter EC_DBG_SEP fmt EC_DBG_SEP filter, ##__VA_ARGS__) 169 + 170 + #define ec_log_drv(fmt, ...) \ 171 + ec_log(EC_DBG_DRV, fmt, ##__VA_ARGS__) 172 + #define ec_dbg_drv(fmt, ...) \ 173 + ec_dbg(EC_DBG_DRV, fmt, ##__VA_ARGS__) 174 + #define ec_dbg_stm(fmt, ...) \ 175 + ec_dbg(EC_DBG_STM, fmt, ##__VA_ARGS__) 176 + #define ec_dbg_req(fmt, ...) \ 177 + ec_dbg(EC_DBG_REQ, fmt, ##__VA_ARGS__) 178 + #define ec_dbg_evt(fmt, ...) \ 179 + ec_dbg(EC_DBG_EVT, fmt, ##__VA_ARGS__) 180 + #define ec_dbg_ref(ec, fmt, ...) \ 181 + ec_dbg_raw("%lu: " fmt, ec->reference_count, ## __VA_ARGS__) 182 + 183 + /* -------------------------------------------------------------------------- 140 184 * Device Flags 141 185 * -------------------------------------------------------------------------- */ 142 186 ··· 203 159 { 204 160 u8 x = inb(ec->command_addr); 205 161 206 - pr_debug("EC_SC(R) = 0x%2.2x " 207 - "SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d\n", 208 - x, 209 - !!(x & ACPI_EC_FLAG_SCI), 210 - !!(x & ACPI_EC_FLAG_BURST), 211 - !!(x & ACPI_EC_FLAG_CMD), 212 - !!(x & ACPI_EC_FLAG_IBF), 213 - !!(x & ACPI_EC_FLAG_OBF)); 162 + ec_dbg_raw("EC_SC(R) = 0x%2.2x " 163 + "SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d", 164 + x, 165 + !!(x & ACPI_EC_FLAG_SCI), 166 + !!(x & ACPI_EC_FLAG_BURST), 167 + !!(x & ACPI_EC_FLAG_CMD), 168 + !!(x & ACPI_EC_FLAG_IBF), 169 + !!(x & ACPI_EC_FLAG_OBF)); 214 170 return x; 215 171 } 216 172 ··· 219 175 u8 x = inb(ec->data_addr); 220 176 221 177 ec->curr->timestamp = jiffies; 222 - pr_debug("EC_DATA(R) = 0x%2.2x\n", x); 178 + ec_dbg_raw("EC_DATA(R) = 0x%2.2x", x); 223 179 return x; 224 180 } 225 181 226 182 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command) 227 183 { 228 - pr_debug("EC_SC(W) = 0x%2.2x\n", command); 184 + ec_dbg_raw("EC_SC(W) = 0x%2.2x", command); 229 185 outb(command, ec->command_addr); 230 186 ec->curr->timestamp = jiffies; 231 187 } 232 188 233 189 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data) 234 190 { 235 - pr_debug("EC_DATA(W) = 0x%2.2x\n", data); 191 + ec_dbg_raw("EC_DATA(W) = 0x%2.2x", data); 236 192 outb(data, ec->data_addr); 237 193 ec->curr->timestamp = jiffies; 238 194 } ··· 284 240 * software need to manually trigger a pseudo GPE event on 285 241 * EN=1 writes. 286 242 */ 287 - pr_debug("***** Polling quirk *****\n"); 243 + ec_dbg_raw("Polling quirk"); 288 244 advance_transaction(ec); 289 245 } 290 246 } ··· 343 299 { 344 300 if (!test_bit(flag, &ec->flags)) { 345 301 acpi_ec_disable_gpe(ec, false); 346 - pr_debug("+++++ Polling enabled +++++\n"); 302 + ec_dbg_drv("Polling enabled"); 347 303 set_bit(flag, &ec->flags); 348 304 } 349 305 } ··· 353 309 if (test_bit(flag, &ec->flags)) { 354 310 clear_bit(flag, &ec->flags); 355 311 acpi_ec_enable_gpe(ec, false); 356 - pr_debug("+++++ Polling disabled +++++\n"); 312 + ec_dbg_drv("Polling disabled"); 357 313 } 358 314 } 359 315 ··· 379 335 static void acpi_ec_submit_query(struct acpi_ec *ec) 380 336 { 381 337 if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { 382 - pr_debug("***** Event started *****\n"); 338 + ec_dbg_req("Event started"); 383 339 schedule_work(&ec->work); 384 340 } 385 341 } ··· 388 344 { 389 345 if (ec->curr->command == ACPI_EC_COMMAND_QUERY) { 390 346 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); 391 - pr_debug("***** Event stopped *****\n"); 347 + ec_dbg_req("Event stopped"); 392 348 } 393 349 } 394 350 ··· 410 366 u8 status; 411 367 bool wakeup = false; 412 368 413 - pr_debug("===== %s (%d) =====\n", 414 - in_interrupt() ? "IRQ" : "TASK", smp_processor_id()); 369 + ec_dbg_stm("%s (%d)", in_interrupt() ? "IRQ" : "TASK", 370 + smp_processor_id()); 415 371 /* 416 372 * By always clearing STS before handling all indications, we can 417 373 * ensure a hardware STS 0->1 change after this clearing can always ··· 434 390 if (t->rlen == t->ri) { 435 391 t->flags |= ACPI_EC_COMMAND_COMPLETE; 436 392 if (t->command == ACPI_EC_COMMAND_QUERY) 437 - pr_debug("***** Command(%s) hardware completion *****\n", 438 - acpi_ec_cmd_string(t->command)); 393 + ec_dbg_req("Command(%s) hardware completion", 394 + acpi_ec_cmd_string(t->command)); 439 395 wakeup = true; 440 396 } 441 397 } else ··· 454 410 acpi_ec_complete_query(ec); 455 411 t->rdata[t->ri++] = 0x00; 456 412 t->flags |= ACPI_EC_COMMAND_COMPLETE; 457 - pr_debug("***** Command(%s) software completion *****\n", 458 - acpi_ec_cmd_string(t->command)); 413 + ec_dbg_req("Command(%s) software completion", 414 + acpi_ec_cmd_string(t->command)); 459 415 wakeup = true; 460 416 } else if ((status & ACPI_EC_FLAG_IBF) == 0) { 461 417 acpi_ec_write_cmd(ec, t->command); ··· 546 502 ret = -EINVAL; 547 503 goto unlock; 548 504 } 505 + ec_dbg_ref(ec, "Increase command"); 549 506 /* following two actions should be kept atomic */ 550 507 ec->curr = t; 551 - pr_debug("***** Command(%s) started *****\n", 552 - acpi_ec_cmd_string(t->command)); 508 + ec_dbg_req("Command(%s) started", acpi_ec_cmd_string(t->command)); 553 509 start_transaction(ec); 554 510 spin_unlock_irqrestore(&ec->lock, tmp); 555 511 ret = ec_poll(ec); 556 512 spin_lock_irqsave(&ec->lock, tmp); 557 513 if (t->irq_count == ec_storm_threshold) 558 514 acpi_ec_clear_storm(ec, EC_FLAGS_COMMAND_STORM); 559 - pr_debug("***** Command(%s) stopped *****\n", 560 - acpi_ec_cmd_string(t->command)); 515 + ec_dbg_req("Command(%s) stopped", acpi_ec_cmd_string(t->command)); 561 516 ec->curr = NULL; 562 517 /* Disable GPE for command processing (IBF=0/OBF=1) */ 563 518 acpi_ec_complete_request(ec); 519 + ec_dbg_ref(ec, "Decrease command"); 564 520 unlock: 565 521 spin_unlock_irqrestore(&ec->lock, tmp); 566 522 return ret; ··· 720 676 721 677 spin_lock_irqsave(&ec->lock, flags); 722 678 if (!test_and_set_bit(EC_FLAGS_STARTED, &ec->flags)) { 723 - pr_debug("+++++ Starting EC +++++\n"); 679 + ec_dbg_drv("Starting EC"); 724 680 /* Enable GPE for event processing (SCI_EVT=1) */ 725 - if (!resuming) 681 + if (!resuming) { 726 682 acpi_ec_submit_request(ec); 727 - pr_debug("EC started\n"); 683 + ec_dbg_ref(ec, "Increase driver"); 684 + } 685 + ec_log_drv("EC started"); 728 686 } 729 687 spin_unlock_irqrestore(&ec->lock, flags); 730 688 } ··· 748 702 749 703 spin_lock_irqsave(&ec->lock, flags); 750 704 if (acpi_ec_started(ec)) { 751 - pr_debug("+++++ Stopping EC +++++\n"); 705 + ec_dbg_drv("Stopping EC"); 752 706 set_bit(EC_FLAGS_STOPPED, &ec->flags); 753 707 spin_unlock_irqrestore(&ec->lock, flags); 754 708 wait_event(ec->wait, acpi_ec_stopped(ec)); 755 709 spin_lock_irqsave(&ec->lock, flags); 756 710 /* Disable GPE for event processing (SCI_EVT=1) */ 757 - if (!suspending) 711 + if (!suspending) { 758 712 acpi_ec_complete_request(ec); 713 + ec_dbg_ref(ec, "Decrease driver"); 714 + } 759 715 clear_bit(EC_FLAGS_STARTED, &ec->flags); 760 716 clear_bit(EC_FLAGS_STOPPED, &ec->flags); 761 - pr_debug("EC stopped\n"); 717 + ec_log_drv("EC stopped"); 762 718 } 763 719 spin_unlock_irqrestore(&ec->lock, flags); 764 720 } ··· 872 824 873 825 if (!handler) 874 826 return; 875 - pr_debug("##### Query(0x%02x) started #####\n", handler->query_bit); 827 + ec_dbg_evt("Query(0x%02x) started", handler->query_bit); 876 828 if (handler->func) 877 829 handler->func(handler->data); 878 830 else if (handler->handle) 879 831 acpi_evaluate_object(handler->handle, NULL, NULL, NULL); 880 - pr_debug("##### Query(0x%02x) stopped #####\n", handler->query_bit); 832 + ec_dbg_evt("Query(0x%02x) stopped", handler->query_bit); 881 833 acpi_ec_put_query_handler(handler); 882 834 } 883 835 ··· 909 861 if (value == handler->query_bit) { 910 862 /* have custom handler for this bit */ 911 863 handler = acpi_ec_get_query_handler(handler); 912 - pr_debug("##### Query(0x%02x) scheduled #####\n", 913 - handler->query_bit); 864 + ec_dbg_evt("Query(0x%02x) scheduled", 865 + handler->query_bit); 914 866 status = acpi_os_execute((handler->func) ? 915 867 OSL_NOTIFY_HANDLER : OSL_GPE_HANDLER, 916 868 acpi_ec_run, handler); ··· 1146 1098 ec->gpe, ec->command_addr, ec->data_addr); 1147 1099 1148 1100 ret = ec_install_handlers(ec); 1101 + 1102 + /* Reprobe devices depending on the EC */ 1103 + acpi_walk_dep_device_list(ec->handle); 1149 1104 1150 1105 /* EC is fully operational, allow queries */ 1151 1106 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
+1 -1
drivers/acpi/pmic/intel_pmic_crc.c
··· 207 207 } 208 208 module_init(intel_crc_pmic_opregion_driver_init); 209 209 210 - MODULE_DESCRIPTION("CrystalCove ACPI opration region driver"); 210 + MODULE_DESCRIPTION("CrystalCove ACPI operation region driver"); 211 211 MODULE_LICENSE("GPL");