Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3936912pxj; Mon, 21 Jun 2021 09:45:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq2AE4FbtxBucyvoA2d7B/8fB02uUKtCvjxPNyLcG73tO1bgvp8BdacccBWfwm1TXZ+9qA X-Received: by 2002:aa7:db03:: with SMTP id t3mr19234333eds.153.1624293902991; Mon, 21 Jun 2021 09:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293902; cv=none; d=google.com; s=arc-20160816; b=mFEC9O5Dk2JTWzdC8UmPEihLBxfTc8h3/S1rrAaNUPf+vLAXKHPbUGXtkAt/nUn7sH rE/TAE7SNAlS7aPa2xZgtSET0QCY3oMrEkLcdxYj+1b2XRLUpcmdMEQL3I59cGQC7O5F LyIxqt3bD7gV3HQK8c2MbcqaNsi/0lW0FNbW2se5cCLllGgAAF/bOppqHuN9Wo1jDFCC S7d8JPNF8IBpSapiEVqAiomY4VNYFXkQ1PzNrdIDynWinyQcjkhBn/O8USw11xQZnhjw rxTmeHpyEU/4dmeSlJmRDtyj9iAvxjlVOhP6Xh1nzw9rmN/+HD5EhUTMvfsAXHjJGpZd OJgg== 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=AEqmadG0RVqpCmL04F6ihBeSgfPyco6wIKknPnW8HSg=; b=cPyRB53LR4tWvfeCBTdCnmaH36zy1qhtOIjYFAbmW9gi1d4AlN8N1j6+k3uJw8Y+hB T7eNfQsPZPICBAkNdYRR96LXnS3IzJKmXo5qnIfdBuareGZWsP5hXAP/aogFYD86WtTe t5QN+h+Gq+zNEJD8HzQiSbqGGXXFEOo96fmVEP/1EiEDoim0PZ8Pew3exbMtghUWJH0a QcleObWDnyJSjIp2l18/dqHqOMr+bOkg4Ojc5Ud7VrpiRf2evWJcEPQ8CKGb59G1Setz fcms425euahYdX9IOoBHeIcx6JFwayoC0fXudbWzXLxW+lT5yzPahWkaEF2osROt1l+3 yEvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rVt068Ax; 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=pass (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 h3si7982294ede.590.2021.06.21.09.44.40; Mon, 21 Jun 2021 09:45:02 -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=@linuxfoundation.org header.s=korg header.b=rVt068Ax; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231341AbhFUQqC (ORCPT + 99 others); Mon, 21 Jun 2021 12:46:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:33868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232689AbhFUQlN (ORCPT ); Mon, 21 Jun 2021 12:41:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BBAC66143F; Mon, 21 Jun 2021 16:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293035; bh=gWLfIzXJZK4LxcX4VlDVRxc7ggcOR+XhL+IFOjhYs8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rVt068AxKA85fLeCM34KGfwzrbhsM+hrR6fH0111kLEhoTQc0hcbK15eK7rWei1HW tr6GRYFjtX9wHsm/tmAxRH2qSqzrNUNUNhY9JQyKgHOb9iS75CnBILGSAk6UVNfZRe m+IL9zzRcXHb4d8WuuSyrC8Zwdx9sks+tcX06pIg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Parav Pandit , Vu Pham , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.12 075/178] net/mlx5: SF_DEV, remove SF device on invalid state Date: Mon, 21 Jun 2021 18:14:49 +0200 Message-Id: <20210621154925.128806325@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@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: Parav Pandit [ Upstream commit c7d6c19b3bde66d7aebbe93e0f9e6d9ff57fc3fa ] When auxiliary bus autoprobe is disabled and SF is in ACTIVE state, on SF port deletion it transitions from ACTIVE->ALLOCATED->INVALID. When VHCA event handler queries the state, it is already transition to INVALID state. In this scenario, event handler missed to delete the SF device. Fix it by deleting the SF when SF state is INVALID. Fixes: 90d010b8634b ("net/mlx5: SF, Add auxiliary device support") Signed-off-by: Parav Pandit Reviewed-by: Vu Pham Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c index 90b524c59f3c..c4139f4648bf 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c @@ -153,6 +153,7 @@ mlx5_sf_dev_state_change_handler(struct notifier_block *nb, unsigned long event_ sf_index = event->function_id - MLX5_CAP_GEN(table->dev, sf_base_id); sf_dev = xa_load(&table->devices, sf_index); switch (event->new_vhca_state) { + case MLX5_VHCA_STATE_INVALID: case MLX5_VHCA_STATE_ALLOCATED: if (sf_dev) mlx5_sf_dev_del(table->dev, sf_dev, sf_index); -- 2.30.2