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 X-Spam-Level: X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 3F779C07E96 for ; Tue, 6 Jul 2021 16:52:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19AF361C41 for ; Tue, 6 Jul 2021 16:52:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229910AbhGFQzS (ORCPT ); Tue, 6 Jul 2021 12:55:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:41726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbhGFQzR (ORCPT ); Tue, 6 Jul 2021 12:55:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9105F61C2F; Tue, 6 Jul 2021 16:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625590359; bh=rHrA7JR1kuHRO2ObXygxNOXB6QH+LMH9XbYpS8HdJ9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=spoMXdtXvQawjGCgd1UmNPafDZ5jez0CvDeD3r8po/jkAIVhUdq7TptLXjdqWjlG6 HLiMw3suvYCjfmlI+lwvjwDL+vID0oebjv+QzU+7k7sj+Ltlm4FUaMMBRee6Ty8opY gHNUHaBaLfuE3VnyrQMArpz+heloBAPlvq+rmH83zOtDuuImbpqQ8TuOwvEgfEhrXX xfv6nWk/s2df/LoIlJA93I0c3M8rggXgoZs4U6xH565bvMtHNMaQRMfrJshINRQTvI MNlvO3ARjb8gsYwjHQlKkgOMFX6A9tEs/LYUTBj0Bi3PvkVw+r+p3vORTvxPgKRKr7 4hXPec9l829fQ== Date: Tue, 6 Jul 2021 17:52:34 +0100 From: Will Deacon To: Marek Szyprowski Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Rob Clark , Robin Murphy , Joerg Roedel , Amey Narkhede , Krishna Reddy Subject: Re: [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path" Message-ID: <20210706165233.GB20750@willie-the-truck> References: <20210705065657.30356-1-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210705065657.30356-1-m.szyprowski@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Mon, Jul 05, 2021 at 08:56:57AM +0200, Marek Szyprowski wrote: > 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 > --- > drivers/iommu/arm/arm-smmu/qcom_iommu.c | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) Thanks, Marek: Acked-by: Will Deacon Joerg -- please can you pick this up as a fix? Cheers, Will > 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) > -- > 2.17.1 > 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 X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 BE5CBC07E96 for ; Tue, 6 Jul 2021 16:52:46 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 6E7B161C3F for ; Tue, 6 Jul 2021 16:52:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E7B161C3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4362E605C5; Tue, 6 Jul 2021 16:52:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dahbqDEM4l93; Tue, 6 Jul 2021 16:52:45 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2C8B0605A7; Tue, 6 Jul 2021 16:52:45 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 05585C001A; Tue, 6 Jul 2021 16:52:45 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 92D5AC000E for ; Tue, 6 Jul 2021 16:52:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 705C64013B for ; Tue, 6 Jul 2021 16:52:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a-W1XY-_GEbG for ; Tue, 6 Jul 2021 16:52:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp2.osuosl.org (Postfix) with ESMTPS id 877F840136 for ; Tue, 6 Jul 2021 16:52:39 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9105F61C2F; Tue, 6 Jul 2021 16:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625590359; bh=rHrA7JR1kuHRO2ObXygxNOXB6QH+LMH9XbYpS8HdJ9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=spoMXdtXvQawjGCgd1UmNPafDZ5jez0CvDeD3r8po/jkAIVhUdq7TptLXjdqWjlG6 HLiMw3suvYCjfmlI+lwvjwDL+vID0oebjv+QzU+7k7sj+Ltlm4FUaMMBRee6Ty8opY gHNUHaBaLfuE3VnyrQMArpz+heloBAPlvq+rmH83zOtDuuImbpqQ8TuOwvEgfEhrXX xfv6nWk/s2df/LoIlJA93I0c3M8rggXgoZs4U6xH565bvMtHNMaQRMfrJshINRQTvI MNlvO3ARjb8gsYwjHQlKkgOMFX6A9tEs/LYUTBj0Bi3PvkVw+r+p3vORTvxPgKRKr7 4hXPec9l829fQ== Date: Tue, 6 Jul 2021 17:52:34 +0100 From: Will Deacon To: Marek Szyprowski Subject: Re: [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path" Message-ID: <20210706165233.GB20750@willie-the-truck> References: <20210705065657.30356-1-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210705065657.30356-1-m.szyprowski@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, Amey Narkhede , Robin Murphy , linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Mon, Jul 05, 2021 at 08:56:57AM +0200, Marek Szyprowski wrote: > 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 > --- > drivers/iommu/arm/arm-smmu/qcom_iommu.c | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) Thanks, Marek: Acked-by: Will Deacon Joerg -- please can you pick this up as a fix? Cheers, Will > 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) > -- > 2.17.1 > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 BCD1DC07E96 for ; Tue, 6 Jul 2021 16:57:23 +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 795D761C3B for ; Tue, 6 Jul 2021 16:57:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 795D761C3B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HyNHAow9t6ZHvPsVfYpQlyTwIMDtQKXBA+hNPPJCSL0=; b=QvGA9f8aEMCeTa lYWA5eCKilKkzlMOsbRhyBjaE0V+dWpWF1dD2m/53cm/WBdwuOJv/6or4wk9cMpHYKjUJXRSM4035 mttDurPzm0QZjOCCugr0a6YcwxiylEeKh7ZAQhQz1wKwVaxspG9nBBDuJvuF1SOiH8ePenTO5TEpV sPqyG3T7FBiseOXUO4cYhbNKgNyiOA8H7lv1VQGyMRojo1yodvvdsILLPTO5YZxjIf3GBPC07W/6K tH8Fga7kIq1sBsHKLqJtoM7XgOanaT2ifbmKSSuZspDMO5xWpE76qcMMkm31trdN6Uiwb5yPuLSyq B8jKdr3JoA+5oTD9Snrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0oJz-00CPPM-2o; Tue, 06 Jul 2021 16:53:19 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0oJL-00COvw-II for linux-arm-kernel@lists.infradead.org; Tue, 06 Jul 2021 16:52:41 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9105F61C2F; Tue, 6 Jul 2021 16:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625590359; bh=rHrA7JR1kuHRO2ObXygxNOXB6QH+LMH9XbYpS8HdJ9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=spoMXdtXvQawjGCgd1UmNPafDZ5jez0CvDeD3r8po/jkAIVhUdq7TptLXjdqWjlG6 HLiMw3suvYCjfmlI+lwvjwDL+vID0oebjv+QzU+7k7sj+Ltlm4FUaMMBRee6Ty8opY gHNUHaBaLfuE3VnyrQMArpz+heloBAPlvq+rmH83zOtDuuImbpqQ8TuOwvEgfEhrXX xfv6nWk/s2df/LoIlJA93I0c3M8rggXgoZs4U6xH565bvMtHNMaQRMfrJshINRQTvI MNlvO3ARjb8gsYwjHQlKkgOMFX6A9tEs/LYUTBj0Bi3PvkVw+r+p3vORTvxPgKRKr7 4hXPec9l829fQ== Date: Tue, 6 Jul 2021 17:52:34 +0100 From: Will Deacon To: Marek Szyprowski Subject: Re: [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path" Message-ID: <20210706165233.GB20750@willie-the-truck> References: <20210705065657.30356-1-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210705065657.30356-1-m.szyprowski@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210706_095239_718845_1A339D38 X-CRM114-Status: GOOD ( 20.52 ) 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: linux-arm-msm@vger.kernel.org, Joerg Roedel , Rob Clark , iommu@lists.linux-foundation.org, Amey Narkhede , Robin Murphy , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 05, 2021 at 08:56:57AM +0200, Marek Szyprowski wrote: > 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 > --- > drivers/iommu/arm/arm-smmu/qcom_iommu.c | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) Thanks, Marek: Acked-by: Will Deacon Joerg -- please can you pick this up as a fix? Cheers, Will > 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) > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel