From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CFF2C44536 for ; Wed, 21 Jan 2026 14:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aVmNpRwJkD/JEMm4c8LH3FOIC2UTRCdrTMW6411SbMs=; b=xdM3CORIEAVxlT8rzxMQNcw5Vn tgileNNpxf0FeFUb/ObSHZ0OZomIFY2GjkNfKUWB6bFctA+JPwbqMZfpY4GvZ+eF/N+wmcndSnxto YIrDR16D7DglCj4jBwbG6tdlRv/iqzIeHSnkx5NJZBBRjsCYmYRjp9ta0SbQ2kTI7iLQH8GncXge5 Bb0I8abagHJO+L3KIutEIv0R0qfuuE8tWUYrYmHtULEQK8Kzx8SpbJHwhBrp8/QzP9N9HElvl5FYW sTCF/zg1pV4YxdW34d1XAmUVQpq385FOnlvim+elODkUT0/VT7Dx/f/XbDLNyRI2NH7rahu47EziX tqLUScQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1viZTz-00000005d78-2kt6; Wed, 21 Jan 2026 14:46:55 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1viZTy-00000005d5d-3Qc9 for linux-arm-kernel@lists.infradead.org; Wed, 21 Jan 2026 14:46:54 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 6D9CE60097; Wed, 21 Jan 2026 14:46:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A8B3C4CEF1; Wed, 21 Jan 2026 14:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1769006813; bh=S+5EpmdELU8PLZTSrl8ayAXpEobV1mMRAAa5uAOth0c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oRuaQeTimy3+0QFPFe2bCRMcbMxj26B7rlNdaMdWcO384tZkzsFAqbDlm9YpSBtMB bovOxj10jSa3NGXqSBGunOpvNJvHFgeR9dGqZJ1JeIaLmvXa+mLoe834NRHzxK8+q4 RpmMQ7E3dv33x0KyCuEi5FH92zmTQRz4EpAJqHu0= Date: Wed, 21 Jan 2026 15:46:49 +0100 From: Greg KH To: Danilo Krummrich Cc: rafael@kernel.org, broonie@kernel.org, will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, robin.clark@oss.qualcomm.com, hanguidong02@gmail.com, quic_c_gdjako@quicinc.com, dmitry.baryshkov@oss.qualcomm.com, driver-core@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] iommu/arm-smmu-qcom: do not register driver in probe() Message-ID: <2026012139-crewmate-radiantly-d533@gregkh> References: <20260121141215.29658-1-dakr@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260121141215.29658-1-dakr@kernel.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 21, 2026 at 03:12:01PM +0100, Danilo Krummrich wrote: > Commit 0b4eeee2876f ("iommu/arm-smmu-qcom: Register the TBU driver in > qcom_smmu_impl_init") intended to also probe the TBU driver when > CONFIG_ARM_SMMU_QCOM_DEBUG is disabled, but also moved the corresponding > platform_driver_register() call into qcom_smmu_impl_init() which is > called from arm_smmu_device_probe(). > > However, it neither makes sense to register drivers from probe() > callbacks of other drivers, nor does the driver core allow registering > drivers with a device lock already being held. > > The latter was revealed by commit dc23806a7c47 ("driver core: enforce > device_lock for driver_match_device()") leading to a deadlock condition > described in [1]. > > Additionally, it was noted by Robin that the current approach is > potentially racy with async probe [2]. > > Hence, fix this by registering the qcom_smmu_tbu_driver from > module_init(). Unfortunately, due to the vendoring of the driver, this > requires an indirection through arm-smmu-impl.c. > > Reported-by: Mark Brown > Closes: https://lore.kernel.org/lkml/7ae38e31-ef31-43ad-9106-7c76ea0e8596@sirena.org.uk/ > Link: https://lore.kernel.org/lkml/DFU7CEPUSG9A.1KKGVW4HIPMSH@kernel.org/ [1] > Link: https://lore.kernel.org/lkml/0c0d3707-9ea5-44f9-88a1-a65c62e3df8d@arm.com/ [2] > Fixes: dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()") > Fixes: 0b4eeee2876f ("iommu/arm-smmu-qcom: Register the TBU driver in qcom_smmu_impl_init") > Signed-off-by: Danilo Krummrich Reviewed-by: Greg Kroah-Hartman