28 Mar, 2020

1 commit

  • On Android/x86 the module loading infrastructure can't deal with
    softdeps. Therefore the check for presence of the Realtek PHY driver
    module fails. mdiobus_register() will try to load the PHY driver
    module, therefore move the check to after this call and explicitly
    check that a dedicated PHY driver is bound to the PHY device.

    Fixes: f32593773549 ("r8169: check that Realtek PHY driver module is loaded")
    Reported-by: Chih-Wei Huang
    Signed-off-by: Heiner Kallweit
    Signed-off-by: David S. Miller

    Heiner Kallweit
     

27 Mar, 2020

3 commits

  • This patch reverts 58292104832f ("net: ks8851-ml: Fix 16-bit IO operation")
    and edacb098ea9c ("net: ks8851-ml: Fix 16-bit data access"), because it
    turns out these were only necessary due to buggy hardware. This patch adds
    a check for such a buggy hardware to prevent any such mistakes again.

    While working further on the KS8851 driver, it came to light that the
    KS8851-16MLL is capable of switching bus endianness by a hardware strap,
    EESK pin. If this strap is incorrect, the IO accesses require such endian
    swapping as is being reverted by this patch. Such swapping also impacts
    the performance significantly.

    Hence, in addition to removing it, detect that the hardware is broken,
    report to user, and fail to bind with such hardware.

    Fixes: 58292104832f ("net: ks8851-ml: Fix 16-bit IO operation")
    Fixes: edacb098ea9c ("net: ks8851-ml: Fix 16-bit data access")
    Signed-off-by: Marek Vasut
    Cc: David S. Miller
    Cc: Lukas Wunner
    Cc: Petr Stetiar
    Cc: YueHaibing
    Signed-off-by: David S. Miller

    Marek Vasut
     
  • list_for_each_entry_from_reverse() iterates backwards over the list from
    the current position, but in the error path we should start from the
    previous position.

    Fix this by using list_for_each_entry_continue_reverse() instead.

    This suppresses the following error from coccinelle:

    drivers/net/ethernet/mellanox/mlxsw//spectrum_mr.c:655:34-38: ERROR:
    invalid reference to the index variable of the iterator on line 636

    Fixes: c011ec1bbfd6 ("mlxsw: spectrum: Add the multicast routing offloading logic")
    Signed-off-by: Ido Schimmel
    Reviewed-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • In qlcnic_83xx_get_reset_instruction_template, the variable
    of null test is bad, so correct it.

    Signed-off-by: Xu Wang
    Signed-off-by: David S. Miller

    Xu Wang
     

26 Mar, 2020

