[PATCH linux dev-4.7] drivers: fsi: scom: Add reset functionality and sysfs interface

Eddie James eajames at linux.vnet.ibm.com
Tue Feb 21 01:59:36 AEDT 2017



On 02/20/2017 12:54 AM, Jeremy Kerr wrote:
> Hi Eddie,
>
> The changelog doesn't have much context, so a bit of a question:
>
>> +static ssize_t store_reset_register(struct device *dev,
>> +				    struct device_attribute *attr,
>> +				    const char *buf, size_t count)
>> +{
>> +	int rc;
>> +	struct fsi_device *fsi_dev = to_fsi_dev(dev);
>> +
>> +	rc = scom_full_reset(fsi_dev);
>> +
>> +	return rc ? rc : count;
>> +}
>> +DEVICE_ATTR(reset, 0200, NULL, store_reset_register);
>> +
> How does this interact with the scom read/write operations? Having
> different interfaces access methods (file for one, sysfs interface for
> another)for both seems like an invitation for trouble - would this make
> more sense as an ioctl on the existing fd?

It would, but I was under the impression ioctls were frowned upon for 
some reason? Since we only have one option (reset), I felt a sysfs entry 
made more sense for now? It doesn't interact at all with the read/write 
operations, though I suppose if you wrote reset while in the middle of a 
getscom/putscom, you'd probably end up with a bus error. I'd classify 
that as user error. We could add some sort of locking.

>
> Cheers,
>
>
> Jeremy
>



More information about the openbmc mailing list