]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: microchip: sparx5: fix PTP init/deinit not checking all ports
authorCasper Andersson <casper.casan@gmail.com>
Fri, 3 Feb 2023 08:55:57 +0000 (09:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2023 18:11:45 +0000 (19:11 +0100)
commitc0eb3c0cdd1bb6501ad72521b13d3b3316e038e9
tree8e424c7db7e996ce02d9a44e50cba588e36ed813
parent89c0c69fc7398f3ea3bc900a7ae3cab0c8c97f4e
net: microchip: sparx5: fix PTP init/deinit not checking all ports

[ Upstream commit d7d94b2612f5dc25d61dc7bf58aafe7b31f40191 ]

Check all ports instead of just port_count ports. PTP init was only
checking ports 0 to port_count. If the hardware ports are not mapped
starting from 0 then they would be missed, e.g. if only ports 20-30 were
mapped it would attempt to init ports 0-10, resulting in NULL pointers
when attempting to timestamp. Now it will init all mapped ports.

Fixes: 70dfe25cd866 ("net: sparx5: Update extraction/injection for timestamping")
Signed-off-by: Casper Andersson <casper.casan@gmail.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c