* [PATCH] aacraid: Correct hba_send to include iu_type
@ 2018-04-25 16:24 ` Dave Carroll
0 siblings, 0 replies; 5+ messages in thread
From: Dave Carroll @ 2018-04-25 16:24 UTC (permalink / raw)
To: Martin K . Petersen, Noah Misner, James Bottomley, Hannes Reinecke
Cc: Dave Carroll, linux-scsi, aacraid, Scott Benesh, stable
commit b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()")
allows aac_hba_send() to send scsi commands, and TMF requests, but the existing
code only updates the iu_type for scsi commands. For TMF requests we are sending
an unknown iu_type to firmware, which causes a fault.
Include iu_type prior to determining the validity of the command
Reported-by: Noah Misner <nmisner@us.ibm.com>
Fixes: b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()")
Fixes: 423400e64d377 ("aacraid: Include HBA direct interface")
Tested-by: Noah Misner <nmisner@us.ibm.com>
cc: stable@vger.kernel.org
Signed-off-by: Dave Carroll <david.carroll@microsemi.com>
Reviewed-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
---
drivers/scsi/aacraid/commsup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 0156c96..d62ddd6 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -724,6 +724,8 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
int wait;
unsigned long flags = 0;
unsigned long mflags = 0;
+ struct aac_hba_cmd_req *hbacmd = (struct aac_hba_cmd_req *)
+ fibptr->hw_fib_va;
fibptr->flags = (FIB_CONTEXT_FLAG | FIB_CONTEXT_FLAG_NATIVE_HBA);
if (callback) {
@@ -734,11 +736,9 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
wait = 1;
- if (command == HBA_IU_TYPE_SCSI_CMD_REQ) {
- struct aac_hba_cmd_req *hbacmd =
- (struct aac_hba_cmd_req *)fibptr->hw_fib_va;
+ hbacmd->iu_type = command;
- hbacmd->iu_type = command;
+ if (command == HBA_IU_TYPE_SCSI_CMD_REQ) {
/* bit1 of request_id must be 0 */
hbacmd->request_id =
cpu_to_le32((((u32)(fibptr - dev->fibs)) << 2) + 1);
--
2.8.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] aacraid: Correct hba_send to include iu_type
@ 2018-04-25 16:24 ` Dave Carroll
0 siblings, 0 replies; 5+ messages in thread
From: Dave Carroll @ 2018-04-25 16:24 UTC (permalink / raw)
To: Martin K . Petersen, Noah Misner, James Bottomley, Hannes Reinecke
Cc: Dave Carroll, linux-scsi, aacraid, Scott Benesh, stable
commit b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()")
allows aac_hba_send() to send scsi commands, and TMF requests, but the existing
code only updates the iu_type for scsi commands. For TMF requests we are sending
an unknown iu_type to firmware, which causes a fault.
Include iu_type prior to determining the validity of the command
Reported-by: Noah Misner <nmisner@us.ibm.com>
Fixes: b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()")
Fixes: 423400e64d377 ("aacraid: Include HBA direct interface")
Tested-by: Noah Misner <nmisner@us.ibm.com>
cc: stable@vger.kernel.org
Signed-off-by: Dave Carroll <david.carroll@microsemi.com>
Reviewed-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
---
drivers/scsi/aacraid/commsup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 0156c96..d62ddd6 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -724,6 +724,8 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
int wait;
unsigned long flags = 0;
unsigned long mflags = 0;
+ struct aac_hba_cmd_req *hbacmd = (struct aac_hba_cmd_req *)
+ fibptr->hw_fib_va;
fibptr->flags = (FIB_CONTEXT_FLAG | FIB_CONTEXT_FLAG_NATIVE_HBA);
if (callback) {
@@ -734,11 +736,9 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
wait = 1;
- if (command == HBA_IU_TYPE_SCSI_CMD_REQ) {
- struct aac_hba_cmd_req *hbacmd =
- (struct aac_hba_cmd_req *)fibptr->hw_fib_va;
+ hbacmd->iu_type = command;
- hbacmd->iu_type = command;
+ if (command == HBA_IU_TYPE_SCSI_CMD_REQ) {
/* bit1 of request_id must be 0 */
hbacmd->request_id =
cpu_to_le32((((u32)(fibptr - dev->fibs)) << 2) + 1);
--
2.8.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] aacraid: Correct hba_send to include iu_type
2018-04-25 16:24 ` Dave Carroll
(?)
@ 2018-04-25 20:37 ` Brian King
-1 siblings, 0 replies; 5+ messages in thread
From: Brian King @ 2018-04-25 20:37 UTC (permalink / raw)
To: Dave Carroll, Martin K . Petersen, Noah Misner, James Bottomley,
Hannes Reinecke
Cc: linux-scsi, aacraid, Scott Benesh, stable
On 04/25/2018 10:24 AM, Dave Carroll wrote:
> commit b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()")
>
> allows aac_hba_send() to send scsi commands, and TMF requests, but the existing
> code only updates the iu_type for scsi commands. For TMF requests we are sending
> an unknown iu_type to firmware, which causes a fault.
>
> Include iu_type prior to determining the validity of the command
>
> Reported-by: Noah Misner <nmisner@us.ibm.com>
> Fixes: b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()")
> Fixes: 423400e64d377 ("aacraid: Include HBA direct interface")
> Tested-by: Noah Misner <nmisner@us.ibm.com>
> cc: stable@vger.kernel.org
> Signed-off-by: Dave Carroll <david.carroll@microsemi.com>
> Reviewed-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
> ---
> drivers/scsi/aacraid/commsup.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
> index 0156c96..d62ddd6 100644
> --- a/drivers/scsi/aacraid/commsup.c
> +++ b/drivers/scsi/aacraid/commsup.c
> @@ -724,6 +724,8 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
> int wait;
> unsigned long flags = 0;
> unsigned long mflags = 0;
> + struct aac_hba_cmd_req *hbacmd = (struct aac_hba_cmd_req *)
> + fibptr->hw_fib_va;
>
> fibptr->flags = (FIB_CONTEXT_FLAG | FIB_CONTEXT_FLAG_NATIVE_HBA);
> if (callback) {
> @@ -734,11 +736,9 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
> wait = 1;
>
>
> - if (command == HBA_IU_TYPE_SCSI_CMD_REQ) {
> - struct aac_hba_cmd_req *hbacmd =
> - (struct aac_hba_cmd_req *)fibptr->hw_fib_va;
> + hbacmd->iu_type = command;
>
> - hbacmd->iu_type = command;
> + if (command == HBA_IU_TYPE_SCSI_CMD_REQ) {
> /* bit1 of request_id must be 0 */
> hbacmd->request_id =
> cpu_to_le32((((u32)(fibptr - dev->fibs)) << 2) + 1);
>
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
--
Brian King
Power Linux I/O
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] aacraid: Correct hba_send to include iu_type
2018-04-25 16:24 ` Dave Carroll
@ 2018-05-02 3:21 ` Martin K. Petersen
-1 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2018-05-02 3:21 UTC (permalink / raw)
To: Dave Carroll
Cc: Martin K . Petersen, Noah Misner, James Bottomley,
Hannes Reinecke, linux-scsi, aacraid, Scott Benesh, stable
Dave,
> commit b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()")
>
> allows aac_hba_send() to send scsi commands, and TMF requests, but the existing
> code only updates the iu_type for scsi commands. For TMF requests we are sending
> an unknown iu_type to firmware, which causes a fault.
>
> Include iu_type prior to determining the validity of the command
Applied to 4.17/scsi-fixes. Thank you!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] aacraid: Correct hba_send to include iu_type
@ 2018-05-02 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2018-05-02 3:21 UTC (permalink / raw)
To: Dave Carroll
Cc: Martin K . Petersen, Noah Misner, James Bottomley,
Hannes Reinecke, linux-scsi, aacraid, Scott Benesh, stable
Dave,
> commit b60710ec7d7ab ("aacraid: enable sending of TMFs from aac_hba_send()")
>
> allows aac_hba_send() to send scsi commands, and TMF requests, but the existing
> code only updates the iu_type for scsi commands. For TMF requests we are sending
> an unknown iu_type to firmware, which causes a fault.
>
> Include iu_type prior to determining the validity of the command
Applied to 4.17/scsi-fixes. Thank you!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-02 3:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 16:24 [PATCH] aacraid: Correct hba_send to include iu_type Dave Carroll
2018-04-25 16:24 ` Dave Carroll
2018-04-25 20:37 ` Brian King
2018-05-02 3:21 ` Martin K. Petersen
2018-05-02 3:21 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.