diff mbox series

[2/2] ACPI: PCC: fix Tx done interface in handler

Message ID 20220920094500.11283-3-lihuisong@huawei.com
State New
Headers show
Series ACPI: PCC: add waiting timeout and fix Tx done interface | expand

Commit Message

lihuisong (C) Sept. 20, 2022, 9:45 a.m. UTC
A error, "Client can't run the TX ticker", is printed even if PCC command
executed successfully. This root cause is that PCC handler calls
'mbox_client_txdone()' which depands on the client can received 'ACK'
packet. But PCC handler detects whether the command is complete through
the Tx ACK interrupt. So this patch fix it.

Fixes: 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/acpi/acpi_pcc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sudeep Holla Sept. 21, 2022, 3:43 p.m. UTC | #1
On Tue, Sep 20, 2022 at 05:45:00PM +0800, Huisong Li wrote:
> A error, "Client can't run the TX ticker", is printed even if PCC command
> executed successfully. This root cause is that PCC handler calls
> 'mbox_client_txdone()' which depands on the client can received 'ACK'
> packet. But PCC handler detects whether the command is complete through
> the Tx ACK interrupt. So this patch fix it.
>

Thanks for fixing this. Someone mentioned about the error and it was in
my TODO list.

I would prefer to reword the subject and commit message as below:
"
ACPI: PCC: Fix Tx acknowledge in the PCC address space handler

Currently, mbox_client_txdone() is called from the PCC address space
handler and that expects the user the Tx state machine to be controlled
by the client which is not the case and the below warning is thrown:

  | PCCT: Client can't run the TX ticker

Let the controller run the state machine and the end of Tx can be
acknowledge by calling mbox_chan_txdone() instead.
"

With that:

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
lihuisong (C) Sept. 22, 2022, 2:30 a.m. UTC | #2
在 2022/9/21 23:43, Sudeep Holla 写道:
> On Tue, Sep 20, 2022 at 05:45:00PM +0800, Huisong Li wrote:
>> A error, "Client can't run the TX ticker", is printed even if PCC command
>> executed successfully. This root cause is that PCC handler calls
>> 'mbox_client_txdone()' which depands on the client can received 'ACK'
>> packet. But PCC handler detects whether the command is complete through
>> the Tx ACK interrupt. So this patch fix it.
>>
> Thanks for fixing this. Someone mentioned about the error and it was in
> my TODO list.
Great minds think alike😁
>
> I would prefer to reword the subject and commit message as below:
> "
> ACPI: PCC: Fix Tx acknowledge in the PCC address space handler
>
> Currently, mbox_client_txdone() is called from the PCC address space
> handler and that expects the user the Tx state machine to be controlled
> by the client which is not the case and the below warning is thrown:
>
>    | PCCT: Client can't run the TX ticker
>
> Let the controller run the state machine and the end of Tx can be
> acknowledge by calling mbox_chan_txdone() instead.
> "
Thank you for your suggestion. I will fix it in V2.
> With that:
>
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
>
Rafael J. Wysocki Sept. 22, 2022, 7:10 p.m. UTC | #3
On Wed, Sep 21, 2022 at 5:43 PM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Tue, Sep 20, 2022 at 05:45:00PM +0800, Huisong Li wrote:
> > A error, "Client can't run the TX ticker", is printed even if PCC command
> > executed successfully. This root cause is that PCC handler calls
> > 'mbox_client_txdone()' which depands on the client can received 'ACK'
> > packet. But PCC handler detects whether the command is complete through
> > the Tx ACK interrupt. So this patch fix it.
> >
>
> Thanks for fixing this. Someone mentioned about the error and it was in
> my TODO list.
>
> I would prefer to reword the subject and commit message as below:
> "
> ACPI: PCC: Fix Tx acknowledge in the PCC address space handler
>
> Currently, mbox_client_txdone() is called from the PCC address space
> handler and that expects the user the Tx state machine to be controlled
> by the client which is not the case and the below warning is thrown:
>
>   | PCCT: Client can't run the TX ticker
>
> Let the controller run the state machine and the end of Tx can be
> acknowledge by calling mbox_chan_txdone() instead.
> "
>
> With that:
>
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

Applied as 6.1 material along with the [1/2].

I used the above text in quotes as the subject and changelog instead
of the original pieces.

Thanks!
diff mbox series

Patch

diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
index a1052fe998bf..95d2dc274bd9 100644
--- a/drivers/acpi/acpi_pcc.c
+++ b/drivers/acpi/acpi_pcc.c
@@ -118,7 +118,7 @@  acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
 		}
 	}
 
-	mbox_client_txdone(data->pcc_chan->mchan, ret);
+	mbox_chan_txdone(data->pcc_chan->mchan, ret);
 
 	memcpy_fromio(value, data->pcc_comm_addr, data->ctx.length);