Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp519852pxx; Wed, 28 Oct 2020 10:10:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQXscWll4JiG+3YQjzeN69d4C7nJHXkr9Fnnvr2H4Q4Q7ij5RrvoNCkyyW76Lbw6d337Xs X-Received: by 2002:aa7:cc84:: with SMTP id p4mr8641728edt.97.1603905037990; Wed, 28 Oct 2020 10:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603905037; cv=none; d=google.com; s=arc-20160816; b=sqqHbw+PRXES0mg1IaoCcWMYGkefbovEmNB2CuaG5k+q/XX7TVoqSJpNweptAq9q0f Dn6ywjnDfs6etRjBp47BQtHD2BQEiHI+PWZ1GDrhoJwXKMQBDEpeMS/EbuyIpWf13vyq JDi0vZSzgMMRNK4u/U6SLxyexHFKvUXtlfvL6pdzq2jFwc3r75FVTkxNs+bafEl2tBFf rCohlzYeftdyItzdcb+taRnVxsWSVeB8CjGseXKd8qlS0evPynPeWZVOcnUJ7O8WsvOv BvwcFFHntZHF6YL5gqXRsQjDuRN7g+dCH6bxR7UiTAN4VgWDKJvRB1IWd+Dn17GsWHv2 DVtw== 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=+wKxHWBVziAIdTwpN06kXDwGSpVS83RNxZLy8uFvgQk=; b=RrKK4mrHk/vB+Zr7KNppTnFBtlM72vMx3F3pqlh8v++89cWBue7dgp4bxtErMcMnlV HnmRVQewDUKr6eq2LyxJ1iNTFWn+QXOvhM1Aa2zg5Tb0k7wtDf9WGG4ASMvsGizhHpa6 k3/CZ9pz3aE4GLwFXa9QIdY/PPUWmydbL+wF8HqqVKCfFHgzDXVODRV7RFQ63eJC9NaX CTn8MwTX4jb/Bnk4VolWR3X0jRtmvHE9K/KCAUcjFEogUpJeb2XbPIJpf+fPJyYsrk0Q t/6PGD4AAdGdEkCy8No5R8GbnlOH0jmpzMEZjpTuEeptH+r+B/toPPOUHbkM8afeLSY6 zi4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vykwPpqE; 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 m26si11386edq.372.2020.10.28.10.10.09; Wed, 28 Oct 2020 10:10:37 -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=vykwPpqE; 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 S1820165AbgJ0RdX (ORCPT + 99 others); Tue, 27 Oct 2020 13:33:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:36382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760974AbgJ0OhX (ORCPT ); Tue, 27 Oct 2020 10:37:23 -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 0251922264; Tue, 27 Oct 2020 14:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809442; bh=fx7nSc4+HAA+ZI3A8vS+yupNxWF316MaiDraXpmIKTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vykwPpqEitKzQ4QRd3iwk7y3TovE/5/ACir9ZZ3yixC/hQIZAUhDTFysdQAppQsIH kMj8jDSHe3wWWXy2v7qWk3C8XD7TLz7LF/O5cKwiZ0GP/kw2pgLQOXeKoc4gA0y91B H71izEAdisp9OdoW9KPkLFiKY8KKpKdZhHOPDQvg= 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 5.4 198/408] IB/mlx4: Adjust delayed work when a dup is observed Date: Tue, 27 Oct 2020 14:52:16 +0100 Message-Id: <20201027135504.284490872@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 b591861934b3c..81d6a3460b55d 100644 --- a/drivers/infiniband/hw/mlx4/cm.c +++ b/drivers/infiniband/hw/mlx4/cm.c @@ -280,6 +280,9 @@ static void schedule_delayed(struct ib_device *ibdev, struct id_map_entry *id) if (!sriov->is_going_down && !id->scheduled_delete) { 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