Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7019976imm; Wed, 27 Jun 2018 18:22:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqjLem7n5XECjb6StDhXrWbzjfNReeSHaF+Cp/lv6u0mcCLqHe5Er5Y40tsDPScyHSoUEu X-Received: by 2002:a65:62d8:: with SMTP id m24-v6mr5696167pgv.307.1530148943507; Wed, 27 Jun 2018 18:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530148943; cv=none; d=google.com; s=arc-20160816; b=fTwBjDPgcrJ8xOz4wutIX4BKT4AnY/m2KBRzwcC7OXNgnDxGDIDj3XRFKOZhnABAuF UTtzLxpD8+66BDR8V2wYojBmPCCNs8NU1a5sySOHQ0ARpWLT/524ZBnR+o6a8PJoPrp6 HuXhP/weP7N1XFlkJergjFTBuOnURY7BnKwSpZBvCchS3ZSMaiEgiUhMnWf/frYW0kAQ VQXZ1Mc5F1yeqUcVMl7W6zlzlQSVcF+07KS3tzJ71ueepLfcC1/ZIfsjKtlyiwL3XiuH UBpvPo/UC4uKh5y0GzgxqQsCdwW0HPhhcPDr7NwtWtkUtJmvtTPRAX0fszCLJSBTVjee KpCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=RYRgC05gH1XQDwV0fgR0TlTx/Vd+ROOKNiZeWewXGEs=; b=UY3Y/M9VEH1cWaWFOanvMrn7YjIjP/qRpWKxPaNvDwb27gY63Sy+H3cFEWGAW/Q/QB LylGsGV65Ig5ITk2LyAji2DVGpC2RrivR9b/QRzqW56eqBaS2H3lxdTD/pzcTfEPJou0 FEncTgm7GYtMdg91cmCyRyeNrfgN8VoYrloOvNWGMjlimlyAI5h95rWaEpi/bYVJDBS0 vUzdAGZ7MCUr7qgqWzQdFsSqqkJT7zm50NwYQ3EZp+Y1W4fcoSHjUQTiLKrF9CeEbSsN kVir86nhpbaZ5k/McH4ARBTAO2TPRCBSTo2bKb6Sc97Hjn1Ztyb8xThVjY9M2RnFV4J2 /6ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=nJbZkH3Z; dkim=pass header.i=@codeaurora.org header.s=default header.b=nJbZkH3Z; 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 r1-v6si1318876pgs.566.2018.06.27.18.22.09; Wed, 27 Jun 2018 18:22:23 -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=@codeaurora.org header.s=default header.b=nJbZkH3Z; dkim=pass header.i=@codeaurora.org header.s=default header.b=nJbZkH3Z; 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 S1752662AbeF1BU2 (ORCPT + 99 others); Wed, 27 Jun 2018 21:20:28 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:34138 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbeF1BU0 (ORCPT ); Wed, 27 Jun 2018 21:20:26 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 41E3460B1E; Thu, 28 Jun 2018 01:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530148826; bh=1ae52/X0XZBW+hxISQWqv5aoUmrAd4TFJOUTk7Q9F9A=; h=From:To:Cc:Subject:Date:From; b=nJbZkH3ZKVyXl3YCbEdWPYVht+b3Qf2hHH2R7zfr0fPzGv/w0dswamHdQnRBcLvXX BUNiFlI6/VWcck95pCcUGMcnhwjG415ssEjGXjndS5nO25kpfRVHio9UANw/em1X/L TaZShnbRzmF6tmxyW//TPSM/f/Q03qo3fV4rfIvE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from clew-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: clew@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id DA23F6071C; Thu, 28 Jun 2018 01:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530148826; bh=1ae52/X0XZBW+hxISQWqv5aoUmrAd4TFJOUTk7Q9F9A=; h=From:To:Cc:Subject:Date:From; b=nJbZkH3ZKVyXl3YCbEdWPYVht+b3Qf2hHH2R7zfr0fPzGv/w0dswamHdQnRBcLvXX BUNiFlI6/VWcck95pCcUGMcnhwjG415ssEjGXjndS5nO25kpfRVHio9UANw/em1X/L TaZShnbRzmF6tmxyW//TPSM/f/Q03qo3fV4rfIvE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DA23F6071C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=clew@codeaurora.org From: Chris Lew To: bjorn.andersson@linaro.org, andy.gross@linaro.org, david.brown@linaro.org Cc: aneela@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org, clew@codeaurora.org Subject: [PATCH] rpmsg: glink: Set tail pointer to 0 at end of FIFO Date: Wed, 27 Jun 2018 18:19:57 -0700 Message-Id: <1530148797-31904-1-git-send-email-clew@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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