OSDN Git Service

scsi: megaraid_sas: Fix calculation of target ID
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Sat, 29 Jun 2019 01:02:12 +0000 (18:02 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 12 Jul 2019 00:59:09 +0000 (20:59 -0400)
commitc8f96df5b8e633056b7ebf5d52a9d6fb1b156ce3
tree44b3dd4812964503bf701aba99085ea9e92eb5a2
parent057959c6e36e4e6e5303a39c4df79c4af9d40923
scsi: megaraid_sas: Fix calculation of target ID

In megasas_get_target_prop(), driver is incorrectly calculating the target
ID for devices with channel 1 and 3.  Due to this, firmware will either
fail the command (if there is no device with the target id sent from
driver) or could return the properties for a target which was not
intended.  Devices could end up with the wrong queue depth due to this.

Fix target id calculation for channel 1 and 3.

Fixes: 96188a89cc6d ("scsi: megaraid_sas: NVME interface target prop added")
Cc: stable@vger.kernel.org
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_base.c