Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2279877ybl; Thu, 19 Dec 2019 10:56:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwdFRiDFS1G4/z16s3THJjkjPvId7pq/qhl1E3ugPf9qji7g6RAmswFWEhG1sJXdvWrRIhE X-Received: by 2002:a05:6830:1042:: with SMTP id b2mr10334181otp.306.1576781771901; Thu, 19 Dec 2019 10:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781771; cv=none; d=google.com; s=arc-20160816; b=p5Y8bsBd99Q0Clt5O5nI0B8bbDFxh41BKOazaB9KmoaDwKfC7xfDMRc2K3E67DFJ1p TpBbOScV+EBLSMuHq3EoEYWtWe/SeozJJMelsAIBLfloBERpaCs2JyQHprTKs3QXQDLj pjqgORk3B4Wfk1q+wKQEsRcELcZ3rwOxp4MfxgNtzScZWWP306alT8DiqAhelsV/fRvX Jd/FPy3ueLQXKbXSRToee3VbPE23lFhY/e25hXK/x+nbxqrKlO1Slc6Snk7ckJfq1a+d SJtdIaXPi1ui2cCz422iSpKAFqSpChKXVpeJ4CwvwX+bEwmzuQXhOCDmooVjtamrAefI bjzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H3FoU5hlD2wMryg7ZALqcFy7ZFo176uU0fsY+DxXOHU=; b=tLZlVM4bHImiqCA7ltYYLwV1opSFWfXwLt61+O6ENtJ1lbHcCf698QoijiaZo+/csR gP2Xctx1gtPyEvnognxpuAfpr0xLoGsdryQIyfCqCevcu4H+e4SkZ5mXpygGBeiLQsIU KiaG4B8wKSvDiTpxG9Vuwvg15n3mEheexkjtXU+mZNPG3gZ5s8cyHb3Cn7c5NTbe30Dh VUxqJxYTOtSfsPpY7nfDRVLQ3NNVB6zZPmRLY6VH2SSGLJldvcuX/lAhun2weYAZv3Eq nK5QuYbiRJpItaOJI6lsIGq9zLIOJqSKE77MKeAr+zPifrkOfZ/m1OOyzCTbrephvbhY X25w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oQpucYAB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k67si3295443oib.61.2019.12.19.10.56.00; Thu, 19 Dec 2019 10:56:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oQpucYAB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730296AbfLSSyK (ORCPT + 99 others); Thu, 19 Dec 2019 13:54:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:49430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730445AbfLSSyE (ORCPT ); Thu, 19 Dec 2019 13:54:04 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE8A2222C2; Thu, 19 Dec 2019 18:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781644; bh=iGXz/x6xZIxMlB36RE7c/0DO5szquI6BsXtST0kPL2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQpucYABzKNuxORMhyoOv6x25SAayAEYsvDr8E8J0G+IY3oxOaq2iDTFqBgkH9ZA/ mliRUjCRKMFSrLXFhqfBK60diZNOyRnA98ri3RX2UzwyRMpP1w5u18f2cQmeCYCsHA URBwQuk7IFe5Rjdhmx1Bl6n7IHSQMo5aXCOyJ7rQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Lew , Bjorn Andersson Subject: [PATCH 5.4 21/80] rpmsg: glink: Set tail pointer to 0 at end of FIFO Date: Thu, 19 Dec 2019 19:34:13 +0100 Message-Id: <20191219183101.268904080@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183031.278083125@linuxfoundation.org> References: <20191219183031.278083125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Lew commit 4623e8bf1de0b86e23a56cdb39a72f054e89c3bd upstream. When wrapping around the FIFO, the remote expects the tail pointer to be reset to 0 on the edge case where the tail equals the FIFO length. Fixes: caf989c350e8 ("rpmsg: glink: Introduce glink smem based transport") Cc: stable@vger.kernel.org Signed-off-by: Chris Lew Signed-off-by: Bjorn Andersson Signed-off-by: Greg Kroah-Hartman --- drivers/rpmsg/qcom_glink_smem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -105,7 +105,7 @@ static void glink_smem_rx_advance(struct tail = le32_to_cpu(*pipe->tail); tail += count; - if (tail > pipe->native.length) + if (tail >= pipe->native.length) tail -= pipe->native.length; *pipe->tail = cpu_to_le32(tail);