Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3039237rwd; Fri, 2 Jun 2023 20:14:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Ez8153aPL7zYAaslWcbOyD9zRWKpnAco4cV8NVtw2L0ElcN8VatS0eGEcZIGrEM8cRAUS X-Received: by 2002:a17:90a:de96:b0:258:b097:f692 with SMTP id n22-20020a17090ade9600b00258b097f692mr1585754pjv.43.1685762098443; Fri, 02 Jun 2023 20:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685762098; cv=none; d=google.com; s=arc-20160816; b=HwdI7ZjVpNMQmCmV/B45YpR8I5KhvFf51gLm+n6tzM8VWm836Up6dM8a7qWj7ImGvu M7ZzLtWhW08mn05TYRp85SBBX+OoSnoc9XoeAQHu9u3XPApsw55yajz2SBEAG4ywg44o tBfNWEWIRAfTrkquQAQ9uuSw/XwuBDQVO7r62H6RWdouu0P02i8eFKju5OgwVPFILFlA dLYiPLaHypL4T+dX+VjA394VTujotoGtq69WuAq2bFiAU5mojdiCdXu+XKgSAlXIUPG+ v8QnAMpXHM2RhNSefRv7kr7h4x6G0SaeKVAfrk+ucmVB2psiO+KsirtkelSae1/ZhF3x sr3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=LvWlfX3B4Who81Yh1VIdKlqRov6FVwDTh+2F3P6At2I=; b=Mcy3nEsUk+MzD6BC3pQQ582pgvuG+2XdSHCzlRf+cT+VvZg5GU4tJDdM8cvSheZ33/ F0YcQh412qBO4B2itI/PrWqhRL6QhkDXF/ZL8OUkZg2zXWX/VpHA6/QcqJ9vSVjA6GzW bp3Ddrg58d0QAbA3pMYo9yaMPt2/IRNgTFlL9QS14Fxpubvx5PjFvKQYsIzLB100sPsl GD3VUP9dXWpBM0fIZ9wrfll/9ae5EBKg6GyrzoSuD1V3dSJnDnTbabStCYcfuC93S9e6 pHAkhOvdozDqxqTZg6naSfvAri9MnKq4fgnNZjbd0zSiYY0syJxoyFFjOjIRwHLnTXet NsjQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i71-20020a63874a000000b0053f2c198398si1938397pge.888.2023.06.02.20.14.40; Fri, 02 Jun 2023 20:14:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237001AbjFCCf4 (ORCPT + 99 others); Fri, 2 Jun 2023 22:35:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbjFCCfz (ORCPT ); Fri, 2 Jun 2023 22:35:55 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 269E0E41; Fri, 2 Jun 2023 19:35:52 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.116]) by gateway (Coremail) with SMTP id _____8Bx3+sHp3pkddQDAA--.8080S3; Sat, 03 Jun 2023 10:35:51 +0800 (CST) Received: from [10.20.42.116] (unknown [10.20.42.116]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxMuUGp3pkSMKGAA--.19982S3; Sat, 03 Jun 2023 10:35:50 +0800 (CST) Subject: Re: [PATCH pci] PCI: don't skip probing entire device if first fn OF node has status = "disabled" To: Vladimir Oltean Cc: Liu Peibao , Bjorn Helgaas , linux-pci@vger.kernel.org, netdev@vger.kernel.org, Bjorn Helgaas , Rob Herring , Claudiu Manoil , Michael Walle , linux-kernel@vger.kernel.org, Binbin Zhou , Huacai Chen References: <20230601163335.6zw4ojbqxz2ws6vx@skbuf> <20230601221532.2rfcda4sg5nl7pzp@skbuf> <7a7f78ae-7fd8-b68d-691c-609a38ab3161@loongson.cn> <20230602101628.jkgq3cmwccgsfb4c@skbuf> From: Jianmin Lv Message-ID: <87f2b231-2e16-e7b8-963b-fc86c407bc96@loongson.cn> Date: Sat, 3 Jun 2023 10:35:50 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20230602101628.jkgq3cmwccgsfb4c@skbuf> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8CxMuUGp3pkSMKGAA--.19982S3 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7ur18Zr4rJF13Ww1UWw1ftFb_yoW8ArW3p3 y3AFyFkFs8KFsFkw1qqw4rWa4Yyr48t3s5Wr4DWrn7u398X348tw4Ikw4Yga9rCw4xK3W2 vayYqF4xCFWqyFJanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bxkYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwA2z4 x0Y4vEx4A2jsIE14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UM2AI xVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I8CrVACY4xI64 kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8JwAm 72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07AlzVAYIcxG8wCF04 k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18 MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr4 1lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4 A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8zwZ7UUUUU== X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 2023/6/2 下午6:16, Vladimir Oltean wrote: > Hi Jianmin, > > On Fri, Jun 02, 2023 at 03:36:18PM +0800, Jianmin Lv wrote: >> On 2023/6/2 下午3:21, Liu Peibao wrote: >>> Hi all, >>> >>> It seems that modification for current PCI enumeration framework is >>> needed to solve the problem. If the effect of this modification is not >>> easy to evaluate, for the requirement of Loongson, it should be OK that >>> do the things in Loongson PCI controller driver like discussed >>> before[1]. >>> >>> Br, >>> Peibao >>> >>> [1] https://lore.kernel.org/all/20221114074346.23008-1-liupeibao@loongson.cn/ >>> >> >> Agree. For current pci core code, all functions of the device will be >> skipped if function 0 is not found, even without the patch 6fffbc7ae137 >> (e.g. the func 0 is disabled in bios by setting pci header to 0xffffffff). >> So it seems that there are two ways for the issue: >> >> 1. Adjust the pci scan core code to allow separate function to be >> enumerated, which will affect widely the pci core code. >> 2. Only Adjust loongson pci controller driver as Peibao said, and any >> function of the device should use platform device in DT if function 0 is >> disabled, which is acceptable for loongson. >> >> Thanks, >> Jianmin > > How about 3. handle of_device_is_available() in the probe function of > the "loongson, pci-gmac" driver? Would that not work? > This way does work only for the specified device. There are other devices, such as HDA, I2S, etc, which have shared pins. Then we have to add of_device_is_available() checking to those drivers one by one. And we are not sure if there are other devices in new generation chips in future. So I'm afraid that the way you mentioned is not suitable for us. Thanks, Jianmin