Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12568469rwl; Tue, 3 Jan 2023 17:00:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXvBF85egH26B8fa6huo0vl0e8RLB8blgMpHXLBKHeYrtZG8ntlW90ZDNxAb6eP12YkY92IJ X-Received: by 2002:a17:90a:c781:b0:225:f2aa:cf9c with SMTP id gn1-20020a17090ac78100b00225f2aacf9cmr33806821pjb.31.1672794055214; Tue, 03 Jan 2023 17:00:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672794055; cv=none; d=google.com; s=arc-20160816; b=loJNiBfu2DeKnmE+TX2THkUO+c8odZ2SK6pSTudQ3y14sn9qumDPXC8L13DaK05FdH FE14awxAMl9WaCtVxDSoCi96ffNqwoqzyjWB4G1odNVjnyb+AL42gYGy33URJ+CQ5E45 iVuep/KwKDzBouRY3YRpwY1fp2rOfa4+Szk0Z4VrHpFgXsZB+EDdVJaEuNGkejAWbdeb XaCvltEVR2JdaH2n5IbJLV4+CrQAoA6c1SyqW1327XcEswhFMIsCdqfUqrVGHSRNb36+ w2VagtJrSOZ8Hsq29Abo2WjrNzgNf7bo5yzCd4oa8UZhVZtNkDhck/7yV0zcr5aXla5h CDcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=eIhpR/qxce8uXXnWI0sljvTxC15yx0vN5/MwkffQu8E=; b=xtUmLkimj6xw3bA2RJ/7DAsfrf8nlnIkBfmBr/r2UM7qtuM5VqwEiMExM4l95O8PqD secrpEEeZXbqKGIRMgBizKK1jIe9OEzhMYDHOodCcPg2CklHgv5wNlRpkZsOD9pPnWDd 5JNw+Rx0hWodonDXiyrI1yAvYkTlQ9AwKSP6oV7SRBIW9VTVtCw1QQNvnf7FJ+JijP5+ fT1OUrQ3/ToC1tDCwhqqH1DVYBajyGZh/V04gH5ySh1nFAXRi/aBDDcg2aLk1MtApfZa 4hfozN1WuvgdHMEqZ97FqnlxEXK8grglEJhSDuToU8+9HonQdmjrYJw++3Qv4gNh9lBs LUww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=zDiNrWNi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a6540cb000000b0047860cd6de3si33836187pgp.641.2023.01.03.17.00.46; Tue, 03 Jan 2023 17:00:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=zDiNrWNi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238767AbjADAdh (ORCPT + 57 others); Tue, 3 Jan 2023 19:33:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234202AbjADAc4 (ORCPT ); Tue, 3 Jan 2023 19:32:56 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D43C3140E2; Tue, 3 Jan 2023 16:32:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1672792375; x=1704328375; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=eIhpR/qxce8uXXnWI0sljvTxC15yx0vN5/MwkffQu8E=; b=zDiNrWNi9/Wm2xJWh0a/Y836cvfCQQrZVaLCUbZgLbNbCYLl4o7zjnfk 3sjkxj6DV9crGmplszHWn+EVeJLXjEzSQo/io8MZsUKAHehwHqetSVzFL Kn7JtM0gwNwCOKZ8+7XSFDXPkoQ8bcYHagSKOKpYIYrZTVzEAG0qcvNg4 w=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 03 Jan 2023 16:32:55 -0800 X-QCInternal: smtphost Received: from nasanex01b.na.qualcomm.com ([10.46.141.250]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 16:32:55 -0800 Received: from [10.134.67.48] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 3 Jan 2023 16:32:54 -0800 Message-ID: Date: Tue, 3 Jan 2023 16:32:37 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v8 09/28] mailbox: Add Gunyah message queue mailbox To: Srivatsa Vaddagiri CC: Bjorn Andersson , Jassi Brar , Murali Nalajala , Jonathan Corbet , Trilok Soni , "Carl van Schaik" , Prakruthi Deepak Heragu , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , "Krzysztof Kozlowski" , Bagas Sanjaya , Catalin Marinas , "Will Deacon" , Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , "Dmitry Baryshkov" , , , , , , References: <20221219225850.2397345-1-quic_eberman@quicinc.com> <20221219225850.2397345-10-quic_eberman@quicinc.com> <20230102061330.GA1836549@quicinc.com> Content-Language: en-US From: Elliot Berman In-Reply-To: <20230102061330.GA1836549@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/1/2023 10:13 PM, Srivatsa Vaddagiri wrote: > * Elliot Berman [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!