Skip to content

Commit dca389e

Browse files
committed
Merge tag 'dmaengine-fix-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine fixes from Vinod Koul: "Driver fixes for the at-hdmac, pl330, TI and IDXD drivers: - AT HDMAC driver fixes for Flow Controller bitfield, peripheral ID handling and potential NULL dereference check - PL330 function rename to avoid conflicts - build warning fix for pm function in TI driver - IDXD driver fix for passing freed memory" * tag 'dmaengine-fix-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dmaengine: at_hdmac: Extend the Flow Controller bitfield to three bits dmaengine: at_hdmac: Repair bitfield macros for peripheral ID handling dmaengine: pl330: rename _start to prevent build error dmaengine: at_xdmac: fix potential Oops in at_xdmac_prep_interleaved() dmaengine: ti: k3-udma: annotate pm function with __maybe_unused dmaengine: idxd: Fix passing freed memory in idxd_cdev_open()
2 parents 7877cb9 + e14fd2a commit dca389e

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

drivers/dma/at_hdmac.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
#define ATC_DST_PIP BIT(12) /* Destination Picture-in-Picture enabled */
133133
#define ATC_SRC_DSCR_DIS BIT(16) /* Src Descriptor fetch disable */
134134
#define ATC_DST_DSCR_DIS BIT(20) /* Dst Descriptor fetch disable */
135-
#define ATC_FC GENMASK(22, 21) /* Choose Flow Controller */
135+
#define ATC_FC GENMASK(23, 21) /* Choose Flow Controller */
136136
#define ATC_FC_MEM2MEM 0x0 /* Mem-to-Mem (DMA) */
137137
#define ATC_FC_MEM2PER 0x1 /* Mem-to-Periph (DMA) */
138138
#define ATC_FC_PER2MEM 0x2 /* Periph-to-Mem (DMA) */
@@ -153,8 +153,6 @@
153153
#define ATC_AUTO BIT(31) /* Auto multiple buffer tx enable */
154154

155155
/* Bitfields in CFG */
156-
#define ATC_PER_MSB(h) ((0x30U & (h)) >> 4) /* Extract most significant bits of a handshaking identifier */
157-
158156
#define ATC_SRC_PER GENMASK(3, 0) /* Channel src rq associated with periph handshaking ifc h */
159157
#define ATC_DST_PER GENMASK(7, 4) /* Channel dst rq associated with periph handshaking ifc h */
160158
#define ATC_SRC_REP BIT(8) /* Source Replay Mod */
@@ -181,10 +179,15 @@
181179
#define ATC_DPIP_HOLE GENMASK(15, 0)
182180
#define ATC_DPIP_BOUNDARY GENMASK(25, 16)
183181

184-
#define ATC_SRC_PER_ID(id) (FIELD_PREP(ATC_SRC_PER_MSB, (id)) | \
185-
FIELD_PREP(ATC_SRC_PER, (id)))
186-
#define ATC_DST_PER_ID(id) (FIELD_PREP(ATC_DST_PER_MSB, (id)) | \
187-
FIELD_PREP(ATC_DST_PER, (id)))
182+
#define ATC_PER_MSB GENMASK(5, 4) /* Extract MSBs of a handshaking identifier */
183+
#define ATC_SRC_PER_ID(id) \
184+
({ typeof(id) _id = (id); \
185+
FIELD_PREP(ATC_SRC_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \
186+
FIELD_PREP(ATC_SRC_PER, _id); })
187+
#define ATC_DST_PER_ID(id) \
188+
({ typeof(id) _id = (id); \
189+
FIELD_PREP(ATC_DST_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \
190+
FIELD_PREP(ATC_DST_PER, _id); })
188191

189192

190193

drivers/dma/at_xdmac.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,8 @@ at_xdmac_prep_interleaved(struct dma_chan *chan,
11021102
NULL,
11031103
src_addr, dst_addr,
11041104
xt, xt->sgl);
1105+
if (!first)
1106+
return NULL;
11051107

11061108
/* Length of the block is (BLEN+1) microblocks. */
11071109
for (i = 0; i < xt->numf - 1; i++)
@@ -1132,8 +1134,9 @@ at_xdmac_prep_interleaved(struct dma_chan *chan,
11321134
src_addr, dst_addr,
11331135
xt, chunk);
11341136
if (!desc) {
1135-
list_splice_tail_init(&first->descs_list,
1136-
&atchan->free_descs_list);
1137+
if (first)
1138+
list_splice_tail_init(&first->descs_list,
1139+
&atchan->free_descs_list);
11371140
return NULL;
11381141
}
11391142

drivers/dma/idxd/cdev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp)
277277
if (wq_dedicated(wq)) {
278278
rc = idxd_wq_set_pasid(wq, pasid);
279279
if (rc < 0) {
280-
iommu_sva_unbind_device(sva);
281280
dev_err(dev, "wq set pasid failed: %d\n", rc);
282281
goto failed_set_pasid;
283282
}

drivers/dma/pl330.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ static bool _trigger(struct pl330_thread *thrd)
10501050
return true;
10511051
}
10521052

1053-
static bool _start(struct pl330_thread *thrd)
1053+
static bool pl330_start_thread(struct pl330_thread *thrd)
10541054
{
10551055
switch (_state(thrd)) {
10561056
case PL330_STATE_FAULT_COMPLETING:
@@ -1702,7 +1702,7 @@ static int pl330_update(struct pl330_dmac *pl330)
17021702
thrd->req_running = -1;
17031703

17041704
/* Get going again ASAP */
1705-
_start(thrd);
1705+
pl330_start_thread(thrd);
17061706

17071707
/* For now, just make a list of callbacks to be done */
17081708
list_add_tail(&descdone->rqd, &pl330->req_done);
@@ -2089,7 +2089,7 @@ static void pl330_tasklet(struct tasklet_struct *t)
20892089
} else {
20902090
/* Make sure the PL330 Channel thread is active */
20912091
spin_lock(&pch->thread->dmac->lock);
2092-
_start(pch->thread);
2092+
pl330_start_thread(pch->thread);
20932093
spin_unlock(&pch->thread->dmac->lock);
20942094
}
20952095

@@ -2107,7 +2107,7 @@ static void pl330_tasklet(struct tasklet_struct *t)
21072107
if (power_down) {
21082108
pch->active = true;
21092109
spin_lock(&pch->thread->dmac->lock);
2110-
_start(pch->thread);
2110+
pl330_start_thread(pch->thread);
21112111
spin_unlock(&pch->thread->dmac->lock);
21122112
power_down = false;
21132113
}

drivers/dma/ti/k3-udma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5527,7 +5527,7 @@ static int udma_probe(struct platform_device *pdev)
55275527
return ret;
55285528
}
55295529

5530-
static int udma_pm_suspend(struct device *dev)
5530+
static int __maybe_unused udma_pm_suspend(struct device *dev)
55315531
{
55325532
struct udma_dev *ud = dev_get_drvdata(dev);
55335533
struct dma_device *dma_dev = &ud->ddev;
@@ -5549,7 +5549,7 @@ static int udma_pm_suspend(struct device *dev)
55495549
return 0;
55505550
}
55515551

5552-
static int udma_pm_resume(struct device *dev)
5552+
static int __maybe_unused udma_pm_resume(struct device *dev)
55535553
{
55545554
struct udma_dev *ud = dev_get_drvdata(dev);
55555555
struct dma_device *dma_dev = &ud->ddev;

0 commit comments

Comments
 (0)