Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1682204rwb; Fri, 19 Aug 2022 07:44:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR6UE3WpDLlczIBhyFJaQ8CthsvV9NOVZaRP86QfL5aYSuVRL8k0G9udAa3PGCczHDKGifA5 X-Received: by 2002:a05:6402:35c3:b0:43d:f5d9:b65d with SMTP id z3-20020a05640235c300b0043df5d9b65dmr6565613edc.149.1660920276205; Fri, 19 Aug 2022 07:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660920276; cv=none; d=google.com; s=arc-20160816; b=0kyqxBwomtRnWt8GjaDwZGRyjHOIkVi/ZbzOdyIckOoOOZgCytZkQcOE8QeNzYZEq4 aUIUWKe/CDfSuVy0ZSrRqa8Wqpo8lVWeUOWZajUyTyiSFALA7yk3c2Z0WZrN1rW54nLZ fl1XP0m9vlv+Kh2ooJ9Q2ULgO9yd+eb3n/rSugH3gqeu6UtaKycaAzr2kGNZkokgIGzw yb9B73YfSCqAP5I5PXagvvvMrt3X2DBle8V8X55N81m8sVHhj9Gc/6d560yXggW1SqZQ NBSnGbnhDBvod0ydRgWsMrmwlEB05D2GzVS7GTe4MKMkMIJu0fQdzXTrLXk2cvOrJUDd yJMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dqQxh7f5aEoY6TgSiuycYBHxJKVsrtTxtR4+qhYTbfI=; b=e6XPijw0kXf1wrpfCV36PA//3NtJPlCCxnvshtbE3K5yds1rywViZrWM9w45YlV1YC h9g910nk4NmPDf1D5N0GP0p04CEPpZW+2Zki4rq3tZWH0gdHFIniCikIdFqb5tXGPc5R mSkhCCl+iJnrC6kFL7iIwly3OTI8UAdZhdGHhY5xOXFYzxsjrfE5tbWEsj6aeqV7iwD+ 7pudehRJJ6OiK0kgQgNJNztJy5TxrN3RhLmqcV7Xr7jzNQWDNuq6ZD5SBJ9fXPWjGFAC Dul7WbM4V5RgMgHv/sitE1RJD9cjgx+rDn76a/zduE5ln3QZqWVzH10GzTon60sdjRUF AdKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B6Rhf1Kk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020a056402280400b0043bb9745c2esi3877720ede.172.2022.08.19.07.44.09; Fri, 19 Aug 2022 07:44:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B6Rhf1Kk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349428AbiHSO1I (ORCPT + 99 others); Fri, 19 Aug 2022 10:27:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349572AbiHSO0x (ORCPT ); Fri, 19 Aug 2022 10:26:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757C0EA33D for ; Fri, 19 Aug 2022 07:26:52 -0700 (PDT) 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 B883561199 for ; Fri, 19 Aug 2022 14:26:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9743DC433D7; Fri, 19 Aug 2022 14:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660919211; bh=fGoMU6DeNob0TwcPIAynfHbsmVzBqJ5hRq1jSOsycFo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B6Rhf1KkurTHSjhs8FWrXeH5wwUHD2m0WpgLyFnA+oa40NHJjMGs7gW5k1bRfIYFU kwYJuy3nAic8r2egKQK/VF8+OZ6EfPQ3AxToka5JkLQY0/yWsPPFsbTDyBEyWcb4RY WXyRn+M/MkEyd6eSCqLeLxbWcWVVF5spNtNVGxtikm5Hb/9P4iQFJD2uuAZmDYs+bB Oz0W/M3AVOUXsZ0XzT1LXi4RaRpVmcFYwT8lQzT4QShLhP3xlPnnKo0TLST2cDoLDi CTNdlc3wt9N6NaviEOYkA/06Xw5haDPY4ARurQlRlKo9pavUuQgSCw63ed9/ftSHyH bteZjcXEn/R1w== Date: Fri, 19 Aug 2022 15:26:45 +0100 From: Jean-Philippe Brucker To: Saravana Kannan Cc: Joerg Roedel , Will Deacon , eric.auger@redhat.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, kernel-team@android.com Subject: Re: [PATCH v2 8/9] iommu/of: Delete usage of driver_deferred_probe_check_state() Message-ID: References: <20220601070707.3946847-1-saravanak@google.com> <20220601070707.3946847-9-saravanak@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220601070707.3946847-9-saravanak@google.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana, On Wed, Jun 01, 2022 at 12:07:04AM -0700, Saravana Kannan via iommu wrote: > Now that fw_devlink=on and fw_devlink.strict=1 by default and fw_devlink > supports iommu DT properties, the execution will never get to the point > where driver_deferred_probe_check_state() is called before the supplier > has probed successfully or before deferred probe timeout has expired. > > So, delete the call and replace it with -ENODEV. > > Signed-off-by: Saravana Kannan > --- > drivers/iommu/of_iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c > index 5696314ae69e..41f4eb005219 100644 > --- a/drivers/iommu/of_iommu.c > +++ b/drivers/iommu/of_iommu.c > @@ -40,7 +40,7 @@ static int of_iommu_xlate(struct device *dev, > * a proper probe-ordering dependency mechanism in future. > */ > if (!ops) > - return driver_deferred_probe_check_state(dev); > + return -ENODEV; Unfortunately this breaks virtio-iommu on v6.0-rc1. Could you add it to your revert series [1]? Eventually I'd really like to use fw_devlink in order to enable module support, so I'm looking for a proper fix. Our DT description is peculiar because the virtio-iommu, when it uses the virtio-pci transport, can appear on the same PCI bus than the endpoints it manages. So the PCI node looks like this: pcie@10000000 { compatible = "pci-host-ecam-generic"; ... iommu-map = <0x00 &viommu 0x00 0x20> <0x21 &viommu 0x21 0xffdf>; viommu: virtio_iommu@32 { #iommu-cells = <0x01>; reg = <0x2000 0x00 0x00 0x00 0x00>; compatible = "virtio,pci-iommu"; }; }; The iommu-map property points to the IOMMU sub-node for all endpoints except the IOMMU itself (device 0x20 - 00:04.0). fw_devlink currently rejects this: [ 0.270150] OF: Not linking pcie@10000000 to virtio_iommu@32 - is descendant [ 0.270324] OF: Not linking pcie@10000000 to virtio_iommu@32 - is descendant I don't know yet if this kind of topology could ever work with fw_devlink, but I thought I'd notify you before digging further. Thanks, Jean [1] https://lore.kernel.org/all/20220727185012.3255200-1-saravanak@google.com/#t > > if (!try_module_get(ops->owner)) > return -ENODEV; > -- > 2.36.1.255.ge46751e96f-goog > > _______________________________________________ > iommu mailing list > iommu@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu