aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrakash, Prashanth <pprakash@codeaurora.org>2016-02-17 15:21:02 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 17:35:29 -0500
commitbeee23aebc6650609ef1547f6d813fa5065f74aa (patch)
tree3bb482e066420463ade606addde900101738f18b
parent8b0f57889843af6304b80724e36bd3d93b6484b1 (diff)
ACPI / CPPC: replace writeX/readX to PCC with relaxed version
We do not have a strict read/write order requirement while accessing PCC subspace. The only requirement is all access should be committed before triggering the PCC doorbell to transfer the ownership of PCC to the platform and this requirement is enforced by the PCC driver. Profiling on a many core system shows improvement of about 1.8us on average per freq change request(about 10% improvement on average). Since these operations are executed while holding the pcc_lock, reducing this time helps the CPPC implementation to scale much better as the number of cores increases. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Acked-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/cppc_acpi.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 6970b44d37d5..8a0911a13599 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -116,10 +116,10 @@ static int send_pcc_cmd(u16 cmd)
116 } 116 }
117 117
118 /* Write to the shared comm region. */ 118 /* Write to the shared comm region. */
119 writew(cmd, &generic_comm_base->command); 119 writew_relaxed(cmd, &generic_comm_base->command);
120 120
121 /* Flip CMD COMPLETE bit */ 121 /* Flip CMD COMPLETE bit */
122 writew(0, &generic_comm_base->status); 122 writew_relaxed(0, &generic_comm_base->status);
123 123
124 /* Ring doorbell */ 124 /* Ring doorbell */
125 ret = mbox_send_message(pcc_channel, &cmd); 125 ret = mbox_send_message(pcc_channel, &cmd);
@@ -601,16 +601,16 @@ static int cpc_read(struct cpc_reg *reg, u64 *val)
601 601
602 switch (reg->bit_width) { 602 switch (reg->bit_width) {
603 case 8: 603 case 8:
604 *val = readb(vaddr); 604 *val = readb_relaxed(vaddr);
605 break; 605 break;
606 case 16: 606 case 16:
607 *val = readw(vaddr); 607 *val = readw_relaxed(vaddr);
608 break; 608 break;
609 case 32: 609 case 32:
610 *val = readl(vaddr); 610 *val = readl_relaxed(vaddr);
611 break; 611 break;
612 case 64: 612 case 64:
613 *val = readq(vaddr); 613 *val = readq_relaxed(vaddr);
614 break; 614 break;
615 default: 615 default:
616 pr_debug("Error: Cannot read %u bit width from PCC\n", 616 pr_debug("Error: Cannot read %u bit width from PCC\n",
@@ -632,16 +632,16 @@ static int cpc_write(struct cpc_reg *reg, u64 val)
632 632
633 switch (reg->bit_width) { 633 switch (reg->bit_width) {
634 case 8: 634 case 8:
635 writeb(val, vaddr); 635 writeb_relaxed(val, vaddr);
636 break; 636 break;
637 case 16: 637 case 16:
638 writew(val, vaddr); 638 writew_relaxed(val, vaddr);
639 break; 639 break;
640 case 32: 640 case 32:
641 writel(val, vaddr); 641 writel_relaxed(val, vaddr);
642 break; 642 break;
643 case 64: 643 case 64:
644 writeq(val, vaddr); 644 writeq_relaxed(val, vaddr);
645 break; 645 break;
646 default: 646 default:
647 pr_debug("Error: Cannot write %u bit width to PCC\n", 647 pr_debug("Error: Cannot write %u bit width to PCC\n",