mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 14:44:42 +02:00
Merge branch 'net-macb-fix-the-link-speed-the-taprio-setup-reads'
Aleksei Sviridkin says: ==================== net: macb: fix the link speed the taprio setup reads Two small fixes in macb_taprio_setup_replace(), both in how it obtains the link speed it scales the schedule with. The first: it hands phylink_ethtool_ksettings_get() a stack variable it never zeroed, while phylink fills only what the link mode provides and even reads one field back from the caller. The second: the speed check is written as "<= 0" on a u32, so SPEED_UNKNOWN passes it and turns into a 1 ns hardware limit that every entry then exceeds. Compile-tested against net; the driver has no test surface, and no macb board here. ==================== Link: https://patch.msgid.link/20260903123652.23900-1-f@lex.la Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
commit
c51fe22812
|
|
@ -4300,9 +4300,9 @@ static int macb_taprio_setup_replace(struct net_device *netdev,
|
|||
u64 total_on_time = 0, start_time_sec = 0, start_time = conf->base_time;
|
||||
u32 configured_queues = 0, speed = 0, start_time_nsec;
|
||||
struct macb_queue_enst_config *enst_queue;
|
||||
struct tc_taprio_sched_entry *entry;
|
||||
struct ethtool_link_ksettings kset = {};
|
||||
struct macb *bp = netdev_priv(netdev);
|
||||
struct ethtool_link_ksettings kset;
|
||||
struct tc_taprio_sched_entry *entry;
|
||||
struct macb_queue *queue;
|
||||
u32 queue_mask;
|
||||
u8 queue_id;
|
||||
|
|
@ -4329,8 +4329,8 @@ static int macb_taprio_setup_replace(struct net_device *netdev,
|
|||
}
|
||||
|
||||
speed = kset.base.speed;
|
||||
if (unlikely(speed <= 0)) {
|
||||
netdev_err(netdev, "Invalid speed: %d\n", speed);
|
||||
if (unlikely(speed == SPEED_UNKNOWN || !speed)) {
|
||||
netdev_err(netdev, "Invalid speed %d, link-down?\n", speed);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user