From patchwork Thu Dec 14 20:15:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 122024 Delivered-To: patch@linaro.org Received: by 10.80.152.193 with SMTP id j59csp7161280edb; Thu, 14 Dec 2017 12:15:55 -0800 (PST) X-Google-Smtp-Source: ACJfBosXoKr58QfL9AkshLUJ2xIvLMAmebcx03LUMPjvuTvJgmZXwK3GoJIUirGf8VupCf+g23x9 X-Received: by 10.99.4.142 with SMTP id 136mr9404147pge.72.1513282554976; Thu, 14 Dec 2017 12:15:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513282554; cv=none; d=google.com; s=arc-20160816; b=GCySZ+33yr4OaOs8JkFY5OFRuzxh83aC0U10qGIVcRDEazQykrsP2/pi1qvwW8B4CD K2dlJ2UGyVAxajB1zcfTebsv94hUZ8BKsKC+hTGXR9ZTWz3kJ+aFX8upzkcTIv5flL/8 NRABkTIdXbxVe4E1pJbx+T4rokMEtMeqSng4GkV6zWWU/TotD5WdAB2SMeGiQylDudjW ajPrCS57i3PjfKuGsJcCC8zyGaloOrtipedDfIpUsrKVBEtWOwt0i3vgPSdp2BvAK3Na ySJI0AAEYHWjPl9MV2+dGIra/9mcbyu2aCBfFZloCIFKNUAAdBEXvU8OYEwghXxZCXtJ qLxw== 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 :dkim-signature:arc-authentication-results; bh=2vCiQVdb/xY2LF7drG+ne1DRRmQfZq+kUhjOO/sVakY=; b=QsCkZXx3XYZXTzNgsTbsKw6FQEq/CNn0hbB3USU37mSxqAduDApnnUffIJmS0yPOQP Z3ELvbTs+Fr7gZ8xx2giudHQrsQRlOPQnA1jkKmL+Aq87d9E4e3Zdt4oAmaJn/qhtSbX pnN0CH93mjY4/EgDpTkxtQskxATQkGAmg+zGlaM0Q7KkQjYPmhlHrHyYxUEJ+2fT6+Kl 9AVvItM0WdclXWmBh3USZtEWtLOU6AC/+Mw3h+suRfuRit6UBPsF7a9HUEq/pTYy6nS+ +NIpYNNnmZ2KOo2GWqM9omZ6hCxOZ61dtIZIyl2smTmrM5othj8TMzeRRel3U2D3UGRA YbPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JivE4Zkv; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 k8si3686412pln.310.2017.12.14.12.15.53; Thu, 14 Dec 2017 12:15:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JivE4Zkv; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433AbdLNUPx (ORCPT + 10 others); Thu, 14 Dec 2017 15:15:53 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:44739 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752270AbdLNUPv (ORCPT ); Thu, 14 Dec 2017 15:15:51 -0500 Received: by mail-pg0-f66.google.com with SMTP id j9so4148635pgc.11 for ; Thu, 14 Dec 2017 12:15:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0h6f5oTsT3WPBV45fCBiLwGE6Pm6DtOeO/GvbBfeiJs=; b=JivE4ZkvGNu+4gZL5kD63HBEHuWOXOXEM3Ly648X4gEhJrILtrybVBqr33+DJAn316 dXziTLnDRvaFWbQhVsaYP4vxrmBddwy2Rm1ntmQ1VJxg8aIVih1f6KtpBnnyCQwn005v 26Cv2o3bx6SAdfC8eYEELmV0XgoCfy0AzhjPU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0h6f5oTsT3WPBV45fCBiLwGE6Pm6DtOeO/GvbBfeiJs=; b=pkLGlvdICM/RmiVTKAm1vJjjbuxOj91Q1sdrqxpI0VYlCWj/CixFJLasEg23lJAhXJ jLgbcM8vVLAAcas9pOmfR0s0fkzVN8Ghzd1GFlviRXn6g2viZL1g59Mz60aqYQhqdprt a94p5Wfpkl3Xszj8fYg3D7lodQkN7TiXpTMw9AJh/5s2SrcCAky517pabcgAuTe+xaNv 7blLD/thv29ehwafM0pLg3n4HKMhOY1tqstPGG6g80Dx30LDdmwe995xLYcBCMLqvgyj Nl0PtB9BpOTw1lcob131KOha+IA41T8cRNAqcpRko3PwzDTQwVKwgKBCL0VAJ3/u4yMc UJ8w== X-Gm-Message-State: AKGB3mKePITNsfQHDWcpQm3z6UyJqCVRzLDWp+s/90r06fo8x5SEtQob q4gc36q7aWyp1cpNJD6aFAD+Tw== X-Received: by 10.99.142.73 with SMTP id k70mr9738372pge.426.1513282551154; Thu, 14 Dec 2017 12:15:51 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id z86sm9676103pff.4.2017.12.14.12.15.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2017 12:15:50 -0800 (PST) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam , Chris Lew , linux-arm-msm@vger.kernel.org Subject: [PATCH] rpmsg: glink: smem: Ensure ordering during tx Date: Thu, 14 Dec 2017 12:15:46 -0800 Message-Id: <20171214201546.21942-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Ensure the ordering of the fifo write and the update of the write index, so that the index is not updated before the data has landed in the fifo. Reported-by: Arun Kumar Neelakantam Signed-off-by: Bjorn Andersson --- drivers/rpmsg/qcom_glink_smem.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-By: Chris Lew diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c index 057528e23d3a..892f2b92a4d8 100644 --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -183,6 +183,9 @@ static void glink_smem_tx_write(struct qcom_glink_pipe *glink_pipe, if (head >= pipe->native.length) head -= pipe->native.length; + /* Ensure ordering of fifo and head update */ + wmb(); + *pipe->head = cpu_to_le32(head); }