Skip to contentSkip to conversation

ACPI: CPPC: Support PCC with interrupt flag

PATCH Superseded Hoan Tran 3 participants 6 messages Jul 21, 2016 – Sep 14, 2016

Subsystems (2)
lore
Share & tools
lore

Hoan Tran

author
#0 lore raw

PATCH 1/1 ACPI: CPPC: Support PCC with interrupt flag

For PCC mailbox with interrupt flag, CPPC should call mbox_chan_txdone() function to notify the mailbox framework about TX completion.

---
This patch is tested on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace type 2

 drivers/acpi/cppc_acpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +5 -1
index 2e98173..19606aa 100644
@@ -191,7 +191,11 @@ static int send_pcc_cmd(u16 cmd)
 			last_cmd_cmpl_time = ktime_get();
 	}
 
-	mbox_client_txdone(pcc_channel, ret);
+	if (pcc_channel->mbox->txdone_irq)
+		mbox_chan_txdone(pcc_channel, ret);
+	else
+		mbox_client_txdone(pcc_channel, ret);
+
 	return ret;
 }
 
Signature · 1 line
1.9.1
author
#1 lore raw
Quoted 30 lines · Hoan Tran

For PCC mailbox with interrupt flag, CPPC should call mbox_chan_txdone() function to notify the mailbox framework about TX completion.

---
This patch is tested on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace type 2

 drivers/acpi/cppc_acpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +5 -2
index 2e98173..19606aa 100644
@@ -191,7 +191,11 @@ static int send_pcc_cmd(u16 cmd)
                        last_cmd_cmpl_time = ktime_get();
        }
 
-       mbox_client_txdone(pcc_channel, ret);
+       if (pcc_channel->mbox->txdone_irq)
+               mbox_chan_txdone(pcc_channel, ret);
+       else
+               mbox_client_txdone(pcc_channel, ret);
+
        return ret;
 }
 
--
Quoted 2 lines

1.9.1

Any feedbacks.

Thanks
Hoan

author
#2 lore raw
Quoted 30 lines · Hoan Tran
Quoted 29 lines · Hoan Tran

For PCC mailbox with interrupt flag, CPPC should call mbox_chan_txdone() function to notify the mailbox framework about TX completion.

---
This patch is tested on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace type 2

 drivers/acpi/cppc_acpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +5 -1
index 2e98173..19606aa 100644
@@ -191,7 +191,11 @@ static int send_pcc_cmd(u16 cmd)
                        last_cmd_cmpl_time = ktime_get();
        }
 
-       mbox_client_txdone(pcc_channel, ret);
+       if (pcc_channel->mbox->txdone_irq)
+               mbox_chan_txdone(pcc_channel, ret);
+       else
+               mbox_client_txdone(pcc_channel, ret);
+
        return ret;
 }
 
Quoted 8 lines
Quoted 3 lines

--
1.9.1

Any feedbacks.

Thanks
Hoan

Hi Rafael,

Do you have any comments on this patch ?

Thanks
Hoan

Reviewed-by
#5 lore raw
In reply to Hoan Tran

Hi Hoan,

Quoted 21 lines · Hoan Tran
Quoted 20 lines · Hoan Tran

For PCC mailbox with interrupt flag, CPPC should call mbox_chan_txdone() function to notify the mailbox framework about TX completion.

---
This patch is tested on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace type 2

 drivers/acpi/cppc_acpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +0 -0
index 2e98173..19606aa 100644
@@ -191,7 +191,11 @@ static int send_pcc_cmd(u16 cmd)
                        last_cmd_cmpl_time = ktime_get();
        }
 
Quoted 6 lines

drivers/acpi/cppc_acpi.c static int send_pcc_cmd(u16 cmd) · line 198

Quoted 6 lines
drivers/acpi/cppc_acpi.c +5 -1
-       mbox_client_txdone(pcc_channel, ret);
+       if (pcc_channel->mbox->txdone_irq)
+               mbox_chan_txdone(pcc_channel, ret);
+       else
+               mbox_client_txdone(pcc_channel, ret);
+

Firstly, sorry for the delay.

I was wondering if we should call txdone in PCC interrupt routine as done in some of the mailbox drivers. But then, since we need to support both polling and interrupt, I suppose this makes sense.

Thanks,
Prashanth

Quoted 10 lines
Quoted 6 lines
drivers/acpi/cppc_acpi.c +0 -1
        return ret;
 }
 
--

1.9.1

Any feedbacks.

Thanks
Hoan

#3 lore raw
In reply to Hoan Tran
Quoted 37 lines · Hoan Tran
Quoted 36 lines · Hoan Tran
Quoted 30 lines · Hoan Tran

For PCC mailbox with interrupt flag, CPPC should call mbox_chan_txdone() function to notify the mailbox framework about TX completion.

---
This patch is tested on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace type 2

 drivers/acpi/cppc_acpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +5 -2
index 2e98173..19606aa 100644
@@ -191,7 +191,11 @@ static int send_pcc_cmd(u16 cmd)
                        last_cmd_cmpl_time = ktime_get();
        }
 
-       mbox_client_txdone(pcc_channel, ret);
+       if (pcc_channel->mbox->txdone_irq)
+               mbox_chan_txdone(pcc_channel, ret);
+       else
+               mbox_client_txdone(pcc_channel, ret);
+
        return ret;
 }
 
--
Quoted 2 lines

1.9.1

Any feedbacks.

Quoted 6 lines
Quoted 2 lines

Thanks
Hoan

Hi Rafael,

Do you have any comments on this patch ?

No, but can you please resend it (with the Reviewed-by tag from Prashanth, preferably)? And please make sure it applies on my linux-next branch.

Thanks,
Rafael

author
#4 lore raw
Quoted 41 lines · Rafael J. Wysocki
Quoted 40 lines · Hoan Tran
Quoted 38 lines · Hoan Tran
Quoted 30 lines · Hoan Tran

For PCC mailbox with interrupt flag, CPPC should call mbox_chan_txdone() function to notify the mailbox framework about TX completion.

---
This patch is tested on top and depends on patch[1]:
[1] http://www.spinics.net/lists/linux-acpi/msg66041.html
- [PATCH v3] mailbox: pcc: Support HW-Reduced Communication Subspace type 2

 drivers/acpi/cppc_acpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +5 -2
index 2e98173..19606aa 100644
@@ -191,7 +191,11 @@ static int send_pcc_cmd(u16 cmd)
                        last_cmd_cmpl_time = ktime_get();
        }
 
-       mbox_client_txdone(pcc_channel, ret);
+       if (pcc_channel->mbox->txdone_irq)
+               mbox_chan_txdone(pcc_channel, ret);
+       else
+               mbox_client_txdone(pcc_channel, ret);
+
        return ret;
 }
 
--
Quoted 2 lines

1.9.1

Any feedbacks.

Thanks
Hoan

Quoted 6 lines
Quoted 3 lines

Hi Rafael,

Do you have any comments on this patch ?

No, but can you please resend it (with the Reviewed-by tag from Prashanth, preferably)? And please make sure it applies on my linux-next branch.

Hi Rafael,

I just resent the patch with Reviewed-by tag

Thanks
Hoan

Quoted 4 lines

Thanks,
Rafael