All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] block: sed-opal: Add ioctl to return device status
@ 2022-01-25 21:52 luca.boccassi
  2022-01-25 22:03 ` Douglas Miller
  0 siblings, 1 reply; 5+ messages in thread
From: luca.boccassi @ 2022-01-25 21:52 UTC (permalink / raw)
  To: linux-block; +Cc: dougmill, hch, sbauer, Jonathan.Derrick

From: "dougmill@linux.vnet.ibm.com" <dougmill@linux.vnet.ibm.com>

Provide a mechanism to retrieve basic status information about
the device, including the "supported" flag indicating whether
SED-OPAL is supported. The information returned is from the various
feature descriptors received during the discovery0 step, and so
this ioctl does nothing more than perform the discovery0 step
and then save the information received. See "struct opal_status"
and OPAL_FL_* bits for the status information currently returned.

Signed-off-by: Douglas Miller <dougmill@linux.vnet.ibm.com>
Tested-by: Luca Boccassi <bluca@debian.org>
---
v2: https://patchwork.kernel.org/project/linux-block/patch/612795b5.tj7FMS9wzchsMzrK%25dougmill@linux.vnet.ibm.com/
v3: resend on request, after rebasing and testing on my machine

 block/opal_proto.h            |  5 ++
 block/sed-opal.c              | 90 ++++++++++++++++++++++++++++++-----
 include/linux/sed-opal.h      |  1 +
 include/uapi/linux/sed-opal.h | 12 +++++
 4 files changed, 96 insertions(+), 12 deletions(-)

diff --git a/block/opal_proto.h b/block/opal_proto.h
index b486b3ec7dc4..7152aa1f1a49 100644
--- a/block/opal_proto.h
+++ b/block/opal_proto.h
@@ -39,7 +39,12 @@ enum opal_response_token {
 #define FIRST_TPER_SESSION_NUM	4096
 
 #define TPER_SYNC_SUPPORTED 0x01
+/* FC_LOCKING features */
+#define LOCKING_SUPPORTED_MASK 0x01
+#define LOCKING_ENABLED_MASK 0x02
+#define LOCKED_MASK 0x04
 #define MBR_ENABLED_MASK 0x10
+#define MBR_DONE_MASK 0x20
 
 #define TINY_ATOM_DATA_MASK 0x3F
 #define TINY_ATOM_SIGNED 0x40
diff --git a/block/sed-opal.c b/block/sed-opal.c
index daafadbb88ca..3a9c235be323 100644
--- a/block/sed-opal.c
+++ b/block/sed-opal.c
@@ -74,8 +74,7 @@ struct parsed_resp {
 };
 
 struct opal_dev {
-	bool supported;
-	bool mbr_enabled;
+	u32 flags;
 
 	void *data;
 	sec_send_recv *send_recv;
@@ -280,6 +279,30 @@ static bool check_tper(const void *data)
 	return true;
 }
 
+static bool check_lcksuppt(const void *data)
+{
+	const struct d0_locking_features *lfeat = data;
+	u8 sup_feat = lfeat->supported_features;
+
+	return !!(sup_feat & LOCKING_SUPPORTED_MASK);
+}
+
+static bool check_lckenabled(const void *data)
+{
+	const struct d0_locking_features *lfeat = data;
+	u8 sup_feat = lfeat->supported_features;
+
+	return !!(sup_feat & LOCKING_ENABLED_MASK);
+}
+
+static bool check_locked(const void *data)
+{
+	const struct d0_locking_features *lfeat = data;
+	u8 sup_feat = lfeat->supported_features;
+
+	return !!(sup_feat & LOCKED_MASK);
+}
+
 static bool check_mbrenabled(const void *data)
 {
 	const struct d0_locking_features *lfeat = data;
@@ -288,6 +311,14 @@ static bool check_mbrenabled(const void *data)
 	return !!(sup_feat & MBR_ENABLED_MASK);
 }
 
+static bool check_mbrdone(const void *data)
+{
+	const struct d0_locking_features *lfeat = data;
+	u8 sup_feat = lfeat->supported_features;
+
+	return !!(sup_feat & MBR_DONE_MASK);
+}
+
 static bool check_sum(const void *data)
 {
 	const struct d0_single_user_mode *sum = data;
@@ -435,7 +466,7 @@ static int opal_discovery0_end(struct opal_dev *dev)
 	u32 hlen = be32_to_cpu(hdr->length);
 
 	print_buffer(dev->resp, hlen);
-	dev->mbr_enabled = false;
+	dev->flags &= OPAL_FL_SUPPORTED;
 
 	if (hlen > IO_BUFFER_LENGTH - sizeof(*hdr)) {
 		pr_debug("Discovery length overflows buffer (%zu+%u)/%u\n",
@@ -461,7 +492,16 @@ static int opal_discovery0_end(struct opal_dev *dev)
 			check_geometry(dev, body);
 			break;
 		case FC_LOCKING:
-			dev->mbr_enabled = check_mbrenabled(body->features);
+			if (check_lcksuppt(body->features))
+				dev->flags |= OPAL_FL_LOCKING_SUPPORTED;
+			if (check_lckenabled(body->features))
+				dev->flags |= OPAL_FL_LOCKING_ENABLED;
+			if (check_locked(body->features))
+				dev->flags |= OPAL_FL_LOCKED;
+			if (check_mbrenabled(body->features))
+				dev->flags |= OPAL_FL_MBR_ENABLED;
+			if (check_mbrdone(body->features))
+				dev->flags |= OPAL_FL_MBR_DONE;
 			break;
 		case FC_ENTERPRISE:
 		case FC_DATASTORE:
@@ -2109,7 +2149,8 @@ static int check_opal_support(struct opal_dev *dev)
 	mutex_lock(&dev->dev_lock);
 	setup_opal_dev(dev);
 	ret = opal_discovery0_step(dev);
-	dev->supported = !ret;
+	if (!ret)
+		dev->flags |= OPAL_FL_SUPPORTED;
 	mutex_unlock(&dev->dev_lock);
 
 	return ret;
@@ -2148,6 +2189,7 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv)
 
 	INIT_LIST_HEAD(&dev->unlk_lst);
 	mutex_init(&dev->dev_lock);
+	dev->flags = 0;
 	dev->data = data;
 	dev->send_recv = send_recv;
 	if (check_opal_support(dev) != 0) {
@@ -2528,7 +2570,7 @@ bool opal_unlock_from_suspend(struct opal_dev *dev)
 	if (!dev)
 		return false;
 
-	if (!dev->supported)
+	if (!(dev->flags & OPAL_FL_SUPPORTED))
 		return false;
 
 	mutex_lock(&dev->dev_lock);
@@ -2546,7 +2588,7 @@ bool opal_unlock_from_suspend(struct opal_dev *dev)
 			was_failure = true;
 		}
 
-		if (dev->mbr_enabled) {
+		if (dev->flags & OPAL_FL_MBR_ENABLED) {
 			ret = __opal_set_mbr_done(dev, &suspend->unlk.session.opal_key);
 			if (ret)
 				pr_debug("Failed to set MBR Done in S3 resume\n");
@@ -2620,6 +2662,24 @@ static int opal_generic_read_write_table(struct opal_dev *dev,
 	return ret;
 }
 
+static int opal_get_status(struct opal_dev *dev, void __user *data)
+{
+	struct opal_status sts = {0};
+
+	/*
+	 * check_opal_support() error is not fatal,
+	 * !dev->supported is a valid condition
+	 */
+	if (!check_opal_support(dev)) {
+		sts.flags = dev->flags;
+	}
+	if (copy_to_user(data, &sts, sizeof(sts))) {
+		pr_debug("Error copying status to userspace\n");
+		return -EFAULT;
+	}
+	return 0;
+}
+
 int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *arg)
 {
 	void *p;
@@ -2629,12 +2689,14 @@ int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *arg)
 		return -EACCES;
 	if (!dev)
 		return -ENOTSUPP;
-	if (!dev->supported)
+	if (!(dev->flags & OPAL_FL_SUPPORTED))
 		return -ENOTSUPP;
 
-	p = memdup_user(arg, _IOC_SIZE(cmd));
-	if (IS_ERR(p))
-		return PTR_ERR(p);
+	if (cmd & IOC_IN) {
+		p = memdup_user(arg, _IOC_SIZE(cmd));
+		if (IS_ERR(p))
+			return PTR_ERR(p);
+	}
 
 	switch (cmd) {
 	case IOC_OPAL_SAVE:
@@ -2685,11 +2747,15 @@ int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *arg)
 	case IOC_OPAL_GENERIC_TABLE_RW:
 		ret = opal_generic_read_write_table(dev, p);
 		break;
+	case IOC_OPAL_GET_STATUS:
+		ret = opal_get_status(dev, arg);
+		break;
 	default:
 		break;
 	}
 
-	kfree(p);
+	if (cmd & IOC_IN)
+		kfree(p);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(sed_ioctl);
diff --git a/include/linux/sed-opal.h b/include/linux/sed-opal.h
index 1ac0d712a9c3..6f837bb6c715 100644
--- a/include/linux/sed-opal.h
+++ b/include/linux/sed-opal.h
@@ -43,6 +43,7 @@ static inline bool is_sed_ioctl(unsigned int cmd)
 	case IOC_OPAL_MBR_DONE:
 	case IOC_OPAL_WRITE_SHADOW_MBR:
 	case IOC_OPAL_GENERIC_TABLE_RW:
+	case IOC_OPAL_GET_STATUS:
 		return true;
 	}
 	return false;
diff --git a/include/uapi/linux/sed-opal.h b/include/uapi/linux/sed-opal.h
index 6f5af1a84213..c55bc79e3128 100644
--- a/include/uapi/linux/sed-opal.h
+++ b/include/uapi/linux/sed-opal.h
@@ -132,6 +132,17 @@ struct opal_read_write_table {
 	__u64 priv;
 };
 
+#define OPAL_FL_SUPPORTED		0x00000001
+#define OPAL_FL_LOCKING_SUPPORTED	0x00000002
+#define OPAL_FL_LOCKING_ENABLED		0x00000004
+#define OPAL_FL_LOCKED			0x00000008
+#define OPAL_FL_MBR_ENABLED		0x00000010
+#define OPAL_FL_MBR_DONE		0x00000020
+
+struct opal_status {
+	__u32 flags;
+};
+
 #define IOC_OPAL_SAVE		    _IOW('p', 220, struct opal_lock_unlock)
 #define IOC_OPAL_LOCK_UNLOCK	    _IOW('p', 221, struct opal_lock_unlock)
 #define IOC_OPAL_TAKE_OWNERSHIP	    _IOW('p', 222, struct opal_key)
@@ -148,5 +159,6 @@ struct opal_read_write_table {
 #define IOC_OPAL_MBR_DONE           _IOW('p', 233, struct opal_mbr_done)
 #define IOC_OPAL_WRITE_SHADOW_MBR   _IOW('p', 234, struct opal_shadow_mbr)
 #define IOC_OPAL_GENERIC_TABLE_RW   _IOW('p', 235, struct opal_read_write_table)
+#define IOC_OPAL_GET_STATUS         _IOR('p', 236, struct opal_status)
 
 #endif /* _UAPI_SED_OPAL_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] block: sed-opal: Add ioctl to return device status
  2022-01-25 21:52 [PATCH v3] block: sed-opal: Add ioctl to return device status luca.boccassi
@ 2022-01-25 22:03 ` Douglas Miller
  2022-01-30 16:19   ` Luca Boccassi
  0 siblings, 1 reply; 5+ messages in thread
From: Douglas Miller @ 2022-01-25 22:03 UTC (permalink / raw)
  To: luca.boccassi, linux-block; +Cc: hch, sbauer, Jonathan.Derrick

On 1/25/22 15:52, luca.boccassi@gmail.com wrote:
> From: "dougmill@linux.vnet.ibm.com" <dougmill@linux.vnet.ibm.com>
> 
> Provide a mechanism to retrieve basic status information about
> the device, including the "supported" flag indicating whether
> SED-OPAL is supported. The information returned is from the various
> feature descriptors received during the discovery0 step, and so
> this ioctl does nothing more than perform the discovery0 step
> and then save the information received. See "struct opal_status"
> and OPAL_FL_* bits for the status information currently returned.
> 
> Signed-off-by: Douglas Miller <dougmill@linux.vnet.ibm.com>
> Tested-by: Luca Boccassi <bluca@debian.org>
> ---
> v2: https://patchwork.kernel.org/project/linux-block/patch/612795b5.tj7FMS9wzchsMzrK%25dougmill@linux.vnet.ibm.com/
> v3: resend on request, after rebasing and testing on my machine
> 
>   block/opal_proto.h            |  5 ++
>   block/sed-opal.c              | 90 ++++++++++++++++++++++++++++++-----
>   include/linux/sed-opal.h      |  1 +
>   include/uapi/linux/sed-opal.h | 12 +++++
>   4 files changed, 96 insertions(+), 12 deletions(-)
> 
> diff --git a/block/opal_proto.h b/block/opal_proto.h
> index b486b3ec7dc4..7152aa1f1a49 100644
> --- a/block/opal_proto.h
> +++ b/block/opal_proto.h
> @@ -39,7 +39,12 @@ enum opal_response_token {
>   #define FIRST_TPER_SESSION_NUM	4096
> 
>   #define TPER_SYNC_SUPPORTED 0x01
> +/* FC_LOCKING features */
> +#define LOCKING_SUPPORTED_MASK 0x01
> +#define LOCKING_ENABLED_MASK 0x02
> +#define LOCKED_MASK 0x04
>   #define MBR_ENABLED_MASK 0x10
> +#define MBR_DONE_MASK 0x20
> 
>   #define TINY_ATOM_DATA_MASK 0x3F
>   #define TINY_ATOM_SIGNED 0x40
> diff --git a/block/sed-opal.c b/block/sed-opal.c
> index daafadbb88ca..3a9c235be323 100644
> --- a/block/sed-opal.c
> +++ b/block/sed-opal.c
> @@ -74,8 +74,7 @@ struct parsed_resp {
>   };
> 
>   struct opal_dev {
> -	bool supported;
> -	bool mbr_enabled;
> +	u32 flags;
> 
>   	void *data;
>   	sec_send_recv *send_recv;
> @@ -280,6 +279,30 @@ static bool check_tper(const void *data)
>   	return true;
>   }
> 
> +static bool check_lcksuppt(const void *data)
> +{
> +	const struct d0_locking_features *lfeat = data;
> +	u8 sup_feat = lfeat->supported_features;
> +
> +	return !!(sup_feat & LOCKING_SUPPORTED_MASK);
> +}
> +
> +static bool check_lckenabled(const void *data)
> +{
> +	const struct d0_locking_features *lfeat = data;
> +	u8 sup_feat = lfeat->supported_features;
> +
> +	return !!(sup_feat & LOCKING_ENABLED_MASK);
> +}
> +
> +static bool check_locked(const void *data)
> +{
> +	const struct d0_locking_features *lfeat = data;
> +	u8 sup_feat = lfeat->supported_features;
> +
> +	return !!(sup_feat & LOCKED_MASK);
> +}
> +
>   static bool check_mbrenabled(const void *data)
>   {
>   	const struct d0_locking_features *lfeat = data;
> @@ -288,6 +311,14 @@ static bool check_mbrenabled(const void *data)
>   	return !!(sup_feat & MBR_ENABLED_MASK);
>   }
> 
> +static bool check_mbrdone(const void *data)
> +{
> +	const struct d0_locking_features *lfeat = data;
> +	u8 sup_feat = lfeat->supported_features;
> +
> +	return !!(sup_feat & MBR_DONE_MASK);
> +}
> +
>   static bool check_sum(const void *data)
>   {
>   	const struct d0_single_user_mode *sum = data;
> @@ -435,7 +466,7 @@ static int opal_discovery0_end(struct opal_dev *dev)
>   	u32 hlen = be32_to_cpu(hdr->length);
> 
>   	print_buffer(dev->resp, hlen);
> -	dev->mbr_enabled = false;
> +	dev->flags &= OPAL_FL_SUPPORTED;
> 
>   	if (hlen > IO_BUFFER_LENGTH - sizeof(*hdr)) {
>   		pr_debug("Discovery length overflows buffer (%zu+%u)/%u\n",
> @@ -461,7 +492,16 @@ static int opal_discovery0_end(struct opal_dev *dev)
>   			check_geometry(dev, body);
>   			break;
>   		case FC_LOCKING:
> -			dev->mbr_enabled = check_mbrenabled(body->features);
> +			if (check_lcksuppt(body->features))
> +				dev->flags |= OPAL_FL_LOCKING_SUPPORTED;
> +			if (check_lckenabled(body->features))
> +				dev->flags |= OPAL_FL_LOCKING_ENABLED;
> +			if (check_locked(body->features))
> +				dev->flags |= OPAL_FL_LOCKED;
> +			if (check_mbrenabled(body->features))
> +				dev->flags |= OPAL_FL_MBR_ENABLED;
> +			if (check_mbrdone(body->features))
> +				dev->flags |= OPAL_FL_MBR_DONE;
>   			break;
>   		case FC_ENTERPRISE:
>   		case FC_DATASTORE:
> @@ -2109,7 +2149,8 @@ static int check_opal_support(struct opal_dev *dev)
>   	mutex_lock(&dev->dev_lock);
>   	setup_opal_dev(dev);
>   	ret = opal_discovery0_step(dev);
> -	dev->supported = !ret;
> +	if (!ret)
> +		dev->flags |= OPAL_FL_SUPPORTED;
>   	mutex_unlock(&dev->dev_lock);
> 
>   	return ret;
> @@ -2148,6 +2189,7 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv)
> 
>   	INIT_LIST_HEAD(&dev->unlk_lst);
>   	mutex_init(&dev->dev_lock);
> +	dev->flags = 0;
>   	dev->data = data;
>   	dev->send_recv = send_recv;
>   	if (check_opal_support(dev) != 0) {
> @@ -2528,7 +2570,7 @@ bool opal_unlock_from_suspend(struct opal_dev *dev)
>   	if (!dev)
>   		return false;
> 
> -	if (!dev->supported)
> +	if (!(dev->flags & OPAL_FL_SUPPORTED))
>   		return false;
> 
>   	mutex_lock(&dev->dev_lock);
> @@ -2546,7 +2588,7 @@ bool opal_unlock_from_suspend(struct opal_dev *dev)
>   			was_failure = true;
>   		}
> 
> -		if (dev->mbr_enabled) {
> +		if (dev->flags & OPAL_FL_MBR_ENABLED) {
>   			ret = __opal_set_mbr_done(dev, &suspend->unlk.session.opal_key);
>   			if (ret)
>   				pr_debug("Failed to set MBR Done in S3 resume\n");
> @@ -2620,6 +2662,24 @@ static int opal_generic_read_write_table(struct opal_dev *dev,
>   	return ret;
>   }
> 
> +static int opal_get_status(struct opal_dev *dev, void __user *data)
> +{
> +	struct opal_status sts = {0};
> +
> +	/*
> +	 * check_opal_support() error is not fatal,
> +	 * !dev->supported is a valid condition
> +	 */
> +	if (!check_opal_support(dev)) {
> +		sts.flags = dev->flags;
> +	}
> +	if (copy_to_user(data, &sts, sizeof(sts))) {
> +		pr_debug("Error copying status to userspace\n");
> +		return -EFAULT;
> +	}
> +	return 0;
> +}
> +
>   int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *arg)
>   {
>   	void *p;
> @@ -2629,12 +2689,14 @@ int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *arg)
>   		return -EACCES;
>   	if (!dev)
>   		return -ENOTSUPP;
> -	if (!dev->supported)
> +	if (!(dev->flags & OPAL_FL_SUPPORTED))
>   		return -ENOTSUPP;
> 
> -	p = memdup_user(arg, _IOC_SIZE(cmd));
> -	if (IS_ERR(p))
> -		return PTR_ERR(p);
> +	if (cmd & IOC_IN) {
> +		p = memdup_user(arg, _IOC_SIZE(cmd));
> +		if (IS_ERR(p))
> +			return PTR_ERR(p);
> +	}
> 
>   	switch (cmd) {
>   	case IOC_OPAL_SAVE:
> @@ -2685,11 +2747,15 @@ int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *arg)
>   	case IOC_OPAL_GENERIC_TABLE_RW:
>   		ret = opal_generic_read_write_table(dev, p);
>   		break;
> +	case IOC_OPAL_GET_STATUS:
> +		ret = opal_get_status(dev, arg);
> +		break;
>   	default:
>   		break;
>   	}
> 
> -	kfree(p);
> +	if (cmd & IOC_IN)
> +		kfree(p);
>   	return ret;
>   }
>   EXPORT_SYMBOL_GPL(sed_ioctl);
> diff --git a/include/linux/sed-opal.h b/include/linux/sed-opal.h
> index 1ac0d712a9c3..6f837bb6c715 100644
> --- a/include/linux/sed-opal.h
> +++ b/include/linux/sed-opal.h
> @@ -43,6 +43,7 @@ static inline bool is_sed_ioctl(unsigned int cmd)
>   	case IOC_OPAL_MBR_DONE:
>   	case IOC_OPAL_WRITE_SHADOW_MBR:
>   	case IOC_OPAL_GENERIC_TABLE_RW:
> +	case IOC_OPAL_GET_STATUS:
>   		return true;
>   	}
>   	return false;
> diff --git a/include/uapi/linux/sed-opal.h b/include/uapi/linux/sed-opal.h
> index 6f5af1a84213..c55bc79e3128 100644
> --- a/include/uapi/linux/sed-opal.h
> +++ b/include/uapi/linux/sed-opal.h
> @@ -132,6 +132,17 @@ struct opal_read_write_table {
>   	__u64 priv;
>   };
> 
> +#define OPAL_FL_SUPPORTED		0x00000001
> +#define OPAL_FL_LOCKING_SUPPORTED	0x00000002
> +#define OPAL_FL_LOCKING_ENABLED		0x00000004
> +#define OPAL_FL_LOCKED			0x00000008
> +#define OPAL_FL_MBR_ENABLED		0x00000010
> +#define OPAL_FL_MBR_DONE		0x00000020
> +
> +struct opal_status {
> +	__u32 flags;
> +};
> +
>   #define IOC_OPAL_SAVE		    _IOW('p', 220, struct opal_lock_unlock)
>   #define IOC_OPAL_LOCK_UNLOCK	    _IOW('p', 221, struct opal_lock_unlock)
>   #define IOC_OPAL_TAKE_OWNERSHIP	    _IOW('p', 222, struct opal_key)
> @@ -148,5 +159,6 @@ struct opal_read_write_table {
>   #define IOC_OPAL_MBR_DONE           _IOW('p', 233, struct opal_mbr_done)
>   #define IOC_OPAL_WRITE_SHADOW_MBR   _IOW('p', 234, struct opal_shadow_mbr)
>   #define IOC_OPAL_GENERIC_TABLE_RW   _IOW('p', 235, struct opal_read_write_table)
> +#define IOC_OPAL_GET_STATUS         _IOR('p', 236, struct opal_status)
> 
>   #endif /* _UAPI_SED_OPAL_H */

I would like to withdraw this patch. We are going a different direction 
for our SED-OPAL support and will be submitting a new set of patches 
soon, which includes a different method of obtaining the discovery0 data.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] block: sed-opal: Add ioctl to return device status
  2022-01-25 22:03 ` Douglas Miller
