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 'soc_fsl-7.0-2' of https://git.kernel.org/pub/scm/linux/kernel/git/chleroy/linux into arm/fixes

FSL SOC Fixes for 7.0

- Fix a race condition in Freescale Queue and Buffer Manager.
- Fix a trivial error verification in CPM1

* tag 'soc_fsl-7.0-2' of https://git.kernel.org/pub/scm/linux/kernel/git/chleroy/linux:
soc: fsl: cpm1: qmc: Fix error check for devm_ioremap_resource() in qmc_qe_init_resources()
soc: fsl: qbman: fix race condition in qman_destroy_fq

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+24 -4
+22 -2
drivers/soc/fsl/qbman/qman.c
··· 1827 1827 1828 1828 void qman_destroy_fq(struct qman_fq *fq) 1829 1829 { 1830 + int leaked; 1831 + 1830 1832 /* 1831 1833 * We don't need to lock the FQ as it is a pre-condition that the FQ be 1832 1834 * quiesced. Instead, run some checks. ··· 1836 1834 switch (fq->state) { 1837 1835 case qman_fq_state_parked: 1838 1836 case qman_fq_state_oos: 1839 - if (fq_isset(fq, QMAN_FQ_FLAG_DYNAMIC_FQID)) 1840 - qman_release_fqid(fq->fqid); 1837 + /* 1838 + * There's a race condition here on releasing the fqid, 1839 + * setting the fq_table to NULL, and freeing the fqid. 1840 + * To prevent it, this order should be respected: 1841 + */ 1842 + if (fq_isset(fq, QMAN_FQ_FLAG_DYNAMIC_FQID)) { 1843 + leaked = qman_shutdown_fq(fq->fqid); 1844 + if (leaked) 1845 + pr_debug("FQID %d leaked\n", fq->fqid); 1846 + } 1841 1847 1842 1848 DPAA_ASSERT(fq_table[fq->idx]); 1843 1849 fq_table[fq->idx] = NULL; 1850 + 1851 + if (fq_isset(fq, QMAN_FQ_FLAG_DYNAMIC_FQID) && !leaked) { 1852 + /* 1853 + * fq_table[fq->idx] should be set to null before 1854 + * freeing fq->fqid otherwise it could by allocated by 1855 + * qman_alloc_fqid() while still being !NULL 1856 + */ 1857 + smp_wmb(); 1858 + gen_pool_free(qm_fqalloc, fq->fqid | DPAA_GENALLOC_OFF, 1); 1859 + } 1844 1860 return; 1845 1861 default: 1846 1862 break;
+2 -2
drivers/soc/fsl/qe/qmc.c
··· 1790 1790 return -EINVAL; 1791 1791 qmc->dpram_offset = res->start - qe_muram_dma(qe_muram_addr(0)); 1792 1792 qmc->dpram = devm_ioremap_resource(qmc->dev, res); 1793 - if (IS_ERR(qmc->scc_pram)) 1794 - return PTR_ERR(qmc->scc_pram); 1793 + if (IS_ERR(qmc->dpram)) 1794 + return PTR_ERR(qmc->dpram); 1795 1795 1796 1796 return 0; 1797 1797 }