diff mbox series

[1/2] megaraid_sas: Update structures for HOST_DEVICE_LIST DCMD

Message ID 1549614167-1128-2-git-send-email-shivasharan.srikanteshwara@broadcom.com (mailing list archive)
State Mainlined
Commit a3742d68484083ce55de8fec492be2db2fff2cfa
Headers show
Series megaraid_sas: Update structures for HOST_DEVICE_LIST DCMD | expand

Commit Message

Shivasharan Srikanteshwara Feb. 8, 2019, 8:22 a.m. UTC
Add padding to make the structure variables in MR_HOST_DEVICE_LIST_ENTRY
64-bit aligned.
Also, add reserved fields to MR_HOST_DEVICE_LIST for future firmware usage.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Hannes Reinecke Feb. 8, 2019, 12:07 p.m. UTC | #1
On 2/8/19 9:22 AM, Shivasharan S wrote:
> Add padding to make the structure variables in MR_HOST_DEVICE_LIST_ENTRY
> 64-bit aligned.
> Also, add reserved fields to MR_HOST_DEVICE_LIST for future firmware usage.
> 
> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
> ---
>   drivers/scsi/megaraid/megaraid_sas.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
> index fe1173f02c54..eb48ca17dca0 100644
> --- a/drivers/scsi/megaraid/megaraid_sas.h
> +++ b/drivers/scsi/megaraid/megaraid_sas.h
> @@ -807,13 +807,14 @@ struct MR_HOST_DEVICE_LIST_ENTRY {
>   	} flags;
>   	u8 scsi_type;
>   	__le16 target_id;
> -	u8 reserved[2];
> +	u8 reserved[4];
>   	__le64 sas_addr[2];
>   } __packed;
>   
>   struct MR_HOST_DEVICE_LIST {
>   	__le32			size;
>   	__le32			count;
> +	__le32			reserved[2];
>   	struct MR_HOST_DEVICE_LIST_ENTRY	host_device_list[1];
>   } __packed;
>   
> 
Ho-hum.

Move fields in a structure used for communication with the HBA?
How is that supposed to work?
Do we need a firmware update for the HBA to handle this correctly?
Or did it never work, and we need the padding to retrieve the 
information correctly?

Please clarify.

Cheers,

Hannes
Martin K. Petersen Feb. 8, 2019, 11:10 p.m. UTC | #2
> Move fields in a structure used for communication with the HBA?
> How is that supposed to work?
> Do we need a firmware update for the HBA to handle this correctly?
> Or did it never work, and we need the padding to retrieve the
> information correctly?

> Please clarify.

I just merged the support for the new operation a few days ago. I assume
that this is a fix-up and that none of these have shipped yet?
Shivasharan Srikanteshwara Feb. 9, 2019, 7:38 a.m. UTC | #3
> > Move fields in a structure used for communication with the HBA?
> > How is that supposed to work?
> > Do we need a firmware update for the HBA to handle this correctly?
> > Or did it never work, and we need the padding to retrieve the
> > information correctly?
>
> > Please clarify.
>
> I just merged the support for the new operation a few days ago. I assume
that
> this is a fix-up and that none of these have shipped yet?
>

Yes, that is correct.
Firmware with support for this new DCMD has not yet shipped.
The driver changes were tested earlier, but due to additional requirements
the structure
needed changes later. And this introduced the alignment mismatch and a fix
to the
earlier submission.

Thanks,
Shivasharan
diff mbox series

Patch

diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index fe1173f02c54..eb48ca17dca0 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -807,13 +807,14 @@  struct MR_HOST_DEVICE_LIST_ENTRY {
 	} flags;
 	u8 scsi_type;
 	__le16 target_id;
-	u8 reserved[2];
+	u8 reserved[4];
 	__le64 sas_addr[2];
 } __packed;
 
 struct MR_HOST_DEVICE_LIST {
 	__le32			size;
 	__le32			count;
+	__le32			reserved[2];
 	struct MR_HOST_DEVICE_LIST_ENTRY	host_device_list[1];
 } __packed;