apm821xx: fix sata access freezes
[openwrt/openwrt.git] / target / linux / apm821xx / patches-4.14 / 302-dw-dma-hprot-fix-and-equal-priortiy.patch
1 --- a/drivers/dma/dw/core.c
2 +++ b/drivers/dma/dw/core.c
3 @@ -167,6 +167,8 @@ static void dwc_initialize_chan_dw(struc
4 cfghi |= DWC_CFGH_DST_PER(dwc->dws.dst_id);
5 cfghi |= DWC_CFGH_SRC_PER(dwc->dws.src_id);
6
7 + cfghi |= DWC_CFGH_PROTCTL(3); /* bufferable + privileged access */
8 +
9 /* Set polarity of handshake interface */
10 cfglo |= hs_polarity ? DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL : 0;
11
12 @@ -1293,11 +1295,8 @@ int dw_dma_probe(struct dw_dma_chip *chi
13 else
14 list_add(&dwc->chan.device_node, &dw->dma.channels);
15
16 - /* 7 is highest priority & 0 is lowest. */
17 - if (pdata->chan_priority == CHAN_PRIORITY_ASCENDING)
18 - dwc->priority = pdata->nr_channels - i - 1;
19 - else
20 - dwc->priority = i;
21 + /* set all channels to the same priority */
22 + dwc->priority = pdata->nr_channels - 1;
23
24 dwc->ch_regs = &__dw_regs(dw)->CHAN[i];
25 spin_lock_init(&dwc->lock);