[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230102061330.GA1836549@quicinc.com>
Date: Mon, 2 Jan 2023 11:43:30 +0530
From: Srivatsa Vaddagiri <quic_svaddagi@...cinc.com>
To: Elliot Berman <quic_eberman@...cinc.com>
CC: Bjorn Andersson <quic_bjorande@...cinc.com>,
Jassi Brar <jassisinghbrar@...il.com>,
Murali Nalajala <quic_mnalajal@...cinc.com>,
Jonathan Corbet <corbet@....net>,
Trilok Soni <quic_tsoni@...cinc.com>,
"Carl van Schaik" <quic_cvanscha@...cinc.com>,
Prakruthi Deepak Heragu <quic_pheragu@...cinc.com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh+dt@...nel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@...aro.org>,
Bagas Sanjaya <bagasdotme@...il.com>,
Catalin Marinas <catalin.marinas@....com>,
"Will Deacon" <will@...nel.org>,
Sudeep Holla <sudeep.holla@....com>,
Mark Rutland <mark.rutland@....com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
"Dmitry Baryshkov" <dmitry.baryshkov@...aro.org>,
<linux-arm-msm@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-acpi@...r.kernel.org>
Subject: Re: [PATCH v8 09/28] mailbox: Add Gunyah message queue mailbox
* Elliot Berman <quic_eberman@...cinc.com> [2022-12-19 14:58:30]:
> +static inline bool gh_msgq_has_tx(struct gh_msgq *msgq)
> +{
Consider possibility that msgq->tx_ghrc can be NULL?
> + return msgq->tx_ghrsc->type == GUNYAH_RESOURCE_TYPE_MSGQ_TX;
> +}
> +
> +static inline bool gh_msgq_has_rx(struct gh_msgq *msgq)
> +{
Consider possibility that msgq->rx_ghrc can be NULL?
> + return msgq->rx_ghrsc->type == GUNYAH_RESOURCE_TYPE_MSGQ_RX;
> +}
> +
> +static irqreturn_t gh_msgq_rx_irq_handler(int irq, void *data)
> +{
> + struct gh_msgq *msgq = data;
> + struct gh_msgq_rx_data rx_data;
> + unsigned long gh_err;
> + ssize_t ret;
> + bool ready = false;
> +
> + do {
> + gh_err = gh_hypercall_msgq_recv(msgq->rx_ghrsc->capid,
> + (uintptr_t)&rx_data.data, sizeof(rx_data.data),
> + &rx_data.length, &ready);
> + if (gh_err == GH_ERROR_OK) {
> + mbox_chan_received_data(gh_msgq_chan(msgq), &rx_data);
> + } else if (GH_ERROR_MSGQUEUE_EMPTY) {
gh_err == GH_ERROR_MSGQUEUE_EMPTY
> + break;
> + } else {
> + pr_warn("Failed to receive data from msgq for %s: %ld\n",
> + msgq->mbox.dev ? dev_name(msgq->mbox.dev) : "", ret);
> + break;
> + }
> + } while (ready);
> +
> + return IRQ_HANDLED;
> +}
Powered by blists - more mailing lists