Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp186902pxx; Wed, 28 Oct 2020 02:05:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMF5dohLGHYTJjkkn2SwCur3dWlFuQrmVH1KdKmv/XaCJjzqwUVrkHlX1IvQme78MQo7ab X-Received: by 2002:a17:906:d86:: with SMTP id m6mr6181420eji.331.1603875954528; Wed, 28 Oct 2020 02:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603875954; cv=none; d=google.com; s=arc-20160816; b=Qe9J1oBndS9E3T9wIS7EuVIexmJKIW2HWQ7aEhJVaV32LSdRRO3UkM0SkDF3tUq+lB Gp7Pilgs9Tg3Gw+h0aYVG3tJMgdMQDnTqdjUJIKaQE+EmsRPd2d7MCcj+xj1sYUjQY21 Xs0Nq28+UNZjTvuLhc+74nW9JhudswOiHCV6c6sbZ4oCj3NumSFc5h3BRJn8utUz5jt8 5HMZH214AMIBvA1m93xrQBIRo0iKqaOvk5ZFxmt5qndeP1owFJcshh7732LgG/NnacwQ N18TJo13r/0kNW65uqP/HZgIBbOA+IpOX5w11DRvGshzZhPZPveN5zaRgkaPN9llOpEz IBSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zf17WFm7gFNB7qUS6Komnc/ptlQUoQXby3ozbEhU7wM=; b=L9ZqhFZYJkcsi+5u6ujnNu0OT9pBiLsArHqL6i0aU3sackZwKEn3ms7Skoc5FIvozG 9jDbPYTED7PcKSo+QkohxZaWmG/IuMa5jwDYxTjztqe6wGr23aNQFmtuLfKQtvLwpZFH hdahsjVbZFEpbqe/zguwa8oC56f4v6kzqgqgTq/4TLJsWysox8vQf7/ulq/76t1NL/x0 I1wzIgUfNPok4qy4ZDgF+FTa9QQlkPVXidkak+lcmh37Gz32x7ASAlB78F33GzjzZuVn d2+xWc8ojwLUq4uRgBkz/E+JOdT2MDHUE1x/7zymlFQkCgAZm1bMzDpaLkm8Pa7Ez2N7 fxfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZiryTk0v; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg14si2653130ejb.82.2020.10.28.02.05.32; Wed, 28 Oct 2020 02:05:54 -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=@kernel.org header.s=default header.b=ZiryTk0v; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757054AbgJ0OQB (ORCPT + 99 others); Tue, 27 Oct 2020 10:16:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:33016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756200AbgJ0OL6 (ORCPT ); Tue, 27 Oct 2020 10:11:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98C19222D9; Tue, 27 Oct 2020 14:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807907; bh=XJf9VMU+5vhlCRLTZv/L7ZaAPvTxzT6R+7fdEzE52QQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZiryTk0vrmozMBlMbvzJ/zTs1YQxm7bp4pShtUEczaEM8giGodjMst6vc+DH1edgX iqOEoOTzyQbZS53+54xvPs1MryyiwzIk8UuyrCVVVXPSaaW0Jg+Tlaql7HnCyF7ugd 1Q4puF2OAFX0P9GROAY2Fi0crLyJEQ8JGVt2JzBo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?H=C3=A5kon=20Bugge?= , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 086/191] IB/mlx4: Adjust delayed work when a dup is observed Date: Tue, 27 Oct 2020 14:49:01 +0100 Message-Id: <20201027134913.829072148@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Håkon Bugge [ Upstream commit 785167a114855c5aa75efca97000e405c2cc85bf ] When scheduling delayed work to clean up the cache, if the entry already has been scheduled for deletion, we adjust the delay. Fixes: 3cf69cc8dbeb ("IB/mlx4: Add CM paravirtualization") Link: https://lore.kernel.org/r/20200803061941.1139994-7-haakon.bugge@oracle.com Signed-off-by: Håkon Bugge Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx4/cm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/cm.c index 8c79a480f2b76..d3e11503e67ca 100644 --- a/drivers/infiniband/hw/mlx4/cm.c +++ b/drivers/infiniband/hw/mlx4/cm.c @@ -307,6 +307,9 @@ static void schedule_delayed(struct ib_device *ibdev, struct id_map_entry *id) if (!sriov->is_going_down) { id->scheduled_delete = 1; schedule_delayed_work(&id->timeout, CM_CLEANUP_CACHE_TIMEOUT); + } else if (id->scheduled_delete) { + /* Adjust timeout if already scheduled */ + mod_delayed_work(system_wq, &id->timeout, CM_CLEANUP_CACHE_TIMEOUT); } spin_unlock_irqrestore(&sriov->going_down_lock, flags); spin_unlock(&sriov->id_map_lock); -- 2.25.1