diff --git a/drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.c b/drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.c index 0e9b80e6628a..59991ae6839a 100644 --- a/drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.c +++ b/drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.c @@ -19,11 +19,21 @@ #define ATL2_FW_READ_TRY_MAX 1000 #define atl2_shared_buffer_write(HW, ITEM, VARIABLE) \ + BUILD_BUG_ON_MSG((offsetof(struct fw_interface_in, ITEM) % \ + sizeof(u32)) != 0,\ + "Unaligned write " # ITEM);\ + BUILD_BUG_ON_MSG((sizeof(VARIABLE) % sizeof(u32)) != 0,\ + "Unaligned write length " # ITEM);\ atl2_mif_shared_buf_write(HW,\ (offsetof(struct fw_interface_in, ITEM) / sizeof(u32)),\ (u32 *)&VARIABLE, sizeof(VARIABLE) / sizeof(u32)) #define atl2_shared_buffer_get(HW, ITEM, VARIABLE) \ + BUILD_BUG_ON_MSG((offsetof(struct fw_interface_in, ITEM) % \ + sizeof(u32)) != 0,\ + "Unaligned get " # ITEM);\ + BUILD_BUG_ON_MSG((sizeof(VARIABLE) % sizeof(u32)) != 0,\ + "Unaligned get length " # ITEM);\ atl2_mif_shared_buf_get(HW, \ (offsetof(struct fw_interface_in, ITEM) / sizeof(u32)),\ (u32 *)&VARIABLE, \ @@ -36,7 +46,9 @@ {\ BUILD_BUG_ON_MSG((offsetof(struct fw_interface_out, ITEM) % \ sizeof(u32)) != 0,\ - "Non aligned read " # ITEM);\ + "Unaligned read " # ITEM);\ + BUILD_BUG_ON_MSG((sizeof(VARIABLE) % sizeof(u32)) != 0,\ + "Unaligned read length " # ITEM);\ BUILD_BUG_ON_MSG(sizeof(VARIABLE) > sizeof(u32),\ "Non atomic read " # ITEM);\ atl2_mif_shared_buf_read(HW, \ @@ -666,12 +678,12 @@ static int atl2_fw_get_phy_temperature(struct atl_hw *hw, int *temp) static int atl2_fw_get_mac_addr(struct atl_hw *hw, uint8_t *mac) { - struct mac_address_s mac_address; + struct mac_address_aligned_s mac_address; int err = 0; atl2_shared_buffer_get(hw, mac_address, mac_address); - ether_addr_copy(mac, (u8 *)mac_address.mac_address); + ether_addr_copy(mac, (u8 *)mac_address.aligned.mac_address); return err; } @@ -735,7 +747,7 @@ static int atl2_fw_enable_wol(struct atl_hw *hw, unsigned int wol_mode) struct link_options_s link_options; struct link_control_s link_control; struct wake_on_lan_s wake_on_lan; - struct mac_address_s mac_address; + struct mac_address_aligned_s mac_address; int ret = 0; atl_lock_fw(hw); @@ -758,7 +770,7 @@ static int atl2_fw_enable_wol(struct atl_hw *hw, unsigned int wol_mode) wake_on_lan.restore_link_before_wake = 1; } - ether_addr_copy(mac_address.mac_address, hw->mac_addr); + ether_addr_copy(mac_address.aligned.mac_address, hw->mac_addr); atl2_shared_buffer_write(hw, mac_address, mac_address); atl2_shared_buffer_write(hw, sleep_proxy, wake_on_lan); diff --git a/drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.h b/drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.h index 177251f536d8..b83467a056cc 100644 --- a/drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.h +++ b/drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.h @@ -82,6 +82,11 @@ struct mac_address_s { uint8_t mac_address[6]; }; +struct mac_address_aligned_s { + struct mac_address_s aligned; + u16 rsvd; +}; + struct sleep_proxy_s { struct wake_on_lan_s { uint32_t wake_on_magic_packet:1; @@ -555,8 +560,7 @@ struct request_policy_s { struct fw_interface_in { uint32_t mtu; uint32_t rsvd1:32; - struct mac_address_s mac_address; - uint16_t rsvd; + struct mac_address_aligned_s mac_address; struct link_control_s link_control; uint32_t rsvd2:32; struct link_options_s link_options; diff --git a/drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h b/drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h index 717a36f27bc6..cd0814608d29 100644 --- a/drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h +++ b/drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h @@ -20,7 +20,7 @@ #include #include -#define ATL_VERSION "1.1.15" +#define ATL_VERSION "1.1.18" struct atl_nic; diff --git a/drivers/net/ethernet/aquantia/atlantic-fwd/atl_hw.c b/drivers/net/ethernet/aquantia/atlantic-fwd/atl_hw.c index c3d47216e8a2..8f019ee9efac 100644 --- a/drivers/net/ethernet/aquantia/atlantic-fwd/atl_hw.c +++ b/drivers/net/ethernet/aquantia/atlantic-fwd/atl_hw.c @@ -236,6 +236,7 @@ static int atl2_hw_reset(struct atl_hw *hw) u32 rbl_status = 0; u32 rbl_request; int err = 0; + int boot_time; atl_lock_fw(hw); @@ -260,15 +261,18 @@ static int atl2_hw_reset(struct atl_hw *hw) atl_write(hw, ATL2_MIF_BOOT_REG_ADR, rbl_request); /* Wait for RBL boot */ - busy_wait(200, mdelay(1), rbl_status, - atl_read(hw, ATL2_MIF_BOOT_REG_ADR), - ((rbl_status & ATL2_BOOT_STARTED) == 0) || - (rbl_status == 0xffffffff)); + boot_time = busy_wait(2000, mdelay(1), rbl_status, + atl_read(hw, ATL2_MIF_BOOT_REG_ADR), + ((rbl_status & ATL2_BOOT_STARTED) == 0) || + (rbl_status == 0xffffffff)); if (!(rbl_status & ATL2_BOOT_STARTED)) { err = -ETIME; atl_dev_err("Boot code hung, rbl_status %#x", rbl_status); goto unlock; } + if (boot_time > 200) + atl_dev_err("Boot code took %dms. Thats unexpected and more than 200ms. Will continue.\n", + boot_time); next_turn: busy_wait(1000, mdelay(1), rbl_complete, atl2_mcp_boot_complete(hw), diff --git a/drivers/net/ethernet/aquantia/atlantic-fwd/atl_macsec.c b/drivers/net/ethernet/aquantia/atlantic-fwd/atl_macsec.c index 448b868ff1e2..fea067b78f20 100644 --- a/drivers/net/ethernet/aquantia/atlantic-fwd/atl_macsec.c +++ b/drivers/net/ethernet/aquantia/atlantic-fwd/atl_macsec.c @@ -389,6 +389,9 @@ int atl_init_macsec(struct atl_hw *hw) int index = 0, tbl_idx; int ret; + if (hw->chip_id == ATL_ANTIGUA) + return 0; + rtnl_lock(); memset(&msg, 0, sizeof(msg)); memset(&resp, 0, sizeof(resp)); diff --git a/drivers/net/ethernet/aquantia/atlantic-fwd/release_notes.txt b/drivers/net/ethernet/aquantia/atlantic-fwd/release_notes.txt index 8e5b07ce42b6..a15f3635f4e4 100644 --- a/drivers/net/ethernet/aquantia/atlantic-fwd/release_notes.txt +++ b/drivers/net/ethernet/aquantia/atlantic-fwd/release_notes.txt @@ -1,3 +1,19 @@ +Version 1.1.18 +Date 21/02/2021 +============== +- Hotfix to increase reset tmo on A2 to 2secs + +Version 1.1.17 +Date 19/02/2021 +============== +- Hotfix to disable macsec load on A2 + +Version 1.1.16 +Date 13/02/2021 +============== +- Fixes for compilation without PTP +[ATLDRV-1649]: WOL was not functional. MAC address was invalid. + Version 1.1.15 ============== [ATLDRV-1613] - Atlantic_fwd driver hitting NULL pointer dereference at 0000000000000678 while requesting rx rings