3 commits

  • …rnel/git/kvalo/wireless-drivers

    Kalle Valo says:

    ====================
    wireless-drivers fixes for v5.6

    Fourth, and last, set of fixes for v5.6. Just two important fixes to
    iwlwifi regressions.

    iwlwifi

    * fix GEO_TX_POWER_LIMIT command on certain devices which caused
    firmware to crash during initialisation

    * add back device ids for three devices which were accidentally
    removed
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     
  • net/netfilter/nft_fwd_netdev.c: In function ‘nft_fwd_netdev_eval’:
    net/netfilter/nft_fwd_netdev.c:32:10: error: ‘struct sk_buff’ has no member named ‘tc_redirected’
    pkt->skb->tc_redirected = 1;
    ^~
    net/netfilter/nft_fwd_netdev.c:33:10: error: ‘struct sk_buff’ has no member named ‘tc_from_ingress’
    pkt->skb->tc_from_ingress = 1;
    ^~

    To avoid a direct dependency with tc actions from netfilter, wrap the
    redirect bits around CONFIG_NET_REDIRECT and move helpers to
    include/linux/skbuff.h. Turn on this toggle from the ifb driver, the
    only existing client of these bits in the tree.

    This patch adds skb_set_redirected() that sets on the redirected bit
    on the skbuff, it specifies if the packet was redirect from ingress
    and resets the timestamp (timestamp reset was originally missing in the
    netfilter bugfix).

    Fixes: bcfabee1afd99484 ("netfilter: nft_fwd_netdev: allow to redirect to ifb via ingress")
    Reported-by: noreply@ellerman.id.au
    Reported-by: Geert Uytterhoeven
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Pablo Neira Ayuso
     
  • Currently ENA only provides the PCI remove() handler, used during rmmod
    for example. This is not called on shutdown/kexec path; we are potentially
    creating a failure scenario on kexec:

    (a) Kexec is triggered, no shutdown() / remove() handler is called for ENA;
    instead pci_device_shutdown() clears the master bit of the PCI device,
    stopping all DMA transactions;

    (b) Kexec reboot happens and the device gets enabled again, likely having
    its FW with that DMA transaction buffered; then it may trigger the (now
    invalid) memory operation in the new kernel, corrupting kernel memory area.

    This patch aims to prevent this, by implementing a shutdown() handler
    quite similar to the remove() one - the difference being the handling
    of the netdev, which is unregistered on remove(), but following the
    convention observed in other drivers, it's only detached on shutdown().

    This prevents an odd issue in AWS Nitro instances, in which after the 2nd
    kexec the next one will fail with an initrd corruption, caused by a wild
    DMA write to invalid kernel memory. The lspci output for the adapter
    present in my instance is:

    00:05.0 Ethernet controller [0200]: Amazon.com, Inc. Elastic Network
    Adapter (ENA) [1d0f:ec20]

    Suggested-by: Gavin Shan
    Signed-off-by: Guilherme G. Piccoli
    Acked-by: Sameeh Jubran
    Signed-off-by: David S. Miller

    Guilherme G. Piccoli
     

25 Mar, 2020

