lkml.org 
[lkml]   [2023]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v8 09/28] mailbox: Add Gunyah message queue mailbox
From


On 1/1/2023 10:13 PM, Srivatsa Vaddagiri wrote:
> * Elliot Berman <quic_eberman@quicinc.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
>

Applied the 3 comments, thanks!

\
 
 \ /
  Last update: 2023-03-26 23:26    [W:0.084 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site