Skip to content

Commit

Permalink
Merge tag 'soc-fsl-fix-v5.15-2' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/leo/linux into arm/fixes

NXP/FSL SoC driver fixes for v5.15

DPAA2 DPIO driver
- replace smp_processor_id with raw_smp_processor_id to fix preempt
debug BUG
- use the combined functions to protect critical zone to fix deadlock

DPAA2 console
- free buffer before returning from dpaa2_console_read

* tag 'soc-fsl-fix-v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  soc: fsl: dpaa2-console: free buffer before returning from dpaa2_console_read
  soc: fsl: dpio: use the combined functions to protect critical zone
  soc: fsl: dpio: replace smp_processor_id with raw_smp_processor_id

Link: https://lore.kernel.org/r/20211026235744.19258-1-leoyang.li@nxp.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann committed Oct 27, 2021
2 parents 05d5da3 + 8120bd4 commit 76f7923
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions drivers/soc/fsl/dpaa2-console.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ static ssize_t dpaa2_console_read(struct file *fp, char __user *buf,
cd->cur_ptr += bytes;
written += bytes;

kfree(kbuf);
return written;

err_free_buf:
Expand Down
2 changes: 1 addition & 1 deletion drivers/soc/fsl/dpio/dpio-service.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d,
* potentially being migrated away.
*/
if (cpu < 0)
cpu = smp_processor_id();
cpu = raw_smp_processor_id();

/* If a specific cpu was requested, pick it up immediately */
return dpio_by_cpu[cpu];
Expand Down
9 changes: 3 additions & 6 deletions drivers/soc/fsl/dpio/qbman-portal.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,7 @@ int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s,
int i, num_enqueued = 0;
unsigned long irq_flags;

spin_lock(&s->access_spinlock);
local_irq_save(irq_flags);
spin_lock_irqsave(&s->access_spinlock, irq_flags);

half_mask = (s->eqcr.pi_ci_mask>>1);
full_mask = s->eqcr.pi_ci_mask;
Expand All @@ -744,8 +743,7 @@ int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s,
s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size,
eqcr_ci, s->eqcr.ci);
if (!s->eqcr.available) {
local_irq_restore(irq_flags);
spin_unlock(&s->access_spinlock);
spin_unlock_irqrestore(&s->access_spinlock, irq_flags);
return 0;
}
}
Expand Down Expand Up @@ -784,8 +782,7 @@ int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s,
dma_wmb();
qbman_write_register(s, QBMAN_CINH_SWP_EQCR_PI,
(QB_RT_BIT)|(s->eqcr.pi)|s->eqcr.pi_vb);
local_irq_restore(irq_flags);
spin_unlock(&s->access_spinlock);
spin_unlock_irqrestore(&s->access_spinlock, irq_flags);

return num_enqueued;
}
Expand Down

0 comments on commit 76f7923

Please sign in to comment.