2021-03-16 17:24:01

by Mihai Carabas

[permalink] [raw]
Subject: Re: [PATCH v5 3/3] misc/pvpanic: add PCI driver

..snip..
>> +};
>> +static unsigned int capability = PVPANIC_PANICKED | PVPANIC_CRASH_LOADED;
>> +static unsigned int events;
>> +
>> +static ssize_t capability_show(struct device *dev,
>> + struct device_attribute *attr, char *buf)
>> +{
>> + return sysfs_emit(buf, "%x\n", capability);
> A global capability for all devices? No, this needs to be a per-device
> attttribute as you are showing it to userspace as such.

We can only have a pvpanic-pci device. This is necessary in that case?

...snip..
>> +static struct attribute *pvpanic_pci_dev_attrs[] = {
>> + &dev_attr_capability.attr,
>> + &dev_attr_events.attr,
>> + NULL
>> +};
>> +ATTRIBUTE_GROUPS(pvpanici_pci_dev);
> You did not document these new sysfs files in Documentation/ABI/ so it's
> hard to judge what they do. Please do so next version.

This appeared after 5.12 rebase on pvpanic-mmio. I did this changes to
pvpanic-pci to be on the same page as pvpanic-mmio which is described
here: Documentation/ABI/testing/sysfs-bus-pci-devices-pvpanic.

Thank you,
Mihai


2021-03-16 17:33:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v5 3/3] misc/pvpanic: add PCI driver

On Tue, Mar 16, 2021 at 07:08:38PM +0200, Mihai Carabas wrote:
> ..snip..
> > > +};
> > > +static unsigned int capability = PVPANIC_PANICKED | PVPANIC_CRASH_LOADED;
> > > +static unsigned int events;
> > > +
> > > +static ssize_t capability_show(struct device *dev,
> > > + struct device_attribute *attr, char *buf)
> > > +{
> > > + return sysfs_emit(buf, "%x\n", capability);
> > A global capability for all devices? No, this needs to be a per-device
> > attttribute as you are showing it to userspace as such.
>
> We can only have a pvpanic-pci device. This is necessary in that case?

Why would it not be? Why constrain yourself to something that someone
will only have to fix sometime in the future?

> ...snip..
> > > +static struct attribute *pvpanic_pci_dev_attrs[] = {
> > > + &dev_attr_capability.attr,
> > > + &dev_attr_events.attr,
> > > + NULL
> > > +};
> > > +ATTRIBUTE_GROUPS(pvpanici_pci_dev);
> > You did not document these new sysfs files in Documentation/ABI/ so it's
> > hard to judge what they do. Please do so next version.
>
> This appeared after 5.12 rebase on pvpanic-mmio. I did this changes to
> pvpanic-pci to be on the same page as pvpanic-mmio which is described here:
> Documentation/ABI/testing/sysfs-bus-pci-devices-pvpanic.

Ah, missed that, my fault, sorry. But you also now do this for the
other device type right? So does the documentation need to reflect that
too?

thanks,

greg k-h

2021-03-16 21:20:56

by Mihai Carabas

[permalink] [raw]
Subject: Re: [PATCH v5 3/3] misc/pvpanic: add PCI driver

La 16.03.2021 19:29, Greg KH a scris:
> On Tue, Mar 16, 2021 at 07:08:38PM +0200, Mihai Carabas wrote:
>> ..snip..
>>>> +};
>>>> +static unsigned int capability = PVPANIC_PANICKED | PVPANIC_CRASH_LOADED;
>>>> +static unsigned int events;
>>>> +
>>>> +static ssize_t capability_show(struct device *dev,
>>>> + struct device_attribute *attr, char *buf)
>>>> +{
>>>> + return sysfs_emit(buf, "%x\n", capability);
>>> A global capability for all devices? No, this needs to be a per-device
>>> attttribute as you are showing it to userspace as such.
>> We can only have a pvpanic-pci device. This is necessary in that case?
> Why would it not be? Why constrain yourself to something that someone
> will only have to fix sometime in the future?

Agree. But why this got in in Jan2021 for pvpanic-mmio.c (ex. pvpanic.c)
like this :)?

2021-03-16 21:21:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v5 3/3] misc/pvpanic: add PCI driver

On Tue, Mar 16, 2021 at 08:02:14PM +0200, Mihai Carabas wrote:
> La 16.03.2021 19:29, Greg KH a scris:
> > On Tue, Mar 16, 2021 at 07:08:38PM +0200, Mihai Carabas wrote:
> > > ..snip..
> > > > > +};
> > > > > +static unsigned int capability = PVPANIC_PANICKED | PVPANIC_CRASH_LOADED;
> > > > > +static unsigned int events;
> > > > > +
> > > > > +static ssize_t capability_show(struct device *dev,
> > > > > + struct device_attribute *attr, char *buf)
> > > > > +{
> > > > > + return sysfs_emit(buf, "%x\n", capability);
> > > > A global capability for all devices? No, this needs to be a per-device
> > > > attttribute as you are showing it to userspace as such.
> > > We can only have a pvpanic-pci device. This is necessary in that case?
> > Why would it not be? Why constrain yourself to something that someone
> > will only have to fix sometime in the future?
>
> Agree. But why this got in in Jan2021 for pvpanic-mmio.c (ex. pvpanic.c)
> like this :)?
>

Because I didn't object strong enough :)