Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp20974ybh; Tue, 17 Mar 2020 17:18:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuzfM0HVczegBVbhQKOqQsCnHFhhYeYQwgvMvyb/Ww6Vl8PkdvZmSN6RXwPPLHLVx64BaNY X-Received: by 2002:a05:6830:1d52:: with SMTP id p18mr1749333oth.204.1584490735578; Tue, 17 Mar 2020 17:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584490735; cv=none; d=google.com; s=arc-20160816; b=mu3IdfHTATjXj6dogj7MPwKGtyvrS/Sd0zBdSCAMEvsbrcvVjqTtr0RPGFg5rihPYM PpIrfpD52gJIsLUIFaqeOl6nwIaL+x38CRXqJlvfaC1uiQpqMM8tZcdFEeQShyXcdLuT F0vmhzQsobJg9uxSVmZUbwGJFcyKbws63MolL/5F18Ba3ZxounpzezpfRMgkOliZqRaV XKURbmRwgokvHvvqPBgmaxMRacZVSl0VlrtTznGpAvSAxkwHkIpbmivipbk6ZLlIfWsM RaEnvoyqC8pM2p2bMbL+AdgN/mwEBb2r9e3nY35eETj3Iw6+2cU1/lEiCg5yMEiRmsOo URmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=00i66m1wtM2+P1s/tRhqDIGUbMRLcSr0KSarPdUP5w0=; b=grlVaHIGfTwZ3YALtx53qu3uQLMUS83/LCU3Gs8rAE4jBs00Do7qaSl+MoDlCLae6T QQN2GqEX0CGfb/nUdNiiX2FJH3jYEqEWR3Wzxu+tjcYPTBw8M+6nTb/GNt9bOY9LQf9B Z+6ZeyazYTciztLtfunGT+Q6jmckMvqN0BWHT4KpyskN2oA3hSuZRxY5fj7vhqUdRrOJ w5owH5iDLCDqg/d8FXYp/ppL0pdInwmNvcOsM1rQUSMllXc5Ty9r1tmgVv3rEBxuf4Em vdV7NzbJjsCGJ1z5VjCXafa4d6h+j2XcHpxzHK6YEoD5ViqyPFX3A1O3+lKW+mYgmMrE On4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KwyMwcTv; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w79si2387708oif.21.2020.03.17.17.18.35; Tue, 17 Mar 2020 17:18:55 -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=@gmail.com header.s=20161025 header.b=KwyMwcTv; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727331AbgCRARV (ORCPT + 99 others); Tue, 17 Mar 2020 20:17:21 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44249 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727313AbgCRART (ORCPT ); Tue, 17 Mar 2020 20:17:19 -0400 Received: by mail-wr1-f68.google.com with SMTP id y2so12610245wrn.11; Tue, 17 Mar 2020 17:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=00i66m1wtM2+P1s/tRhqDIGUbMRLcSr0KSarPdUP5w0=; b=KwyMwcTvlZwqq7M8RopS1rcsR9Pl4g3h8aAWTRuCDWS/Y+PAsOCDZV89UouR8StFl8 /sMiQT1OWTZN3nSViZGALrlWN80fh+L1WbdBv/e0lMGWY4U2edaugJnZEuZ6oP7wgHbA 3w8LEef+quCgr8bHoce/njjXXsPenhxo95XM1YqdDJlQ1BZQRQ9rG1pR684o663i+/M7 jfSgPCBfcuwU114PeueZtBc2XnUZblJQT2lHXTfLfVZyceuzLiEeIfV9uOhMtuvcOeUc kf6H9C5IPaJR++D15CbHz+F6GTkRXNNTbpNQcojxqX8DYMx5ltIj0z7urfTU8NMHAO7k CnmQ== 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:in-reply-to :references; bh=00i66m1wtM2+P1s/tRhqDIGUbMRLcSr0KSarPdUP5w0=; b=nRHA9c3N9OLxFjMGpj4URTDAaKTnrBlf/7vyUq0Bu0B9DHuVadXYHDPu88imPq6DbA Rd4Do7FzI3k8SHORFj1IJJ9eRbLMu6FBlRik/ePDc37dmAvE/U2NGSMovXy1hC6TLYIj ZftgIZ1tU6zA0cbbQ2B6wojcglK5RlupAd7tZ9nkaM7kPC6bwG31pjQJxkr+0dfDQ1pY A6/k4k7BKOciR8Rfk6VJ2F3yTJ+t/Vby33WN5zeVsniH6wH+IeFGHNMZcSAI1au+Mq4N n61+BIgEOLoN6ccqW+UNHtWRlEY2VVupxqQmBsyTtn21W2R+eZmxOPbzJTVjXMovvNzB +8Sg== X-Gm-Message-State: ANhLgQ33oTR2aBwgsRJSQ2cohdEOY4ezD8nU37dZHK8QarLzxqNp/c12 mhLhNFd5JW4ZMBvrvxhlPVU= X-Received: by 2002:a5d:6150:: with SMTP id y16mr1631350wrt.352.1584490637777; Tue, 17 Mar 2020 17:17:17 -0700 (PDT) Received: from localhost.localdomain ([79.115.60.40]) by smtp.gmail.com with ESMTPSA id i6sm6584600wru.40.2020.03.17.17.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 17:17:17 -0700 (PDT) From: Vladimir Oltean To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, eha@deif.com, angelo@sysam.it, andrew.smirnov@gmail.com, gustavo@embeddedor.com, weic@nvidia.com, mhosny@nvidia.com, michael@walle.cc, peng.ma@nxp.com Subject: [PATCH v5 08/12] spi: spi-fsl-dspi: Fix interrupt-less DMA mode taking an XSPI code path Date: Wed, 18 Mar 2020 02:15:59 +0200 Message-Id: <20200318001603.9650-9-olteanv@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200318001603.9650-1-olteanv@gmail.com> References: <20200318001603.9650-1-olteanv@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean Interrupts are not necessary for DMA functionality, since the completion event is provided by the DMA driver. But if the driver fails to request the IRQ defined in the device tree, it will call dspi_poll which would make the driver hang waiting for data to become available in the RX FIFO. Fixes: c55be3059159 ("spi: spi-fsl-dspi: Use poll mode in case the platform IRQ is missing") Signed-off-by: Vladimir Oltean --- Changes in v5: None. Changes in v4: Patch is new. drivers/spi/spi-fsl-dspi.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 81e22b6eadc7..fcc6f20b6631 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -965,13 +965,15 @@ static int dspi_transfer_one_message(struct spi_controller *ctlr, goto out; } - if (!dspi->irq) { - do { - status = dspi_poll(dspi); - } while (status == -EINPROGRESS); - } else if (trans_mode != DSPI_DMA_MODE) { - wait_for_completion(&dspi->xfer_done); - reinit_completion(&dspi->xfer_done); + if (trans_mode != DSPI_DMA_MODE) { + if (dspi->irq) { + wait_for_completion(&dspi->xfer_done); + reinit_completion(&dspi->xfer_done); + } else { + do { + status = dspi_poll(dspi); + } while (status == -EINPROGRESS); + } } spi_transfer_delay_exec(transfer); -- 2.17.1