lkml.org 
[lkml]   [2019]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 64/83] net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query
    Date
    From: Erez Alfasi <ereza@mellanox.com>

    [ Upstream commit 135dd9594f127c8a82d141c3c8430e9e2143216a ]

    Querying EEPROM high pages data for SFP module is currently
    not supported by our driver but is still tried, resulting in
    invalid FW queries.

    Set the EEPROM ethtool data length to 256 for SFP module to
    limit the reading for page 0 only and prevent invalid FW queries.

    Fixes: 7202da8b7f71 ("ethtool, net/mlx4_en: Cable info, get_module_info/eeprom ethtool support")
    Signed-off-by: Erez Alfasi <ereza@mellanox.com>
    Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 4 +++-
    drivers/net/ethernet/mellanox/mlx4/port.c | 5 -----
    2 files changed, 3 insertions(+), 6 deletions(-)

    --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
    +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
    @@ -1930,6 +1930,8 @@ static int mlx4_en_set_tunable(struct ne
    return ret;
    }

    +#define MLX4_EEPROM_PAGE_LEN 256
    +
    static int mlx4_en_get_module_info(struct net_device *dev,
    struct ethtool_modinfo *modinfo)
    {
    @@ -1964,7 +1966,7 @@ static int mlx4_en_get_module_info(struc
    break;
    case MLX4_MODULE_ID_SFP:
    modinfo->type = ETH_MODULE_SFF_8472;
    - modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
    + modinfo->eeprom_len = MLX4_EEPROM_PAGE_LEN;
    break;
    default:
    return -ENOSYS;
    --- a/drivers/net/ethernet/mellanox/mlx4/port.c
    +++ b/drivers/net/ethernet/mellanox/mlx4/port.c
    @@ -1960,11 +1960,6 @@ int mlx4_get_module_info(struct mlx4_dev
    size -= offset + size - I2C_PAGE_SIZE;

    i2c_addr = I2C_ADDR_LOW;
    - if (offset >= I2C_PAGE_SIZE) {
    - /* Reset offset to high page */
    - i2c_addr = I2C_ADDR_HIGH;
    - offset -= I2C_PAGE_SIZE;
    - }

    cable_info = (struct mlx4_cable_info *)inmad->data;
    cable_info->dev_mem_address = cpu_to_be16(offset);

    \
     
     \ /
      Last update: 2019-06-09 18:56    [W:4.090 / U:0.512 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site