@ 2022-01-30 16:19   ` Luca Boccassi
  2022-07-05 10:38     ` Luca Boccassi
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Boccassi @ 2022-01-30 16:19 UTC (permalink / raw)
  To: Douglas Miller; +Cc: linux-block

On Tue, 25 Jan 2022 at 22:03, Douglas Miller
<dougmill@linux.vnet.ibm.com> wrote:
>
> On 1/25/22 15:52, luca.boccassi@gmail.com wrote:
> > From: "dougmill@linux.vnet.ibm.com" <dougmill@linux.vnet.ibm.com>
> >
> > Provide a mechanism to retrieve basic status information about
> > the device, including the "supported" flag indicating whether
> > SED-OPAL is supported. The information returned is from the various
> > feature descriptors received during the discovery0 step, and so
> > this ioctl does nothing more than perform the discovery0 step
> > and then save the information received. See "struct opal_status"
> > and OPAL_FL_* bits for the status information currently returned.
> >
> > Signed-off-by: Douglas Miller <dougmill@linux.vnet.ibm.com>
> > Tested-by: Luca Boccassi <bluca@debian.org>
> > ---
> > v2: https://patchwork.kernel.org/project/linux-block/patch/612795b5.tj7FMS9wzchsMzrK%25dougmill@linux.vnet.ibm.com/
> > v3: resend on request, after rebasing and testing on my machine
>
> I would like to withdraw this patch. We are going a different direction
> for our SED-OPAL support and will be submitting a new set of patches
> soon, which includes a different method of obtaining the discovery0 data.

