From patchwork Mon Jul 5 06:56:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 12358331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6B48C07E99 for ; Mon, 5 Jul 2021 06:58:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6F5D161350 for ; Mon, 5 Jul 2021 06:58:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F5D161350 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:List-Owner; bh=MrLZM0Z9gyvOzxuR/dXUqcaMuPtFyoVroMrQowp6HV0=; b=SL CuHcGsmfSqUTll2xjZDuB87aPpxJwslKifzSQM/tirt2PTE/WhaL0zt/IREPPo7AydeD4/HOMvgcY agJCoW4GR68nkeg3rg67jBIQzXeApDLproFzBB+j7UKao6sMxCkVsmyGkIDLYhPQnkXM4IOj/YHlc 22jmAbuXENthmZ1hT13sQqrl5xkfrGKiALnKSiiVF2uStx1PWtsKONCrLAkWaTs0gy8qFQDK6j90x nSaZFAQ+dpuxCLQI8CSOGzD6bdZz1eOrzg1w5nJiqA1OTpDUx0I/BW00Bpylxx4Rxb5YCbxrRiTpf C+e4SDJ44+kQEUZ3+eIoLSVcXJvl3+Qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0IXb-0081mn-Lj; Mon, 05 Jul 2021 06:57:15 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0IXX-0081m8-3I for linux-arm-kernel@lists.infradead.org; Mon, 05 Jul 2021 06:57:13 +0000 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20210705065704euoutp01df10901c88a77380b0fed08963320a2b~O0rzzHfKa0973209732euoutp01j for ; Mon, 5 Jul 2021 06:57:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20210705065704euoutp01df10901c88a77380b0fed08963320a2b~O0rzzHfKa0973209732euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625468224; bh=Rn6oui8vNSOkba5+SL9hOQCcwE6W7/neAD8+y9vs3gY=; h=From:To:Cc:Subject:Date:References:From; b=ZLp/xms0USWtQpdfN4vwt8eg7e7Vt4Qb9LDuue8r6sGBT5a5ifCwmgSlR6PPtrV4R ojYAtFRslq7MpydzI9OtuxqancFp67IeG2GByKf1Bw7ImvWBctu4oaUlw+VWeVyQM0 +bGGMkk/4197CTe6vf5blwa9mYnXHzq3NAlXhT7c= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20210705065703eucas1p24403b2842e74f7d843f8d77ce61aab6e~O0rzFHrJb2770227702eucas1p2g; Mon, 5 Jul 2021 06:57:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 07.1F.45756.F3DA2E06; Mon, 5 Jul 2021 07:57:03 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20210705065703eucas1p2e89258a2fc286896b755047e06f514cb~O0ryjuym82752127521eucas1p2c; Mon, 5 Jul 2021 06:57:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210705065703eusmtrp2704ec35040dd29269ebdc309b2f114f3~O0ryi_AuN1229112291eusmtrp2q; Mon, 5 Jul 2021 06:57:03 +0000 (GMT) X-AuditID: cbfec7f2-7d5ff7000002b2bc-e7-60e2ad3f3ff7 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 70.FC.31287.E3DA2E06; Mon, 5 Jul 2021 07:57:02 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210705065702eusmtip15a3d78a6d0c3d1a4c75d47a32eb85aff~O0ryAs9NO0308503085eusmtip1I; Mon, 5 Jul 2021 06:57:02 +0000 (GMT) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path" Date: Mon, 5 Jul 2021 08:56:57 +0200 Message-Id: <20210705065657.30356-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42LZduzneV37tY8SDDYeVrS4tH0Zq8WC/dYW nbM3sFtsenyN1WLi/rPsFmuP3GW3eL7wB7PFwQ9PWC369gZZtNwxdeDyeHJwHpPHmnlrGD12 zrrL7rFpVSebx+Yl9R6Tbyxn9Ohtfsfm0bdlFaPH501yAZxRXDYpqTmZZalF+nYJXBldh58z FZzhq1hw5QlLA+MWni5GDg4JAROJl7uFuxi5OIQEVjBKfJx/gRHC+cIosXnqBXYI5zOjxIaF 24AcTrCOLd0TWCESyxkl1v76xQLX8mPzdVaQKjYBQ4mut11sILaIQLZEw/FWsFHMAu1MEjem rmUGSQgLJEqsadkAVsQioCox5ctRMJtXwFZi5qrHjBDr5CVWbzjADNIsIbCWQ+L6ikdMEAkX if27LrNA2MISr45vgbpPRuL/zvlMEA3NjBIPz61lh3B6GCUuN82AGmstcefcLzZQGDALaEqs 36UPEXaUePV3JxskaPgkbrwVBAkzA5mTtk1nhgjzSnS0CUFUq0nMOr4Obu3BC5eYIWwPiTnP J4GdJiQQK7Hz+CfmCYxysxB2LWBkXMUonlpanJueWmyYl1quV5yYW1yal66XnJ+7iRGYTE7/ O/5pB+PcVx/1DjEycTAeYpTgYFYS4RWZ8ihBiDclsbIqtSg/vqg0J7X4EKM0B4uSOO+q2Wvi hQTSE0tSs1NTC1KLYLJMHJxSDUyeOd62vw+IhG9dlrjzaVl9g6j8xhtuNtrJJyKnFMr8rL5w X6KV42eUqq+wxXXOgICGzUIP5UsXcInsUtM72zV/Q0FQS8uUeSqvLIt9fr0QEP+znLXz0U+F ys5Zi0S8LsmquV8O/blv62qFH7e+1lqbKLGv6Yq4u+BRzrKQ9xHBBrd/1XjbOsi+kklkduC+ wKUmxP2MTbbgvk+CpfzhpunWawqFvl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Op3UcW72z4++jG8YBb jFt2dYtpCZQ/Tj3+5/KTpR8nRklxsylPkwuSbnTffleJpTgj0VCLuag4EQC9ltwG6wIAAA== X-CMS-MailID: 20210705065703eucas1p2e89258a2fc286896b755047e06f514cb X-Msg-Generator: CA X-RootMTR: 20210705065703eucas1p2e89258a2fc286896b755047e06f514cb X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210705065703eucas1p2e89258a2fc286896b755047e06f514cb References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210704_235711_627562_36DA4768 X-CRM114-Status: GOOD ( 16.07 ) 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: , Cc: Will Deacon , Joerg Roedel , Rob Clark , Amey Narkhede , Robin Murphy , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org QCOM IOMMU driver calls bus_set_iommu() for every IOMMU device controller, what fails for the second and latter IOMMU devices. This is intended and must be not fatal to the driver registration process. Also the cleanup path should take care of the runtime PM state, what is missing in the current patch. Revert relevant changes to the QCOM IOMMU driver until a proper fix is prepared. This partially reverts commit 249c9dc6aa0db74a0f7908efd04acf774e19b155. Fixes: 249c9dc6aa0d ("iommu/arm: Cleanup resources in case of probe error path") Suggested-by: Will Deacon Signed-off-by: Marek Szyprowski Acked-by: Will Deacon --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index 25ed444ff94d..021cf8f65ffc 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -849,12 +849,10 @@ static int qcom_iommu_device_probe(struct platform_device *pdev) ret = iommu_device_register(&qcom_iommu->iommu, &qcom_iommu_ops, dev); if (ret) { dev_err(dev, "Failed to register iommu\n"); - goto err_sysfs_remove; + return ret; } - ret = bus_set_iommu(&platform_bus_type, &qcom_iommu_ops); - if (ret) - goto err_unregister_device; + bus_set_iommu(&platform_bus_type, &qcom_iommu_ops); if (qcom_iommu->local_base) { pm_runtime_get_sync(dev); @@ -863,13 +861,6 @@ static int qcom_iommu_device_probe(struct platform_device *pdev) } return 0; - -err_unregister_device: - iommu_device_unregister(&qcom_iommu->iommu); - -err_sysfs_remove: - iommu_device_sysfs_remove(&qcom_iommu->iommu); - return ret; } static int qcom_iommu_device_remove(struct platform_device *pdev)