From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bn3nam01on0125.outbound.protection.outlook.com ([104.47.33.125]:5792 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754175AbeDIAUO (ORCPT ); Sun, 8 Apr 2018 20:20:14 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Desnes Augusto Nunes do Rosario , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 127/189] ibmvnic: fix firmware version when no firmware level has been provided by the VIOS server Date: Mon, 9 Apr 2018 00:18:28 +0000 Message-ID: <20180409001637.162453-127-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Desnes Augusto Nunes do Rosario [ Upstream commit a107311d7fdf6b826f3737c4a90fd0e0046e7a3a ] Older versions of VIOS servers do not send the firmware level in the VPD buffer for the ibmvnic driver. Thus, not only the current message is mis- leading but the firmware version in the ethtool will be NULL. Therefore, this patch fixes the firmware string and its warning. Fixes: 4e6759be28e4 ("ibmvnic: Feature implementation of VPD for the ibmvni= c driver") Signed-off-by: Desnes A. Nunes do Rosario Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmvnic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/= ibmvnic.c index d4e87333bac2..4ba49a98c689 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -3294,7 +3294,11 @@ static void handle_vpd_rsp(union ibmvnic_crq *crq, */ substr =3D strnstr(adapter->vpd->buff, "RM", adapter->vpd->len); if (!substr) { - dev_info(dev, "No FW level provided by VPD\n"); + dev_info(dev, "Warning - No FW level has been provided in the VPD buffer= by the VIOS Server\n"); + ptr =3D strncpy((char *)adapter->fw_version, "N/A", + 3 * sizeof(char)); + if (!ptr) + dev_err(dev, "Failed to inform that firmware version is unavailable to = the adapter\n"); goto complete; } =20 --=20 2.15.1