From patchwork Mon Feb 13 15:52:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 56350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2420684wrn; Mon, 13 Feb 2023 07:55:25 -0800 (PST) X-Google-Smtp-Source: AK7set+09V6VFZmcRZiNE2lf4pnPpue33S7Cu0RgfI8u53Op4/xtYGXRJBVjeSpJpZJHjZH6J4MT X-Received: by 2002:a17:902:e0d4:b0:19a:821b:486 with SMTP id e20-20020a170902e0d400b0019a821b0486mr7408858pla.45.1676303725389; Mon, 13 Feb 2023 07:55:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676303725; cv=none; d=google.com; s=arc-20160816; b=RM9aJ0M22jdWAfPEn8jK9MChFLTDWeBgB1mXIm/lozElscA/QUSaDPU/A0BXzVfwiH YbsFCIbRHwiZQpU266Re7i/25Dcf9+8yib3MVXrjLnfskhP/9mmLu3cpW/0Tib/2dVor WV5ZA3iEweJ63sKz35OJlKzEsYtjUWMCZ4r4vKdRSxmSN9fkkrLfoB4OtVZ1guyhWN2p 2kMe6fWdHHHl6vnLv/iKKxv08J/bLH3bkyFvch88R9seDeIQ9obMJ6GB7HydpHyl0v/i K5EkjJC6Ktt8sH36b8AVnkHpyoxMN2R20z5B0qzWYhCeo/fjlcb9yNzTHT37G+xwg2aD 2Jsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zJ+9aePAzG2OB/TDji5cRHGTMJtKEtO6/Bwc5MijWvg=; b=MuSDOilLB54MbFEQEVmsgedgbLX0lU+XcZqVL/h32Pmh1CSMwobNIwalUUWIGkbsk/ xd8tdQfqJMBjTJSnNuxSi8RpLTY4P0bgL0clwpKxIOu00boroNvtbhGDzhNgizROG9gK QAMcw+LX9ShXVpuzYpSt+9eDueOeaZ+K6OowwtO4r8939NkF5VLMT/yYZds/1KW/tgAg qbNdyMr0SMzb0iuuFd81H4s4Xikb+vENUE4cizGha4hiEePKnIbKjJCN4e9qw4jE5ys3 Zkse9SgTKCDlleDTlx7mzd9q9cJG82o/jpHOX9L740YBXsyvTGm1rGn/Bjl+uHxF5JpI eZ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gNGTqdQA; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a170903124700b00192bac60af2si12612131plh.473.2023.02.13.07.55.13; Mon, 13 Feb 2023 07:55:25 -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=qcppdkim1 header.b=gNGTqdQA; 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 S230258AbjBMPw2 (ORCPT + 99 others); Mon, 13 Feb 2023 10:52:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjBMPw0 (ORCPT ); Mon, 13 Feb 2023 10:52:26 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F0A51A665; Mon, 13 Feb 2023 07:52:25 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31DE3R6R017636; Mon, 13 Feb 2023 15:52:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=zJ+9aePAzG2OB/TDji5cRHGTMJtKEtO6/Bwc5MijWvg=; b=gNGTqdQASymCqvgxM1X/qzCJUSfUuD4LCFRrxtY/faHpzgtnMTjRrk7eNUyripnf0xZt ZroER7IBvA+KssjK78FVeSfshKygdCstrQMuWPzHo/xH92tfpyJUFDr79+Ca6wtobact mbRTFNr3ZOMmSc2isKYRJHGWFZvoZJL4nNJREp/pcn39vNBS+dK/XZZnz+ikyNb5vTzH YOhOQ1GZm56AwCdKYlO2zO80LaRqEyrXiZK4fzMt+m+ON84uVlZSsG35qBKEzKc2WQgd BhBUdfr+f2vlWaTSKY3IpgV0dSdDmvlqA2lJbfa0s4jeYOxRaHkatZn2O5RyVcQaJmf7 hg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nqpmmg709-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Feb 2023 15:52:22 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31DFqL2N001582 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Feb 2023 15:52:21 GMT Received: from hu-bjorande-lv.qualcomm.com (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 13 Feb 2023 07:52:21 -0800 From: Bjorn Andersson To: Bjorn Andersson , Mathieu Poirier , Chris Lew CC: , , Subject: [PATCH v2 1/6] rpmsg: glink: Extract tx kick operation Date: Mon, 13 Feb 2023 07:52:10 -0800 Message-ID: <20230213155215.1237059-2-quic_bjorande@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230213155215.1237059-1-quic_bjorande@quicinc.com> References: <20230213155215.1237059-1-quic_bjorande@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: g4Da9XEikKjCiwbWUl5531pt8Q-n78FM X-Proofpoint-GUID: g4Da9XEikKjCiwbWUl5531pt8Q-n78FM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-13_11,2023-02-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 impostorscore=0 bulkscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302130143 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757731855130367698?= X-GMAIL-MSGID: =?utf-8?q?1757731855130367698?= Refactor out the tx kick operations to its own function, in preparation for pushing the details to the individual transports. Reviewed-by: Chris Lew Signed-off-by: Bjorn Andersson --- Changes since v1: - None drivers/rpmsg/qcom_glink_native.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 115c0a1eddb1..5fd8b70271b7 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -303,6 +303,12 @@ static void qcom_glink_tx_write(struct qcom_glink *glink, glink->tx_pipe->write(glink->tx_pipe, hdr, hlen, data, dlen); } +static void qcom_glink_tx_kick(struct qcom_glink *glink) +{ + mbox_send_message(glink->mbox_chan, NULL); + mbox_client_txdone(glink->mbox_chan, 0); +} + static void qcom_glink_send_read_notify(struct qcom_glink *glink) { struct glink_msg msg; @@ -313,8 +319,7 @@ static void qcom_glink_send_read_notify(struct qcom_glink *glink) qcom_glink_tx_write(glink, &msg, sizeof(msg), NULL, 0); - mbox_send_message(glink->mbox_chan, NULL); - mbox_client_txdone(glink->mbox_chan, 0); + qcom_glink_tx_kick(glink); } static int qcom_glink_tx(struct qcom_glink *glink, @@ -355,9 +360,7 @@ static int qcom_glink_tx(struct qcom_glink *glink, } qcom_glink_tx_write(glink, hdr, hlen, data, dlen); - - mbox_send_message(glink->mbox_chan, NULL); - mbox_client_txdone(glink->mbox_chan, 0); + qcom_glink_tx_kick(glink); out: spin_unlock_irqrestore(&glink->tx_lock, flags); @@ -1046,9 +1049,7 @@ static irqreturn_t qcom_glink_native_intr(int irq, void *data) break; case RPM_CMD_READ_NOTIF: qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); - - mbox_send_message(glink->mbox_chan, NULL); - mbox_client_txdone(glink->mbox_chan, 0); + qcom_glink_tx_kick(glink); break; case RPM_CMD_INTENT: qcom_glink_handle_intent(glink, param1, param2, avail);