Received: by 10.192.165.156 with SMTP id m28csp246041imm; Tue, 10 Apr 2018 20:53:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx48pH02zbfkynfG6bUdPQWKkfO/1WlbuPorHkCPi7aAqatnTwvXYBQalgsmkXfMxEd/iSx3i X-Received: by 2002:a17:902:bb81:: with SMTP id m1-v6mr3168822pls.71.1523418792008; Tue, 10 Apr 2018 20:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523418791; cv=none; d=google.com; s=arc-20160816; b=U+tB4zZ0NiR7Zhqrg6VAdp4ySYxax4C/YL1Z+i7wKxtVL0Dx+6O83g+sRTx/QCE3Nx ST8nciHOZsq1PrV4PmarLhdwlNqdW1/ndoFNZFixjNwDa6Y7iA603htKgII8KtI8a88u 1/+3SvmjIsjB54rcudXEOMwJlSOWagNNZeWrWvkHi0EdcugyG8WLlBgPlwu0k1hT0VXR CojNKVzsvHZP+sTzx8RJpqaGnPU/FzHzg0taAw62Wl0vaEdu1KMFtWR8I2lqGEGFuEK9 sDsaINduPoaDujpm5wZKC1VHdli/imxJGsZBfL5rO89805FW4vxeY2xrj8z6tjNnZ47d rN2Q== 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=FRZXncidUNRWeOgbeuv7vpJ8CsHqHN0DfZ/N7ZEKuWY=; b=G6VYoAa+1s6qm02DnqNDNkr3f+ZIez0KDOgT9VAibR8l8259+Dx53dDUsrX65Bz5bj pycIsRRNFm5Mbtz2AT63Zgauhu0utIG1pWO39WC/v5ri8M3AtmP1DEFe5Q5TDOA0ahi5 EkFl3lmQu81V7+jqD7yRabegaEZ0qlnbV9s5DhNzUCMZVTzi02P258NVhgj3meddHB3O PsJR6UPJG0L4ObQiEOI1Rb5dCybMWrr5pxpggZG7QOWO90GbQCIkp5oDnQiqSTjNlU8w 6KEZvownkxytF0FoJR2Bgfv09/fsKp/3tlKuLRGY3lYKd+PEieZF3Pb5SKfhwAZ7yVqW DGXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=ll/zRHAm; 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 g11si128125pgs.153.2018.04.10.20.52.35; Tue, 10 Apr 2018 20:53:11 -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=@163.com header.s=s110527 header.b=ll/zRHAm; 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 S1752289AbeDKDrp (ORCPT + 99 others); Tue, 10 Apr 2018 23:47:45 -0400 Received: from m12-18.163.com ([220.181.12.18]:46859 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbeDKDrn (ORCPT ); Tue, 10 Apr 2018 23:47:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=FRZXncidUNRWeOgbeu v7vpJ8CsHqHN0DfZ/N7ZEKuWY=; b=ll/zRHAmjNsQdJEbFC/ToxzYa2Ebx1rZqr ySkEADyJdKZGxJPdvFGIe/IT4IXMsbg4u40fOEGb+eiuj9NulYXSUQ+TGU00m15Y lOYKODudutsCW/5BeIeuZGvrjYUdZehzHed7QpTgGAaFiUfhPftvvoPi+HiHseuW hdkPnVEaY= Received: from localhost.localdomain (unknown [113.140.17.238]) by smtp14 (Coremail) with SMTP id EsCowACXsdBEhc1atNCREg--.17491S3; Wed, 11 Apr 2018 11:47:26 +0800 (CST) From: sxauwsk To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, sxauwsk@163.com, guojian , wangshikai Subject: [PATCH] spi: cadence: Add usleep_range() for cdns_spi_fill_tx_fifo() Date: Mon, 9 Apr 2018 19:16:50 +0800 Message-Id: <1523272610-49116-1-git-send-email-sxauwsk@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: EsCowACXsdBEhc1atNCREg--.17491S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw1rtF1kuw1UZF13Zw47Arb_yoWfAFbEvF 1UAws7Gay5JF9FyFy29rsrZryjva1Fqr1kuF1qqas8JwsrZan2vrn5Zr1DKw17Zw4UuFnx Zr1vga4DArsxKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRRJ3ktUUUUU== X-Originating-IP: [113.140.17.238] X-CM-SenderInfo: 5v0d34lvn6il2tof0z/xtbBZA8lJlQG-7C1lAAAsU Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of xspi work in busy condition, may send bytes failed. Add one bytes delay Signed-off-by: sxauwsk Signed-off-by: guojian Signed-off-by: wangshikai --- drivers/spi/spi-cadence.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c index 5c9516a..66ae055 100644 --- a/drivers/spi/spi-cadence.c +++ b/drivers/spi/spi-cadence.c @@ -313,6 +313,12 @@ static void cdns_spi_fill_tx_fifo(struct cdns_spi *xspi) while ((trans_cnt < CDNS_SPI_FIFO_DEPTH) && (xspi->tx_bytes > 0)) { + + /* When xspi in busy condition, bytes may send failed, + * caused communication failure so add one byte delay + */ + usleep_range(10, 20); + if (xspi->txbuf) cdns_spi_write(xspi, CDNS_SPI_TXD, *xspi->txbuf++); else -- 1.7.9.5