diff options
author | Shivasharan S <shivasharan.srikanteshwara@broadcom.com> | 2017-03-10 03:22:13 -0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-03-13 22:59:53 -0400 |
commit | 49524b3c6e12375627ddd870613fcc6b24909898 (patch) | |
tree | 766631ea51d8ccc2bb1269c31a1e0570151a509e /drivers/scsi/megaraid/megaraid_sas_base.c | |
parent | 64ff64b90e62c860772fd0be50b7cfcef1d8a9b2 (diff) | |
download | linux-stable-49524b3c6e12375627ddd870613fcc6b24909898.tar.gz linux-stable-49524b3c6e12375627ddd870613fcc6b24909898.tar.bz2 linux-stable-49524b3c6e12375627ddd870613fcc6b24909898.zip |
scsi: megaraid_sas: add correct return type check for ldio hint logic for raid1
Return value check of atomic_dec_if_positive is required as it returns
old value minus one. Without this fix, driver will send small ios to
firmware path and that will be a performance issue.
Not critical, but good to have r1_ldio_hint as default value in sdev
private.
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas_base.c')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 016ffcebaf66..0016f12cc563 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -1963,6 +1963,9 @@ scan_target: if (!mr_device_priv_data) return -ENOMEM; sdev->hostdata = mr_device_priv_data; + + atomic_set(&mr_device_priv_data->r1_ldio_hint, + instance->r1_ldio_hint_default); return 0; } |