Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1376585ybt; Sun, 14 Jun 2020 21:08:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrXNTEunYvLfy19Tffcn/lEl62JQKD8ysq2jkwgeGemo/N0WbOhw5Q8+s+ag29naEqIYRY X-Received: by 2002:a17:906:4d13:: with SMTP id r19mr23702231eju.45.1592194104232; Sun, 14 Jun 2020 21:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592194104; cv=none; d=google.com; s=arc-20160816; b=KMd7LfAY4EvTnhZayT4v2fHTiGDKQXmkCYDFTkLtxZifBiIvMSwIN/Uy1T15vLEQ+H XUAdv+pixzmu6+UGLDqomg6zH5Sj+c9eRq+wk7jNa6jtSCAGU6AV/kljHwxsrFnDTi5+ oU8vwDgar6dWVsbyp8nscm+ZJtCeGXHPRirdxjf4yA6iaqns382XLaAziqOh0xT+TyPb o7GtjcQFGOhYgq7MJzHGopZvWUmI1t0xqOsOwxlXNmUP9Q7JwwDWOHFQmgj5yYf6meT+ /LQuS2LL4QP74a+CTp6KPZFY4BrXQPsfl1ZuLwsk0u2b5y+VLDzmeXuZwbrOhjkST6Tr oVZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=14TIDfQM4sjvxFhCbCg35NzSBMoiXfw8Vj4bejq5yIA=; b=nLUL0+lzdWrBhfveSzRP4Ob+STWVqyW3IVvgKM4kAxFyavn8lzuFe5VDWQqjA9i3J9 FE2BmqlgQlTK/eNU0k6CZFGvbii4wquaA5lzwc+P8CKSZwdeCkSiw+wBTWPLUOFcNYye IfFn++zOLeA1TjpiH0MKno5AFaSKtpptRcpfkbnvl8mZX9mBjQGW5fkBMUPOJj62gPuW 5E/6iCQN/9PbdhQMc06y5bCOTYg+9LhnvicCP0XACxVUaObkR+YKVwJMJIot629kAA+F 4+X7hpDjUJogr/QT81lFBQr7wgijjb7QvTw3f5HSbKfbStbhK4mDaZOtptSwXQ/czxFc rufA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=l0Gx52Ee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si8692299ejm.8.2020.06.14.21.08.02; Sun, 14 Jun 2020 21:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=l0Gx52Ee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728234AbgFOEGJ (ORCPT + 99 others); Mon, 15 Jun 2020 00:06:09 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:50534 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728177AbgFOEGH (ORCPT ); Mon, 15 Jun 2020 00:06:07 -0400 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id F168D891B4; Mon, 15 Jun 2020 16:05:57 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1592193957; bh=14TIDfQM4sjvxFhCbCg35NzSBMoiXfw8Vj4bejq5yIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l0Gx52Eec/kBwQTSjVGM1xUEVTnOBPvth+mR/mmHeqzS2g0bsS7raeSlSODiYpT7V W4ws/XLQ8vQ9ewAcH7jdo0ADllaXeioz1Q5nh3QQ1MttwRxS4n+NFMv+J4VluNhGT2 cLJWS9knrdkCjO6ggsZ18jzofmykcZT98rgm+ZtiY3B+qPrvEmq+SgQuj5+eGnwchT +IRNrRDKwUO21kSMGf4KmfH5A5iFZxCIO6HY7Xj94lZKfP4mj62LWexSiHldtQCipY dOXKrnJGjKTXg8dXnzZJQqTv8uS5TwQR7kOZmJFoO+qIxmt5zGilQ3kUM5NRb9sNma 74UeLuJR5tYXw== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Mon, 15 Jun 2020 16:05:57 +1200 Received: from markto-dl.ws.atlnz.lc (markto-dl.ws.atlnz.lc [10.33.23.25]) by smtp (Postfix) with ESMTP id AAFB113EDE4; Mon, 15 Jun 2020 16:05:56 +1200 (NZST) Received: by markto-dl.ws.atlnz.lc (Postfix, from userid 1155) id 5B313341283; Mon, 15 Jun 2020 16:05:57 +1200 (NZST) From: Mark Tomlinson To: broonie@kernel.org, kdasu.kdev@gmail.com Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Mark Tomlinson Subject: [PATCH 5/5] spi: bcm-qspi: Improve interrupt handling Date: Mon, 15 Jun 2020 16:05:57 +1200 Message-Id: <20200615040557.2011-6-mark.tomlinson@alliedtelesis.co.nz> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615040557.2011-1-mark.tomlinson@alliedtelesis.co.nz> References: <20200615040557.2011-1-mark.tomlinson@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable x-atlnz-ls: pat Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acknowledge interrupts correctly and add support for fifo-full interrupt, distinguishing it from the done interrupt. Reviewed-by: Callum Sinclair Reviewed-by: Chris Packham Signed-off-by: Mark Tomlinson --- drivers/spi/spi-bcm-qspi.c | 11 ++++++----- drivers/spi/spi-bcm-qspi.h | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 0cc51bcda300..3753eff8a154 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -1123,6 +1123,8 @@ static irqreturn_t bcm_qspi_bspi_lr_l2_isr(int irq,= void *dev_id) if (qspi->bspi_rf_op_len =3D=3D 0) { qspi->bspi_rf_op =3D NULL; if (qspi->soc_intc) { + /* Ack BSPI done interrupt */ + soc_intc->bcm_qspi_int_ack(soc_intc, BSPI_DONE); /* disable soc BSPI interrupt */ soc_intc->bcm_qspi_int_set(soc_intc, BSPI_DONE, false); @@ -1134,11 +1136,10 @@ static irqreturn_t bcm_qspi_bspi_lr_l2_isr(int ir= q, void *dev_id) bcm_qspi_bspi_lr_clear(qspi); else bcm_qspi_bspi_flush_prefetch_buffers(qspi); - } - - if (qspi->soc_intc) - /* clear soc BSPI interrupt */ - soc_intc->bcm_qspi_int_ack(soc_intc, BSPI_DONE); + } else if (qspi->soc_intc) + /* Ack FIFO full interrupt */ + soc_intc->bcm_qspi_int_ack(soc_intc, + BSPI_FIFO_FULL); } =20 status &=3D INTR_BSPI_LR_SESSION_DONE_MASK; diff --git a/drivers/spi/spi-bcm-qspi.h b/drivers/spi/spi-bcm-qspi.h index 01aec6460108..b68e275bc721 100644 --- a/drivers/spi/spi-bcm-qspi.h +++ b/drivers/spi/spi-bcm-qspi.h @@ -48,7 +48,8 @@ enum { MSPI_DONE =3D 0x1, BSPI_DONE =3D 0x2, BSPI_ERR =3D 0x4, - MSPI_BSPI_DONE =3D 0x7 + MSPI_BSPI_DONE =3D 0x7, + BSPI_FIFO_FULL =3D 0x8 }; =20 struct bcm_qspi_soc_intc { @@ -84,6 +85,8 @@ static inline u32 get_qspi_mask(int type) return INTR_MSPI_DONE_MASK; case BSPI_DONE: return BSPI_LR_INTERRUPTS_ALL; + case BSPI_FIFO_FULL: + return INTR_BSPI_LR_FULLNESS_REACHED_MASK; case MSPI_BSPI_DONE: return QSPI_INTERRUPTS_ALL; case BSPI_ERR: --=20 2.27.0