[dpdk-stable] [PATCH v2 18.11 07/10] net/atlantic: bad logic with offsets talking with firmware

Igor Russkikh Igor.Russkikh at aquantia.com
Tue May 21 10:55:34 CEST 2019


From: Pavel Belous <pavel.belous at aquantia.com>

eeprom write accesses start using non zero configuration memory
accesses. This revealed an issue where firmware interface was actually
always did the uploads starting with zero offset

Fixes: 86d36773bd42 ("net/atlantic: implement firmware operations")
cc: stable at dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh at aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous at aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous at aquantia.com>
---
 drivers/net/atlantic/hw_atl/hw_atl_utils.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/atlantic/hw_atl/hw_atl_utils.c
index bb5c6ed1512e..262601941d47 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.c
@@ -333,12 +333,13 @@ int hw_atl_utils_fw_upload_dwords(struct aq_hw_s *self, u32 a, u32 *p,
 		goto err_exit;
 	}
 	if (IS_CHIP_FEATURE(REVISION_B1)) {
-		u32 offset = 0;
+		u32 mbox_offset = (a - self->rpc_addr) / sizeof(u32);
+		u32 data_offset = 0;
 
-		for (; offset < cnt; ++offset) {
-			aq_hw_write_reg(self, 0x328, p[offset]);
+		for (; data_offset < cnt; ++mbox_offset, ++data_offset) {
+			aq_hw_write_reg(self, 0x328, p[data_offset]);
 			aq_hw_write_reg(self, 0x32C,
-				(0x80000000 | (0xFFFF & (offset * 4))));
+				(0x80000000 | (0xFFFF & (mbox_offset * 4))));
 			hw_atl_mcp_up_force_intr_set(self, 1);
 			/* 1000 times by 10us = 10ms */
 			AQ_HW_WAIT_FOR((aq_hw_read_reg(self,
-- 
2.17.1



More information about the stable mailing list