Skip to contentSkip to conversation

qla2xxx: Fix the ARM build

PATCH In review Bart Van Assche 3 participants 5 messages Jun 10, 2020

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

PATCH v2 1/1 qla2xxx: Fix the ARM build

This patch fixes the build errors reported by the kernel test robot on June 7th. Does this perhaps mean that so far nobody has tried to use the qla2xxx driver on an ARM system? For the kernel test robot output, see also
https://lore.kernel.org/lkml/202006070558.Cy93XggE%[email protected]/.

Cc Nilesh Javali <[email protected]>
Cc Quinn Tran <[email protected]>
Cc Himanshu Madhani <[email protected]>
Cc Hannes Reinecke <[email protected]>
Cc Daniel Wagner <[email protected]>
Cc Roman Bolshakov <[email protected]>
---
 drivers/scsi/qla2xxx/qla_def.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_def.h +1 -1
index 42dbf90d4651..de9c1604c575 100644
@@ -46,7 +46,7 @@ typedef struct {
 	uint8_t al_pa;
 	uint8_t area;
 	uint8_t domain;
-} le_id_t;
+} __packed le_id_t;
 
 #include "qla_bsg.h"
 #include "qla_dsd.h"
Reviewed-by on v2 1/1
#1 lore raw
Quoted 21 lines · Bart Van Assche

This patch fixes the build errors reported by the kernel test robot on June 7th. Does this perhaps mean that so far nobody has tried to use the qla2xxx driver on an ARM system? For the kernel test robot output, see also
https://lore.kernel.org/lkml/202006070558.Cy93XggE%[email protected]/.

Cc Nilesh Javali <[email protected]>
Cc Quinn Tran <[email protected]>
Cc Himanshu Madhani <[email protected]>
Cc Hannes Reinecke <[email protected]>
Cc Daniel Wagner <[email protected]>
Cc Roman Bolshakov <[email protected]>
---
 drivers/scsi/qla2xxx/qla_def.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_def.h +0 -0
index 42dbf90d4651..de9c1604c575 100644

drivers/scsi/qla2xxx/qla_def.h typedef struct { · line 52

Quoted 8 lines
drivers/scsi/qla2xxx/qla_def.h +1 -1
@@ -46,7 +46,7 @@ typedef struct {
 	uint8_t al_pa;
 	uint8_t area;
 	uint8_t domain;
-} le_id_t;
+} __packed le_id_t;
 
 #include "qla_bsg.h"
 #include "qla_dsd.h"

BTW, it might worth to mention the bot found the issue:

Thanks,
Roman

#2 lore raw
In reply to Bart Van Assche

Hi Bart,

drivers/scsi/qla2xxx/qla_def.h typedef struct { · line 49

Quoted 10 lines
drivers/scsi/qla2xxx/qla_def.h +1 -1
index 42dbf90d4651..de9c1604c575 100644
@@ -46,7 +46,7 @@ typedef struct {
 	uint8_t al_pa;
 	uint8_t area;
 	uint8_t domain;
-} le_id_t;
+} __packed le_id_t;

Now I am totally confused. le_id_t (and why does be_id_t not need it?) are not used inside either of the reported data structure (cmd_entry_t, ms_iocb_entry_t, request_t, struct ctio_crc2_to_fw, struct ctio7_to_24xx, struct ctio_to_2xxx) which the bot reports. I must oversee something.

Besides this, my small test report 3 bytes size for le_id_t on all architectures too. I'll try to see what the compiler generates from the kernel source (takes a while because I am running it natively...)

#3 lore raw
Quoted 18 lines · Daniel Wagner

Hi Bart,

drivers/scsi/qla2xxx/qla_def.h typedef struct { · line 49

Quoted 10 lines
drivers/scsi/qla2xxx/qla_def.h +1 -1
index 42dbf90d4651..de9c1604c575 100644
@@ -46,7 +46,7 @@ typedef struct {
 	uint8_t al_pa;
 	uint8_t area;
 	uint8_t domain;
-} le_id_t;
+} __packed le_id_t;

Now I am totally confused. le_id_t (and why does be_id_t not need it?) are not used inside either of the reported data structure (cmd_entry_t, ms_iocb_entry_t, request_t, struct ctio_crc2_to_fw, struct ctio7_to_24xx, struct ctio_to_2xxx) which the bot reports. I must oversee something.

I also had the thought that both fields should be packed for sake of consistency because there is fcp_hdr with be_id_t sid/did and fcp_hdr_le with le_id_t sid/did. You also seem to be correct, about your concerns. I overlooked that only ctio_crc2_to_fw and ctio7_to_24xx have le_id_t initiator_id field.

Roman

#4 lore raw
Quoted 17 lines · Roman Bolshakov
Quoted 7 lines · Daniel Wagner
Quoted 7 lines
drivers/scsi/qla2xxx/qla_def.h +0 -0
index 42dbf90d4651..de9c1604c575 100644
@@ -46,7 +46,7 @@ typedef struct {
 	uint8_t al_pa;
 	uint8_t area;
Quoted 8 lines

drivers/scsi/qla2xxx/qla_def.h typedef struct { · line 49

Quoted 3 lines
drivers/scsi/qla2xxx/qla_def.h +1 -1
 	uint8_t domain;
-} le_id_t;
+} __packed le_id_t;

Now I am totally confused. le_id_t (and why does be_id_t not need it?) are not used inside either of the reported data structure (cmd_entry_t, ms_iocb_entry_t, request_t, struct ctio_crc2_to_fw, struct ctio7_to_24xx, struct ctio_to_2xxx) which the bot reports. I must oversee something.

Quoted 5 lines

I also had the thought that both fields should be packed for sake of consistency because there is fcp_hdr with be_id_t sid/did and fcp_hdr_le with le_id_t sid/did. You also seem to be correct, about your concerns. I overlooked that only ctio_crc2_to_fw and ctio7_to_24xx have le_id_t initiator_id field.

It's only now that I noticed that the build failures are reported by sparse (C=1). So the build failures may indicate a bug in sparse.

Bart.