Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: zynqmp: Take the phy mutex in xlate

Take the phy mutex in xlate to protect against concurrent
modification/access to gtr_phy. This does not typically cause any
issues, since in most systems the phys are only xlated once and
thereafter accessed with the phy API (which takes the locks). However,
we are about to allow userspace to access phys for debugging, so it's
important to avoid any data races.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://lore.kernel.org/r/20240628205540.3098010-5-sean.anderson@linux.dev
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Sean Anderson and committed by
Vinod Koul
d79c6840 235d8b66

+1
+1
drivers/phy/xilinx/phy-zynqmp.c
··· 759 759 phy_type = args->args[1]; 760 760 phy_instance = args->args[2]; 761 761 762 + guard(mutex)(&gtr_phy->phy->mutex); 762 763 ret = xpsgtr_set_lane_type(gtr_phy, phy_type, phy_instance); 763 764 if (ret < 0) { 764 765 dev_err(gtr_dev->dev, "Invalid PHY type and/or instance\n");