Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4983534rwd; Sun, 4 Jun 2023 18:01:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UwXZ7Ajt6uaSl/kxOAQmmqLR1Hj+wA3L0q03ko6SuumFtJfyfDXsSLoKy704+V5BbRvPP X-Received: by 2002:a54:4894:0:b0:398:2b78:3272 with SMTP id r20-20020a544894000000b003982b783272mr5674615oic.26.1685926908053; Sun, 04 Jun 2023 18:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685926908; cv=none; d=google.com; s=arc-20160816; b=lxwxatyvSOT0ltcIBoPxIhB96wzkmCPbfFRta5KSLkKFF4nACKR2tkrHzTMdfDJonf Z6aLOoHRXrGS79GQE5m0rWXWGB3K/n6AXNfDEFEV/xamfNILFsJARnHhXoImEXgvJw97 +zDFCwlDQ1Magp3iYDHR3qtLojhbyfqSWRUDo2BgemlNd0c1qKP0B7RG0dn6CbJ8f2Td eUFcW7b0V3jsGd7X127K/d9CZCHxDC0NBnMUPHT8Y9++hA/uGWywmEK4Uv6MhLHoTWAi X1hb7zY3nKmVl6BQpvX6IVudqVzh6uQ527EgtwBLr84vjriZJu0hUdAQjcpERJ0Uyi1J 7qIw== 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=vu2viY7QjwsF82DGQju9SWspJW3yD0uJkkGnxQFGpm8=; b=G/OFttcvP8HGoe/AkdRek8gDeZQrwnxvk2aF4p8DIaDcgwF82k94/drU1qGJxhayyu GbMuD31oXwGCurb8v8Vbvu3wtvwgMNoENqh0QKE6Xpo8uiGkVXKNGpbDAnWIzk7mRQSH hQ9RAQrea03tX86e3GEY7yXj2p/3WyerC52uxR/1X3xkHYFQtuY2rc0iczfcO2hdUfHA ypLN3zVAf0R3vEmKOtuiHBC/8SF4aerlEMgdOh3roJ5BYtO05IftToaRs6CeeVj61DtO 8G9ICsuL8hYpRuq2Qy6Rxpzf3tYrCaoX+OicBwkhferZoSJDpc5SY5yW3gQGjS71+jZw aeeQ== 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 q15-20020a656a8f000000b0052c2b1efee2si4806493pgu.339.2023.06.04.18.01.34; Sun, 04 Jun 2023 18:01:48 -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 S231560AbjFEA72 (ORCPT + 99 others); Sun, 4 Jun 2023 20:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjFEA70 (ORCPT ); Sun, 4 Jun 2023 20:59:26 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BC620B8; Sun, 4 Jun 2023 17:59:24 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.116]) by gateway (Coremail) with SMTP id _____8AxhPBrM31kzHcEAA--.9081S3; Mon, 05 Jun 2023 08:59:23 +0800 (CST) Received: from [10.20.42.116] (unknown [10.20.42.116]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxWdJrM31kxQeKAA--.24862S3; Mon, 05 Jun 2023 08:59:23 +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> <87f2b231-2e16-e7b8-963b-fc86c407bc96@loongson.cn> <20230604085500.ioaos3ydehvqq24i@skbuf> From: Jianmin Lv Message-ID: Date: Mon, 5 Jun 2023 08:59:23 +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: <20230604085500.ioaos3ydehvqq24i@skbuf> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxWdJrM31kxQeKAA--.24862S3 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7tr4rWFyUuF1kAFW7XFyxZrb_yoW8CF43pa y3AFWFkF4kKr4Ik3sxZw4rGF1ft39Fy395Jr4kJr90kws8Z34ftr1I9r45Xay7uw4xZay2 vFy0qrs5Ca4kA3DanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bI8YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l e2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4xG64xvF2 IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE14v26r1j6r4U McvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62AI1cAE67vIY487Mx AIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_ Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwI xGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8 JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcV C2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxU7_MaUUUUU 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/4 下午4:55, Vladimir Oltean wrote: > On Sat, Jun 03, 2023 at 10:35:50AM +0800, Jianmin Lv wrote: >>> 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. > > Got it, so you have more on-chip PCIe devices than the ones listed in > loongson64-2k1000.dtsi, and you don't want to describe them in the > device tree just to put status = "disabled" for those devices/functions > that you don't want Linux to use - although you could, and it wouldn't > be that hard or have unintended side effects. > > Though you need to admit, in case you had an on-chip multi-function PCIe > device like the NXP ENETC, and you wanted Linux to not use function 0, > the strategy you're suggesting here that is acceptable for Loongson > would not have worked. > > I believe we need a bit of coordination from PCIe and device tree > maintainers, to suggest what would be the encouraged best practices and > ways to solve this regression for the ENETC. > For a multi-function device, if func 0 is not allowed to be scanned, as I said in way of 2, the other funcs of the device will be described as platform devices instead of pci and be not scanned either, which is acceptable for Loongson. The main goal by any way for us is to resolve the problem that shared pins can not be used simultaneously by devices sharing them. IMO, configure them in DT one by one may be reasonable, but adapting each driver will be bothered. Any way, let's listen to opinions from Bjorn and Rob.