Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2766283lqp; Mon, 25 Mar 2024 08:38:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeZQh/ukvnSECcAB1UauzazYUGhFgabBrCbdWrkt0+L6sASJAp2XIy1K6lvqO31uI22OooM1A9MbMgtfjZCxbDae+wuqA4WyIaQzxzIA== X-Google-Smtp-Source: AGHT+IFQ5VaOgEf+zrKu9KkoHBhvEyDLZhCGuGMjp7gJkFVHoMFsHImknW+5iJ5ArV14EBNzRzsY X-Received: by 2002:a17:903:22cb:b0:1dd:7e2:b9c2 with SMTP id y11-20020a17090322cb00b001dd07e2b9c2mr9901657plg.10.1711381139362; Mon, 25 Mar 2024 08:38:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711381139; cv=pass; d=google.com; s=arc-20160816; b=nBTuCBzj86SkRyvphqlvk8e3ICMMqDDLaBI6AysN+deRcL1PjvEdB5HofaBwgsNjI6 5nivf5dC+268BpZJOwIGml1400WUEu56XL4i19luETF8j6PY1XQkdCbnhgu1qnRyAz33 O7vw0wz/gQb777l1yff0+xZvYoX7zz4w3h27SJnDqPkBJZz0VnmT59RNfhyV6/qP52Mj rT82uHzLEjGsjAdMKjLBsoPcoe3z8xs3ACZDikH0BLme+Ld+J3eP5IZ/SD8rqE8PSPsP aaqZUhxlSX10+DiRk26KJsiIUqQrL57Sv4jkodLJUt8n6YvpwS/VPhKyfhBIz6JFXz1f nmsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to:subject:cc :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=e3e7smD0PkzETiNJAH7qNPhNb/J9VKrdvNRN2vJGpM8=; fh=GjFLP2iJzMYdDNZWLKwk7ID0mQu9f26uq7vRg0T56Bg=; b=AYVJND6IgAwC6woNVQxDxCx5w3bLqRDLQ1/rIuI0UzbwrbAu4cUQq2mPgyH6CpoC1T gDcCW/QbYGgjvdvsIKA3TRX9TWzhce8knz4n4oC/GezWykOh7nNbycMsmBueD74OAs7y yso+gsHeMqMDPcyT5FH49Axiqs/7SNM3RWb3rcT9Bo6TOD57DgEqZnTahFtaf9fFeWOk Y+T46OwFhn+ZYr7Y8qZPaZUCkVdYRt6p6LV31PNXwn6JGUWpP769NA/Nb+IscsYYS4x0 c9M8NQDC/O9cr+1uvQxyMkE8EXp1Jhsjs/SVYart1DkM9iziSIXTfFuoVM6HDtfCPCTt Gv1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-117063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o16-20020a170902d4d000b001dd63e18e5bsi5648195plg.136.2024.03.25.08.38.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 08:38:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-117063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1CD032C1CE6 for ; Mon, 25 Mar 2024 15:30:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4833F13CF87; Mon, 25 Mar 2024 12:51:45 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E226047A6F; Mon, 25 Mar 2024 12:51:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711371104; cv=none; b=JJbHICv8aPeynWnNO38PWVwcAm0GRt4V2/X4VD2AIAGbBmaEqe13mbjHlITd+nFatvnaCIXP5r9h00vZmWbls+826gLfRKEHH+K7Fe5y3sye2RDHJ3YV5LCOi07GnNlXpKlKOfRI4iQYXa1VZWyaxsIL2wo2QQsQCdAjbDs2B1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711371104; c=relaxed/simple; bh=ZVogx11ulyTOf9KakHLa9Y+wnnqXepPLDEtt7Xo49Rk=; h=Message-ID:Date:MIME-Version:CC:Subject:To:References:From: In-Reply-To:Content-Type; b=FQPwl3rstC5NwIjtlwmxstjeeglcWY1P2OWwWBa7e/PiPpoRYHFxn0QvR87QlZMOzp8T7SWru4Rpp5OGt7y1hp1YFnk9q7R8Xqxc/D2gtGM9YIe1ndTquDQpXjSSwB4ophHwguwUIgPeFKp4ZUO3VA51d5tjHMHovDYdtN7b9pU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4V3CV71mj4z1GD2P; Mon, 25 Mar 2024 20:51:11 +0800 (CST) Received: from kwepemm600007.china.huawei.com (unknown [7.193.23.208]) by mail.maildlp.com (Postfix) with ESMTPS id 083661A016C; Mon, 25 Mar 2024 20:51:40 +0800 (CST) Received: from [10.67.120.192] (10.67.120.192) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 25 Mar 2024 20:51:39 +0800 Message-ID: Date: Mon, 25 Mar 2024 20:51:10 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , , , , , , , , , , , , , Subject: Re: [PATCH V3 net 2/3] net: hns3: fix kernel crash when devlink reload during pf initialization To: Jiri Pirko References: <20240318132948.3624333-1-shaojijie@huawei.com> <20240318132948.3624333-3-shaojijie@huawei.com> From: Jijie Shao In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600007.china.huawei.com (7.193.23.208) on 2024/3/19 19:17, Jiri Pirko wrote: > Mon, Mar 18, 2024 at 02:29:47PM CET, shaojijie@huawei.com wrote: >> From: Yonglong Liu >> >> The devlink reload process will access the hardware resources, >> but the register operation is done before the hardware is initialized. >> so, if process the devlink reload during initialization, may lead to kernel >> crash. This patch fixes this by checking whether the NIC is initialized. > Fix your locking, you should take devl_lock during your init. That would > disallow reload to race with it. > > pw-bot: cr Thanks, We have fixed this in v4. Jijie Shao