DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 09/36] e1000/base: add evaluation of e1000_nvm_read return value
Date: Fri, 16 Oct 2015 10:50:55 +0800	[thread overview]
Message-ID: <1444963882-30931-10-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1444963882-30931-1-git-send-email-wenzhuo.lu@intel.com>

Adding code to a case where e1000_nvn_read is called, but there is no
consideration for when the read fails (returns an error code).
Also, this patch adds an error message to a base NVM reading function that
is missing it for consistency.
This patch is not covering all cases of these conditions, it only covers
the code used by the e1000e driver.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/e1000/base/e1000_manage.c | 5 ++++-
 drivers/net/e1000/base/e1000_nvm.c    | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/e1000/base/e1000_manage.c b/drivers/net/e1000/base/e1000_manage.c
index ac4c08a..8564a7f 100644
--- a/drivers/net/e1000/base/e1000_manage.c
+++ b/drivers/net/e1000/base/e1000_manage.c
@@ -363,9 +363,12 @@ bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
 	} else if ((hw->mac.type == e1000_82574) ||
 		   (hw->mac.type == e1000_82583)) {
 		u16 data;
+		s32 ret_val;
 
 		factps = E1000_READ_REG(hw, E1000_FACTPS);
-		e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
+		ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
+		if (ret_val)
+			return false;
 
 		if (!(factps & E1000_FACTPS_MNGCG) &&
 		    ((data & E1000_NVM_INIT_CTRL2_MNGM) ==
diff --git a/drivers/net/e1000/base/e1000_nvm.c b/drivers/net/e1000/base/e1000_nvm.c
index 966a34c..01be9e4 100644
--- a/drivers/net/e1000/base/e1000_nvm.c
+++ b/drivers/net/e1000/base/e1000_nvm.c
@@ -585,6 +585,9 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
 			   E1000_NVM_RW_REG_DATA);
 	}
 
+	if (ret_val)
+		DEBUGOUT1("NVM read error: %d\n", ret_val);
+
 	return ret_val;
 }
 
-- 
1.9.3

  parent reply	other threads:[~2015-10-16  2:51 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14  6:34 [dpdk-dev] [PATCH 00/34] update e1000 base driver Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 01/34] e1000/base: update readme and copyright Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 02/34] e1000/base: add new devices Wenzhuo Lu
