Skip to contentSkip to conversation

block: sed-opal: Introduce SUM_SET_LIST parameter and append it using 'add_token_u64'

PATCH Applied Revanth Rajashekar 3 participants 6 messages Nov 8, 2019 – Nov 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: sed-opal: Introduce SUM_SET_LIST parameter and append it using 'add_token_u64'

In function 'activate_lsp', rather than hard-coding the short atom header(0x83), we need to let the function 'add_short_atom_header' append the header based on the parameter being appended.

The paramete has been defined in Section 3.1.2.1 of
https://trustedcomputinggroup.org/wp-content/uploads/TCG_Storage-Opal_Feature_Set_Single_User_Mode_v1-00_r1-00-Final.pdf

---
 block/opal_proto.h | 4 ++++
 block/sed-opal.c   | 6 +-----
 2 files changed, 5 insertions(+), 5 deletions(-)
block/opal_proto.h +4 -0
index 736e67c3e7c5..325cbba2465f 100644
@@ -205,6 +205,10 @@ enum opal_lockingstate {
 	OPAL_LOCKING_LOCKED = 0x03,
 };
 
+enum opal_parameter {
+	OPAL_SUM_SET_LIST = 0x060000,
+};
+
 /* Packets derived from:
  * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
  * Secion: 3.2.3 ComPackets, Packets & Subpackets
block/sed-opal.c +1 -5
index b2cacc9ddd11..880cc57a5f6b 100644
@@ -1886,7 +1886,6 @@ static int activate_lsp(struct opal_dev *dev, void *data)
 {
 	struct opal_lr_act *opal_act = data;
 	u8 user_lr[OPAL_UID_LENGTH];
-	u8 uint_3 = 0x83;
 	int err, i;
 
 	err = cmd_start(dev, opaluid[OPAL_LOCKINGSP_UID],
@@ -1899,10 +1898,7 @@ static int activate_lsp(struct opal_dev *dev, void *data)
 			return err;
 
 		add_token_u8(&err, dev, OPAL_STARTNAME);
-		add_token_u8(&err, dev, uint_3);
-		add_token_u8(&err, dev, 6);
-		add_token_u8(&err, dev, 0);
-		add_token_u8(&err, dev, 0);
+		add_token_u64(&err, dev, OPAL_SUM_SET_LIST);
 
 		add_token_u8(&err, dev, OPAL_STARTLIST);
 		add_token_bytestring(&err, dev, user_lr, OPAL_UID_LENGTH);
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Quoted 43 lines · Revanth Rajashekar

In function 'activate_lsp', rather than hard-coding the short atom header(0x83), we need to let the function 'add_short_atom_header' append the header based on the parameter being appended.

The paramete has been defined in Section 3.1.2.1 of
https://trustedcomputinggroup.org/wp-content/uploads/TCG_Storage-Opal_Feature_Set_Single_User_Mode_v1-00_r1-00-Final.pdf

---
 block/opal_proto.h | 4 ++++
 block/sed-opal.c   | 6 +-----
 2 files changed, 5 insertions(+), 5 deletions(-)
block/opal_proto.h +4 -0
index 736e67c3e7c5..325cbba2465f 100644
@@ -205,6 +205,10 @@ enum opal_lockingstate {
 	OPAL_LOCKING_LOCKED = 0x03,
 };
 
+enum opal_parameter {
+	OPAL_SUM_SET_LIST = 0x060000,
+};
+
 /* Packets derived from:
  * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
  * Secion: 3.2.3 ComPackets, Packets & Subpackets
block/sed-opal.c +0 -1
index b2cacc9ddd11..880cc57a5f6b 100644
@@ -1886,7 +1886,6 @@ static int activate_lsp(struct opal_dev *dev, void *data)
 {
 	struct opal_lr_act *opal_act = data;
 	u8 user_lr[OPAL_UID_LENGTH];
-	u8 uint_3 = 0x83;
 	int err, i;
 
 	err = cmd_start(dev, opaluid[OPAL_LOCKINGSP_UID],
@@ -1899,10 +1898,7 @@ static int activate_lsp(struct opal_dev *dev, void *data)
 			return err;

block/sed-opal.c static int activate_lsp(struct opal_dev *dev, void *data) · line 1904

Quoted 10 lines
block/sed-opal.c +1 -4
 
 		add_token_u8(&err, dev, OPAL_STARTNAME);
-		add_token_u8(&err, dev, uint_3);
-		add_token_u8(&err, dev, 6);
-		add_token_u8(&err, dev, 0);
-		add_token_u8(&err, dev, 0);
+		add_token_u64(&err, dev, OPAL_SUM_SET_LIST);
 
 		add_token_u8(&err, dev, OPAL_STARTLIST);
 		add_token_bytestring(&err, dev, user_lr, OPAL_UID_LENGTH);

Kind remainder to review this patch and throw your comments if any :)

Thank you

Revanth Rajashekar

maintainer
#2 lore raw
Quoted 54 lines · Revanth

Hi,

Quoted 51 lines · Revanth Rajashekar

In function 'activate_lsp', rather than hard-coding the short atom header(0x83), we need to let the function 'add_short_atom_header' append the header based on the parameter being appended.

The paramete has been defined in Section 3.1.2.1 of
https://trustedcomputinggroup.org/wp-content/uploads/TCG_Storage-Opal_Feature_Set_Single_User_Mode_v1-00_r1-00-Final.pdf

---
  block/opal_proto.h | 4 ++++
  block/sed-opal.c   | 6 +-----
  2 files changed, 5 insertions(+), 5 deletions(-)
block/opal_proto.h +4 -0
index 736e67c3e7c5..325cbba2465f 100644
@@ -205,6 +205,10 @@ enum opal_lockingstate {
  	OPAL_LOCKING_LOCKED = 0x03,
  };
 
+enum opal_parameter {
+	OPAL_SUM_SET_LIST = 0x060000,
+};
+
  /* Packets derived from:
   * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
   * Secion: 3.2.3 ComPackets, Packets & Subpackets
block/sed-opal.c +1 -5
index b2cacc9ddd11..880cc57a5f6b 100644
@@ -1886,7 +1886,6 @@ static int activate_lsp(struct opal_dev *dev, void *data)
  {
  	struct opal_lr_act *opal_act = data;
  	u8 user_lr[OPAL_UID_LENGTH];
-	u8 uint_3 = 0x83;
  	int err, i;
 
  	err = cmd_start(dev, opaluid[OPAL_LOCKINGSP_UID],
@@ -1899,10 +1898,7 @@ static int activate_lsp(struct opal_dev *dev, void *data)
  			return err;
 
  		add_token_u8(&err, dev, OPAL_STARTNAME);
-		add_token_u8(&err, dev, uint_3);
-		add_token_u8(&err, dev, 6);
-		add_token_u8(&err, dev, 0);
-		add_token_u8(&err, dev, 0);
+		add_token_u64(&err, dev, OPAL_SUM_SET_LIST);
 
Quoted 4 lines

block/sed-opal.c static int activate_lsp(struct opal_dev *dev, void *data) · line 1904

Quoted 2 lines
block/sed-opal.c +0 -0
  		add_token_u8(&err, dev, OPAL_STARTLIST);
  		add_token_bytestring(&err, dev, user_lr, OPAL_UID_LENGTH);

Kind remainder to review this patch and throw your comments if any :)

I'll be happy to queue it up for 5.5, but Scott/Jonathan should review/ack it first.

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 55 lines · Jens Axboe
Quoted 54 lines · Revanth

Hi,

Quoted 51 lines · Revanth Rajashekar

In function 'activate_lsp', rather than hard-coding the short atom header(0x83), we need to let the function 'add_short_atom_header' append the header based on the parameter being appended.

The paramete has been defined in Section 3.1.2.1 of
https://trustedcomputinggroup.org/wp-content/uploads/TCG_Storage-Opal_Feature_Set_Single_User_Mode_v1-00_r1-00-Final.pdf

---
  block/opal_proto.h | 4 ++++
  block/sed-opal.c   | 6 +-----
  2 files changed, 5 insertions(+), 5 deletions(-)
block/opal_proto.h +4 -0
index 736e67c3e7c5..325cbba2465f 100644
@@ -205,6 +205,10 @@ enum opal_lockingstate {
  	OPAL_LOCKING_LOCKED = 0x03,
  };
 
+enum opal_parameter {
+	OPAL_SUM_SET_LIST = 0x060000,
+};
+
  /* Packets derived from:
   * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
   * Secion: 3.2.3 ComPackets, Packets & Subpackets
block/sed-opal.c +1 -5
index b2cacc9ddd11..880cc57a5f6b 100644
@@ -1886,7 +1886,6 @@ static int activate_lsp(struct opal_dev *dev, void *data)
  {
  	struct opal_lr_act *opal_act = data;
  	u8 user_lr[OPAL_UID_LENGTH];
-	u8 uint_3 = 0x83;
  	int err, i;
 
  	err = cmd_start(dev, opaluid[OPAL_LOCKINGSP_UID],
@@ -1899,10 +1898,7 @@ static int activate_lsp(struct opal_dev *dev, void *data)
  			return err;
 
  		add_token_u8(&err, dev, OPAL_STARTNAME);
-		add_token_u8(&err, dev, uint_3);
-		add_token_u8(&err, dev, 6);
-		add_token_u8(&err, dev, 0);
-		add_token_u8(&err, dev, 0);
+		add_token_u64(&err, dev, OPAL_SUM_SET_LIST);
 
Quoted 5 lines
Quoted 3 lines

block/sed-opal.c static int activate_lsp(struct opal_dev *dev, void *data) · line 1904

Quoted 2 lines
block/sed-opal.c +0 -0
  		add_token_u8(&err, dev, OPAL_STARTLIST);
  		add_token_bytestring(&err, dev, user_lr, OPAL_UID_LENGTH);

Kind remainder to review this patch and throw your comments if any :)

I'll be happy to queue it up for 5.5, but Scott/Jonathan should review/ack it first.

Sure.

Thank you :)

Reviewed-by
#4 lore raw
In reply to Jens Axboe
Quoted 55 lines · Jens Axboe
Quoted 54 lines · Revanth

Hi,

Quoted 51 lines · Revanth Rajashekar

In function 'activate_lsp', rather than hard-coding the short atom header(0x83), we need to let the function 'add_short_atom_header' append the header based on the parameter being appended.

The paramete has been defined in Section 3.1.2.1 of
https://trustedcomputinggroup.org/wp-content/uploads/TCG_Storage-Opal_Feature_Set_Single_User_Mode_v1-00_r1-00-Final.pdf

---
  block/opal_proto.h | 4 ++++
  block/sed-opal.c   | 6 +-----
  2 files changed, 5 insertions(+), 5 deletions(-)
block/opal_proto.h +4 -0
index 736e67c3e7c5..325cbba2465f 100644
@@ -205,6 +205,10 @@ enum opal_lockingstate {
  	OPAL_LOCKING_LOCKED = 0x03,
  };
 
+enum opal_parameter {
+	OPAL_SUM_SET_LIST = 0x060000,
+};
+
  /* Packets derived from:
   * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
   * Secion: 3.2.3 ComPackets, Packets & Subpackets
block/sed-opal.c +1 -5
index b2cacc9ddd11..880cc57a5f6b 100644
@@ -1886,7 +1886,6 @@ static int activate_lsp(struct opal_dev *dev, void *data)
  {
  	struct opal_lr_act *opal_act = data;
  	u8 user_lr[OPAL_UID_LENGTH];
-	u8 uint_3 = 0x83;
  	int err, i;
 
  	err = cmd_start(dev, opaluid[OPAL_LOCKINGSP_UID],
@@ -1899,10 +1898,7 @@ static int activate_lsp(struct opal_dev *dev, void *data)
  			return err;
 
  		add_token_u8(&err, dev, OPAL_STARTNAME);
-		add_token_u8(&err, dev, uint_3);
-		add_token_u8(&err, dev, 6);
-		add_token_u8(&err, dev, 0);
-		add_token_u8(&err, dev, 0);
+		add_token_u64(&err, dev, OPAL_SUM_SET_LIST);
 
Quoted 8 lines
Quoted 4 lines

block/sed-opal.c static int activate_lsp(struct opal_dev *dev, void *data) · line 1904

Quoted 2 lines
block/sed-opal.c +0 -0
  		add_token_u8(&err, dev, OPAL_STARTLIST);
  		add_token_bytestring(&err, dev, user_lr, OPAL_UID_LENGTH);

Kind remainder to review this patch and throw your comments if any :)

I'll be happy to queue it up for 5.5, but Scott/Jonathan should review/ack it first.

Looks like it should work the same

maintainer Applied
#5 lore raw
In reply to Revanth Rajashekar
Quoted 7 lines · Revanth Rajashekar

In function 'activate_lsp', rather than hard-coding the short atom header(0x83), we need to let the function 'add_short_atom_header' append the header based on the parameter being appended.

The paramete has been defined in Section 3.1.2.1 of
https://trustedcomputinggroup.org/wp-content/uploads/TCG_Storage-Opal_Feature_Set_Single_User_Mode_v1-00_r1-00-Final.pdf

Applied, thanks.

Signature · 1 line
Jens Axboe