Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3490459pxf; Mon, 29 Mar 2021 03:50:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR+j/EYGG89CnWw8bkSHY9u8Zj4dmaYN4MMM2i+zjjGtsU84+3vGFeoMDEKpY1blyxEjNq X-Received: by 2002:a17:906:5611:: with SMTP id f17mr28037317ejq.208.1617015039610; Mon, 29 Mar 2021 03:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617015039; cv=none; d=google.com; s=arc-20160816; b=g58OyZQ4TExwepGUFJPLBghjw66W4bGUE4ND6+f4d9xFP3SiLZ6xEI4BKLQ+qzMrlv kUoO4jpN0FIyWyTyDRTjtNxOBmdRi540VlW1e+52rOF3lKceTgGb//cJIQg2SQLsnPo9 FHS/uleV23zIkpYNsCaLneUSJe8Bhc4lhTSPIdaYAxWfC4+LIcgPNMX5ivZA4TNxNCW1 TbMyb1SmYcg9BwW0fUcDEGKo/5VmcF8BL0MLGmRIGSV/EulGI/wM5/jd2CZo9pi9tz56 TKbTOz9DTCV0BXcHx0b2FSSd4Q3VmKEizU/p7NxBfjq69XwQ+YgU6RyqQT+nd+TR883Y qftw== 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=FgQ0CEfL3itRZzwGDPogjCbCtgHxNn/dvQkZeTnF3BA=; b=N/58EBrsiMqC/jFWLsZgtdssSuNyQrzNcCwnX9tRYdJQf//z4eQscK2oq0GA4DbFYj NXoHHLxrhd3nBIgfcKQ2fwZcZ5+lcaaZYaffh/hyVEN6PwPfESlP//oT3s9F2GDACYol toaHO94+kyEZt8MZp4sSRA6RT7VBh3bVWjToJkRjvrgPuV6FC6LSXb8lFGVCoFr2zXln gdgG9FRf73xlwbnSYCxAC2YR5Uqj8B2EpltKIY/a9XJaaSWcChgzG6JzkpGx8TYO6Lq3 3d7WBnmo22hbCU+jDizxoIwHhay/tz/LIpoiCuVusV8+R5TUkfPe6nYv3TYMgOXrpA+O jT8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y6fEpJcJ; 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 jl16si13489078ejc.330.2021.03.29.03.50.17; Mon, 29 Mar 2021 03:50:39 -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=y6fEpJcJ; 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 S234301AbhC2Iiw (ORCPT + 99 others); Mon, 29 Mar 2021 04:38:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:40044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbhC2IXP (ORCPT ); Mon, 29 Mar 2021 04:23:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5333B61878; Mon, 29 Mar 2021 08:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006194; bh=szo+i99XAlECFY6ZOW5TvB0FQPM9zL/u94zq0Ht52IE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y6fEpJcJPpghxL3/W3FVo1v8Wonqv2WTSWUow838A1uyb91rQ1mrRSihF492ZI598 J95huGwZFywOC7CXtk5uUCZc9xVZW9E8nMZy0NGYhNrhiqoj/cQ8icMLY2Et2vtTg0 Fl82RMRf4YsIAHIYebmkNq3nNXiRwkhxQR3yo180= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geetha sowjanya , Hariprasad Kelam , Sunil Kovvuri Goutham , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 153/221] octeontx2-af: Fix irq free in rvu teardown Date: Mon, 29 Mar 2021 09:58:04 +0200 Message-Id: <20210329075634.270098675@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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: Geetha sowjanya [ Upstream commit ae2619dd4fccdad9876aa5f900bd85484179c50f ] Current devlink code try to free already freed irqs as the irq_allocate flag is not cleared after free leading to kernel crash while removing rvu driver. The patch fixes the irq free sequence and clears the irq_allocate flag on free. Fixes: 7304ac4567bc ("octeontx2-af: Add mailbox IRQ and msg handlers") Signed-off-by: Geetha sowjanya Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c index e1f918960730..644d28b0692b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c @@ -2151,8 +2151,10 @@ static void rvu_unregister_interrupts(struct rvu *rvu) INTR_MASK(rvu->hw->total_pfs) & ~1ULL); for (irq = 0; irq < rvu->num_vec; irq++) { - if (rvu->irq_allocated[irq]) + if (rvu->irq_allocated[irq]) { free_irq(pci_irq_vector(rvu->pdev, irq), rvu); + rvu->irq_allocated[irq] = false; + } } pci_free_irq_vectors(rvu->pdev); -- 2.30.1