Hi,

Do you have a rough ETA on the new series? Also would you mind CC'ing
me when you send it, please? Thanks!

Kind Regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] block: sed-opal: Add ioctl to return device status
@ 2022-02-02 14:41 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-02-02 14:41 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4445 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220125215248.6489-1-luca.boccassi@gmail.com>
References: <20220125215248.6489-1-luca.boccassi@gmail.com>
TO: luca.boccassi(a)gmail.com
TO: linux-block(a)vger.kernel.org
CC: dougmill(a)linux.vnet.ibm.com
CC: hch(a)infradead.org
CC: sbauer(a)plzdonthack.me
CC: Jonathan.Derrick(a)solidigmtechnology.com

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on linus/master v5.17-rc2 next-20220202]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/luca-boccassi-gmail-com/block-sed-opal-Add-ioctl-to-return-device-status/20220126-055454
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: openrisc-randconfig-m031-20220201 (https://download.01.org/0day-ci/archive/20220202/202202022253.Nh8enpBH-lkp(a)intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
block/sed-opal.c:2703 sed_ioctl() error: uninitialized symbol 'p'.

Old smatch warnings:
block/sed-opal.c:2706 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2709 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2712 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2715 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2718 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2721 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2724 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2727 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2730 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2733 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2736 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2739 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2742 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2745 sed_ioctl() error: uninitialized symbol 'p'.
block/sed-opal.c:2748 sed_ioctl() error: uninitialized symbol 'p'.

vim +/p +2703 block/sed-opal.c

0bf8b38e88d576 dougmill(a)linux.vnet.ibm.com 2022-01-25  2682  
e225c20eb0fd0b Scott Bauer                 2017-02-14  2683  int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *arg)
455a7b238cd6bc Scott Bauer                 2017-02-03  2684  {
e225c20eb0fd0b Scott Bauer                 2017-02-14  2685  	void *p;
e225c20eb0fd0b Scott Bauer                 2017-02-14  2686  	int ret = -ENOTTY;
455a7b238cd6bc Scott Bauer                 2017-02-03  2687  
455a7b238cd6bc Scott Bauer                 2017-02-03  2688  	if (!capable(CAP_SYS_ADMIN))
455a7b238cd6bc Scott Bauer                 2017-02-03  2689  		return -EACCES;
4f1244c8298606 Christoph Hellwig           2017-02-17  2690  	if (!dev)
4f1244c8298606 Christoph Hellwig           2017-02-17  2691  		return -ENOTSUPP;
0bf8b38e88d576 dougmill(a)linux.vnet.ibm.com 2022-01-25  2692  	if (!(dev->flags & OPAL_FL_SUPPORTED))
455a7b238cd6bc Scott Bauer                 2017-02-03  2693  		return -ENOTSUPP;
455a7b238cd6bc Scott Bauer                 2017-02-03  2694  
0bf8b38e88d576 dougmill(a)linux.vnet.ibm.com 2022-01-25  2695  	if (cmd & IOC_IN) {
e225c20eb0fd0b Scott Bauer                 2017-02-14  2696  		p = memdup_user(arg, _IOC_SIZE(cmd));
e225c20eb0fd0b Scott Bauer                 2017-02-14  2697  		if (IS_ERR(p))
e225c20eb0fd0b Scott Bauer                 2017-02-14  2698  			return PTR_ERR(p);
0bf8b38e88d576 dougmill(a)linux.vnet.ibm.com 2022-01-25  2699  	}
455a7b238cd6bc Scott Bauer                 2017-02-03  2700  
e225c20eb0fd0b Scott Bauer                 2017-02-14  2701  	switch (cmd) {
e225c20eb0fd0b Scott Bauer                 2017-02-14  2702  	case IOC_OPAL_SAVE:
e225c20eb0fd0b Scott Bauer                 2017-02-14 @2703  		ret = opal_save(dev, p);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] block: sed-opal: Add ioctl to return device status
  2022-01-30 16:19   ` Luca Boccassi
@ 2022-07-05 10:38     ` Luca Boccassi
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Boccassi @ 2022-07-05 10:38 UTC (permalink / raw)
  To: Douglas Miller; +Cc: linux-block

On Sun, 30 Jan 2022 at 16:19, Luca Boccassi <luca.boccassi@gmail.com> wrote:
>
> On Tue, 25 Jan 2022 at 22:03, Douglas Miller
> <dougmill@linux.vnet.ibm.com> wrote:
> >
> > On 1/25/22 15:52, luca.boccassi@gmail.com wrote:
> > > From: "dougmill@linux.vnet.ibm.com" <dougmill@linux.vnet.ibm.com>
> > >
> > > Provide a mechanism to retrieve basic status information about
> > > the device, including the "supported" flag indicating whether
> > > SED-OPAL is supported. The information returned is from the various
> > > feature descriptors received during the discovery0 step, and so
> > > this ioctl does nothing more than perform the discovery0 step
> > > and then save the information received. See "struct opal_status"
> > > and OPAL_FL_* bits for the status information currently returned.
> > >
> > > Signed-off-by: Douglas Miller <dougmill@linux.vnet.ibm.com>
> > > Tested-by: Luca Boccassi <bluca@debian.org>
> > > ---
> > > v2: https://patchwork.kernel.org/project/linux-block/patch/612795b5.tj7FMS9wzchsMzrK%25dougmill@linux.vnet.ibm.com/
> > > v3: resend on request, after rebasing and testing on my machine
> >
> > I would like to withdraw this patch. We are going a different direction
> > for our SED-OPAL support and will be submitting a new set of patches
> > soon, which includes a different method of obtaining the discovery0 data.
>
> Hi,
>
> Do you have a rough ETA on the new series? Also would you mind CC'ing
> me when you send it, please? Thanks!

Hello Douglas,

It's been more than half a year now, any progress on this new set of
patches? I really need this functionality.

Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-05 10:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-25 21:52 [PATCH v3] block: sed-opal: Add ioctl to return device status luca.boccassi
2022-01-25 22:03 ` Douglas Miller
2022-01-30 16:19   ` Luca Boccassi
2022-07-05 10:38     ` Luca Boccassi
  -- strict thread matches above, loose matches on Subject: below --
2022-02-02 14:41 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.