Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3254642lqp; Tue, 26 Mar 2024 04:22:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUd5D+8ON0RmI2nGHd0b4xHoxY3bw+Dcu+ccDxCnqmytWFkoVJs3bVZ/ANGDCVl/W8ZyGdLhk+1RGz3FKn8ZItDWxAiLy+FYV6FnVhxog== X-Google-Smtp-Source: AGHT+IFeDvWcGpRFN/pvVbkwJW/UragLVkNrje/SXbKYNPMA3zyuT2w9uC4PzWU95j/CVfpJMAOK X-Received: by 2002:a05:6a20:d489:b0:1a1:87df:beff with SMTP id im9-20020a056a20d48900b001a187dfbeffmr10821518pzb.4.1711452175234; Tue, 26 Mar 2024 04:22:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711452175; cv=pass; d=google.com; s=arc-20160816; b=aRFK+yQS4kis+jT+YJ18B1v3sUSuS6E8wz7DzQovgCR2CLvPoGiTlb9P0m1SW+U964 vgFmKOLZYF5yyCXdc1Q8v0YIK6vKhzuEm+baHNamSHxxEFZECj/GdcCeVJ8+LaBXo39i 5XdKAqY0rDb7fcElXHomFTUUCf7zcKeu/1Y3RyGavgjmQ2ngtNnlnAEikVKzobHeX63A GIERxElWiFT5TJc/1+Vl9xuCEkag9wbzoQgFmpoKBYb5VOKFhUOrCm+E1VY37Q+XDGeN b4+WEJrEbWcgh7R3AOalrsAjy1RiK1lx0qGggtU+vow51jC1m68jVq1NHHs7B9tMS+lT mB0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VbpUDV54tdO/9fbqu4yZisiMtyQtFoVoNSrjeeZ7vBU=; fh=OYOMwh5N7I+MXUPw8E2BFpDK7IlOD9YzS7/jGBaD5+E=; b=rNR9M9L8q3ZACCBteUiaVZorSG0VdD5ilmhHQjLKSAop4nA0CH87oDyD+bch8RDDQX Qd2B5KyOnEYAlz6P03EyS019r2QBYt8Bygin6ZxsdPKnQYDmKp8Skwa4C8k4XS3ivuBF gaDUiQr1iG7VZSwqz3H/AqMu/ChQBikgSApF/BaVNwLA08Cp9NO8MKFfbEJC44LGus31 Or+HvgHcQTBoSvFkc6gQjl9y3JrP+KxfEnzDq0n5hymkqca5vdrb9pkHLN8QEwFWg4n5 iStLm/xZr2PwOf15zOLawooJYrMOp+fA6EInWWFtZjpn8cFrJrTS5TBPniSxUqKMBRqF zzvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yw4J7Cry; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id nd7-20020a17090b4cc700b002a0901f18c7si311435pjb.138.2024.03.26.04.22.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 04:22:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yw4J7Cry; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 7C3F7302217 for ; Tue, 26 Mar 2024 11:22:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E142B55C35; Tue, 26 Mar 2024 11:22:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Yw4J7Cry" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 143C652F67; Tue, 26 Mar 2024 11:22:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711452164; cv=none; b=NdSnnWKK1V5S+ij5R/GopJrEO/aC6V6sPlkKCB1CqBNf4ZR8FC/iieB66YpZ0DuPOKZP15twrOhZTGgl5Jq2vJA8baQ7IbVKq6fu2PKQ/hKCeAdE7XlwOoY5fDrzI3B7buqmyPbvS9kUrGi5pzYXL0CMs0BLEmhvDJBDSsrOVLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711452164; c=relaxed/simple; bh=zqluNaI5eTMbfBTncHbPKfxvIRYojlIJJXj8sffFUiU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hG8tLLJ5jF62NHOajokLoixX12upaBJdB0kQlFuTae802CjbdZmZvKfODLrUKHV7XWwjCdBJp6JIW/hXqzUXCNoOkaWiaUDnSXyttDh4d0t1JHQvC2g2tMBE5Jby5syH6dazOSY7yPynDTvbYvjKQSdL/N19x9Tgs+5VB+kEI4E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Yw4J7Cry; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4F26C433F1; Tue, 26 Mar 2024 11:22:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711452163; bh=zqluNaI5eTMbfBTncHbPKfxvIRYojlIJJXj8sffFUiU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Yw4J7CrybtAxnxTEfT8uv9KRTXKDVMtNt1HwX6TSWyDJs/6PAcrrHs0boufJfA1Ob Fr6GUZAdT0zl/YaNwjqvbesuwp3VG9koHhmSsWRHkgOX6MM0aD3xKmtda5knLZFINL kPRgtXEmEgWZnDS0YjURXaSRlKZtlBI2l7bDmbGKB7BQj/w6KhV49aNvA1mTNtn82m hmoJDXkpruFt/tawwI4ZIRfIu6o71qqkG2EOSmRgHhxvW2oNucgNLuo8YKbkmuSohy oqk3oBcjZVsEhIyiWSEyhDEP03DTI6CN+V2zOs5T3xrnBKgkSMdpzF34e571Mujosa KIqPWnh0NaNUQ== Date: Tue, 26 Mar 2024 11:22:38 +0000 From: Simon Horman To: Jijie Shao Cc: yisen.zhuang@huawei.com, salil.mehta@huawei.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, michal.kubiak@intel.com, rkannoth@marvell.com, jiri@resnulli.us, shenjian15@huawei.com, wangjie125@huawei.com, liuyonglong@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V4 net 2/3] net: hns3: fix kernel crash when devlink reload during pf initialization Message-ID: <20240326112238.GM403975@kernel.org> References: <20240325124311.1866197-1-shaojijie@huawei.com> <20240325124311.1866197-3-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240325124311.1866197-3-shaojijie@huawei.com> On Mon, Mar 25, 2024 at 08:43:10PM +0800, Jijie Shao 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, processing the devlink reload during initialization may lead to kernel > crash. This patch fixes this by taking devl_lock during initialization. > > Fixes: b741269b2759 ("net: hns3: add support for registering devlink for PF") > Signed-off-by: Yonglong Liu > Signed-off-by: Jijie Shao Reviewed-by: Simon Horman