Skip to contentSkip to conversation

Fix log page buffer size passed in GetLogPage(CDW10.NUMD).

PATCH Superseded Indraneel Mukherjee 3 participants 3 messages May 28, 2014

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

PATCH 1/1 Fix log page buffer size passed in GetLogPage(CDW10.NUMD).

drivers/block/nvme-scsi.c +4 -4
index da3b252..0d9805b 100644
@@ -1014,8 +1014,8 @@ static int nvme_trans_log_info_exceptions(struct nvme_ns *ns,
 	c.common.opcode = nvme_admin_get_log_page;
 	c.common.nsid = cpu_to_le32(0xFFFFFFFF);
 	c.common.prp1 = cpu_to_le64(dma_addr);
-	c.common.cdw10[0] = cpu_to_le32(((sizeof(struct nvme_smart_log) /
-			BYTES_TO_DWORDS) << 16) | NVME_GET_SMART_LOG_PAGE);
+	c.common.cdw10[0] = cpu_to_le32((((sizeof(struct nvme_smart_log) /
+			BYTES_TO_DWORDS)-1) << 16) | NVME_GET_SMART_LOG_PAGE);
 	res = nvme_submit_admin_cmd(dev, &c, NULL);
 	if (res != NVME_SC_SUCCESS) {
 		temp_c = LOG_TEMP_UNKNOWN;
@@ -1082,8 +1082,8 @@ static int nvme_trans_log_temperature(struct nvme_ns *ns, struct sg_io_hdr *hdr,
 	c.common.opcode = nvme_admin_get_log_page;
 	c.common.nsid = cpu_to_le32(0xFFFFFFFF);
 	c.common.prp1 = cpu_to_le64(dma_addr);
-	c.common.cdw10[0] = cpu_to_le32(((sizeof(struct nvme_smart_log) /
-			BYTES_TO_DWORDS) << 16) | NVME_GET_SMART_LOG_PAGE);
+	c.common.cdw10[0] = cpu_to_le32((((sizeof(struct nvme_smart_log) /
+			BYTES_TO_DWORDS)-1) << 16) | NVME_GET_SMART_LOG_PAGE);
 	res = nvme_submit_admin_cmd(dev, &c, NULL);
 	if (res != NVME_SC_SUCCESS) {
 		temp_c_cur = LOG_TEMP_UNKNOWN;
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 Fix log page buffer size passed in GetLogPage(CDW10.NUMD).

drivers/block/nvme-scsi.c static int nvme_trans_log_info_exceptions(struct nvme_ns *ns, · line 1018

Quoted 12 lines · Indraneel Mukherjee
drivers/block/nvme-scsi.c +2 -2
index da3b252..0d9805b 100644
@@ -1014,8 +1014,8 @@ static int nvme_trans_log_info_exceptions(struct nvme_ns *ns,
 	c.common.opcode = nvme_admin_get_log_page;
 	c.common.nsid = cpu_to_le32(0xFFFFFFFF);
 	c.common.prp1 = cpu_to_le64(dma_addr);
-	c.common.cdw10[0] = cpu_to_le32(((sizeof(struct nvme_smart_log) /
-			BYTES_TO_DWORDS) << 16) | NVME_GET_SMART_LOG_PAGE);
+	c.common.cdw10[0] = cpu_to_le32((((sizeof(struct nvme_smart_log) /
+			BYTES_TO_DWORDS)-1) << 16) | NVME_GET_SMART_LOG_PAGE);

Documentation/CodingStyle says both these changes should read ") - 1)" instead of ")-1)" (spacing difference).

Quoted 4 lines
drivers/block/nvme-scsi.c +0 -0
 	res = nvme_submit_admin_cmd(dev, &c, NULL);
 	if (res != NVME_SC_SUCCESS) {
 		temp_c = LOG_TEMP_UNKNOWN;

drivers/block/nvme-scsi.c static int nvme_trans_log_temperature(struct nvme_ns *ns, struct sg_io_hdr *hdr, · line 1089

Quoted 10 lines
drivers/block/nvme-scsi.c +2 -2
@@ -1082,8 +1082,8 @@ static int nvme_trans_log_temperature(struct nvme_ns *ns, struct sg_io_hdr *hdr,
 	c.common.opcode = nvme_admin_get_log_page;
 	c.common.nsid = cpu_to_le32(0xFFFFFFFF);
 	c.common.prp1 = cpu_to_le64(dma_addr);
-	c.common.cdw10[0] = cpu_to_le32(((sizeof(struct nvme_smart_log) /
-			BYTES_TO_DWORDS) << 16) | NVME_GET_SMART_LOG_PAGE);
+	c.common.cdw10[0] = cpu_to_le32((((sizeof(struct nvme_smart_log) /
+			BYTES_TO_DWORDS)-1) << 16) | NVME_GET_SMART_LOG_PAGE);
 	res = nvme_submit_admin_cmd(dev, &c, NULL);
 	if (res != NVME_SC_SUCCESS) {
 		temp_c_cur = LOG_TEMP_UNKNOWN;

In principle, the patch is good, thanks for submitting this. I'd be happy to ack this once you resend with the changes.

-Vishal

#2 lore raw

PATCH 1/1 Fix log page buffer size passed in GetLogPage(CDW10.NUMD).

In reply to Indraneel Mukherjee
Quoted 1 line · Indraneel Mukherjee

Could there be an intro/description to this patch like there is for all the other patches I've seen on this list, please (Keith's patch sent yesterday could be an example)? Thanks!

Quoted 27 lines
drivers/block/nvme-scsi.c +4 -4
index da3b252..0d9805b 100644
@@ -1014,8 +1014,8 @@ static int nvme_trans_log_info_exceptions(struct nvme_ns *ns,
  	c.common.opcode = nvme_admin_get_log_page;
  	c.common.nsid = cpu_to_le32(0xFFFFFFFF);
  	c.common.prp1 = cpu_to_le64(dma_addr);
-	c.common.cdw10[0] = cpu_to_le32(((sizeof(struct nvme_smart_log) /
-			BYTES_TO_DWORDS) << 16) | NVME_GET_SMART_LOG_PAGE);
+	c.common.cdw10[0] = cpu_to_le32((((sizeof(struct nvme_smart_log) /
+			BYTES_TO_DWORDS)-1) << 16) | NVME_GET_SMART_LOG_PAGE);
  	res = nvme_submit_admin_cmd(dev, &c, NULL);
  	if (res != NVME_SC_SUCCESS) {
  		temp_c = LOG_TEMP_UNKNOWN;
@@ -1082,8 +1082,8 @@ static int nvme_trans_log_temperature(struct nvme_ns *ns, struct sg_io_hdr *hdr,
  	c.common.opcode = nvme_admin_get_log_page;
  	c.common.nsid = cpu_to_le32(0xFFFFFFFF);
  	c.common.prp1 = cpu_to_le64(dma_addr);
-	c.common.cdw10[0] = cpu_to_le32(((sizeof(struct nvme_smart_log) /
-			BYTES_TO_DWORDS) << 16) | NVME_GET_SMART_LOG_PAGE);
+	c.common.cdw10[0] = cpu_to_le32((((sizeof(struct nvme_smart_log) /
+			BYTES_TO_DWORDS)-1) << 16) | NVME_GET_SMART_LOG_PAGE);
  	res = nvme_submit_admin_cmd(dev, &c, NULL);
  	if (res != NVME_SC_SUCCESS) {
  		temp_c_cur = LOG_TEMP_UNKNOWN;