From patchwork Tue May 17 08:41:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 573445 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1f0e:0:0:0:0 with SMTP id hs14csp200512mab; Tue, 17 May 2022 01:42:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc0Do+3YflFPmBcj8XX1wAuGFHCOXRxv89Z3o7+4O8Jx7qwA/3gEit9pJfCtCSkFRmQUlk X-Received: by 2002:a17:906:4fd1:b0:6f3:be23:7ad5 with SMTP id i17-20020a1709064fd100b006f3be237ad5mr19003212ejw.264.1652776933419; Tue, 17 May 2022 01:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652776933; cv=none; d=google.com; s=arc-20160816; b=C2QgwlCLPKXtekIqA/dnYu7QGTvKSuBqIOAlVMbfxYo3WxBlC7KIsuIwzBBYXnW4lL MDxcc8sECYOLlxeoiXKEfDLsnbVvdkUzhNqDAC/JrayhKsTL64dAMR6GPENrdzmUaDYx up6BGjxbyeyxlBBf/UeBeEojWD2M6c1T8ztBJL6NDIFpbgvQFIbEuChDxN8R3ntcE8gT X1nCzMFWIPP1BGR042eW463LLkcVcnH6O3lUDQ79DwrUHNbw8B5HdZrfNPolGGN385Aj EpFCav4rredCA40JV/uCb5OxPvCLx0OAQp3CmbaZXaIL5H7YuzWhmQvpVcKGwD5z+DoK atSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=+VJkz3r+HT0aPk4dOt6gTTKx498b4iUa89FhychMvAE=; b=RgmTkCi8J/OlEnI5id+KUyNsFeV0ZYxsQNhzTW3BxmbB4h/8x/WMwhHVk6iSVVUXJG Pcw2LK/MqykhwdtcBW5YVUBfZ76FAsOk4uYV0pWoZQ3j7RVqs4/PL5/+34sFXUr4cPXI RQtRv4+DQJgMNNJ5zmQ7PP/I/fn3DdgEbmX4s6gfhzX5kjp9ENzLYfXN/eUst3XC8zSK 7yIY0M0W6DefIg4fwmnMRLrGRkUMLguUvbocry1pNIR8P6oVF2weunTllmxHvf43nUXl hXQarOF3kfwUf3xM9oLLFu01C9WMNB7nZfIzac6MMbumEtTj6yrkig1F2WVAyC+LMNKp V9ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PMcIXeRk; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id f13-20020a0564021e8d00b00427db9c8ee3si14907984edf.283.2022.05.17.01.42.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:42:13 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PMcIXeRk; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D2A258426A; Tue, 17 May 2022 10:41:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PMcIXeRk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26D1F803C8; Tue, 17 May 2022 10:41:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 296448421F for ; Tue, 17 May 2022 10:41:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pf1-x436.google.com with SMTP id a11so16305526pff.1 for ; Tue, 17 May 2022 01:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+VJkz3r+HT0aPk4dOt6gTTKx498b4iUa89FhychMvAE=; b=PMcIXeRkpNWnlYa/LsJFvU2QdinGUdJ3Bcr+IaVWG1zQdw1zyhrVYgkpVxHo+6VXC2 gwpX8bLJWXi+hR9ucDb6FmMEsd98EvyJJwlsxXVtdAJypyVb1uFms62Wk/e+ToeoiX/6 V76/cQsZ5eZBluS42LPHzhXkwqgvGMVfwvVTOWE6z+KEAQ8vK0gNl2Qbv9/y/HDMAkRP uEruylMRXQxsUllh6G6NZB2sEneuR+bbACTTOkdHrK0FVssdpRc2k1Lx1AoL5wewarZl BbiVBtgMxr83Of2sXydC+PxxevAQgVh40KibCOSmby7WkPJd9ST5QZvOGJyOZhKlmWGy j+Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+VJkz3r+HT0aPk4dOt6gTTKx498b4iUa89FhychMvAE=; b=vgRCnNQ43MQ9ruYKtN48iDsLCYler+y+pnQPNxt9ayehOhMfDJ7kRhF5Ie8WBjTNLt fdwrBOVQC244t/opi/ik6+gBIhxsZWPo6dJZaHvWwWSIjejah8mFV++8dg5ZscztF11Z br9fBWI1qQKVYMKc5QfZ0LL81X5CzWV1R3y0LPUnEYFWUuGBZGVs39ytNjgEJz2rsUVa MtAfQaQIskqMR815FzNoq3aqDj1feDokvBVbUosE/k47KO3U2TwiWVonzQ7MpT7eMceR AC5BLl5PjhBSQJotS6MbeQoaz2ZgUj9iSgzOelZ0KuoMjTcX0K9U4xFqPF2hk+eRSknS Pj/w== X-Gm-Message-State: AOAM533/PA6gNEc+xCPnjxxYhzyCwXAZN3vbhoMu4fmvnqwFNqEHyPgJ V/3b62Nvb9sAop2EsRp116GZNx6u0jP9Lw== X-Received: by 2002:a63:1b62:0:b0:3f2:5438:e553 with SMTP id b34-20020a631b62000000b003f25438e553mr11083613pgm.4.1652776892467; Tue, 17 May 2022 01:41:32 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id s200-20020a632cd1000000b003f5912ba179sm741569pgs.58.2022.05.17.01.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:41:32 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Jassi Brar , Satoru Okamoto , Masahisa Kojima , Jagan Teki Subject: [PATCH 3/4] spi: synquacer: DMSTART bit must not be set while transferring Date: Tue, 17 May 2022 17:41:38 +0900 Message-Id: <20220517084139.6986-4-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220517084139.6986-1-masahisa.kojima@linaro.org> References: <20220517084139.6986-1-masahisa.kojima@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean DMSTART bit must not be set while there is active transfer. This commit sets the DMSTART bit only when the transfer begins. Signed-off-by: Masahisa Kojima Signed-off-by: Satoru Okamoto Acked-by: Jassi Brar --- drivers/spi/spi-synquacer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c index f1422cf893..5e1b3aedc7 100644 --- a/drivers/spi/spi-synquacer.c +++ b/drivers/spi/spi-synquacer.c @@ -330,9 +330,11 @@ static int synquacer_spi_xfer(struct udevice *dev, unsigned int bitlen, writel(~0, priv->base + RXC); /* Trigger */ - val = readl(priv->base + DMSTART); - val |= BIT(TRIGGER); - writel(val, priv->base + DMSTART); + if (flags & SPI_XFER_BEGIN) { + val = readl(priv->base + DMSTART); + val |= BIT(TRIGGER); + writel(val, priv->base + DMSTART); + } while (busy & (BIT(RXBIT) | BIT(TXBIT))) { if (priv->rx_words)