Re: [PATCH v6 1/2] mctp pcc: Check before sending MCTP PCC response ACK

From: lihuisong (C)
Date: Thu Oct 31 2024 - 21:30:35 EST


Hi Adam,

All modifications in the patch is done for pcc instead of mctp.
Suggest that use the prefix "mailbox: pcc: xxxx".
Please find my following reply.


在 2024/11/1 8:16, Adam Young 写道:

On 10/30/24 05:45, lihuisong (C) wrote:
+ check_and_ack(pchan, chan);
      pchan->chan_in_use = false;
        return IRQ_HANDLED;
@@ -352,6 +368,9 @@ pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id)
      if (rc)
          return ERR_PTR(rc);
  +    pchan->shmem_base_addr = devm_ioremap(chan->mbox->dev,
+                          pchan->chan.shmem_base_addr,
+                          pchan->chan.shmem_size);
Currently, the PCC mbox client does ioremap after requesting PCC channel.
Thus all current clients will ioremap twice. This is not good to me.
How about add a new interface and give the type4 client the right to decide whether to reply in rx_callback?


I do agree that is a cleaner implementation, but I don't have a way of testing the other drivers, and did not want to break them. I think your driver is the only that makes use of it, so we can certainly come up with a common approach.
I understand what you are concerned about.
But this duplicate ioremap also works for all PCC clients no matter which type they used. It has very wide influence.
My driver just uses type3 instead of type4. What's more, AFAICS, it doesn't seem there is type4 client driver in linux.
Therefore, determining whether type4 client driver needs to reply to platform has the minimum or even no impact in their rx_callback.

The mailbox interface does not allow a return code from mbox_chan_received_data, which is what I originally wanted.  If that could return multiple status codes, one of them could indicate the need  to send the interrupt back.  Otherwise, we need to query the driver to read the shared memory again.
yes

.