All of lore.kernel.org
 help / color / mirror / Atom feed
From: leonid.ravich@dell.com
To: dmaengine@vger.kernel.org
Cc: lravich@gmail.com, Leonid Ravich <Leonid.Ravich@dell.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Vinod Koul <vkoul@kernel.org>, Dave Jiang <dave.jiang@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Alexander.Barabash@dell.com" <Alexander.Barabash@dell.com>,
	Alexios Zavras <alexios.zavras@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 2/3] dmaengine: ioat: remove unnesesery double complition timer modification.
Date: Thu, 23 Apr 2020 00:09:17 +0300	[thread overview]
Message-ID: <1587589761-32690-2-git-send-email-leonid.ravich@dell.com> (raw)
In-Reply-To: <1587589761-32690-1-git-send-email-leonid.ravich@dell.com>

From: Leonid Ravich <Leonid.Ravich@emc.com>

removing unnecessary mod_timer from timeout handler
incase of ioat_cleanup_preamble() is true  for cleaner code

Acked-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Leonid Ravich <Leonid.Ravich@emc.com>
---
 drivers/dma/ioat/dma.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index da59b28..55a8cf1 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -922,17 +922,23 @@ void ioat_timer_event(struct timer_list *t)
 		spin_lock_bh(&ioat_chan->prep_lock);
 		check_active(ioat_chan);
 		spin_unlock_bh(&ioat_chan->prep_lock);
-		spin_unlock_bh(&ioat_chan->cleanup_lock);
-		return;
+		goto unlock_out;
+	}
+
+	/* handle the missed cleanup case */
+	if (ioat_cleanup_preamble(ioat_chan, &phys_complete)) {
+		/* timer restarted in ioat_cleanup_preamble
+		 * and IOAT_COMPLETION_ACK cleared
+		 */
+		__cleanup(ioat_chan, phys_complete);
+		goto unlock_out;
 	}
 
 	/* if we haven't made progress and we have already
 	 * acknowledged a pending completion once, then be more
 	 * forceful with a restart
 	 */
-	if (ioat_cleanup_preamble(ioat_chan, &phys_complete))
-		__cleanup(ioat_chan, phys_complete);
-	else if (test_bit(IOAT_COMPLETION_ACK, &ioat_chan->state)) {
+	if (test_bit(IOAT_COMPLETION_ACK, &ioat_chan->state)) {
 		u32 chanerr;
 
 		chanerr = readl(ioat_chan->reg_base + IOAT_CHANERR_OFFSET);
@@ -945,12 +951,13 @@ void ioat_timer_event(struct timer_list *t)
 			ioat_ring_active(ioat_chan));
 
 		ioat_reboot_chan(ioat_chan);
-		spin_unlock_bh(&ioat_chan->cleanup_lock);
-		return;
-	} else
-		set_bit(IOAT_COMPLETION_ACK, &ioat_chan->state);
 
+		goto unlock_out;
+	}
+
+	set_bit(IOAT_COMPLETION_ACK, &ioat_chan->state);
 	mod_timer(&ioat_chan->timer, jiffies + COMPLETION_TIMEOUT);
+unlock_out:
 	spin_unlock_bh(&ioat_chan->cleanup_lock);
 }
 
-- 
1.9.3


  reply	other threads:[~2020-04-22 21:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02  9:27 [PATCH 1/2] dmaengine: ioat: fixing chunk sizing macros dependency leonid.ravich
2020-04-02  9:27 ` [PATCH 2/2] dmaengine: ioat: Decreasing allocation chunk size 2M -> 512K leonid.ravich
2020-04-02 15:06   ` Dave Jiang
2020-04-02 16:33   ` [PATCH v2 1/2] dmaengine: ioat: fixing chunk sizing macros dependency leonid.ravich
2020-04-02 16:33     ` [PATCH v2 2/2] dmaengine: ioat: Decreasing allocation chunk size 2M -> 512K leonid.ravich
2020-04-15 15:53       ` Vinod Koul
2020-04-16 17:06       ` [PATCH v3 1/2] dmaengine: ioat: fixing chunk sizing macros dependency leonid.ravich
2020-04-16 17:06         ` [PATCH v3 2/2] dmaengine: ioat: Decreasing allocation chunk size 2M->512K leonid.ravich
2020-04-22 19:25           ` [PATCH v2 1/3] dmaengine: ioat: removing duplicate code from timeout handler leonid.ravich
2020-04-22 19:25             ` [PATCH v2 2/3] dmaengine: ioat: remove unnesesery double complition timer modification leonid.ravich
2020-04-22 19:25             ` [PATCH v2 3/3] dmaengine: ioat: adding missed issue_pending to timeout handler leonid.ravich
2020-04-22 19:58               ` Dave Jiang
2020-04-22 21:09               ` [PATCH v3 1/3] dmaengine: ioat: removing duplicate code from " leonid.ravich
2020-04-22 21:09                 ` leonid.ravich [this message]
2020-04-22 21:09                 ` [PATCH v3 3/3] dmaengine: ioat: adding missed issue_pending to " leonid.ravich
2020-04-23  7:21                 ` [PATCH v3 1/3] dmaengine: ioat: removing duplicate code from " Vinod Koul
2020-04-17 11:58         ` [PATCH v3 1/2] dmaengine: ioat: fixing chunk sizing macros dependency Vinod Koul
2020-04-02 16:42     ` [PATCH v2 " Dave Jiang
2020-04-02 16:46       ` Ravich, Leonid
2020-04-02 16:49         ` Dave Jiang
2020-04-15 15:52     ` Vinod Koul
2020-04-02 15:04 ` [PATCH " Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587589761-32690-2-git-send-email-leonid.ravich@dell.com \
    --to=leonid.ravich@dell.com \
    --cc=Alexander.Barabash@dell.com \
    --cc=alexios.zavras@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lravich@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.