2015-10-14 16:00   ` Stephen Hemminger
2015-10-14  6:34 ` [dpdk-dev] [PATCH 03/34] e1000/base: fix issue with link flap on 82579 Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 04/34] e1000/base: fix issue with jumbo frame CRC failures in client Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 05/34] e1000/base: redundant PHY power down for i210 Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 06/34] e1000/base: add return value to the functions of setting receive address register Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 07/34] e1000/base: add defaults for i210 TX/RX PBSIZE Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 08/34] e1000/base: remove E1000_WRITE_FLUSH for DH89XXCC_SGMII after commencing HW reset Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 09/34] e1000/base: add evaluation of e1000_nvm_read return value Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 10/34] e1000/base: change invariant return to not use variables Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 11/34] e1000/base: add return value handler when check manage mode Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 12/34] e1000/base: add return value handler for ESB2 controller init and reset Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 13/34] e1000/base: add support for inverted format ETrackId Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 14/34] e1000/base: add EEARBC_I210 for i210 Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 15/34] e1000/base: apply paranoia to macro arguments Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 16/34] e1000/base: add flags to set eee advertisement modes Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 17/34] e1000/base: prevent ulp flow if cable connected Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 18/34] e1000/base: fix TIPG value for non 10 half duplex mode Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 19/34] e1000/base: add return value for resume workaround Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 20/34] e1000/base: fix link detect flow Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 21/34] e1000/base: cleanup NAHUM6LP_HW tags Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 22/34] e1000/base: add bit for disable packetbuffer read Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 23/34] e1000/base: K1 flow fixes Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 24/34] e1000/base: remove FIXME comment Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 25/34] e1000/base: set correct value of beacon duration Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 26/34] e1000/base: disable extension header parsing for IPv6 Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 27/34] e1000/base: fix for i354 88E1112 PHY using AutoMedia Detect Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 28/34] e1000/base: increase timeout of polling bit RSPCIPHY in check_reset_block Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 29/34] e1000/base: implement 88E1543 PHY initialization Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 30/34] e1000/base: use the correct i210 register for EEMNGCTL Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 31/34] e1000/base: move the print to the right position Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 32/34] e1000/base: synchronization of MAC-PHY interface only on non- ME systems Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 33/34] e1000/base: fix to enable both ulp and EEE in Sx state Wenzhuo Lu
2015-10-14  6:34 ` [dpdk-dev] [PATCH 34/34] e1000/base: some minor change Wenzhuo Lu
2015-10-15  2:03 ` [dpdk-dev] [PATCH v2 00/35] update e1000 base code Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 01/35] e1000/base: update readme and copyright Wenzhuo Lu
2015-10-15  8:30     ` Mcnamara, John
2015-10-15  8:37       ` Lu, Wenzhuo
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 02/35] e1000/base: add new devices Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 03/35] e1000/base: fix issue with link flap on 82579 Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 04/35] e1000/base: fix issue with jumbo frame CRC failures in client Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 05/35] e1000/base: redundant PHY power down for i210 Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 06/35] e1000/base: add return value to the functions of setting receive address register Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 07/35] e1000/base: add defaults for i210 TX/RX PBSIZE Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 08/35] e1000/base: remove E1000_WRITE_FLUSH for DH89XXCC_SGMII after commencing HW reset Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 09/35] e1000/base: add evaluation of e1000_nvm_read return value Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 10/35] e1000/base: change invariant return to not use variables Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 11/35] e1000/base: add return value handler when check manage mode Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 12/35] e1000/base: add return value handler for ESB2 controller init and reset Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 13/35] e1000/base: add support for inverted format ETrackId Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 14/35] e1000/base: add EEARBC_I210 for i210 Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 15/35] e1000/base: apply paranoia to macro arguments Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 16/35] e1000/base: add flags to set eee advertisement modes Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 17/35] e1000/base: prevent ulp flow if cable connected Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 18/35] e1000/base: fix TIPG value for non 10 half duplex mode Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 19/35] e1000/base: add return value for resume workaround Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 20/35] e1000/base: fix link detect flow Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 21/35] e1000/base: cleanup NAHUM6LP_HW tags Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 22/35] e1000/base: add bit for disable packetbuffer read Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 23/35] e1000/base: K1 flow fixes Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 24/35] e1000/base: remove FIXME comment Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 25/35] e1000/base: set correct value of beacon duration Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 26/35] e1000/base: disable extension header parsing for IPv6 Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 27/35] e1000/base: fix for i354 88E1112 PHY using AutoMedia Detect Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 28/35] e1000/base: increase timeout of polling bit RSPCIPHY in check_reset_block Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 29/35] e1000/base: implement 88E1543 PHY initialization Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 30/35] e1000/base: use the correct i210 register for EEMNGCTL Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 31/35] e1000/base: move the print to the right position Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 32/35] e1000/base: synchronization of MAC-PHY interface only on non- ME systems Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 33/35] e1000/base: fix to enable both ulp and EEE in Sx state Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 34/35] e1000/base: some minor change Wenzhuo Lu
2015-10-15  2:03   ` [dpdk-dev] [PATCH v2 35/35] e1000: add new devices Wenzhuo Lu
2015-10-16  2:50 ` [dpdk-dev] [PATCH v3 00/36] update e1000 base code Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 01/36] e1000/base: update readme and copyright Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 02/36] e1000/base: add new devices Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 03/36] e1000/base: fix issue with link flap on 82579 Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 04/36] e1000/base: fix issue with jumbo frame CRC failures in client Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 05/36] e1000/base: redundant PHY power down for i210 Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 06/36] e1000/base: add return value to the functions of setting receive address register Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 07/36] e1000/base: add defaults for i210 TX/RX PBSIZE Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 08/36] e1000/base: remove E1000_WRITE_FLUSH for DH89XXCC_SGMII after commencing HW reset Wenzhuo Lu
2015-10-16  2:50   ` Wenzhuo Lu [this message]
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 10/36] e1000/base: change invariant return to not use variables Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 11/36] e1000/base: add return value handler when check manage mode Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 12/36] e1000/base: add return value handler for ESB2 controller init and reset Wenzhuo Lu
2015-10-16  2:50   ` [dpdk-dev] [PATCH v3 13/36] e1000/base: add support for inverted format ETrackId Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 14/36] e1000/base: add EEARBC_I210 for i210 Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 15/36] e1000/base: apply paranoia to macro arguments Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 16/36] e1000/base: add flags to set eee advertisement modes Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 17/36] e1000/base: prevent ulp flow if cable connected Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 18/36] e1000/base: fix TIPG value for non 10 half duplex mode Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 19/36] e1000/base: add return value for resume workaround Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 20/36] e1000/base: fix link detect flow Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 21/36] e1000/base: cleanup NAHUM6LP_HW tags Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 22/36] e1000/base: add bit for disable packetbuffer read Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 23/36] e1000/base: K1 flow fixes Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 24/36] e1000/base: remove FIXME comment Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 25/36] e1000/base: set correct value of beacon duration Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 26/36] e1000/base: disable extension header parsing for IPv6 Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 27/36] e1000/base: fix for i354 88E1112 PHY using AutoMedia Detect Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 28/36] e1000/base: increase timeout of polling bit RSPCIPHY in check_reset_block Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 29/36] e1000/base: implement 88E1543 PHY initialization Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 30/36] e1000/base: use the correct i210 register for EEMNGCTL Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 31/36] e1000/base: move the print to the right position Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 32/36] e1000/base: synchronization of MAC-PHY interface only on non- ME systems Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 33/36] e1000/base: fix to enable both ulp and EEE in Sx state Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 34/36] e1000/base: some minor change Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 35/36] e1000: add new devices Wenzhuo Lu
2015-10-16  2:51   ` [dpdk-dev] [PATCH v3 36/36] doc: update release notes for e1000 base code update Wenzhuo Lu
2015-10-27 15:32     ` Thomas Monjalon
2015-10-28  2:33       ` Lu, Wenzhuo
2015-10-27 15:34   ` [dpdk-dev] [PATCH v3 00/36] update e1000 base code Thomas Monjalon
2015-10-28  1:58     ` Lu, Wenzhuo
2015-10-19 16:03 ` [dpdk-dev] [PATCH 00/34] update e1000 base driver Thomas Monjalon
2015-10-20  0:59   ` Lu, Wenzhuo
2015-10-21 10:21     ` Glynn, Michael J

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444963882-30931-10-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).