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

Re: [PATCH v2 11/17] xen/arm: PCI host bridge discovery within XEN on ARM


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Fri, 24 Sep 2021 12:54:20 +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=9GtB33dIgD5zIx9S6HYS1ULvpV3qdRk8yqcQyYGnGnE=; b=UfNf/Zetqy4qo0Hd5W/NScP78uZyAtuW4IEoyXivJNtwHosFjThTigNUMHeT+w/0YEdrS2NLwr60mxjdXEWTtHSfwvUwbbHwCQKQJk+X7xqwb3CX1m8Bn5rQUzAe/nG6YBeFZMyy0prLkM5Ht7Iv5Dn1lVOtY1Gm73TVNxtTth6Ba5esqJAtDF+KpgDPkQRvtsk7Ynovb37rcBM2bWVHjD0c1gxLGPDqqT7EQ3O7nbr4JxGWUXv2wD+F+NfWD6TytB78ZLl8YP4CsGUMNqcAxtW/C9ml7nYL2whHIcRTQAZhuVSNxgG4HmpR8o2NMOI8j5y303IlYiuWDvVZD7u9vQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vy7eFj6SLavyhKy202AVtE5bMnrwmil8CcKdECzEuFrIjDUfECk+ivKuu/YiRuE4KOzHScJ4mIG5yopNlZ7Lb+R6dXrOgaQuXCQOCbK98UvFg5bfE7N/9LZS08dP5bsIHqw9nQjeRsGBzy61+mBsBKRZZ/g++c8lJpLXiKYLkC/qxE6vwNSjCKQzTYToI9ONfx3DKhwWQKY4lPdK1BB2BD89MFA2d2wqAksp0ORUisStgF+MdVYg7NqKLBxwyYAxvSl0l8fa4CWPorrxllheJIRpFyjVaYSnl3awsrPXODD5x/6iYl99ofjwdPyFDsrpTy2Qgiq4l3KLMuZ+PZcwHQ==
  • Authentication-results-original: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Andre Przywara <Andre.Przywara@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 24 Sep 2021 12:54:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXr6aPsmXcRwLbA0y2fuTM/iBxWauw4OaAgAD7DQCAACKOAIABKMWA
  • Thread-topic: [PATCH v2 11/17] xen/arm: PCI host bridge discovery within XEN on ARM

Hi Stefano,

> On 23 Sep 2021, at 8:12 pm, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> On Thu, 23 Sep 2021, Rahul Singh wrote:
>>>> +            goto err_exit;
>>>> +    }
>>> 
>>> This is unnecessary at the moment, right? Can we get rid of ops->init ?
>> 
>> No this is required for N1SDP board. Please check below patch.
>> https://gitlab.com/rahsingh/xen-integration/-/commit/6379ba5764df33d57547087cff4ffc078dc515d5
> 
> OK
> 
> 
>>>> +int pci_host_common_probe(struct dt_device_node *dev, const void *data)
>>>> +{
>>>> +    struct pci_host_bridge *bridge;
>>>> +    struct pci_config_window *cfg;
>>>> +    struct pci_ecam_ops *ops;
>>>> +    const struct dt_device_match *of_id;
>>>> +    int err;
>>>> +
>>>> +    if ( dt_device_for_passthrough(dev) )
>>>> +        return 0;
>>>> +
>>>> +    of_id = dt_match_node(dev->dev.of_match_table, dev->dev.of_node);
>>>> +    ops = (struct pci_ecam_ops *) of_id->data;
>>> 
>>> Do we really need dt_match_node and dev->dev.of_match_table to get
>>> dt_device_match.data?
>>> 
>> 
>>> data is passed as a parameter to pci_host_common_probe, isn't it enough
>>> to do:
>>> 
>>> ops = (struct pci_ecam_ops *) data;
>> 
>> As of now not required but in future we might need it if we implement other 
>> ecam supported bridge
>> 
>> static const struct dt_device_match gen_pci_dt_match[] = {                   
>>    
>>    { .compatible = "pci-host-ecam-generic",                                  
>>   
>>      .data =       &pci_generic_ecam_ops },
>> 
>>    { .compatible = "pci-host-cam-generic",
>>      .data = &gen_pci_cfg_cam_bus_ops },                                 
>> 
>>    { },                                                                      
>>   
>> };
> 
> Even if we add another ECAM-supported bridge, the following:
> 
> ops = (struct pci_ecam_ops *) data;
> 
> could still work, right? The probe function will directly receive as
> parameter the .data pointer. You shouldn't need the indirection via
> dt_match_node?

As per my understanding probe function will not get .data pointer.Probe data 
argument is NULL in most of the cases in XEN
Please have a look once dt_pci_init() -> device_init(..) call flow 
implementation.

Regards,
Rahul
 
> 
> If you are worried about gen_pci_cfg_cam_bus_ops not being a struct
> pci_ecam_ops: that problem can also be solved by making
> gen_pci_cfg_cam_bus_ops a struct containinig a struct pci_ecam_ops.




 


Rackspace

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