RE: [PATCH v3 1/3] Add sysfs attribute for CXL 1.1 device link status

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

 




> Dan Williams wrote:
> > Kobayashi,Daisuke wrote:
> > > +static struct attribute_group cxl_rcd_group = {
> > > +		.attrs = cxl_rcd_attrs,
> > > +		.is_visible = cxl_rcd_visible,
> > > +};
> > > +
> > > +__ATTRIBUTE_GROUPS(cxl_rcd);
> > > +
> > >  static int cxl_pci_probe(struct pci_dev *pdev, const struct
> > > pci_device_id *id)  {
> > >  	struct pci_host_bridge *host_bridge =
> > > pci_find_host_bridge(pdev->bus); @@ -806,6 +995,9 @@ static int
> > cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> > >  	if (IS_ERR(mds))
> > >  		return PTR_ERR(mds);
> > >  	cxlds = &mds->cxlds;
> > > +	device_create_file(&pdev->dev, &dev_attr_rcd_link_cap);
> > > +	device_create_file(&pdev->dev, &dev_attr_rcd_link_ctrl);
> > > +	device_create_file(&pdev->dev, &dev_attr_rcd_link_status);
> >
> > No need to manually call device_create_file() when the attribute group is
> > already registered below. I am surprised you did not get duplicate sysfs file
> > warnings when registering these files twice.
> >
> 
> Thank you for pointing it out. Remove these calls.
> 
If you are aware of the cause, I would appreciate your insight. 
In my environment, when I removed this device_create_file(), 
the file was not generated in sysfs. Therefore, I have not been 
able to remove this manual procedure at the moment. Is there a 
possibility that simply registering with 
struct pci_driver.driver.groups will not generate a sysfs file?

> > >  	pci_set_drvdata(pdev, cxlds);
> > >
> > >  	cxlds->rcd = is_cxl_restricted(pdev); @@ -967,6 +1159,7 @@ static
> > > struct pci_driver cxl_pci_driver = {
> > >  	.err_handler		= &cxl_error_handlers,
> > >  	.driver	= {
> > >  		.probe_type	= PROBE_PREFER_ASYNCHRONOUS,
> > > +		.dev_groups	= cxl_rcd_groups,
> > >  	},
> > >  };
> > >
> > > --
> > > 2.43.0
> > >
> > >
> >
> 






[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux