From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388123; b=gxGoSdLt6J4yyZ8JIExu/Exzw51bmG5krdsTQkIHl7I23KxPMhazFdEke4+xckjK7l+t TFGkgQTO3zJ0aEfI8Er84aXgqCujlftYhUX4hGcesOfcjpOtrZl7Nfeou57q887yABPje Rb9cfK0lEZ9EVUgS+ut5yq5Rtj8cJKwZu68tEksaj5M76t8tZV7dLjbO93wTtVlOfVltU utPdvdDLA7HvthJhnREwb2D1OEBuX5+8crHuDl9v6dWV+2tCUbDtcGF6zczW6r9rdtbD4 qZ4iSoFMk9AGYOkdECSVBaIXtAMEBB72mDCdyfrMAcukJHELLAgNPsfa7dM+Io1I3AA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388123; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Zol1GI/cw38/Fh2/3MTeV9SXYMgvcX6pMUK0Oq7XnZI=; b=ptAFv8+Geu4t3IYfMy7HUJjtxXdtFgMngcJRpnhIy3jxpGqHPEK+4BgX3HuTkt/Ftv45 LYDuVLPkhAIiA9POJv4z7xYaw9Gx9r4LQpRMNeV/mLTZEyCE4EflwGAiFvjhhg1fgVhsj a0E6tLt86k1Zr48Jiq7irk/wNrZbx9RLcmiu7q8miMqVY8PT8wbP0T5PrKceH/ikT+2L+ F0uSqq97Fdi0FMLb1JqzD7o/w9QjX6EfmpXdORDR1SmIaCs/5R37a/YC72qoMuirjiV4v m+gRWgLF5zeunz0XtQsiX5x4etzt7IQbwudFP7BVs6JoUzSEMyQRRHWcw94U1Wa4tVw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SRnbnpNV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2443E606A322; Fri, 4 Dec 2026 12:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SRnbnpNV Received: by smtp.kernel.org (Postfix) with ESMTPSA id B355E1F000C2; Fri, 4 Dec 2026 12:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388123; bh=Zol1GI/cw38/Fh2/3MTeV9SXYMgvcX6pMUK0Oq7XnZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SRnbnpNVNfxaP5IrJzDXrlRYed9UvWz9+BBBCOqf1I02PB758ZTw8p2XfvfzIkuKJ BKBpMijm8A0VXsvxvVRStYjGlW65rWlBeI92r1LuFUDGXpRQA4PL4vfjVO4C3JpyPC ly3wKXbTXcBWDWXcLPnVV6X9WiVVimtOODKYQeR0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tapio Reijonen , Daniel Machon , Paolo Abeni Subject: [PATCH 6.1 0490/1059] net: dsa: microchip: initialize the IRQ access mutex Date: Fri, 4 Dec 2026 19:00:21 +0900 Message-ID: <20261204100656.928403345@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tapio Reijonen commit ba1dc196502f3435f4ae53ed6745caacf066f83e upstream. ksz_switch_register() initializes dev_mutex, regmap_mutex, alu_mutex and vlan_mutex but not lock_irq, which the IRQ chip takes in its bus lock callbacks on every mask and unmask of a switch interrupt, and the PTP code takes the same way. The zeroed mutex happens to work on the uncontended fast path, but with CONFIG_DEBUG_MUTEXES the first lock, from the IRQ domain mapping during probe, warns: DEBUG_LOCKS_WARN_ON(lock->magic != lock) WARNING: kernel/locking/mutex.c:625 at __mutex_lock ... ksz_irq_domain_map irq_domain_associate_locked irq_create_mapping_affinity ksz_irq_common_setup ksz9477_setup dsa_register_switch ksz_spi_probe and turns lock debugging off for the rest of the boot. Initialize it with the other mutexes. Triggered at every boot of a KSZ9897S over SPI on an i.MX6 SoloX board with CONFIG_DEBUG_MUTEXES, on v7.4-rc1 and earlier. With this patch the same board boots with lock debugging enabled and it stays enabled (debug_locks 1) through two hours of unrelated stress tests. Fixes: c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link") Cc: stable@vger.kernel.org Signed-off-by: Tapio Reijonen Reviewed-by: Daniel Machon Link: https://patch.msgid.link/20261104-ksz-irq-mutex-init-v1-1-e3bb7d9dbd80@vaisala.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/microchip/ksz_common.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -2923,6 +2923,7 @@ int ksz_switch_register(struct ksz_devic mutex_init(&dev->regmap_mutex); mutex_init(&dev->alu_mutex); mutex_init(&dev->vlan_mutex); + mutex_init(&dev->lock_irq); ret = ksz_switch_detect(dev); if (ret)