Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3646290pxb; Mon, 24 Jan 2022 14:19:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQSGFi3DZmLkI8l9YGTM0ul0KcEeYRroXJXuW3DbWU8Z4rmpwup+9sBqr9CKNqC0zvVjZY X-Received: by 2002:a17:902:be11:b0:149:5e5e:7b10 with SMTP id r17-20020a170902be1100b001495e5e7b10mr16821497pls.75.1643062763059; Mon, 24 Jan 2022 14:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062763; cv=none; d=google.com; s=arc-20160816; b=ChlmqxK63X8ADIMybTs4MRHolsIQOSf8oHbIcwUT494ngvTnBtKD5gjsno1MiPjwZ3 gpB+9L2J6P8Ohw87jLxMZYrcCyVyM1beSauKlua+YpmmoKsr2rRAlHl+rblFu5upvJVv 2g6FlKyKXj0RRkOvjiaV/+3pSwxKPd0cRuNP2XS3PqLBpJYTyZTk9cEop1yIn9n4iyLW mHb+/FWrFvnmAOhpjZnDwciwzaFqou37Fh43xk3EIvSo03i5vst1iYFykisJe9jyk70Q ElPTONAx+lyHkxNiwe/FtQheNTEcOlpHoN840gUZL6NDiK2cr77mEmNYEmyttCPBgCQS JS1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wm6XV/kDBvC7UXJJq4Jh0xVd64OA8KUpprjJkBBUjzg=; b=OfqWzsO0291qdmzIgvj7PRJLOMlhRVG1LpKkuIIU/Jv7s5OINsUMVg/0o3+sgPGq/B l2Vm+pT9CWq87az4amRhdMvj9yoMApJTqL2W2SNnoWc4MmkSRbXnqWb+0/1wkUIdgAy/ aULDWsKkcUhC92bYkc+jblglrf/lbuqpipUOWicn3NHE2OYhm0svE2WuvpSFS7aLhr47 qgPCv9PYQqjHKqdCjUHt28BTgYGt68UrZgx/ZblfML1U57XkQhynBHR6T1FHateHJAyO enbeDcUrl01FAtZmB7ixYLS6LSRtk5wNx6kK3zTsTHi8RSJKjhFcNihoELAK4e6fqCoD 1w1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WwL7mIcR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l4si463746pju.77.2022.01.24.14.19.03; Mon, 24 Jan 2022 14:19:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WwL7mIcR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1581516AbiAXWL5 (ORCPT + 99 others); Mon, 24 Jan 2022 17:11:57 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:46924 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1452794AbiAXV0h (ORCPT ); Mon, 24 Jan 2022 16:26:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1302661320; Mon, 24 Jan 2022 21:26:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20732C340E4; Mon, 24 Jan 2022 21:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059595; bh=syKAXgGkNN/cd6e1sptDYNJgaiCH3RcEKn5+Joj72mU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WwL7mIcRKNrtdRnVhXugrE7R6u7XLI+qBs6BWTgZ/D3IQFdBisEBlgxpnBqdhyJdI hETtNEJYu4nqYFijQ8INpb0BCw/lYycFgY/rKHcNiZ47Z8N0J5sl7Udymfuc5GOK1y k8quSd+1LKbTms3RLOtgFvoZfLi/tul/s34h5bUc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Chiu , Felix Fietkau , Sasha Levin Subject: [PATCH 5.16 0669/1039] mt76: mt7615: fix possible deadlock while mt7615_register_ext_phy() Date: Mon, 24 Jan 2022 19:40:58 +0100 Message-Id: <20220124184147.862142126@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Chiu [ Upstream commit 8c55516de3f9b76b9d9444e7890682ec2efc809f ] ieee80211_register_hw() is called with rtnl_lock held, and this could be caused lockdep from a work item that's on a workqueue that is flushed with the rtnl held. Move mt7615_register_ext_phy() outside the init_work(). Signed-off-by: Peter Chiu Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c index a2465b49ecd0c..87b4aa52ee0f9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c @@ -28,8 +28,6 @@ static void mt7615_pci_init_work(struct work_struct *work) return; mt7615_init_work(dev); - if (dev->dbdc_support) - mt7615_register_ext_phy(dev); } static int mt7615_init_hardware(struct mt7615_dev *dev) @@ -160,6 +158,12 @@ int mt7615_register_device(struct mt7615_dev *dev) mt7615_init_txpower(dev, &dev->mphy.sband_2g.sband); mt7615_init_txpower(dev, &dev->mphy.sband_5g.sband); + if (dev->dbdc_support) { + ret = mt7615_register_ext_phy(dev); + if (ret) + return ret; + } + return mt7615_init_debugfs(dev); } -- 2.34.1