Skip to contentSkip to conversation

qla2xxx: Fix the ARM build

PATCH Superseded Bart Van Assche 2 participants 3 messages Jun 9, 2020 – Jun 10, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +3 -3
index 42dbf90d4651..edc9c082dc6e 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"
@@ -1841,8 +1841,8 @@ typedef union {
 	struct {
 		uint8_t reserved;
 		uint8_t standard;
-	} id;
-} target_id_t;
+	} __packed id;
+} __packed target_id_t;
 
 #define SET_TARGET_ID(ha, to, from)			\
 do {							\
#1 lore raw

Hi Bart,

Quoted 14 lines · Bart Van Assche
drivers/scsi/qla2xxx/qla_def.h +1 -1
index 42dbf90d4651..edc9c082dc6e 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"

drivers/scsi/qla2xxx/qla_def.h typedef union { · line 1845

Quoted 7 lines
drivers/scsi/qla2xxx/qla_def.h +2 -2
@@ -1841,8 +1841,8 @@ typedef union {
 	struct {
 		uint8_t reserved;
 		uint8_t standard;
-	} id;
-} target_id_t;
+	} __packed id;
+} __packed target_id_t;

This is a bit strange. Why is that only these two definitions need this treatment? With gcc 6.3.0 on Debian stretch, the compiler did the right thing for x86_64, ARMv7 and ARMv8. In all cases target_id_t is 2 bytes long.

Or does this happen because target_id_t is embedded into cmd_entry_t?

Here is the test code:

#include <stdio.h>
#include <stdint.h>

typedef union {
	uint16_t	extended;
	struct {
		uint8_t reserved;
		uint8_t standard;
	} id;
} target_id_t;

int main(int argc, char *argv[])

{
	printf("sizeof(target_id_t) = %zu\n", sizeof(target_id_t));
	return 0;
}

The only thing which is different to the above code is the use uint16_t instead of __le16. But I thought this should make a difference.

Thanks,
Daniel

#2 lore raw
Quoted 14 lines · Daniel Wagner

Hi Bart,

Quoted 11 lines · Bart Van Assche
drivers/scsi/qla2xxx/qla_def.h +1 -1
index 42dbf90d4651..edc9c082dc6e 100644
@@ -46,7 +46,7 @@ typedef struct {
 	uint8_t al_pa;
 	uint8_t area;
 	uint8_t domain;
-} le_id_t;
+} __packed le_id_t;
 
Quoted 15 lines

drivers/scsi/qla2xxx/qla_def.h typedef union { · line 1845

Quoted 10 lines
drivers/scsi/qla2xxx/qla_def.h +2 -2
 #include "qla_bsg.h"
 #include "qla_dsd.h"
@@ -1841,8 +1841,8 @@ typedef union {
 	struct {
 		uint8_t reserved;
 		uint8_t standard;
-	} id;
-} target_id_t;
+	} __packed id;
+} __packed target_id_t;

This is a bit strange. Why is that only these two definitions need this treatment? With gcc 6.3.0 on Debian stretch, the compiler did the right thing for x86_64, ARMv7 and ARMv8. In all cases target_id_t is 2 bytes long.

Hi Daniel,

That's a good catch. I checked again and the __packed annotations for target_id_t are not necessary. I will send a v2 of this patch.

Thanks,

Bart.