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 77B6A345726; Tue, 26 Aug 2025 13:48:54 +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=1756216134; cv=none; b=vFzYUiHiFJnJrxY3mQBMt2SH5dKRSgx+Ujqz7sS0VDRxGBahOtN0TEjFaJV0GKhDw5ALSzOEcpmPLEYcelcEBnpslGQam/Mnz5EvfIt6GobE4Cf8wxK2eoKYZ/w6TQrqVKA/fXQt99jiVdqjfRoOno8q7krdvRK1ESMJEKDF6f0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756216134; c=relaxed/simple; bh=tVjOuTUICe6jNSpYznWVgv4U6cbitFbCcYWskxvw4GI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t5zu9n1+9FtSl8FPTGctEtOf3yxYkwJahveaUnTA+XpSi8rzFy1cGyU4TB/wpan87cmb6dSjw72U20qqnCbg6VgpWQ47aAKbV6fRgUZvKu4s84aR4/2pHvBYqEfWE0hk5mrgF8sw/CX0W8pO9wUf47Ner1ZzPR8f/PX98NzO27A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IuoaOVel; 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="IuoaOVel" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D803C113CF; Tue, 26 Aug 2025 13:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756216134; bh=tVjOuTUICe6jNSpYznWVgv4U6cbitFbCcYWskxvw4GI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IuoaOVelAh0ZAtpZNieW7FKQ9GDHX9MdWPiMIyKv2yOvXadOWg6SGHFhNA7rVCpx9 qxM5Xhrfl1gaY90zITpaXpOTrHyFt8ZsDKUwhvUlBAWzJvQOnLkYKwdlndrW440WCi guP3UVYm1qqKaw0LWYL4mq9gxKZB/YzquwLadn1o= 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 5.15 265/644] net: usb: asix_devices: add phy_mask for ax88772 mdio bus Date: Tue, 26 Aug 2025 13:05:56 +0200 Message-ID: <20250826110952.941019916@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@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 5.15-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 @@ -669,6 +669,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);