From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1998631B131; Mon, 18 Aug 2025 12:50:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755521444; cv=none; b=rCld/Ze7LC8mDR+YpN7vMDQC301wFGNXwOt7cbe2lmnqFsrtKSuV6uOZIIHqyP8pV1Pyto9L6cT8EadKl5XoYGB9k9iDqp4ZfLNBEb+E9ZBw6U4MFDu4n0GMs6ukf3h/zqMnQP657yBP05HE38wDV6lnCURzEH/TKFgydRi9FZ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755521444; c=relaxed/simple; bh=e57gELrrxuHUpYyweIC8QGn61UksmZqsxFbbOB7/lpY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lpwdbAsTp7pCFVufw+P/S7/HvlBQ3NDjWMWLYjGGYjuPKLdjnlzcB9t+BoNd0iY+C0GhdexXJqY68GqkTx87RZM1nDp/Gp1yfAcPCFi8kPC3MLdpzs7gv74ePMVcCoGGzYoRxosriMMZJtFzgcqQ+vzCuboWgLn/z9kYl8tenas= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O90dMiJQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="O90dMiJQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FCBCC4CEEB; Mon, 18 Aug 2025 12:50:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755521443; bh=e57gELrrxuHUpYyweIC8QGn61UksmZqsxFbbOB7/lpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O90dMiJQWAOIH+qfizuQ7Fd4Uu5/uowDzkV4JvBFyeqz1xyXq8bnuduucSXofgzkB yBjV6I93S+05d4zVrrZbBgSotXMQj7YxSiT4obtXvEGw2TRc7gu83huXACquiOI6oP /jjtXMuDzsQbcxvvE4JZp4yMX4s/TWfs/0hsxyKE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xu Yang , Oleksij Rempel , Paolo Abeni Subject: [PATCH 6.12 022/444] net: usb: asix_devices: add phy_mask for ax88772 mdio bus Date: Mon, 18 Aug 2025 14:40:48 +0200 Message-ID: <20250818124449.762120718@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124448.879659024@linuxfoundation.org> References: <20250818124448.879659024@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xu Yang commit 4faff70959d51078f9ee8372f8cff0d7045e4114 upstream. Without setting phy_mask for ax88772 mdio bus, current driver may create at most 32 mdio phy devices with phy address range from 0x00 ~ 0x1f. DLink DUB-E100 H/W Ver B1 is such a device. However, only one main phy device will bind to net phy driver. This is creating issue during system suspend/resume since phy_polling_mode() in phy_state_machine() will directly deference member of phydev->drv for non-main phy devices. Then NULL pointer dereference issue will occur. Due to only external phy or internal phy is necessary, add phy_mask for ax88772 mdio bus to workarnoud the issue. Closes: https://lore.kernel.org/netdev/20250806082931.3289134-1-xu.yang_2@nxp.com Fixes: e532a096be0e ("net: usb: asix: ax88772: add phylib support") Cc: stable@vger.kernel.org Signed-off-by: Xu Yang Tested-by: Oleksij Rempel Reviewed-by: Oleksij Rempel Link: https://patch.msgid.link/20250811092931.860333-1-xu.yang_2@nxp.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/asix_devices.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -676,6 +676,7 @@ static int ax88772_init_mdio(struct usbn priv->mdio->read = &asix_mdio_bus_read; priv->mdio->write = &asix_mdio_bus_write; priv->mdio->name = "Asix MDIO Bus"; + priv->mdio->phy_mask = ~(BIT(priv->phy_addr) | BIT(AX_EMBD_PHY_ADDR)); /* mii bus name is usb-- */ snprintf(priv->mdio->id, MII_BUS_ID_SIZE, "usb-%03d:%03d", dev->udev->bus->busnum, dev->udev->devnum);