dmaengine: bcm-sba-raid: Allow arbitrary number free sba_request
authorAnup Patel <anup.patel@broadcom.com>
Tue, 22 Aug 2017 09:56:56 +0000 (15:26 +0530)
committerVinod Koul <vinod.koul@intel.com>
Mon, 28 Aug 2017 11:14:24 +0000 (16:44 +0530)
commit5655e00f5cde2c856c80eb10d0e6c911b7d880f2
treeadc764a18c7955eb664e12a2aef903f9dcdbb0a0
parentabfa251afe27ee7820c3a082fe573ec5bedb3488
dmaengine: bcm-sba-raid: Allow arbitrary number free sba_request

Currently, we cannot have any arbitrary number of free sba_request
because sba_prealloc_channel_resources() allocates an array of
sba_request using devm_kcalloc() and kcalloc() cannot provide
memory beyond certain size.

This patch removes "reqs" (sba_request array) from sba_device
and makes "cmds" as variable array (instead of pointer) in
sba_request. This helps sba_prealloc_channel_resources() to
allocate sba_request and associated SBA command in one allocation
which in-turn allows arbitrary number of free sba_request.

Signed-off-by: Anup Patel <anup.patel@broadcom.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/bcm-sba-raid.c