Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1280331ybp; Fri, 11 Oct 2019 11:42:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPL7kkOLBUsLETB1ktRAlOf136vEoLAyMUjIcZRNaJWe1z8mcMdzWK3FG9C+FxgFaEQz9/ X-Received: by 2002:a05:6402:b38:: with SMTP id bo24mr15416552edb.103.1570819352999; Fri, 11 Oct 2019 11:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570819352; cv=none; d=google.com; s=arc-20160816; b=UliNv2uvhq6ldT1PtY7ywwNrPICmGJNJyuTsn1MR4WUN0PJYbi38ViAwZBsxAiG02A XIn3JpaeZt7S6JGLmSX0i7rDH7PHicFdhZrNZmFHNDKjEbgsP9skNzLfZd9v0daMYl+6 xEmaq07MnNe1KDSt3wlU6ynz1C14KhO1bcbr0pi+bhFxv4tkasLexKYHBDgRFZaVugr/ 2ZgxmX1Fv9nXY4RaMdn1zQa/GmKotLJlGhUi10mB8t6qsdqLoSruT8+a0NsHpjKK1POq nXb0Mv1aqEJs9MgsCDLAGXEjRRNe6cep0YZybfB/C3aRIFYttL8LCf4TzJBiS3fV1nn0 2Ywg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lwWZ1BSEiAs6avMUbGhrgTIvNodesvQRhyRgPzlrHsQ=; b=fLpwOHl/ctQmwxwcyrArP9jD9MmgLMjZmCJg63xEGjjnhTvoEz3kK5kUqAYKBXX7Kg cWOzOp8+CRcyrWR6/vPsqb/YNWoglWXIlSonbxaaxHqucNFyZJTwIwL2VXRRdKjCZ+KM KyY2tLG6LD26ECF7+E3u8abiJf6Djag1wcX4NLG7D7TbfzRJoTjknrZkoiZeKJu7QhNY VQtV/83YoQkW3cAAv9AKoIqiUygfpnteyQGeJUskl1IJKbdQEEJisM/lr11rwuDAPfTy 1b9TRjha9iCvuKp3WIHh3/NCSF4f+FssEMSl860DZ+X6d4twZnC9aMUDSZ861ylPytUA nq2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OGEl8+OX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si5969972ejr.417.2019.10.11.11.42.08; Fri, 11 Oct 2019 11:42:32 -0700 (PDT) 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=@linaro.org header.s=google header.b=OGEl8+OX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728796AbfJKSjo (ORCPT + 99 others); Fri, 11 Oct 2019 14:39:44 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42818 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728721AbfJKSjo (ORCPT ); Fri, 11 Oct 2019 14:39:44 -0400 Received: by mail-pf1-f196.google.com with SMTP id q12so6575115pff.9 for ; Fri, 11 Oct 2019 11:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lwWZ1BSEiAs6avMUbGhrgTIvNodesvQRhyRgPzlrHsQ=; b=OGEl8+OXDAIs8vJC1UB0yr5NA4I9xd/0/Uc6k8efasx0S90iUqOOdUJdjiaZTNQpOk Z4otOBVHj6ZB05PknrEdkOUDQxIcBdkg8SmYUgX2VLIZRoQcLurAoIfkExCBhrLpQfFP F/Jzv71PvpMamtM0I7nx5+Cnx7DYmvotb5y9Lr4Byh4tw8+EboCI20DKJ+S/qLoD/ecM OTpcvvP592CAKBkzScEvOnTQ80jr7eHK4NMyGOv4bcrzWrfnqTvoxxBnWZxGLYFknbOD BM+R72yblf+mENBnsN0hapKq7yaOlVO4gE5HRSmvLWN2wdKwot/kz3MAYteXNZyn6/MR djVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lwWZ1BSEiAs6avMUbGhrgTIvNodesvQRhyRgPzlrHsQ=; b=pX0DvJZxWG6hyfB2lmcYSmGfhDp+E9Hzbyb8w/q1BKxsFVoIz239FYqf3o4FVVZ5zB tgcFMB0f2BCCXEDwyBsd4oqUhCh+DzqcV/txillzvBo+0iia4+rgn3JP6IkINWjmhGrf R3NhXYhsuD+0E73WuEAIV1sk73Db6rgi/vkqomOaaWxhcRGkojSGZqGK3DbAshxNKwxs VXkGCoG7gwfmw0i2a61VqrooukIVrP+UIHW9J6CXmNpOUQrv7Kwo0NnKuEaCEvHFHADr /C4hAwHnzY3nkm9qHeY1vWi6AvknjE/wjDERC47+aUGkwUOQWEHFnkmuw0d+oERprraa vpNQ== X-Gm-Message-State: APjAAAXyt8K4F8+Bzg6bAEN3luX5QF0MMe/Gvz1YBPPJRI2QwcYiuwI2 koReaG+GCZsJp/w1cZLpSQDYaQ== X-Received: by 2002:a63:77cc:: with SMTP id s195mr5854243pgc.147.1570819182473; Fri, 11 Oct 2019 11:39:42 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id c62sm13279165pfa.92.2019.10.11.11.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 11:39:41 -0700 (PDT) Date: Fri, 11 Oct 2019 11:39:39 -0700 From: Bjorn Andersson To: Chris Lew Cc: andy.gross@linaro.org, david.brown@linaro.org, aneela@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rpmsg: glink: Set tail pointer to 0 at end of FIFO Message-ID: <20191011183939.GA30457@tuxbook-pro> References: <1530148797-31904-1-git-send-email-clew@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530148797-31904-1-git-send-email-clew@codeaurora.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 27 Jun 18:19 PDT 2018, Chris Lew wrote: > 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. > Applied Thanks, Bjorn > Signed-off-by: Chris Lew > --- > drivers/rpmsg/qcom_glink_smem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c > index 2b5cf2790954..7a276be598d6 100644 > --- a/drivers/rpmsg/qcom_glink_smem.c > +++ b/drivers/rpmsg/qcom_glink_smem.c > @@ -109,7 +109,7 @@ static void glink_smem_rx_advance(struct qcom_glink_pipe *np, > 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); > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >