Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp947954pxb; Wed, 1 Sep 2021 13:27:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHjwb/nwHraARE/5HAoLqoVyO69TdlSmi9YBIF2xYAMRzV6ZZ3jlnlqFjbXDjaSS10hE1j X-Received: by 2002:a05:6638:1301:: with SMTP id r1mr1276702jad.32.1630528053678; Wed, 01 Sep 2021 13:27:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630528053; cv=none; d=google.com; s=arc-20160816; b=f2B3tZMjFwhWwwhGK1SXtwDubvknCaN4u3gQbhYqF8prxL/+OpJCMqsGAdpAAIY7OD WobZxG9avdarOBtIVrBttapyERPgQ44sla1tAO0hUbgYSMdIt9SrcCl7wMaus8/JdxnW kTHDHiTboC3QIXoGFcIbrBjRM2NfMq7v9yrNQR83TLPZNVlnjsWIu+mPmC49wcSmRzHS RUrNSMzbaBnPGmxp5ty5ueuR2/lhT+qC6Cqyk9eRLqUHYdlhFhCroiylkKmvy61BgJNH Qeb6aNuDpHDcmjbtbCG+Y06z4qhmU8WtOo+jUtOfRxmP2qZ9dM7DNlfsIB8w/X5gadRJ +MSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ga/73LCDI9Gcan/Gpq5krVHkxU2u+tUGELB3VUIPVPc=; b=gUWmH4a/pLci5WI7ok4pAfbjeD6n2/Wvq+ogdq+IsO3MAl8Kf4VmyJVsiPmNjlj9Oz A7W1q9U5J9gIIPCv5eNLVK8fy6kvLwjxHTX5u1zo/vpagjkWMbvxPfCqAfkAqKARz67d IIxbtRS8QPGjzvpTm1vvOcvshiN5cbgsPHDnoHLxK5mn94UQBYjAS0DPbh4fAQkvFyjl jyRUXtOqbMJm0hKr5rR7FfZzYQuJYY5VrwxVqPnE+/OJTZa8evG4uF8JXL1VE1N1gdUC dSGYZ2wsDou52iWD77HN0UXvJtLT+mtdXDECGP2cIQxrN1TDuDyAk5X0mWbpntvdv4rO WbpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si437166iod.86.2021.09.01.13.27.22; Wed, 01 Sep 2021 13:27:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243223AbhIAULp (ORCPT + 99 others); Wed, 1 Sep 2021 16:11:45 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:46236 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231553AbhIAULp (ORCPT ); Wed, 1 Sep 2021 16:11:45 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 928ED1C0B7F; Wed, 1 Sep 2021 22:10:46 +0200 (CEST) Date: Wed, 1 Sep 2021 22:10:46 +0200 From: Pavel Machek To: Pavel Machek Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jacob Keller , Tony Brelinski , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: Re: [PATCH 5.10 026/103] ice: do not abort devlink info if board identifier cant be found Message-ID: <20210901201046.GC8962@duo.ucw.cz> References: <20210901122300.503008474@linuxfoundation.org> <20210901122301.400339475@linuxfoundation.org> <20210901194236.GA8962@duo.ucw.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fig2xvG2VGoz8o/s" Content-Disposition: inline In-Reply-To: <20210901194236.GA8962@duo.ucw.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Fig2xvG2VGoz8o/s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > The devlink dev info command reports version information about the > > device and firmware running on the board. This includes the "board.id" > > field which is supposed to represent an identifier of the board design. > > The ice driver uses the Product Board Assembly identifier for this. > >=20 > > In some cases, the PBA is not present in the NVM. If this happens, > > devlink dev info will fail with an error. Instead, modify the > > ice_info_pba function to just exit without filling in the context > > buffer. This will cause the board.id field to be skipped. Log a dev_dbg > > message in case someone wants to confirm why board.id is not showing up > > for them. >=20 > Will it cause field to be skipped? I believe buffer will not be > initialized which will result in some confusion... IOW I believe this is good idea. Signed-off-by: Pavel Machek (CIP) diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/eth= ernet/intel/ice/ice_devlink.c index f18ce43b7e74..7034704b1b50 100644 --- a/drivers/net/ethernet/intel/ice/ice_devlink.c +++ b/drivers/net/ethernet/intel/ice/ice_devlink.c @@ -22,10 +22,12 @@ static int ice_info_pba(struct ice_pf *pf, char *buf, s= ize_t len) enum ice_status status; =20 status =3D ice_read_pba_string(hw, (u8 *)buf, len); - if (status) + if (status) { + *buf =3D 0; /* We failed to locate the PBA, so just skip this entry */ dev_dbg(ice_pf_to_dev(pf), "Failed to read Product Board Assembly string= , status %s\n", ice_stat_str(status)); + } =20 return 0; } --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --Fig2xvG2VGoz8o/s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYS/eRgAKCRAw5/Bqldv6 8rD3AJ4v++4A3ckn6ERC+g7sW3FQ+A3Y7gCfR2/DnUejV0yQt6WJDIUuLpb4Ng0= =Ok0J -----END PGP SIGNATURE----- --Fig2xvG2VGoz8o/s--