Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp364123ybb; Fri, 10 Apr 2020 01:27:13 -0700 (PDT) X-Google-Smtp-Source: APiQypIYqKaf4iNjbhyoVMrr/bozoEGeT5LVPusFifVy97YLNqR+Gk6nYSlp8TF4htCJ4dX3EvJ8 X-Received: by 2002:ac8:72cd:: with SMTP id o13mr3320625qtp.326.1586507233179; Fri, 10 Apr 2020 01:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586507233; cv=none; d=google.com; s=arc-20160816; b=Cu4H4Itj6hvqfs+drPSv22/GF8X3d32+s3hJS7ary4P2kdLGThVdrZKdaO/pWHlkxg re6p4575nqB401Pp7hqTfxhodEyCjkVXXFT1NwULpRW9f1gU3klPGH7Zvjbp+nErIdZX mvLe+B+WF8yL21mQRLMIjF6W05gqnqypt44ruBQMUT67Z9fLKI+SmzzDu+ueoyijWSNL AV4fWRJBk2iz7FwvxO0eBLrTQR78x/k3XRkhOWtiNgMYrH6jC9lOtQaH4OG3NLRDJzrY jEndu3YZs2hYsXOO/jHc/KXvFwPM3sDVDPqHx/jl0ef9mtXg54KHtNnY44+Ox0LQjeIC wM/w== 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 :ironport-sdr:ironport-sdr; bh=Z13HqteARcF3SjDdppyOnkA3blu3prE9bKxOqFDaF1c=; b=Mj8njbbwRb1y6wNAqGnVl5r7UFlbv9NvIKHXCrlmqGX3SBatnqM4wjXUa+7uFYKtIc faM5o4mOksNtf/VL6Gf5lFydFlzgC5NEkIBtV5GIqhPi8zRGK5r7nEEvFTb4nuqcp0cg uSV1jvi7U8H2ojpNasFj/rDLgZWMdrYBN8H7a0o1lsGxlTRkC5ED62gpefyh5ZF5U3OX KsfOoDctgczkDZNDMJdrSKP6PpE2CFFXbhaJ80dbvV9tQz5xg/GKsQ/ola0HgP/a+Ggp iKXg59DQqHQtWKGXqxhnii6RWB43wzqP95cz2cell84yk5vaRaETbp37FcC99fIU1O6o zBXA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si678717qvl.206.2020.04.10.01.26.58; Fri, 10 Apr 2020 01:27:13 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726203AbgDJIYr (ORCPT + 99 others); Fri, 10 Apr 2020 04:24:47 -0400 Received: from mga09.intel.com ([134.134.136.24]:58714 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbgDJIYr (ORCPT ); Fri, 10 Apr 2020 04:24:47 -0400 IronPort-SDR: N0DN82FGHIpSP2Gb04EusPYI7rI39p1GffVhtCAe9ls8i0QtMiwTmmIUhmGgpM0420tDtwXB6P BeS+KzaWdzXg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2020 01:24:47 -0700 IronPort-SDR: 4J82DjhtLJQl5YAb9QpZYCc1HHXmkr2XSVxtsqIJGROazogFMGxZu4IhH9LDJUmBlPg6y3PMoO lx3/P6QbX8Rg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,366,1580803200"; d="scan'208";a="362390975" Received: from brentlu-desk0.itwn.intel.com ([10.5.253.11]) by fmsmga001.fm.intel.com with ESMTP; 10 Apr 2020 01:24:43 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , Brent Lu , Richard Fontana , Kate Stewart , Allison Randal , Greg Kroah-Hartman , Thomas Gleixner , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] ASoC: Intel: sst: ipc command timeout Date: Fri, 10 Apr 2020 16:18:25 +0800 Message-Id: <1586506705-3194-1-git-send-email-brent.lu@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After sending an ipc command to DSP, the host waits for the reply message which will be read from SST_IPCD register in sst_byt_irq_thread() to complete the transaction. Sometimes the value read from SST_IPCD register is still the reply message for previous command instead of the waiting command so ipc command timeout happens. In an experiment we read the same SST_IPCD register again when the defect happens and found the value of second read is different from previous one and is the correct reply message. It suggests the DSP is okay but the way we read the register may be the cause. Currently the driver is using memcpy_fromio() to read the value of 64-bit registers. This function is based on __builtin_memcpy() call and depends on the implementation of compiler. Since this issue happens right after the toolchain switched from clang 10 to clang 11, we replace the register read with two readl() function calls to avoid all optimization from compiler's library. Signed-off-by: Brent Lu --- sound/soc/intel/common/sst-dsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/common/sst-dsp.c b/sound/soc/intel/common/sst-dsp.c index ec66be2..12af7aa 100644 --- a/sound/soc/intel/common/sst-dsp.c +++ b/sound/soc/intel/common/sst-dsp.c @@ -42,7 +42,7 @@ u64 sst_shim32_read64(void __iomem *addr, u32 offset) { u64 val; - memcpy_fromio(&val, addr + offset, sizeof(val)); + sst_memcpy_fromio_32(NULL, &val, addr + offset, sizeof(val)); return val; } EXPORT_SYMBOL_GPL(sst_shim32_read64); -- 2.7.4