[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 04/14] xen/arm: Add support for PCI init to initialize the PCI driver.


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Fri, 10 Sep 2021 10:47:06 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • 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; bh=q3T5QrqH9Wr/xr6+l3AdimKefw6fTFiBu4kjW1CQhac=; b=cHHnqmISqrVadKZ03sCJqejBra6kzCbeZVCebWZBj8vsM1I5D7Ecro49rzDOZScWR2VodYZZ0bS3RMCHIpSim8pXil45/ib+T1VpWhby4c5Pvf1xVpNUD4dr+JQ5eR/Peemj9WqIpm1AOViGXrKkSCoaQTSjddlRB3RnXktY6zi4UyB6rbUoMl0MJZfGD3GNGQTrgJMhEyYsg9Mu909BRNqJ8Z9jw2/NThcRiSOnzyk1qDsgDFd9GIDsWfqWzMNBe3Z/zeE7qf+kGKFpktAUuJszJUAhbfSsfrqoJ3v9LxnmHavLfkwPIEgpgm8Y5uIE7L/HAANYWu62P3KBCcPbIA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IJAjMGGrD6WCvoK6/BPb8b9aiaupusvuqRbHqyll2ZR1YqoZ5EdrvmO/0rjQQeRDOXpOkmGF7cV/TpYr6tH7nlSgUTR3dOCcVo5y60YbqG/sEifZdszkv2NQ834BmoGD7FAYAV0qL2IDF+cWTxnuX5OfqxIIJr7W/AfrsZXiMQiH2C/0CbthvezvX2mY7JeLE0a9oAUXveyk1zMAwuz2iY9MJchcyV6ZMQTD3hPTgX6ltzDSP1Itpb38h5d/C9eOIYQRop6mX9fORoF9Eear2JZrLgu5lXJ8wtBT1wSeTbtNdXLGEUrJvcB8fOQ2GO97qsoVvnoKmFAziVuWXJpFmg==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 10 Sep 2021 10:47:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXlPKX2eY2zjLj706Keqt9aql1MKuYWIqAgATf9QA=
  • Thread-topic: [PATCH v1 04/14] xen/arm: Add support for PCI init to initialize the PCI driver.

Hi Julien,

> On 7 Sep 2021, at 9:20 am, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul,
> 
> On 19/08/2021 13:02, Rahul Singh wrote:
>> pci_init(..) will be called during xen startup to initialize and probe
>> the PCI host-bridge driver.
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>> ---
>>  xen/arch/arm/pci/pci.c       | 54 ++++++++++++++++++++++++++++++++++++
>>  xen/include/asm-arm/device.h |  1 +
>>  2 files changed, 55 insertions(+)
>> diff --git a/xen/arch/arm/pci/pci.c b/xen/arch/arm/pci/pci.c
>> index dc55d23778..d1c9cf997d 100644
>> --- a/xen/arch/arm/pci/pci.c
>> +++ b/xen/arch/arm/pci/pci.c
>> @@ -14,13 +14,67 @@
>>   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>>   */
>>  +#include <xen/acpi.h>
>> +#include <xen/device_tree.h>
>> +#include <xen/errno.h>
>> +#include <xen/init.h>
>>  #include <xen/pci.h>
>> +#include <xen/param.h>
> 
> This include doesn't look to be necessary (yet?).
 
Yes you are right this is not necessary .I will remove "param.h"
> 
>>    int arch_pci_clean_pirqs(struct domain *d)
>>  {
>>      return 0;
>>  }
>>  +static int __init dt_pci_init(void)
>> +{
>> +    struct dt_device_node *np;
>> +    int rc;
>> +
>> +    dt_for_each_device_node(dt_host, np)
>> +    {
>> +        rc = device_init(np, DEVICE_PCI, NULL);
>> +        if( !rc )
>> +            continue;
>> +        /*
>> +         * Ignore the following error codes:
>> +         *   - EBADF: Indicate the current is not an pci
>> +         *   - ENODEV: The pci device is not present or cannot be used by
>> +         *     Xen.
>> +         */
>> +        else if ( rc != -EBADF && rc != -ENODEV )
>> +        {
>> +            printk(XENLOG_ERR "No driver found in XEN or driver init 
>> error.\n");
>> +            return rc;
>> +        }
>> +    }
>> +
>> +    return 0;
>> +}
>> +
>> +#ifdef CONFIG_ACPI
>> +static void __init acpi_pci_init(void)
>> +{
>> +    printk(XENLOG_ERR "ACPI pci init not supported \n");
>> +    return;
>> +}
>> +#else
>> +static inline void __init acpi_pci_init(void) { }
>> +#endif
>> +
>> +static int __init pci_init(void)
>> +{
>> +    if ( acpi_disabled )
>> +        dt_pci_init();
>> +    else
>> +        acpi_pci_init();
>> +
>> +    pci_segments_init();
> 
> Shouldn't this happen before the PCI initialization?

Calling pci_segment_init(..) before or after PCI initialization will not make 
any 
difference as this is independent call. Anyway I will move the 
pci_segment_init(..)  
before PCI initialization.

Regards,
Rahul


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.