Patch "net: lan966x: Remove ptp traps in case the ptp is not enabled." has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: lan966x: Remove ptp traps in case the ptp is not enabled.

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-lan966x-remove-ptp-traps-in-case-the-ptp-is-not-.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cec5099bef575fbff139511e24c071c79c05fb60
Author: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx>
Date:   Fri May 17 15:58:08 2024 +0200

    net: lan966x: Remove ptp traps in case the ptp is not enabled.
    
    [ Upstream commit eda40be3a5ff3fdce513d2bcfeaca8cc16cf962a ]
    
    Lan966x is adding ptp traps to redirect the ptp frames to the CPU such
    that the HW will not forward these frames anywhere. The issue is that in
    case ptp is not enabled and the timestamping source is et to
    HWTSTAMP_SOURCE_NETDEV then these traps would not be removed on the
    error path.
    Fix this by removing the traps in this case as they are not needed.
    
    Fixes: 54e1ed69c40a ("net: lan966x: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()")
    Suggested-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
    Reviewed-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
    Signed-off-by: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240517135808.3025435-1-horatiu.vultur@xxxxxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
index 61d88207eed42..6695ed661ef83 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
@@ -474,14 +474,14 @@ static int lan966x_port_hwtstamp_set(struct net_device *dev,
 	    cfg->source != HWTSTAMP_SOURCE_PHYLIB)
 		return -EOPNOTSUPP;
 
+	if (cfg->source == HWTSTAMP_SOURCE_NETDEV && !port->lan966x->ptp)
+		return -EOPNOTSUPP;
+
 	err = lan966x_ptp_setup_traps(port, cfg);
 	if (err)
 		return err;
 
 	if (cfg->source == HWTSTAMP_SOURCE_NETDEV) {
-		if (!port->lan966x->ptp)
-			return -EOPNOTSUPP;
-
 		err = lan966x_ptp_hwtstamp_set(port, cfg, extack);
 		if (err) {
 			lan966x_ptp_del_traps(port);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux