From patchwork Tue Feb 14 23:42:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 57278 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3264866wrn; Tue, 14 Feb 2023 15:49:06 -0800 (PST) X-Google-Smtp-Source: AK7set8LtF2quwg0Zy/Lb7MDWhKE8a7u2M7uz/5ySuYROzxkdikVhGXGykmjTvRQJQok2tuNh4E2 X-Received: by 2002:a05:6402:180f:b0:4ac:be53:1789 with SMTP id g15-20020a056402180f00b004acbe531789mr47006edy.40.1676418546141; Tue, 14 Feb 2023 15:49:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676418546; cv=none; d=google.com; s=arc-20160816; b=UIbGXWOYPmPLomrVO6amem3tDvSEg2Tua/K2P8auGDvsRBI+KKw/eCuv6uvRdYgtuv ZNom1UR2yFN/um8MazfppEbfyrEuaik+VdIP6TdWqm44SfJXS92wx3eMEBSYQyct3z05 PmuE709kF16qltZOROAXjCBefuJlnI+A6fBO0bkd4JKewWonCCIQFnwDLdBaymMBrcGD kRoeHG0eUa7bZUk0X9KVgI5Go/mn9TWJkIW/QPlCzOclSSEfoeZ+kT4yPbvbofCuHo6y uEVTs39Ecl1OPhL7MYMBQ5ROGtrtjoQIPmTloElWA2vNoB1tUaDqvFeF6Y1kp6ZyYIN8 mslg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=LgTMlt1+gaba4Tu8W+SSOOFVQqW1YtZBCdX6PcSrSAk=; b=Cf6Vb9imfiAUL9zdNIxhV0qe4Dx0Bin1aTOAvUAw5unPlbX1oyu4Jy1IVdFwK1Nam8 vmbuj32SUrvx/f6rLyDdZ2BTf80eDoCw8naSEZvXn1UVoWa6fXgCqbBLW0K9hvlfAhJ2 GqqpsNCqPKVokImaZknQ27sjxu0S8HA4+tptXNDqnxfnTq6SQ4CRT94aylwH1fmSciVy HNnfnXFCdrrUKFgro5VXfVkQgpPHoEHAw7bvc+fI6vUwxpT9Ka2scdGYXjLzy/92h3Ne OOpKOi/EN78lPnvrDzwett2DcMVBHOeifNJtOxfWkpqQe+38ks4ZyPrVlmujN7iR317H UidQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fK4IJHBq; 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 i21-20020aa7dd15000000b004acbbc70421si12339628edv.366.2023.02.14.15.48.42; Tue, 14 Feb 2023 15:49:06 -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=fK4IJHBq; 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 S231571AbjBNXnK (ORCPT + 99 others); Tue, 14 Feb 2023 18:43:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbjBNXnI (ORCPT ); Tue, 14 Feb 2023 18:43:08 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 091F52914A; Tue, 14 Feb 2023 15:43:08 -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 31E7m2X6013701; Tue, 14 Feb 2023 23:42:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=LgTMlt1+gaba4Tu8W+SSOOFVQqW1YtZBCdX6PcSrSAk=; b=fK4IJHBqnAHU3Knk2nyxJdnE+xp+4FdRfFdX2BUU0bnboVL9RO1rd36juu3DspnlG2WV L1AxQkJI4OyV3WCyWZnEeDi4uAMNNryVRGYaC0PP/WV0zgEfifenvP4/yY/4YpYxaRwN 5LZAcFSJnrEappsOPd6IL2HTvoWXqypYNiz4ZcvoNTmMlmI54poL0dZeKTOFRqoYt2L/ UrNUy8lEZktusafzPgTmqj31qSU59qClabEJ+AuON/WBDyzhdmoX4ifkVbtCMYzlKeg8 OT7M+/MfylGhb64lNziXtsiGl6X0W+5ED1bJlu8sgcxUNhzf/9mESLBD+SZc0P6A/LcT TA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nqpmmmbqq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Feb 2023 23:42:37 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31ENgaoT031882 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Feb 2023 23:42:36 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; Tue, 14 Feb 2023 15:42:36 -0800 From: Bjorn Andersson To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , Sricharan R , "Arun Kumar Neelakantam" , Chris Lew CC: , , Subject: [PATCH v2] rpmsg: glink: Avoid infinite loop on intent for missing channel Date: Tue, 14 Feb 2023 15:42:31 -0800 Message-ID: <20230214234231.2069751-1-quic_bjorande@quicinc.com> X-Mailer: git-send-email 2.25.1 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: 0-z-JVApmqbwWRCs31o1ORv0m4diCl-f X-Proofpoint-GUID: 0-z-JVApmqbwWRCs31o1ORv0m4diCl-f 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-14_15,2023-02-14_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=1011 mlxscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302140203 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?1754586598215782510?= X-GMAIL-MSGID: =?utf-8?q?1757852253057113677?= In the event that an intent advertisement arrives on an unknown channel the fifo is not advanced, resulting in the same message being handled over and over. Fixes: dacbb35e930f ("rpmsg: glink: Receive and store the remote intent buffers") Signed-off-by: Bjorn Andersson Reviewed-by: Chris Lew --- Changes since v1: - Don't drop packet if the following memory allocation fails. drivers/rpmsg/qcom_glink_native.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 89c3381f06c3..b6c60bf86009 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -966,6 +966,7 @@ static void qcom_glink_handle_intent(struct qcom_glink *glink, spin_unlock_irqrestore(&glink->idr_lock, flags); if (!channel) { dev_err(glink->dev, "intents for non-existing channel\n"); + qcom_glink_rx_advance(glink, ALIGN(msglen, 8)); return; }