Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4339897pxa; Mon, 10 Aug 2020 06:59:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybdiLlgae3+sNcGquO0bcmM+pwzrVrBSHUCKQK1jn8WM0p5tXljXSokhsijrpztiXcLvYn X-Received: by 2002:a17:906:f912:: with SMTP id lc18mr5800389ejb.226.1597067974425; Mon, 10 Aug 2020 06:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597067974; cv=none; d=google.com; s=arc-20160816; b=MJg9/o2XOOeEcw+k1mO2ebWz2IdhpF7uf2oPoV5AmqE2cb9PgSZW7nnsXG4MfYDEVD 2eb/PundLCuaQkApVKj1Ljv9Uy8AKK6nKrKli1/ptXmtqEQvnG+ucqSG5l8RJxe4vclC eX4VD1thPd22QqFunMLUQ2lUzVy3CpZZEE2t9k9IQ+slKkIoTM/tEsMjCKjfd3kXnBYp +91OdI3TxWPHgKd7RBguTP4N1hkkMNKaIZH7f2hCSmnCzeEcY2e9HbvCU3MyUUchYHL+ 8sUFeybxAS4+xfPrZiA9IkUdmh+EQ8xC/n5xvHrt8MzdzwIFmW+YMjSYqSHRLgFueIBO Yy2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=vtkPoHQDvYajXGLuabMI9UoYnOmnSF7rLTIxGLOMMt0=; b=HSSkhT+AHzGBENVkBSZ70Q5tCoLnLo8kFbjdSvjzEJh19cid/P2pIwkqr3OqFijSYF nLK4DaFTTO78eeHnkNATLCcK/XViktYVytsGVLl769eHBPkF7UxIG2vZOH4ulyYJ5Y3s nNm6KlRDWbKndj7+8A88sUbo4Yddk8LakwYEpit+/nicE9tsZ7gtiUGK6BenPNgkRKa6 O/pGhXmy2p3B9BMHAERJPMdhB/tZjQxHeGMA70al4K5Elkygx76rmnt74MQ7ikR7f6oO Z12XVafHoZrQx/Y0G70MSrSt1JnhxikYmujrs5dkBr0klhGjjf6PclhMrcQaImO0/YBl JrXg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si10561954eji.684.2020.08.10.06.59.11; Mon, 10 Aug 2020 06:59:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726949AbgHJN4X (ORCPT + 99 others); Mon, 10 Aug 2020 09:56:23 -0400 Received: from mga07.intel.com ([134.134.136.100]:57142 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbgHJN4U (ORCPT ); Mon, 10 Aug 2020 09:56:20 -0400 IronPort-SDR: WaNxmwxiwkySdttbO8SGW/kGdtEbQoe1uZDZD9H+v/db/8qrJ+FTURgUMUPMVwWBxsjIvkQF7f LtOTOlVaMnbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9708"; a="217872764" X-IronPort-AV: E=Sophos;i="5.75,457,1589266800"; d="scan'208";a="217872764" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 06:56:19 -0700 IronPort-SDR: 0t9M9lMXOzK3HPE+tIyyb47C/vDYHkaxh4iEG9ZHgOOKa+dI1zioTnfx8C3pc7Lm9uXZy5/6no hUzT16+SboCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,457,1589266800"; d="scan'208";a="469052860" Received: from ahunter-desktop.fi.intel.com ([10.237.72.73]) by orsmga005.jf.intel.com with ESMTP; 10 Aug 2020 06:56:17 -0700 From: Adrian Hunter To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Alim Akhtar , Avri Altman , Venkat Gopalakrishnan , Can Guo Subject: [PATCH 2/2] scsi: ufs: Improve interrupt handling for shared interrupts Date: Mon, 10 Aug 2020 16:55:48 +0300 Message-Id: <20200810135548.28213-2-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200810135548.28213-1-adrian.hunter@intel.com> References: <20200810135548.28213-1-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For shared interrupts, the interrupt status might be zero, so check that first. Signed-off-by: Adrian Hunter --- drivers/scsi/ufs/ufshcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index d7522dba4dcf..fd006340f37a 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5983,7 +5983,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba) * read, make sure we handle them by checking the interrupt status * again in a loop until we process all of the reqs before returning. */ - do { + while (intr_status && retries--) { enabled_intr_status = intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE); if (intr_status) @@ -5992,7 +5992,7 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba) retval |= ufshcd_sl_intr(hba, enabled_intr_status); intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS); - } while (intr_status && --retries); + } spin_unlock(hba->host->host_lock); return retval; -- 2.17.1