Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'coresight-fixes-v6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-linus

Suzuki writes:

coresight: Fixes for v6.6

Couple of fixes for the CoreSight self-hosted tracing
targeting v6.6. Includes :

- Fix runtime warnings while reusing the TMC-ETR buffer
- Fix (disable) warning when a large buffer is allocated in
the flat mode.

* tag 'coresight-fixes-v6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux:
coresight: tmc-etr: Disable warnings for allocation failures
coresight: Fix run time warnings while reusing ETR buffer

+15 -12
+15 -12
drivers/hwtracing/coresight/coresight-tmc-etr.c
··· 610 610 611 611 flat_buf->vaddr = dma_alloc_noncoherent(real_dev, etr_buf->size, 612 612 &flat_buf->daddr, 613 - DMA_FROM_DEVICE, GFP_KERNEL); 613 + DMA_FROM_DEVICE, 614 + GFP_KERNEL | __GFP_NOWARN); 614 615 if (!flat_buf->vaddr) { 615 616 kfree(flat_buf); 616 617 return -ENOMEM; ··· 1175 1174 } 1176 1175 1177 1176 /* 1178 - * In sysFS mode we can have multiple writers per sink. Since this 1179 - * sink is already enabled no memory is needed and the HW need not be 1180 - * touched, even if the buffer size has changed. 1181 - */ 1182 - if (drvdata->mode == CS_MODE_SYSFS) { 1183 - atomic_inc(&csdev->refcnt); 1184 - goto out; 1185 - } 1186 - 1187 - /* 1188 1177 * If we don't have a buffer or it doesn't match the requested size, 1189 1178 * use the buffer allocated above. Otherwise reuse the existing buffer. 1190 1179 */ ··· 1195 1204 1196 1205 static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev) 1197 1206 { 1198 - int ret; 1207 + int ret = 0; 1199 1208 unsigned long flags; 1200 1209 struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); 1201 1210 struct etr_buf *sysfs_buf = tmc_etr_get_sysfs_buffer(csdev); ··· 1204 1213 return PTR_ERR(sysfs_buf); 1205 1214 1206 1215 spin_lock_irqsave(&drvdata->spinlock, flags); 1216 + 1217 + /* 1218 + * In sysFS mode we can have multiple writers per sink. Since this 1219 + * sink is already enabled no memory is needed and the HW need not be 1220 + * touched, even if the buffer size has changed. 1221 + */ 1222 + if (drvdata->mode == CS_MODE_SYSFS) { 1223 + atomic_inc(&csdev->refcnt); 1224 + goto out; 1225 + } 1226 + 1207 1227 ret = tmc_etr_enable_hw(drvdata, sysfs_buf); 1208 1228 if (!ret) { 1209 1229 drvdata->mode = CS_MODE_SYSFS; 1210 1230 atomic_inc(&csdev->refcnt); 1211 1231 } 1212 1232 1233 + out: 1213 1234 spin_unlock_irqrestore(&drvdata->spinlock, flags); 1214 1235 1215 1236 if (!ret)