Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp426057imi; Thu, 21 Jul 2022 04:02:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ul2XGtxvcul++JBwkO1DPfX3qoqzAvwvhM33Lg6Kubao5DEiZjfYOT1So2lJPJzzgKoAQB X-Received: by 2002:a17:90a:9488:b0:1f2:2768:facf with SMTP id s8-20020a17090a948800b001f22768facfmr5610958pjo.38.1658401326309; Thu, 21 Jul 2022 04:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658401326; cv=none; d=google.com; s=arc-20160816; b=GX8CHOf7L5I04fNGggJPaAlrFPEzGB+2rkVSwlm4e+2JeQH4aZjAOA31XL46CxNFqK Cb8CT5tIUxBPYmjGmlwjsmFuqV8kXd6jtRjQeMOAzDUKAlPmNkErpwip13N4XIfA8zmI tqX1D23a4QOylchDSSBJ5l4CzZgn1gx0GGOYm9ln9GX+kZoXdnPmHQiiH6VOsZFyY8xU YCVIGy3PHtoGy1HnfxYpJSQCoZxTJaE2eD4/rctKH12SK+ATswjK6MujX0tSGfci7wRe cxSuCaZJswo4+L3WOYZFJtamFLDKH8DO677H3m0u+Q0rvFEZKDlcFEWWAebMb8QYqdgg GOBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=i72ix9/vLqj3WlysQhcHY9hq3MwM1JTvuoM8AC2CyM8=; b=ZMxfhUFw3bgyh9hX9ABUaTaPXdFEEIpYWKis+3K86qTF1wXWLDHmHwLLkaJJ0b+Q/V /Rua9xG2GrIGiyrP7MgyAjhL0/m/YdWyG6ldS/c2geQWDRv5Uyi5z5bJFaHAZyqNbKlH nVk4q8OdJRUurzH9w32rs0JMZYLn2CZAPDNU0Y733fwj7buPZFqzY103zV2r95BC/8cm 8vMsYQ4nbNJlJ5cwzafcV8geuYJMTVqUlGMbPjindgF9vCmUbBSeCk5k1NrAgKAMtqel /RcVhcPzJ4v5Dk4JZeFF6nzq81PbjNtspxK5GzBGYWOHssZs+0APOblH9OlgC2zBoIG3 U3OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=licGoNO1; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020a170902e84e00b0016c1e0a4c19si2243262plg.61.2022.07.21.04.01.50; Thu, 21 Jul 2022 04:02:06 -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=@ti.com header.s=ti-com-17Q1 header.b=licGoNO1; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233220AbiGUKdH (ORCPT + 99 others); Thu, 21 Jul 2022 06:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232607AbiGUKdF (ORCPT ); Thu, 21 Jul 2022 06:33:05 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E325D125; Thu, 21 Jul 2022 03:33:04 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 26LAWtEB015258; Thu, 21 Jul 2022 05:32:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1658399575; bh=i72ix9/vLqj3WlysQhcHY9hq3MwM1JTvuoM8AC2CyM8=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=licGoNO1ElXIw89rsaC2Jss8iyZQghm7esEoWwd7rupH9eEVd0EnYM1c6d6CP/PdH 21KuTG3jg407vMjUv1ZUiuI5h7twWZni1RKLPNsYKYhJEDTXF2d+AQwCVYu6YO4RE0 eL8SXgxyQaIkhM/vOlN/MpxTQqXSpThv0J0Ypqpk= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 26LAWtMc059112 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 21 Jul 2022 05:32:55 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Jul 2022 05:32:55 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 21 Jul 2022 05:32:55 -0500 Received: from [172.24.145.247] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 26LAWr0R105234; Thu, 21 Jul 2022 05:32:54 -0500 Message-ID: Date: Thu, 21 Jul 2022 16:02:53 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: No controller seen in /sys/kernel/config/pci_ep/controllers Content-Language: en-US To: Ajay Garg , Bjorn Helgaas CC: , References: <20220713181805.GA841376@bhelgaas> From: Kishon Vijay Abraham I In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 21/07/22 15:54, Ajay Garg wrote: > Any pointers please? > > Thanks and Regards, > Ajay > > On Wed, Jul 13, 2022 at 11:48 PM Bjorn Helgaas wrote: >> >> [+to Kishon, endpoint maintainer, +cc LKML] >> >> On Wed, Jul 13, 2022 at 12:53:06PM +0530, Ajay Garg wrote: >>> Hello everyone. >>> >>> The kernel has been built with : >>> >>> ################################### >>> CONFIG_PCI_ENDPOINT=y >>> CONFIG_PCI_ENDPOINT_CONFIGFS=y >>> CONFIG_PCI_EPF_TEST=y >>> CONFIG_PCI_ENDPOINT_TEST=y >>> ################################### >>> >>> >>> Thereafter, following are seen : >>> >>> ################################### >>> $ sudo mount none /sys/kernel/config/ -t configfs >>> mount: /sys/kernel/config: none already mounted or mount point busy. >>> >>> $ ls -lrth /sys/class/pci_epc/ >>> total 0 >>> >>> $ ls -lrth /sys/kernel/config >>> total 0 >>> drwxr-xr-x 4 root root 0 Jul 13 10:58 pci_ep >>> drwxr-xr-x 2 root root 0 Jul 13 10:58 usb_gadget >>> >>> $ ls -lrth /sys/kernel/config/pci_ep/functions >>> total 0 >>> drwxr-xr-x 2 root root 0 Jul 13 10:58 pci_epf_test >>> >>> $ ls -lrth /sys/kernel/config/pci_ep/controllers >>> total 0 >>> >>> $ >>> ################################### >>> >>> What is being missed? >>> >>> Side Queries : Is the controller that is expected to be listed, a >>> virtual-controller (like the one provided by CONFIG_USB_DUMMY_HCD in >>> case of USB)? There are no virtual PCIe endpoint controllers in Linux. >>> >>> Or there must be a real additional controller for pci-endpoint purpose? right, there should be an endpoint controller and the driver for it should register with the Linux endpoint framework. >>> If yes, then : >>> >>> * I guess no listing is expected currently, as my machine has just >>> one controller (as pci-host). correct. >>> >>> * Is there a way to have an additional virtual pci-controller? Not sure what exactly your use case is. All it's going to need is the driver to use devm_pci_epc_create() to register a endpoint controller. You can refer existing endpoint controller drivers https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/cadence/pcie-cadence-ep.c https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/dwc/pcie-designware-ep.c Thanks, Kishon