Re: [PATCH] fix qla2xxx regression on sparc64

Bart Van Assche
2020-08-21T20:55:21Z

On 8/21/20 5:28 AM, Rene Rebe wrote:
>
> Commit 9a50aaefc1b896e734bf7faf3d085f71a360ce97 in 2014 broke
> qla2xxx on sparc64, e.g. as in the Sun Blade 1000 / 2000.
> Unbreak by fixing endianess in nvram firmware defaults
> initialization.
>
> Signed-off-by: René Rebe <rene@exactcode.de>
>
> --- linux-5.8/drivers/scsi/qla2xxx/qla_init.c.vanilla 2020-08-21 09:55:18.600926737 +0200
> +++ linux-5.8/drivers/scsi/qla2xxx/qla_init.c 2020-08-21 09:57:35.992926885 +0200
> @@ -4603,18 +4603,18 @@
> nv->firmware_options[1] = BIT_7 | BIT_5;
> nv->add_firmware_options[0] = BIT_5;
> nv->add_firmware_options[1] = BIT_5 | BIT_4;
> - nv->frame_payload_size = 2048;
> + nv->frame_payload_size = cpu_to_le16(2048);
> nv->special_options[1] = BIT_7;
> } else if (IS_QLA2200(ha)) {
> nv->firmware_options[0] = BIT_2 | BIT_1;
> nv->firmware_options[1] = BIT_7 | BIT_5;
> nv->add_firmware_options[0] = BIT_5;
> nv->add_firmware_options[1] = BIT_5 | BIT_4;
> - nv->frame_payload_size = 1024;
> + nv->frame_payload_size = cpu_to_le16(1024);
> } else if (IS_QLA2100(ha)) {
> nv->firmware_options[0] = BIT_3 | BIT_1;
> nv->firmware_options[1] = BIT_5;
> - nv->frame_payload_size = 1024;
> + nv->frame_payload_size = cpu_to_le16(1024);
> }
>
> nv->max_iocb_allocation = cpu_to_le16(256);

Hi Rene,

Please keep the qla2xxx driver endianness-clean and include the following in your patch:

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 8c92af5e4390..2182b2da43ed 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1626,7 +1626,7 @@ typedef struct {
*/
uint8_t firmware_options[2];

- uint16_t frame_payload_size;
+ __le16 frame_payload_size;
__le16 max_iocb_allocation;
__le16 execution_throttle;
uint8_t retry_count;

Thanks,

Bart.