Merge "dmaengine: gpi: fix assigning same gpii's to qup SE instances"
This commit is contained in:
commit
c256012854
@ -486,6 +486,7 @@ struct gpi_dev {
|
|||||||
u32 klog_lvl;
|
u32 klog_lvl;
|
||||||
struct dentry *dentry;
|
struct dentry *dentry;
|
||||||
bool is_le_vm;
|
bool is_le_vm;
|
||||||
|
struct mutex qup_se_lock; /* qup SE instance lock */
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct gpi_dev *gpi_dev_dbg[5];
|
static struct gpi_dev *gpi_dev_dbg[5];
|
||||||
@ -3876,6 +3877,7 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
|||||||
u32 seid, chid;
|
u32 seid, chid;
|
||||||
int gpii, static_gpii_no;
|
int gpii, static_gpii_no;
|
||||||
struct gpii_chan *gpii_chan;
|
struct gpii_chan *gpii_chan;
|
||||||
|
struct dma_chan *dma_chan;
|
||||||
|
|
||||||
if (args->args_count < REQ_OF_DMA_ARGS) {
|
if (args->args_count < REQ_OF_DMA_ARGS) {
|
||||||
GPI_ERR(gpi_dev,
|
GPI_ERR(gpi_dev,
|
||||||
@ -3890,6 +3892,7 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_lock(&gpi_dev->qup_se_lock);
|
||||||
seid = args->args[1];
|
seid = args->args[1];
|
||||||
static_gpii_no = (args->args[4] & STATIC_GPII_BMSK) >> STATIC_GPII_SHFT;
|
static_gpii_no = (args->args[4] & STATIC_GPII_BMSK) >> STATIC_GPII_SHFT;
|
||||||
|
|
||||||
@ -3900,6 +3903,7 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
|||||||
|
|
||||||
if (gpii < 0) {
|
if (gpii < 0) {
|
||||||
GPI_ERR(gpi_dev, "no available gpii instances\n");
|
GPI_ERR(gpi_dev, "no available gpii instances\n");
|
||||||
|
mutex_unlock(&gpi_dev->qup_se_lock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3907,6 +3911,7 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
|||||||
if (gpii_chan->vc.chan.client_count) {
|
if (gpii_chan->vc.chan.client_count) {
|
||||||
GPI_ERR(gpi_dev, "gpii:%d chid:%d seid:%d already configured\n",
|
GPI_ERR(gpi_dev, "gpii:%d chid:%d seid:%d already configured\n",
|
||||||
gpii, chid, gpii_chan->seid);
|
gpii, chid, gpii_chan->seid);
|
||||||
|
mutex_unlock(&gpi_dev->qup_se_lock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3922,8 +3927,9 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
|||||||
"client req gpii:%u chid:%u #_tre:%u prio:%u proto:%u SE:%d init_config:%d\n",
|
"client req gpii:%u chid:%u #_tre:%u prio:%u proto:%u SE:%d init_config:%d\n",
|
||||||
gpii, chid, gpii_chan->req_tres, gpii_chan->priority,
|
gpii, chid, gpii_chan->req_tres, gpii_chan->priority,
|
||||||
gpii_chan->protocol, gpii_chan->seid, gpii_chan->init_config);
|
gpii_chan->protocol, gpii_chan->seid, gpii_chan->init_config);
|
||||||
|
dma_chan = dma_get_slave_channel(&gpii_chan->vc.chan);
|
||||||
return dma_get_slave_channel(&gpii_chan->vc.chan);
|
mutex_unlock(&gpi_dev->qup_se_lock);
|
||||||
|
return dma_chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* gpi_setup_debug - setup debug capabilities */
|
/* gpi_setup_debug - setup debug capabilities */
|
||||||
@ -4059,6 +4065,7 @@ static int gpi_probe(struct platform_device *pdev)
|
|||||||
if (!gpi_dev->gpiis)
|
if (!gpi_dev->gpiis)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
mutex_init(&gpi_dev->qup_se_lock);
|
||||||
gpi_dev->is_le_vm = of_property_read_bool(pdev->dev.of_node, "qcom,le-vm");
|
gpi_dev->is_le_vm = of_property_read_bool(pdev->dev.of_node, "qcom,le-vm");
|
||||||
if (gpi_dev->is_le_vm)
|
if (gpi_dev->is_le_vm)
|
||||||
GPI_LOG(gpi_dev, "LE-VM usecase\n");
|
GPI_LOG(gpi_dev, "LE-VM usecase\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user