Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4580656ybl; Wed, 22 Jan 2020 00:26:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzpnME/IezG17xPhAVIB79Lv0rqrhR9dKsxNjXHOSJk0tXjA9U+yvCt5mOGLBwEu0kYfAwH X-Received: by 2002:a9d:53cb:: with SMTP id i11mr6676073oth.158.1579681565498; Wed, 22 Jan 2020 00:26:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579681565; cv=none; d=google.com; s=arc-20160816; b=bdcO2TJGlixMruvmliov65jACtD39H69aqKSmAXlbzE+NY3ewnVrPasU8H9/feC70A wlpVeyGXrvAdvyvl0d2RJ+Fk3/rTWQJR1S/ENgs9a0vagW605iMjU5VeJ1RvGsK/i+gH QZKmgm1LA+sIt7yVlILuULLSBp65e0a0tQS3qle1xX90Zj8m0ZD4FHQx//a0Pw7Exj2o SgHwyvDlbysxPqVTvj0PGX084mIcdbyNB31zS+e+NM+1cfl9th8NRn2uyVXH806lFzjb dc29UIPs7vSF5pnZaFlgy1oB+RDcO/Zov+oz0ygvYm0ROJ3EgenvsdAzCYffZT783FG7 vlow== 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; bh=nD1uDpoY7on6/qYV0kLzeZEptmi3C0Urt07mALi0s8k=; b=e825CXmapat9mvrYaLwC9YwJrZg8bLuv6mhtaY/x972QuW7cZPpez4le2temMezcbA dyk9A74kUC2P3FdFJ+K2O+Lu5V+hwDm3gKhJlzaC1oULvXD3PLlSde3cnWkg7pQYfOMs v0Kd7wgxIql2rsSn1Mf7eUAMTzokmVHDepwGnGZD+RXGD4qqohrTpl713wVck3uUDOsf CNA3TBpV0FgJDM7ojYXFE/yrDTVifU2UTjE+jY3Y1fCufyH/d/80+PWiUcallXOsO09p AJT63x9lal21cTyflVEpySETxwXAxsorGGYhTMlj4HmPqEwrvMg86hhe3xHrei8cvEyS L2pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Wui+LGph; 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 x5si21356813oic.72.2020.01.22.00.25.53; Wed, 22 Jan 2020 00:26:05 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Wui+LGph; 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 S1729160AbgAVIYb (ORCPT + 99 others); Wed, 22 Jan 2020 03:24:31 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:44227 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbgAVIYb (ORCPT ); Wed, 22 Jan 2020 03:24:31 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1579681470; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=nD1uDpoY7on6/qYV0kLzeZEptmi3C0Urt07mALi0s8k=; b=Wui+LGphn+mABh89XdojXbRNTJRVAcJMKVB14bsO+K9juJ3vf/OKLE61ILht2ZvO/6hyPj6U FjPK5dUtMCmfpw5niq29owuOU/jipkzf2T+HbhneRAMXcwJwZS6K14LaARrHxtt9dp6wqEQz yUBNJpFeL9j8QIAgHdjtdwjPspU= X-Mailgun-Sending-Ip: 104.130.122.25 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e2806bb.7f195737fc00-smtp-out-n02; Wed, 22 Jan 2020 08:24:27 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C7B28C433CB; Wed, 22 Jan 2020 08:24:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela) by smtp.codeaurora.org (Postfix) with ESMTPSA id 30FB2C433A2; Wed, 22 Jan 2020 08:24:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 30FB2C433A2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: bjorn.andersson@linaro.org, clew@codeaurora.org Cc: Arun Kumar Neelakantam , Andy Gross , linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] soc: qcom: aoss: Read back before triggering the IRQ Date: Wed, 22 Jan 2020 13:54:13 +0530 Message-Id: <1579681454-1229-1-git-send-email-aneela@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 In some device memory used by msm_qmp, there can be an early ack of a write to memory succeeding. This may cause the outgoing interrupt to be triggered before the msgram reflects the write. Add a readback to ensure the data is flushed to device memory before triggering the ipc interrupt. Signed-off-by: Arun Kumar Neelakantam --- drivers/soc/qcom/qcom_aoss.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c index fe79661..f43a2e0 100644 --- a/drivers/soc/qcom/qcom_aoss.c +++ b/drivers/soc/qcom/qcom_aoss.c @@ -225,6 +225,7 @@ static bool qmp_message_empty(struct qmp *qmp) static int qmp_send(struct qmp *qmp, const void *data, size_t len) { long time_left; + size_t tlen; int ret; if (WARN_ON(len + sizeof(u32) > qmp->size)) @@ -239,6 +240,9 @@ static int qmp_send(struct qmp *qmp, const void *data, size_t len) __iowrite32_copy(qmp->msgram + qmp->offset + sizeof(u32), data, len / sizeof(u32)); writel(len, qmp->msgram + qmp->offset); + + /* Read back len to confirm data written in message RAM */ + tlen = readl(qmp->msgram + qmp->offset); qmp_kick(qmp); time_left = wait_event_interruptible_timeout(qmp->event, -- 1.9.1