[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250804222952.GA3645019@bhelgaas>
Date: Mon, 4 Aug 2025 17:29:52 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: "Aneesh Kumar K.V (Arm)" <aneesh.kumar@...nel.org>
Cc: linux-coco@...ts.linux.dev, kvmarm@...ts.linux.dev,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
aik@....com, lukas@...ner.de, Samuel Ortiz <sameo@...osinc.com>,
Xu Yilun <yilun.xu@...ux.intel.com>, Jason Gunthorpe <jgg@...pe.ca>,
Suzuki K Poulose <Suzuki.Poulose@....com>,
Steven Price <steven.price@....com>,
Catalin Marinas <catalin.marinas@....com>,
Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>
Subject: Re: [RFC PATCH v1 14/38] coco: host: arm64: Device communication
support
On Mon, Jul 28, 2025 at 07:21:51PM +0530, Aneesh Kumar K.V (Arm) wrote:
> Add helpers for device communication from RMM
> +++ b/drivers/virt/coco/arm-cca-host/rmm-da.c
> +static int __do_dev_communicate(int type, struct pci_tsm *tsm)
> +{
> + /* FIXME!! depending on the DevComms status,
> + * it might require to ABORT the communcation.
s/communcation/communication/
Even better, fix the FIXME :)
> + */
> + return -EINVAL;
> + }
> +
> + if (io_exit->cache_rsp_len > cache_remaining)
> + return -EINVAL;
> +
> + memcpy(cache_buf + *cache_offset,
> + (comm_data->resp_buff + io_exit->cache_rsp_offset), io_exit->cache_rsp_len);
> + *cache_offset += io_exit->cache_rsp_len;
> + }
> +
> + /*
> + * wait for last packet request from RMM.
> + * We should not find this because our device communication in synchronous
s/communication in/communication is/
> + */
> + if (io_exit->flags & RMI_DEV_COMM_EXIT_WAIT)
> + return -ENXIO;
> +
> + is_multi = !!(io_exit->flags & RMI_DEV_COMM_EXIT_MULTI);
> +
> + /* next packet to send */
> + if (io_exit->flags & RMI_DEV_COMM_EXIT_SEND) {
> + nbytes = doe_send_req_resp(tsm);
> + if (nbytes < 0) {
> + /* report error back to RMM */
> + io_enter->status = RMI_DEV_COMM_ERROR;
> + } else {
> + /* send response back to RMM */
> + io_enter->resp_len = nbytes;
> + io_enter->status = RMI_DEV_COMM_RESPONSE;
> + }
> + } else {
> + /* no data transmitted => no data received */
> + io_enter->resp_len = 0;
> + }
> +
> + /* The call need to do multiple request/respnse */
s/respnse/response/
> + if (is_multi)
> + goto redo_communicate;
> +
> + return 0;
> +}
Powered by blists - more mailing lists