9 commits

  • Saeed Mahameed says:

    ====================
    Mellanox, mlx5 fixes 2020-03-24

    This series introduces some fixes to mlx5 driver.

    From Aya, Fixes to the RX error recovery flows
    From Leon, Fix IB capability mask

    Please pull and let me know if there is any problem.

    For -stable v5.5
    ('net/mlx5_core: Set IB capability mask1 to fix ib_srpt connection failure')

    For -stable v5.4
    ('net/mlx5e: Fix ICOSQ recovery flow with Striding RQ')
    ('net/mlx5e: Do not recover from a non-fatal syndrome')
    ('net/mlx5e: Fix missing reset of SW metadata in Striding RQ reset')
    ('net/mlx5e: Enhance ICOSQ WQE info fields')

    The above patch ('net/mlx5e: Enhance ICOSQ WQE info fields')
    will fail to apply cleanly on v5.4 due to a trivial contextual conflict,
    but it is an important fix, do I need to do something about it or just
    assume Greg will know how to handle this ?
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The original change fixed an issue on RTL8168b by mimicking the vendor
    driver behavior to disable MSI on chip versions before RTL8168d.
    This however now caused an issue on a system with RTL8168c, see [0].
    Therefore leave MSI disabled on RTL8168b, but re-enable it on RTL8168c.

    [0] https://bugzilla.redhat.com/show_bug.cgi?id=1792839

    Fixes: 003bd5b4a7b4 ("r8169: don't use MSI before RTL8168d")
    Signed-off-by: Heiner Kallweit
    Signed-off-by: David S. Miller

    Heiner Kallweit
     
  • The DT binding for this PHY describes an *optional* clock property.
    Due to a bug in the error handling logic, we are actually ignoring this
    clock *all* of the time so far.

    Fix this by using devm_clk_get_optional() to handle this clock properly.

    Fixes: b78ac6ecd1b6b ("net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider")
    Signed-off-by: Andre Przywara
    Reviewed-by: Andrew Lunn
    Acked-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Andre Przywara
     
  • cxgb4_ptp_fineadjtime() doesn't pass the signedness of offset delta
    in FW_PTP_CMD. Fix it by passing correct sign.

    Signed-off-by: Raju Rangoju
    Signed-off-by: David S. Miller

    Raju Rangoju
     
  • For non-fatal syndromes like LOCAL_LENGTH_ERR, recovery shouldn't be
    triggered. In these scenarios, the RQ is not actually in ERR state.
    This misleads the recovery flow which assumes that the RQ is really in
    error state and no more completions arrive, causing crashes on bad page
    state.

    Fixes: 8276ea1353a4 ("net/mlx5e: Report and recover from CQE with error on RQ")
    Signed-off-by: Aya Levin
    Reviewed-by: Tariq Toukan
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • In striding RQ mode, the buffers of an RX WQE are first
    prepared and posted to the HW using a UMR WQEs via the ICOSQ.
    We maintain the state of these in-progress WQEs in the RQ
    SW struct.

    In the flow of ICOSQ recovery, the corresponding RQ is not
    in error state, hence:

    - The buffers of the in-progress WQEs must be released
    and the RQ metadata should reflect it.
    - Existing RX WQEs in the RQ should not be affected.

    For this, wrap the dealloc of the in-progress WQEs in
    a function, and use it in the ICOSQ recovery flow
    instead of mlx5e_free_rx_descs().

    Fixes: be5323c8379f ("net/mlx5e: Report and recover from CQE error on ICOSQ")
    Signed-off-by: Aya Levin
    Reviewed-by: Tariq Toukan
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • When resetting the RQ (moving RQ state from RST to RDY), the driver
    resets the WQ's SW metadata.
    In striding RQ mode, we maintain a field that reflects the actual
    expected WQ head (including in progress WQEs posted to the ICOSQ).
    It was mistakenly not reset together with the WQ. Fix this here.

    Fixes: 8276ea1353a4 ("net/mlx5e: Report and recover from CQE with error on RQ")
    Signed-off-by: Aya Levin
    Reviewed-by: Tariq Toukan
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • Add number of WQEBBs (WQE's Basic Block) to WQE info struct. Set the
    number of WQEBBs on WQE post, and increment the consumer counter (cc)
    on completion.

    In case of error completions, the cc was mistakenly not incremented,
    keeping a gap between cc and pc (producer counter). This failed the
    recovery flow on the ICOSQ from a CQE error which timed-out waiting for
    the cc and pc to meet.

    Fixes: be5323c8379f ("net/mlx5e: Report and recover from CQE error on ICOSQ")
    Signed-off-by: Aya Levin
    Reviewed-by: Tariq Toukan
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • The cap_mask1 isn't protected by field_select and not listed among RW
    fields, but it is required to be written to properly initialize ports
    in IB virtualization mode.

    Link: https://lore.kernel.org/linux-rdma/88bab94d2fd72f3145835b4518bc63dda587add6.camel@redhat.com
    Fixes: ab118da4c10a ("net/mlx5: Don't write read-only fields in MODIFY_HCA_VPORT_CONTEXT command")
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Saeed Mahameed

    Leon Romanovsky
     

24 Mar, 2020

10 commits

  • If ring counts are not reset when ring reservation fails,
    bnxt_init_dflt_ring_mode() will not be called again to reinitialise
    IRQs when open() is called and results in system crash as napi will
    also be not initialised. This patch fixes it by resetting the ring
    counts.

    Fixes: 47558acd56a7 ("bnxt_en: Reserve rings at driver open if none was reserved at probe time.")
    Signed-off-by: Vasundhara Volam
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Vasundhara Volam
     
  • Other shutdown code paths will always disable PCI first to shutdown DMA
    before freeing context memory. Do the same sequence in the error path
    of probe to be safe and consistent.

    Fixes: c20dc142dd7b ("bnxt_en: Disable bus master during PCI shutdown and driver unload.")
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan
     
  • The current code ignores the return value from
    bnxt_hwrm_func_backing_store_cfg(), causing the driver to proceed in
    the init path even when this vital firmware call has failed. Fix it
    by propagating the error code to the caller.

    Fixes: 1b9394e5a2ad ("bnxt_en: Configure context memory on new devices.")
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan
     
  • The allocated ieee_ets structure goes out of scope without being freed,
    leaking memory. Appropriate result codes should be returned so that
    callers do not rely on invalid data passed by reference.

    Also cache the ETS config retrieved from the device so that it doesn't
    need to be freed. The balance of the code was clearly written with the
    intent of having the results of querying the hardware cached in the
    device structure. The commensurate store was evidently missed though.

    Fixes: 7df4ae9fe855 ("bnxt_en: Implement DCBNL to support host-based DCBX.")
    Signed-off-by: Edwin Peer
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Edwin Peer
     
  • There is an indexing bug in determining these ethtool priority
    counters. Instead of using the queue ID to index, we need to
    normalize by modulo 10 to get the index. This index is then used
    to obtain the proper CoS queue counter. Rename bp->pri2cos to
    bp->pri2cos_idx to make this more clear.

    Fixes: e37fed790335 ("bnxt_en: Add ethtool -S priority counters.")
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan
     
  • Only attach macsec to ethernet devices.

    Syzbot was able to trigger a KMSAN warning in macsec_handle_frame
    by attaching to a phonet device.

    Macvlan has a similar check in macvlan_port_create.

    v1->v2
    - fix commit message typo

    Reported-by: syzbot
    Signed-off-by: Willem de Bruijn
    Signed-off-by: David S. Miller

    Willem de Bruijn
     
  • ASKEY WWHC050 is a mcie LTE modem.
    The oem configuration states:

    T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
    D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
    P: Vendor=1690 ProdID=7588 Rev=ff.ff
    S: Manufacturer=Android
    S: Product=Android
    S: SerialNumber=813f0eef6e6e
    C:* #Ifs= 6 Cfg#= 1 Atr=80 MxPwr=500mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
    E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
    E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
    E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    E: Ad=88(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
    E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
    E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

    Tested on openwrt distribution.

    Signed-off-by: Cezary Jackiewicz
    Signed-off-by: Pawel Dembicki
    Acked-by: Bjørn Mork
    Signed-off-by: David S. Miller

    Pawel Dembicki
     
  • Saeed Mahameed says:

    ====================
    Mellanox, mlx5 fixes 2020-03-05

    This series introduces some fixes to mlx5 driver.

    Please pull and let me know if there is any problem.

    For -stable v5.4
    ('net/mlx5: DR, Fix postsend actions write length')

    For -stable v5.5
    ('net/mlx5e: kTLS, Fix TCP seq off-by-1 issue in TX resync flow')
    ('net/mlx5e: Fix endianness handling in pedit mask')
    ====================

    Reviewed-by: Jakub Kicinski
    Signed-off-by: David S. Miller

    David S. Miller
     
  • The GEO_TX_POWER_LIMIT command was sent although
    there is no wgds table, so the fw got wrong SAR values
    from the driver.

    Fix this by avoiding sending the command if no wgds
    tables are available.

    Signed-off-by: Golan Ben Ami
    Fixes: 39c1a9728f93 ("iwlwifi: refactor the SAR tables from mvm to acpi")
    Signed-off-by: Luca Coelho
    Tested-By: Jonathan McDowell
    Tested-by: Len Brown
    Signed-off-by: Kalle Valo
    Link: https://lore.kernel.org/r/iwlwifi.20200318081237.46db40617cc6.Id5cf852ec8c5dbf20ba86bad7b165a0c828f8b2e@changeid

    Golan Ben Ami
     
  • Three devices, with PCI device ID 0x2526 and subdevice IDs 0x4010,
    0x4018 and 0x401C were removed accidentally. Add them back.

    Reported-by: Brett Hassal
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206661
    Fixes: 0b295a1eb81f ("iwlwifi: add device name to device_info")
    Signed-off-by: Luca Coelho
    Signed-off-by: Kalle Valo
    Link: https://lore.kernel.org/r/iwlwifi.20200317123331.16762b29f26c.I928bcaa799e7b3d33838c0667714eeb9fa665290@changeid

    Luca Coelho
     

22 Mar, 2020

10 commits

  • The hardware offloading of the NETIF_F_HW_CSUM and NETIF_F_RXCSUM
    features requires the use of Transmit Status Blocks before transmit
    frame data and Receive Status Blocks before receive frame data to
    carry the checksum information.

    Unfortunately, these status blocks are currently only enabled when
    the NETIF_F_HW_CSUM feature is enabled. As a result NETIF_F_RXCSUM
    will not actually be offloaded to the hardware unless both it and
    NETIF_F_HW_CSUM are enabled. Fortunately, that is the default
    configuration.

    This commit addresses this issue by always enabling the use of
    status blocks on both transmit and receive frames. Further, it
    replaces the use of a dedicated flag within the driver private
    data structure with direct use of the netdev features flags.

    Fixes: 810155397890 ("net: bcmgenet: use CHECKSUM_COMPLETE for NETIF_F_RXCSUM")
    Signed-off-by: Doug Berger
    Acked-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Doug Berger
     
  • When the DP83867 PHY is strapped to enable Fast Link Drop (FLD) feature
    STRAP_STS2.STRAP_ FLD (reg 0x006F bit 10), the Energy Lost Threshold for
    FLD Energy Lost Mode FLD_THR_CFG.ENERGY_LOST_FLD_THR (reg 0x002e bits 2:0)
    will be defaulted to 0x2. This may cause the phy link to be unstable. The
    new DP83867 DM recommends to always restore ENERGY_LOST_FLD_THR to 0x1.

    Hence, restore default value of FLD_THR_CFG.ENERGY_LOST_FLD_THR to 0x1 when
    FLD is enabled by bootstrapping as recommended by DM.

    Signed-off-by: Grygorii Strashko
    Signed-off-by: David S. Miller

    Grygorii Strashko
     
  • Make sure we clean up devicetree related configuration
    also when clock init fails.

    Fixes: fecd4d7eef8b ("net: stmmac: dwmac-rk: Add integrated PHY support")
    Signed-off-by: Emil Renner Berthing
    Signed-off-by: David S. Miller

    Emil Renner Berthing
     
  • As the description before netdev_run_todo, we cannot call free_netdev
    before rtnl_unlock, fix it by reorder the code.

    This patch is a 1:1 copy of upstream slip.c commit f596c87005f7
    ("slip: not call free_netdev before rtnl_unlock in slip_open").

    Reported-by: yangerkun
    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     
  • Headers ionic_if.h and ionic_regs.h are licensed under three alternative
    licenses and the used SPDX-License-Identifier expression makes
    ./scripts/spdxcheck.py complain:

    drivers/net/ethernet/pensando/ionic/ionic_if.h: 1:52 Syntax error: OR
    drivers/net/ethernet/pensando/ionic/ionic_regs.h: 1:52 Syntax error: OR

    As OR is associative, it is irrelevant if the parentheses are put around
    the first or the second OR-expression.

    Simply add parentheses to make spdxcheck.py happy.

    Signed-off-by: Lukas Bulwahn
    Acked-by: Shannon Nelson
    Signed-off-by: David S. Miller

    Lukas Bulwahn
     
  • the minimum value of skb len that hw supports is 32 rather than 17

    Signed-off-by: Luo bin
    Signed-off-by: David S. Miller

    Luo bin
     
  • the second input parameter of wait_for_completion_timeout should
    be jiffies instead of millisecond

    Signed-off-by: Luo bin
    Signed-off-by: David S. Miller

    Luo bin
     
  • add read barrier in driver code to keep from reading other fileds
    in dma memory which is writable for hw until we have verified the
    memory is valid for driver

    Signed-off-by: Luo bin
    Signed-off-by: David S. Miller

    Luo bin
     
  • should disable eq irq before freeing it, must clear event queue
    depth in hw before freeing relevant memory to avoid illegal
    memory access and update consumer idx to avoid invalid interrupt

    Signed-off-by: Luo bin
    Signed-off-by: David S. Miller

    Luo bin
     
  • it's unreliable for fw to check whether IO is stopped, so driver
    wait for enough time to ensure IO process is done in hw before
    freeing resources

    Signed-off-by: Luo bin
    Signed-off-by: David S. Miller

    Luo bin
     

20 Mar, 2020

4 commits

  • Driver reclaims descriptors in much smaller batches, even if hardware
    indicates more to reclaim, during backpressure. So, fix the check to
    restart the Txq during backpressure, by looking at how many
    descriptors hardware had indicated to reclaim, and not on how many
    descriptors that driver had actually reclaimed. Once the Txq is
    restarted, driver will reclaim even more descriptors when Tx path
    is entered again.

    Fixes: d429005fdf2c ("cxgb4/cxgb4vf: Add support for SGE doorbell queue timer")
    Signed-off-by: Rahul Lakkireddy
    Signed-off-by: David S. Miller

    Rahul Lakkireddy
     
  • commit 7c3bebc3d868 ("cxgb4: request the TX CIDX updates to status page")
    reverted back to getting Tx CIDX updates via DMA, instead of interrupts,
    introduced by commit d429005fdf2c ("cxgb4/cxgb4vf: Add support for SGE
    doorbell queue timer")

    However, it missed reverting back several code changes where Tx CIDX
    updates are not explicitly requested during backpressure when using
    interrupt mode. These missed changes cause slow recovery during
    backpressure because the corresponding interrupt no longer comes and
    hence results in Tx throughput drop.

    So, revert back these missed code changes, as well, which will allow
    explicitly requesting Tx CIDX updates when backpressure happens.
    This enables the corresponding interrupt with Tx CIDX update message
    to get generated and hence speed up recovery and restore back
    throughput.

    Fixes: 7c3bebc3d868 ("cxgb4: request the TX CIDX updates to status page")
    Fixes: d429005fdf2c ("cxgb4/cxgb4vf: Add support for SGE doorbell queue timer")
    Signed-off-by: Rahul Lakkireddy
    Signed-off-by: David S. Miller

    Rahul Lakkireddy
     
  • Andrew reported:

    After a number of network port link up/down changes, sometimes the switch
    port gets stuck in a state where it thinks it is still transmitting packets
    but the cpu port is not actually transmitting anymore. In this state you
    will see a message on the console
    "mtk_soc_eth 1e100000.ethernet eth0: transmit timed out" and the Tx counter
    in ifconfig will be incrementing on virtual port, but not incrementing on
    cpu port.

    The issue is that MAC TX/RX status has no impact on the link status or
    queue manager of the switch. So the queue manager just queues up packets
    of a disabled port and sends out pause frames when the queue is full.

    Change the LINK bit to reflect the link status.

    Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
    Reported-by: Andrew Smith
    Signed-off-by: René van Dorst
    Reviewed-by: Vivien Didelot
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    René van Dorst
     
  • During initialization the driver issues a software reset command and
    then waits for the system status to change back to "ready" state.

    However, before issuing the reset command the driver does not check that
    the system is actually in "ready" state. On Spectrum-{1,2} systems this
    was always the case as the hardware initialization time is very short.
    On Spectrum-3 systems this is no longer the case. This results in the
    software reset command timing-out and the driver failing to load:

    [ 6.347591] mlxsw_spectrum3 0000:06:00.0: Cmd exec timed-out (opcode=40(ACCESS_REG),opcode_mod=0,in_mod=0)
    [ 6.358382] mlxsw_spectrum3 0000:06:00.0: Reg cmd access failed (reg_id=9023(mrsr),type=write)
    [ 6.368028] mlxsw_spectrum3 0000:06:00.0: cannot register bus device
    [ 6.375274] mlxsw_spectrum3: probe of 0000:06:00.0 failed with error -110

    Fix this by waiting for the system to become ready both before issuing
    the reset command and afterwards. In case of failure, print the last
    system status to aid in debugging.

    Fixes: da382875c616 ("mlxsw: spectrum: Extend to support Spectrum-3 ASIC")
    Signed-off-by: Ido Schimmel
    Reviewed-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel