aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/longhaul.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2016-04-05 16:28:25 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-04-08 19:35:18 -0400
commit1c5864e26c99cf32b51e878f3daf73a388d7561a (patch)
tree573c01b9df76d0d1ddd7d04955a8171cf08ed31c /drivers/cpufreq/longhaul.c
parentb49c22a6ca3656c68506fea57caf3d8f08878570 (diff)
cpufreq: Use consistent prefixing via pr_fmt
Use the more common kernel style adding a define for pr_fmt. Miscellanea: o Remove now unused PFX defines Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/longhaul.c')
-rw-r--r--drivers/cpufreq/longhaul.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index 2baeb8c01474..beae5cf5c62c 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -21,6 +21,8 @@
21 * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* 21 * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous*
22 */ 22 */
23 23
24#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25
24#include <linux/kernel.h> 26#include <linux/kernel.h>
25#include <linux/module.h> 27#include <linux/module.h>
26#include <linux/moduleparam.h> 28#include <linux/moduleparam.h>
@@ -40,8 +42,6 @@
40 42
41#include "longhaul.h" 43#include "longhaul.h"
42 44
43#define PFX "longhaul: "
44
45#define TYPE_LONGHAUL_V1 1 45#define TYPE_LONGHAUL_V1 1
46#define TYPE_LONGHAUL_V2 2 46#define TYPE_LONGHAUL_V2 2
47#define TYPE_POWERSAVER 3 47#define TYPE_POWERSAVER 3
@@ -347,13 +347,13 @@ retry_loop:
347 freqs.new = calc_speed(longhaul_get_cpu_mult()); 347 freqs.new = calc_speed(longhaul_get_cpu_mult());
348 /* Check if requested frequency is set. */ 348 /* Check if requested frequency is set. */
349 if (unlikely(freqs.new != speed)) { 349 if (unlikely(freqs.new != speed)) {
350 pr_info(PFX "Failed to set requested frequency!\n"); 350 pr_info("Failed to set requested frequency!\n");
351 /* Revision ID = 1 but processor is expecting revision key 351 /* Revision ID = 1 but processor is expecting revision key
352 * equal to 0. Jumpers at the bottom of processor will change 352 * equal to 0. Jumpers at the bottom of processor will change
353 * multiplier and FSB, but will not change bits in Longhaul 353 * multiplier and FSB, but will not change bits in Longhaul
354 * MSR nor enable voltage scaling. */ 354 * MSR nor enable voltage scaling. */
355 if (!revid_errata) { 355 if (!revid_errata) {
356 pr_info(PFX "Enabling \"Ignore Revision ID\" option\n"); 356 pr_info("Enabling \"Ignore Revision ID\" option\n");
357 revid_errata = 1; 357 revid_errata = 1;
358 msleep(200); 358 msleep(200);
359 goto retry_loop; 359 goto retry_loop;
@@ -363,10 +363,10 @@ retry_loop:
363 * but it doesn't change frequency. I tried poking various 363 * but it doesn't change frequency. I tried poking various
364 * bits in northbridge registers, but without success. */ 364 * bits in northbridge registers, but without success. */
365 if (longhaul_flags & USE_ACPI_C3) { 365 if (longhaul_flags & USE_ACPI_C3) {
366 pr_info(PFX "Disabling ACPI C3 support\n"); 366 pr_info("Disabling ACPI C3 support\n");
367 longhaul_flags &= ~USE_ACPI_C3; 367 longhaul_flags &= ~USE_ACPI_C3;
368 if (revid_errata) { 368 if (revid_errata) {
369 pr_info(PFX "Disabling \"Ignore Revision ID\" option\n"); 369 pr_info("Disabling \"Ignore Revision ID\" option\n");
370 revid_errata = 0; 370 revid_errata = 0;
371 } 371 }
372 msleep(200); 372 msleep(200);
@@ -377,7 +377,7 @@ retry_loop:
377 * RevID = 1. RevID errata will make things right. Just 377 * RevID = 1. RevID errata will make things right. Just
378 * to be 100% sure. */ 378 * to be 100% sure. */
379 if (longhaul_version == TYPE_LONGHAUL_V2) { 379 if (longhaul_version == TYPE_LONGHAUL_V2) {
380 pr_info(PFX "Switching to Longhaul ver. 1\n"); 380 pr_info("Switching to Longhaul ver. 1\n");
381 longhaul_version = TYPE_LONGHAUL_V1; 381 longhaul_version = TYPE_LONGHAUL_V1;
382 msleep(200); 382 msleep(200);
383 goto retry_loop; 383 goto retry_loop;
@@ -385,7 +385,7 @@ retry_loop:
385 } 385 }
386 386
387 if (!bm_timeout) { 387 if (!bm_timeout) {
388 pr_info(PFX "Warning: Timeout while waiting for idle PCI bus\n"); 388 pr_info("Warning: Timeout while waiting for idle PCI bus\n");
389 return -EBUSY; 389 return -EBUSY;
390 } 390 }
391 391
@@ -430,12 +430,12 @@ static int longhaul_get_ranges(void)
430 /* Get current frequency */ 430 /* Get current frequency */
431 mult = longhaul_get_cpu_mult(); 431 mult = longhaul_get_cpu_mult();
432 if (mult == -1) { 432 if (mult == -1) {
433 pr_info(PFX "Invalid (reserved) multiplier!\n"); 433 pr_info("Invalid (reserved) multiplier!\n");
434 return -EINVAL; 434 return -EINVAL;
435 } 435 }
436 fsb = guess_fsb(mult); 436 fsb = guess_fsb(mult);
437 if (fsb == 0) { 437 if (fsb == 0) {
438 pr_info(PFX "Invalid (reserved) FSB!\n"); 438 pr_info("Invalid (reserved) FSB!\n");
439 return -EINVAL; 439 return -EINVAL;
440 } 440 }
441 /* Get max multiplier - as we always did. 441 /* Get max multiplier - as we always did.
@@ -465,11 +465,11 @@ static int longhaul_get_ranges(void)
465 print_speed(highest_speed/1000)); 465 print_speed(highest_speed/1000));
466 466
467 if (lowest_speed == highest_speed) { 467 if (lowest_speed == highest_speed) {
468 pr_info(PFX "highestspeed == lowest, aborting\n"); 468 pr_info("highestspeed == lowest, aborting\n");
469 return -EINVAL; 469 return -EINVAL;
470 } 470 }
471 if (lowest_speed > highest_speed) { 471 if (lowest_speed > highest_speed) {
472 pr_info(PFX "nonsense! lowest (%d > %d) !\n", 472 pr_info("nonsense! lowest (%d > %d) !\n",
473 lowest_speed, highest_speed); 473 lowest_speed, highest_speed);
474 return -EINVAL; 474 return -EINVAL;
475 } 475 }
@@ -535,16 +535,16 @@ static void longhaul_setup_voltagescaling(void)
535 535
536 rdmsrl(MSR_VIA_LONGHAUL, longhaul.val); 536 rdmsrl(MSR_VIA_LONGHAUL, longhaul.val);
537 if (!(longhaul.bits.RevisionID & 1)) { 537 if (!(longhaul.bits.RevisionID & 1)) {
538 pr_info(PFX "Voltage scaling not supported by CPU\n"); 538 pr_info("Voltage scaling not supported by CPU\n");
539 return; 539 return;
540 } 540 }
541 541
542 if (!longhaul.bits.VRMRev) { 542 if (!longhaul.bits.VRMRev) {
543 pr_info(PFX "VRM 8.5\n"); 543 pr_info("VRM 8.5\n");
544 vrm_mV_table = &vrm85_mV[0]; 544 vrm_mV_table = &vrm85_mV[0];
545 mV_vrm_table = &mV_vrm85[0]; 545 mV_vrm_table = &mV_vrm85[0];
546 } else { 546 } else {
547 pr_info(PFX "Mobile VRM\n"); 547 pr_info("Mobile VRM\n");
548 if (cpu_model < CPU_NEHEMIAH) 548 if (cpu_model < CPU_NEHEMIAH)
549 return; 549 return;
550 vrm_mV_table = &mobilevrm_mV[0]; 550 vrm_mV_table = &mobilevrm_mV[0];
@@ -555,21 +555,21 @@ static void longhaul_setup_voltagescaling(void)
555 maxvid = vrm_mV_table[longhaul.bits.MaximumVID]; 555 maxvid = vrm_mV_table[longhaul.bits.MaximumVID];
556 556
557 if (minvid.mV == 0 || maxvid.mV == 0 || minvid.mV > maxvid.mV) { 557 if (minvid.mV == 0 || maxvid.mV == 0 || minvid.mV > maxvid.mV) {
558 pr_info(PFX "Bogus values Min:%d.%03d Max:%d.%03d - Voltage scaling disabled\n", 558 pr_info("Bogus values Min:%d.%03d Max:%d.%03d - Voltage scaling disabled\n",
559 minvid.mV/1000, minvid.mV%1000, 559 minvid.mV/1000, minvid.mV%1000,
560 maxvid.mV/1000, maxvid.mV%1000); 560 maxvid.mV/1000, maxvid.mV%1000);
561 return; 561 return;
562 } 562 }
563 563
564 if (minvid.mV == maxvid.mV) { 564 if (minvid.mV == maxvid.mV) {
565 pr_info(PFX "Claims to support voltage scaling but min & max are both %d.%03d - Voltage scaling disabled\n", 565 pr_info("Claims to support voltage scaling but min & max are both %d.%03d - Voltage scaling disabled\n",
566 maxvid.mV/1000, maxvid.mV%1000); 566 maxvid.mV/1000, maxvid.mV%1000);
567 return; 567 return;
568 } 568 }
569 569
570 /* How many voltage steps*/ 570 /* How many voltage steps*/
571 numvscales = maxvid.pos - minvid.pos + 1; 571 numvscales = maxvid.pos - minvid.pos + 1;
572 pr_info(PFX "Max VID=%d.%03d Min VID=%d.%03d, %d possible voltage scales\n", 572 pr_info("Max VID=%d.%03d Min VID=%d.%03d, %d possible voltage scales\n",
573 maxvid.mV/1000, maxvid.mV%1000, 573 maxvid.mV/1000, maxvid.mV%1000,
574 minvid.mV/1000, minvid.mV%1000, 574 minvid.mV/1000, minvid.mV%1000,
575 numvscales); 575 numvscales);
@@ -608,12 +608,12 @@ static void longhaul_setup_voltagescaling(void)
608 pos = minvid.pos; 608 pos = minvid.pos;
609 freq_pos->driver_data |= mV_vrm_table[pos] << 8; 609 freq_pos->driver_data |= mV_vrm_table[pos] << 8;
610 vid = vrm_mV_table[mV_vrm_table[pos]]; 610 vid = vrm_mV_table[mV_vrm_table[pos]];
611 pr_info(PFX "f: %d kHz, index: %d, vid: %d mV\n", 611 pr_info("f: %d kHz, index: %d, vid: %d mV\n",
612 speed, (int)(freq_pos - longhaul_table), vid.mV); 612 speed, (int)(freq_pos - longhaul_table), vid.mV);
613 } 613 }
614 614
615 can_scale_voltage = 1; 615 can_scale_voltage = 1;
616 pr_info(PFX "Voltage scaling enabled\n"); 616 pr_info("Voltage scaling enabled\n");
617} 617}
618 618
619 619
@@ -711,7 +711,7 @@ static int enable_arbiter_disable(void)
711 pci_write_config_byte(dev, reg, pci_cmd); 711 pci_write_config_byte(dev, reg, pci_cmd);
712 pci_read_config_byte(dev, reg, &pci_cmd); 712 pci_read_config_byte(dev, reg, &pci_cmd);
713 if (!(pci_cmd & 1<<7)) { 713 if (!(pci_cmd & 1<<7)) {
714 pr_err(PFX "Can't enable access to port 0x22\n"); 714 pr_err("Can't enable access to port 0x22\n");
715 status = 0; 715 status = 0;
716 } 716 }
717 } 717 }
@@ -748,7 +748,7 @@ static int longhaul_setup_southbridge(void)
748 if (pci_cmd & 1 << 7) { 748 if (pci_cmd & 1 << 7) {
749 pci_read_config_dword(dev, 0x88, &acpi_regs_addr); 749 pci_read_config_dword(dev, 0x88, &acpi_regs_addr);
750 acpi_regs_addr &= 0xff00; 750 acpi_regs_addr &= 0xff00;
751 pr_info(PFX "ACPI I/O at 0x%x\n", acpi_regs_addr); 751 pr_info("ACPI I/O at 0x%x\n", acpi_regs_addr);
752 } 752 }
753 753
754 pci_dev_put(dev); 754 pci_dev_put(dev);
@@ -842,7 +842,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
842 longhaul_version = TYPE_LONGHAUL_V1; 842 longhaul_version = TYPE_LONGHAUL_V1;
843 } 843 }
844 844
845 pr_info(PFX "VIA %s CPU detected. ", cpuname); 845 pr_info("VIA %s CPU detected. ", cpuname);
846 switch (longhaul_version) { 846 switch (longhaul_version) {
847 case TYPE_LONGHAUL_V1: 847 case TYPE_LONGHAUL_V1:
848 case TYPE_LONGHAUL_V2: 848 case TYPE_LONGHAUL_V2:
@@ -878,14 +878,14 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
878 if (!(longhaul_flags & USE_ACPI_C3 878 if (!(longhaul_flags & USE_ACPI_C3
879 || longhaul_flags & USE_NORTHBRIDGE) 879 || longhaul_flags & USE_NORTHBRIDGE)
880 && ((pr == NULL) || !(pr->flags.bm_control))) { 880 && ((pr == NULL) || !(pr->flags.bm_control))) {
881 pr_err(PFX "No ACPI support: Unsupported northbridge\n"); 881 pr_err("No ACPI support: Unsupported northbridge\n");
882 return -ENODEV; 882 return -ENODEV;
883 } 883 }
884 884
885 if (longhaul_flags & USE_NORTHBRIDGE) 885 if (longhaul_flags & USE_NORTHBRIDGE)
886 pr_info(PFX "Using northbridge support\n"); 886 pr_info("Using northbridge support\n");
887 if (longhaul_flags & USE_ACPI_C3) 887 if (longhaul_flags & USE_ACPI_C3)
888 pr_info(PFX "Using ACPI support\n"); 888 pr_info("Using ACPI support\n");
889 889
890 ret = longhaul_get_ranges(); 890 ret = longhaul_get_ranges();
891 if (ret != 0) 891 if (ret != 0)
@@ -922,18 +922,18 @@ static int __init longhaul_init(void)
922 return -ENODEV; 922 return -ENODEV;
923 923
924 if (!enable) { 924 if (!enable) {
925 pr_err(PFX "Option \"enable\" not set - Aborting\n"); 925 pr_err("Option \"enable\" not set - Aborting\n");
926 return -ENODEV; 926 return -ENODEV;
927 } 927 }
928#ifdef CONFIG_SMP 928#ifdef CONFIG_SMP
929 if (num_online_cpus() > 1) { 929 if (num_online_cpus() > 1) {
930 pr_err(PFX "More than 1 CPU detected, longhaul disabled\n"); 930 pr_err("More than 1 CPU detected, longhaul disabled\n");
931 return -ENODEV; 931 return -ENODEV;
932 } 932 }
933#endif 933#endif
934#ifdef CONFIG_X86_IO_APIC 934#ifdef CONFIG_X86_IO_APIC
935 if (cpu_has_apic) { 935 if (cpu_has_apic) {
936 pr_err(PFX "APIC detected. Longhaul is currently broken in this configuration.\n"); 936 pr_err("APIC detected. Longhaul is currently broken in this configuration.\n");
937 return -ENODEV; 937 return -ENODEV;
938 } 938 }
939#endif 939#endif
@@ -941,7 +941,7 @@ static int __init longhaul_init(void)
941 case 6 ... 9: 941 case 6 ... 9:
942 return cpufreq_register_driver(&longhaul_driver); 942 return cpufreq_register_driver(&longhaul_driver);
943 case 10: 943 case 10:
944 pr_err(PFX "Use acpi-cpufreq driver for VIA C7\n"); 944 pr_err("Use acpi-cpufreq driver for VIA C7\n");
945 default: 945 default:
946 ; 946 ;
947 } 947 }