Re: [PATCH v6 1/3] scsi: ufs: add ioctl interface for query request

Gilad Broner
2015-03-12T15:27:54Z

>> + if (!buffer) {
>> + dev_err(hba->dev, "%s: User buffer is NULL!\n",
>> __func__);
>> + return -EINVAL;
>> + }
>> +
>
> Should we remove this check or move it into ufshcd_query_ioctl()?
> For example, BLKFLS ioctl without argument is correct usage, but
> it always triggers this message. (blkdev_ioctl -> __blkdev_driver_ioctl
> -> sd_ioctl -> scsi_ioctl -> ufshcd_ioctl)

You're right, I'll move the check to ufshcd_query_ioctl().

> +++ b/include/uapi/scsi/ufs/ioctl.h
>> @@ -0,0 +1,57 @@
>> +#ifndef UAPI_UFS_IOCTL_H_
>> +#define UAPI_UFS_IOCTL_H_
>> +
>> +#include <linux/types.h>
>> +
>> +/*
>> + * IOCTL opcode for ufs queries has the following opcode after
>> + * SCSI_IOCTL_GET_PCI
>> + */
>> +#define UFS_IOCTL_QUERY 0x5388
>
> Should we also need some comments near SCSI_IOCTL_GET_PCI in
> include/scsi/scsi.h in order to avoid someone trying to define
> the same ioctl code in the future?
>
Indeed - I will add a comment.

Gilad.