Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345269

[PATCH v5 02/15] scsi: ufs: avoid spurious UFS host controller interrupts

From Yaniv Gardi <ygardi@codeaurora.org>
Newsgroups linux.kernel
Subject [PATCH v5 02/15] scsi: ufs: avoid spurious UFS host controller interrupts
Date 2016-02-28 14:40 +0100
Message-ID <r79JO-30M-53@gated-at.bofh.it> (permalink)
References <r79JL-30M-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When control reaches to Linux UFS driver during UFS boot mode, UFS host
controller interrupt status/enable registers may have left over
settings.
In order to avoid any spurious interrupts due to these left overs,
it's important to clear these interrupt status/enable registers before
enabling UFS interrupt handling.

Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>

---
 drivers/scsi/ufs/ufshcd.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index a8e42df..de7280c 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5837,6 +5837,21 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
 	init_waitqueue_head(&hba->dev_cmd.tag_wq);
 
 	ufshcd_init_clk_gating(hba);
+
+	/*
+	 * In order to avoid any spurious interrupt immediately after
+	 * registering UFS controller interrupt handler, clear any pending UFS
+	 * interrupt status and disable all the UFS interrupts.
+	 */
+	ufshcd_writel(hba, ufshcd_readl(hba, REG_INTERRUPT_STATUS),
+		      REG_INTERRUPT_STATUS);
+	ufshcd_writel(hba, 0, REG_INTERRUPT_ENABLE);
+	/*
+	 * Make sure that UFS interrupts are disabled and any pending interrupt
+	 * status is cleared before registering UFS interrupt handler.
+	 */
+	mb();
+
 	/* IRQ registration */
 	err = devm_request_irq(dev, irq, ufshcd_intr, IRQF_SHARED, UFSHCD, hba);
 	if (err) {
-- 
1.8.5.2

-- 
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 00/15] add fixes, device quirks, error recovery, Yaniv Gardi <ygardi@codeaurora.org> - 2016-02-28 14:40 +0100
  [PATCH v5 03/15] scsi: ufs: implement scsi host timeout handler Yaniv Gardi <ygardi@codeaurora.org> - 2016-02-28 14:40 +0100
    Re: [PATCH v5 03/15] scsi: ufs: implement scsi host timeout handler Hannes Reinecke <hare@suse.de> - 2016-03-01 08:40 +0100
      Re: [PATCH v5 03/15] scsi: ufs: implement scsi host timeout handler ygardi@codeaurora.org - 2016-03-01 14:30 +0100
        Re: [PATCH v5 03/15] scsi: ufs: implement scsi host timeout handler Hannes Reinecke <hare@suse.de> - 2016-03-03 08:30 +0100
          Re: [PATCH v5 03/15] scsi: ufs: implement scsi host timeout handler ygardi@codeaurora.org - 2016-03-03 10:20 +0100
            Re: [PATCH v5 03/15] scsi: ufs: implement scsi host timeout handler Hannes Reinecke <hare@suse.de> - 2016-03-03 14:00 +0100
  [PATCH v5 08/15] scsi: ufs: make error handling bit faster Yaniv Gardi <ygardi@codeaurora.org> - 2016-02-28 14:40 +0100
    Re: [PATCH v5 08/15] scsi: ufs: make error handling bit faster Hannes Reinecke <hare@suse.de> - 2016-03-01 09:00 +0100
      Re: [PATCH v5 08/15] scsi: ufs: make error handling bit faster ygardi@codeaurora.org - 2016-03-01 11:00 +0100
        Re: [PATCH v5 08/15] scsi: ufs: make error handling bit faster Hannes Reinecke <hare@suse.de> - 2016-03-01 11:10 +0100
  [PATCH v5 11/15] scsi: ufs: handle non spec compliant bkops behaviour by device Yaniv Gardi <ygardi@codeaurora.org> - 2016-02-28 14:40 +0100
  [PATCH v5 02/15] scsi: ufs: avoid spurious UFS host controller interrupts Yaniv Gardi <ygardi@codeaurora.org> - 2016-02-28 14:40 +0100
    Re: [PATCH v5 02/15] scsi: ufs: avoid spurious UFS host controller  interrupts Hannes Reinecke <hare@suse.de> - 2016-03-01 06:20 +0100

csiph-web