Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5065rwd; Tue, 30 May 2023 15:12:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5w0sFeMlfVGSR5gf9UJxkPtCriFdROdmcspdSSHMbeiW0cKTbxdmWzfFzs527YU/tlWQRh X-Received: by 2002:a17:90a:fe3:b0:24e:6a6:cd6 with SMTP id 90-20020a17090a0fe300b0024e06a60cd6mr3710063pjz.29.1685484728623; Tue, 30 May 2023 15:12:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685484728; cv=pass; d=google.com; s=arc-20160816; b=T/dAbBVBjCycVeItvLJ0PBIfa2kX0ArE2AqNpjIFVc2ECmP2Qce3FC7fVgVhFc0l78 R3q8lPO0k5pSbrSPLpbM+ihxbEqBpBZ2UDPsFPK35LXmtfk/9FZEnOrhBmuIi+fmrLAI ujBSY/GDrnCnso3mK7EmRklmBhlMAxkZDkmC4quqFmz5EzLbB54fq3a4B3QnFcL4aIcr QoBTeVwjVqD9u8uQXtyqPLYROBZ6knvxWikSiAfBiaeoFryVRe/1TSc5Xnfhylp7NmOI j3B784NtsW0aCfTyZgkrZqKof8K4tWmcTdhvwGo8xSqPvd4o95ltRw7OIPloe/tbp7eC VC5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qGJK/d6YNlRmzVfTCKf3xMj2KYmNZrBFRKPramYl/2U=; b=bNq4tTY/jwzGDVO/cjF2iQYjU+3mYZY3k+2S7cpSGhX369a3mrMshniOwMvCprvu3l NZc1sQ0EbFru7TOws8zEC5cKEBqEX5vzqzp286y8g2Amaj0O95M+to/yV6iv12+y7NVD H0+/8zcp/t6GRt8/o/knaViBmqacvpTFLGs2FZkp//WbXB5l4G6zJfDYr5pOQFTzxCra 6qHfUi/H+jtfuLqMM7oHwNhTzWSLAIP483KXehn1Ep94LK8GXUf97SmKJS6ykFpst/8U 1Q0aS3wQ20veHsytBUp7yIVVLtrBn8gQ1vr3mxzeFdF+POzSCqnLZfGPnVz2xS29TdfK /Plg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=etQ0ndL7; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mn4-20020a17090b188400b002571fbafe9asi642986pjb.142.2023.05.30.15.11.29; Tue, 30 May 2023 15:12:08 -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=@nxp.com header.s=selector2 header.b=etQ0ndL7; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233642AbjE3WE5 (ORCPT + 99 others); Tue, 30 May 2023 18:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233659AbjE3WEu (ORCPT ); Tue, 30 May 2023 18:04:50 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2042.outbound.protection.outlook.com [40.107.15.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F406F11D; Tue, 30 May 2023 15:04:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ftH0J+/N89Nwz9UGuB57LmaNUYKgCAdzD8S8UO/uqyNgbWnN8c2MhDzAt1+V/p/01O3wX9hynMM7E0e7CGrgdhKNj8uTS38MUtnysbn6ecaUwhiQxWNcaWQjLDQdnS7sFqyK2C5KakiEgAQ0vvzLw8Fg6juIhxfhkCwyPWxshMWKmvLyd2Y//sbMaHzae6rRqHJF6qczIFdl/7tFC3b6sx8qGgSgGMLnvUHtcOy1WGwlWvm60XqIjNjbY19LLM0Pd83re/6dixgrQz6CifWO6MQnsHF4SsYQHBS5TT5KKx0iHiIRu942n5NWAy141p79+e0DzG97Bgpl3K1eMv1lfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qGJK/d6YNlRmzVfTCKf3xMj2KYmNZrBFRKPramYl/2U=; b=WbKQQLmk8YRmnjz2aqtLKlP/lMvJguue9h9p7qgOZxnVHtFiu7RwaXi3EDOJWNdMSgeeAhNYza0ivE/0iPbvyZfIVZPdcDqY6DUWYmZv5MqNSneflmsCOHNpIa8MzyNR0P7fZx4Tc9NFvprs9taGATBeKuTvysF0Muyb9ubhx+XihTk88Hi9CkaIyarybDAMIT7d1PwJhQ4I7K2Q3jSv9R2bvOavLnNfRD6wdadS7TelubgI1cSArjel6KXvL0wb+jngiz/fA9tI06kGvKJ8qPV/6Eunr/ZnuWOM2yL6+N2yOYK39qUDiHb3nulC4dbSsu1so6zljRTldtwnseya2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qGJK/d6YNlRmzVfTCKf3xMj2KYmNZrBFRKPramYl/2U=; b=etQ0ndL7hfzRcdtaonm2X3qMptTkMb3EJOYnVEBjzLxEjgywesVdTxNEnQ/rn3JQKjHbRlM8Kq1rgluhKA3jH5KAPpIe30n8jMQlbQadKISk1yOlDnyOYP12n2hU2zomFfbGnLB1a2CvehEKJPkpglVsHIvWO1NX1Din+x1msqI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6459.eurprd04.prod.outlook.com (2603:10a6:10:103::19) by DU2PR04MB9131.eurprd04.prod.outlook.com (2603:10a6:10:2f6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 22:04:40 +0000 Received: from DB8PR04MB6459.eurprd04.prod.outlook.com ([fe80::5ca3:2022:337:7c40]) by DB8PR04MB6459.eurprd04.prod.outlook.com ([fe80::5ca3:2022:337:7c40%7]) with mapi id 15.20.6433.022; Tue, 30 May 2023 22:04:40 +0000 Date: Wed, 31 May 2023 01:04:36 +0300 From: Vladimir Oltean To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, netdev@vger.kernel.org, Bjorn Helgaas , Rob Herring , Claudiu Manoil , Michael Walle , linux-kernel@vger.kernel.org Subject: Re: [PATCH pci] PCI: don't skip probing entire device if first fn OF node has status = "disabled" Message-ID: <20230530220436.fooxifm47irxqlrj@skbuf> References: <20230521115141.2384444-1-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: FR0P281CA0052.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::20) To DB8PR04MB6459.eurprd04.prod.outlook.com (2603:10a6:10:103::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8PR04MB6459:EE_|DU2PR04MB9131:EE_ X-MS-Office365-Filtering-Correlation-Id: dd769c17-599e-4637-6277-08db6159dd51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fted+wFUE6oT5a1YTjzXM56Ub+P6lVGtSTdkQcwFWtDl5mcavvDwbzd2kCp6Au76hzBHTA9OlptPjYxSFVZV9ebVNk44OQ7GGVZ7nW5j8eo9H2qdHpujrP65yxasq4S8MXY5l71TvGs42S9zNxbUDYrp/KmobKEGkPHTt79l4ryBWML13eJf6ebN2dbJz4rbzJ2WxtO98v9JJBWuwrUIgaYoeYMXFV7/AbUxMPcqe9M0lMgdRcWVx+7AluIIrfFDVTmkkg9N+s5VokSBEZ7A3ZoPq/DgebD2N3ksbialuKC/r7XcQKltj/t+v05BRYv1QUWPcKunK+Id5rUMfxD0E5820c5ggVYi1vHl+TrLn+mM/TzzD6RWOjmYnd2PXgXcH+TZiKhU6T4IZ3DvXmDbEMNFOsY8DGfIwf3BbopO1Im+xn/PhcKlKvQbeASPACsJjaDV0yQZqh0kVugQfdISgqozOLtoqCdBX6jmYWlUCFTzNF2x9Z3w7/ZlQ1kQgXc06Qr1fNzcLr1wOI0K9+bjgURRMATfhMI8pQLnG0L+AQrIHlNUHE3D3k1HitQZRLAo X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR04MB6459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(7916004)(396003)(366004)(346002)(39860400002)(136003)(376002)(451199021)(33716001)(83380400001)(41300700001)(26005)(9686003)(6512007)(1076003)(6506007)(186003)(44832011)(66476007)(66556008)(316002)(66946007)(8676002)(5660300002)(4326008)(8936002)(86362001)(478600001)(54906003)(6916009)(38100700002)(6486002)(6666004)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?gOx1NtRnJel12Y3LxS0twQtymKlcMh/WlN0+g27r6L/q7KnA9QAJd2syIcH8?= =?us-ascii?Q?F7njaYrALTgg74/q7FPaHnAk8AEWLMYGy2/GLor9lDlLhdlNB6GSHS21nnXt?= =?us-ascii?Q?ZOjWYK4ya8dpxwuTBn7F9nk7zT+G8JLtZj63/+OAjm1da8PSgogF5EVJkMZv?= =?us-ascii?Q?qmuVDcXp65P3Oj3izq0kI18L8UMuM4zFdeKWZpdyJvUPyvf+UHsSPJ+lZZXd?= =?us-ascii?Q?jVLxbNzIIlua0H43l6oKtRWn18Avtmh/8WtP55SfmpTMr2dEx0shuFvCwC6W?= =?us-ascii?Q?Wg0hkGnGeq6FIUOawGQFtWL4tFbntp66PlRSugrHk3y+YGph8A8tLmE6mBc4?= =?us-ascii?Q?gyLEyhZk8GgJ2brjsJN1//GGB0VqETSrt7QDH9fAMUGVAFEQxZ8yvM6uS6nc?= =?us-ascii?Q?qh1blQBwUu3Mt26O6aVBvS+NIS0UfqQp2bds5aAu77lG7YejGloukoXDA4kH?= =?us-ascii?Q?TjEY5V50SJ2EfDJlmyEP7r5OJHcl7IAIaKElmZzA4ybiK/e4XMN6hy7FDdRM?= =?us-ascii?Q?K0/Poj+FKxW1eVfJUYlpwiNdv1hV7PoOhmvIDetTt2AMGwSNwymtA9/Z+Ixg?= =?us-ascii?Q?GA/p7MdD6lGLdyOJxyoTy/w66lOpCYif2SAU2XdoWZ3cAdiHFvCdfzFRM5Lp?= =?us-ascii?Q?P9k+H2zmKpN4LawL68e4qMyh1b6TTDVuMyxs9vZSIlRSCQohgVmSfZFvskxr?= =?us-ascii?Q?u1LqQqpU8eZf5fQQtsxuvjcfHQNZEx4k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ii?Q?5Q=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd769c17-599e-4637-6277-08db6159dd51 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 22:04:39.9357 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i9fHBWtG1j2AgVD4wvEca4293TtsKPPhuAm/0PkJtYA2qpbyH4GlocVxcvk9uccSkyLT+k/mDsWCYsOEaG/jcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9131 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 On Tue, May 30, 2023 at 04:58:55PM -0500, Bjorn Helgaas wrote: > Can you write this description in terms of PCI topology? The > nitty-gritty SERDES details are not relevant at this level, except to > say that Function 0 is present in some cases but not others, and when > it is not present, *other* functions may be present. No. It is to say that within the device, all PCIe functions (including 0) are always available and have the same number, but depending on SERDES configuration, their PCIe presence might be practically useful or not. So that's how function 0 may end having status = "disabled" in the device tree. > Sigh. Per spec (PCIe r6.0, sec 7.5.1.1.9), software is not permitted > to probe for Functions other than 0 unless "explicitly indicated by > another mechanism, such as an ARI or SR-IOV Capability." > > Does it "work" to probe when the spec prohibits it? Probably. Does > it lead to some breakage elsewhere eventually? Quite possibly. They > didn't put "software must not probe" in the spec just to make > enumeration faster. > > So I'm a little grumpy about further complicating this already messy > path just to accommodate a new non-compliant SoC. Everybody pays the > price of understanding all this stuff, and it doesn't seem in balance. > > Can you take advantage of some existing mechanism like > PCI_SCAN_ALL_PCIE_DEVS or hypervisor_isolated_pci_functions() (which > could be renamed and made more general)? Not responding yet to the rest of the email since it's not clear to me that you've understood function 0 is absolutely present and responds to all config space accesses - it's just disabled in the device tree because the user doesn't have something useful to do with it.