From: Greg Kroah-Hartman Date: Fri, 1 May 2020 13:09:49 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v5.4.37~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f09f716b106585da952e27e976d9d6264f165d9e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: asoc-soc-core-disable-route-checks-for-legacy-devices.patch asoc-stm32-spdifrx-fix-regmap-status-check.patch crypto-chelsio-fixes-a-hang-issue-during-driver-registration.patch ext4-check-for-non-zero-journal-inum-in-ext4_calculate_overhead.patch net-use-indirect-call-wrappers-for-skb_copy_datagram_iter.patch qed-fix-race-condition-between-scheduling-and-destroying-the-slowpath-workqueue.patch qed-fix-use-after-free-in-qed_chain_free.patch taprio-do-not-use-bit-in-tca_taprio_attr_flag_-definitions.patch --- diff --git a/queue-5.4/asoc-soc-core-disable-route-checks-for-legacy-devices.patch b/queue-5.4/asoc-soc-core-disable-route-checks-for-legacy-devices.patch new file mode 100644 index 00000000000..faac9c508c5 --- /dev/null +++ b/queue-5.4/asoc-soc-core-disable-route-checks-for-legacy-devices.patch @@ -0,0 +1,100 @@ +From a22ae72b86a4f754e8d25fbf9ea5a8f77365e531 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Mon, 9 Mar 2020 14:27:43 -0500 +Subject: ASoC: soc-core: disable route checks for legacy devices + +From: Pierre-Louis Bossart + +commit a22ae72b86a4f754e8d25fbf9ea5a8f77365e531 upstream. + +v5.4 changes in soc-core tightened the checks on soc_dapm_add_routes, +which results in the ASoC card probe failing. + +Introduce a flag to be set in machine drivers to prevent the probe +from stopping in case of incomplete topologies or missing routes. This +flag is for backwards compatibility only and shall not be used for +newer machine drivers. + +Example with an HDaudio card with a bad topology: + +[ 236.177898] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to +add route iDisp1_out -> direct -> iDisp1 Tx + +[ 236.177902] skl_hda_dsp_generic skl_hda_dsp_generic: +snd_soc_bind_card: snd_soc_dapm_add_routes failed: -19 + +with the disable_route_checks set: + +[ 64.031657] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to +add route iDisp1_out -> direct -> iDisp1 Tx + +[ 64.031661] skl_hda_dsp_generic skl_hda_dsp_generic: +snd_soc_bind_card: disable_route_checks set, ignoring errors on +add_routes + +Fixes: daa480bde6b3a9 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()") +Signed-off-by: Pierre-Louis Bossart +Acked-by: Kuninori Morimoto +Link: https://lore.kernel.org/r/20200309192744.18380-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + include/sound/soc.h | 1 + + sound/soc/soc-core.c | 28 ++++++++++++++++++++++++---- + 2 files changed, 25 insertions(+), 4 deletions(-) + +--- a/include/sound/soc.h ++++ b/include/sound/soc.h +@@ -1059,6 +1059,7 @@ struct snd_soc_card { + const struct snd_soc_dapm_route *of_dapm_routes; + int num_of_dapm_routes; + bool fully_routed; ++ bool disable_route_checks; + + /* lists of probed devices belonging to this card */ + struct list_head component_dev_list; +--- a/sound/soc/soc-core.c ++++ b/sound/soc/soc-core.c +@@ -1076,8 +1076,18 @@ static int soc_probe_component(struct sn + ret = snd_soc_dapm_add_routes(dapm, + component->driver->dapm_routes, + component->driver->num_dapm_routes); +- if (ret < 0) +- goto err_probe; ++ if (ret < 0) { ++ if (card->disable_route_checks) { ++ dev_info(card->dev, ++ "%s: disable_route_checks set, ignoring errors on add_routes\n", ++ __func__); ++ } else { ++ dev_err(card->dev, ++ "%s: snd_soc_dapm_add_routes failed: %d\n", ++ __func__, ret); ++ goto err_probe; ++ } ++ } + + /* see for_each_card_components */ + list_add(&component->card_list, &card->component_dev_list); +@@ -2067,8 +2077,18 @@ static int snd_soc_instantiate_card(stru + + ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, + card->num_dapm_routes); +- if (ret < 0) +- goto probe_end; ++ if (ret < 0) { ++ if (card->disable_route_checks) { ++ dev_info(card->dev, ++ "%s: disable_route_checks set, ignoring errors on add_routes\n", ++ __func__); ++ } else { ++ dev_err(card->dev, ++ "%s: snd_soc_dapm_add_routes failed: %d\n", ++ __func__, ret); ++ goto probe_end; ++ } ++ } + + ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, + card->num_of_dapm_routes); diff --git a/queue-5.4/asoc-stm32-spdifrx-fix-regmap-status-check.patch b/queue-5.4/asoc-stm32-spdifrx-fix-regmap-status-check.patch new file mode 100644 index 00000000000..6b1a09e6cd4 --- /dev/null +++ b/queue-5.4/asoc-stm32-spdifrx-fix-regmap-status-check.patch @@ -0,0 +1,33 @@ +From a168dae5ea14283e8992d5282237bb0d6a3e1c06 Mon Sep 17 00:00:00 2001 +From: Olivier Moysan +Date: Wed, 18 Mar 2020 15:41:23 +0100 +Subject: ASoC: stm32: spdifrx: fix regmap status check + +From: Olivier Moysan + +commit a168dae5ea14283e8992d5282237bb0d6a3e1c06 upstream. + +Release resources when exiting on error. + +Fixes: 1a5c0b28fc56 ("ASoC: stm32: spdifrx: manage identification registers") + +Signed-off-by: Olivier Moysan +Link: https://lore.kernel.org/r/20200318144125.9163-2-olivier.moysan@st.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/stm/stm32_spdifrx.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/soc/stm/stm32_spdifrx.c ++++ b/sound/soc/stm/stm32_spdifrx.c +@@ -995,6 +995,8 @@ static int stm32_spdifrx_probe(struct pl + + if (idr == SPDIFRX_IPIDR_NUMBER) { + ret = regmap_read(spdifrx->regmap, STM32_SPDIFRX_VERR, &ver); ++ if (ret) ++ goto error; + + dev_dbg(&pdev->dev, "SPDIFRX version: %lu.%lu registered\n", + FIELD_GET(SPDIFRX_VERR_MAJ_MASK, ver), diff --git a/queue-5.4/crypto-chelsio-fixes-a-hang-issue-during-driver-registration.patch b/queue-5.4/crypto-chelsio-fixes-a-hang-issue-during-driver-registration.patch new file mode 100644 index 00000000000..c78e4227fd0 --- /dev/null +++ b/queue-5.4/crypto-chelsio-fixes-a-hang-issue-during-driver-registration.patch @@ -0,0 +1,42 @@ +From ad59ddd02de26271b89564962e74d689f1a30b49 Mon Sep 17 00:00:00 2001 +From: Ayush Sawal +Date: Mon, 30 Mar 2020 20:48:52 +0530 +Subject: Crypto: chelsio - Fixes a hang issue during driver registration + +From: Ayush Sawal + +commit ad59ddd02de26271b89564962e74d689f1a30b49 upstream. + +This issue occurs only when multiadapters are present. Hang +happens because assign_chcr_device returns u_ctx pointer of +adapter which is not yet initialized as for this adapter cxgb_up +is not been called yet. + +The last_dev pointer is used to determine u_ctx pointer and it +is initialized two times in chcr_uld_add in chcr_dev_add respectively. + +The fix here is don't initialize the last_dev pointer during +chcr_uld_add. Only assign to value to it when the adapter's +initialization is completed i.e in chcr_dev_add. + +Fixes: fef4912b66d62 ("crypto: chelsio - Handle PCI shutdown event"). + +Signed-off-by: Ayush Sawal +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/crypto/chelsio/chcr_core.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/crypto/chelsio/chcr_core.c ++++ b/drivers/crypto/chelsio/chcr_core.c +@@ -125,8 +125,6 @@ static void chcr_dev_init(struct uld_ctx + atomic_set(&dev->inflight, 0); + mutex_lock(&drv_data.drv_mutex); + list_add_tail(&u_ctx->entry, &drv_data.inact_dev); +- if (!drv_data.last_dev) +- drv_data.last_dev = u_ctx; + mutex_unlock(&drv_data.drv_mutex); + } + diff --git a/queue-5.4/ext4-check-for-non-zero-journal-inum-in-ext4_calculate_overhead.patch b/queue-5.4/ext4-check-for-non-zero-journal-inum-in-ext4_calculate_overhead.patch new file mode 100644 index 00000000000..98092c0ad52 --- /dev/null +++ b/queue-5.4/ext4-check-for-non-zero-journal-inum-in-ext4_calculate_overhead.patch @@ -0,0 +1,73 @@ +From f1eec3b0d0a849996ebee733b053efa71803dad5 Mon Sep 17 00:00:00 2001 +From: Ritesh Harjani +Date: Mon, 16 Mar 2020 15:00:38 +0530 +Subject: ext4: check for non-zero journal inum in ext4_calculate_overhead + +From: Ritesh Harjani + +commit f1eec3b0d0a849996ebee733b053efa71803dad5 upstream. + +While calculating overhead for internal journal, also check +that j_inum shouldn't be 0. Otherwise we get below error with +xfstests generic/050 with external journal (XXX_LOGDEV config) enabled. + +It could be simply reproduced with loop device with an external journal +and marking blockdev as RO before mounting. + +[ 3337.146838] EXT4-fs error (device pmem1p2): ext4_get_journal_inode:4634: comm mount: inode #0: comm mount: iget: illegal inode # +------------[ cut here ]------------ +generic_make_request: Trying to write to read-only block-device pmem1p2 (partno 2) +WARNING: CPU: 107 PID: 115347 at block/blk-core.c:788 generic_make_request_checks+0x6b4/0x7d0 +CPU: 107 PID: 115347 Comm: mount Tainted: G L --------- -t - 4.18.0-167.el8.ppc64le #1 +NIP: c0000000006f6d44 LR: c0000000006f6d40 CTR: 0000000030041dd4 +<...> +NIP [c0000000006f6d44] generic_make_request_checks+0x6b4/0x7d0 +LR [c0000000006f6d40] generic_make_request_checks+0x6b0/0x7d0 +<...> +Call Trace: +generic_make_request_checks+0x6b0/0x7d0 (unreliable) +generic_make_request+0x3c/0x420 +submit_bio+0xd8/0x200 +submit_bh_wbc+0x1e8/0x250 +__sync_dirty_buffer+0xd0/0x210 +ext4_commit_super+0x310/0x420 [ext4] +__ext4_error+0xa4/0x1e0 [ext4] +__ext4_iget+0x388/0xe10 [ext4] +ext4_get_journal_inode+0x40/0x150 [ext4] +ext4_calculate_overhead+0x5a8/0x610 [ext4] +ext4_fill_super+0x3188/0x3260 [ext4] +mount_bdev+0x778/0x8f0 +ext4_mount+0x28/0x50 [ext4] +mount_fs+0x74/0x230 +vfs_kern_mount.part.6+0x6c/0x250 +do_mount+0x2fc/0x1280 +sys_mount+0x158/0x180 +system_call+0x5c/0x70 +EXT4-fs (pmem1p2): no journal found +EXT4-fs (pmem1p2): can't get journal size +EXT4-fs (pmem1p2): mounted filesystem without journal. Opts: dax,norecovery + +Fixes: 3c816ded78bb ("ext4: use journal inode to determine journal overhead") +Reported-by: Harish Sriram +Signed-off-by: Ritesh Harjani +Reviewed-by: Jan Kara +Link: https://lore.kernel.org/r/20200316093038.25485-1-riteshh@linux.ibm.com +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -3562,7 +3562,8 @@ int ext4_calculate_overhead(struct super + */ + if (sbi->s_journal && !sbi->journal_bdev) + overhead += EXT4_NUM_B2C(sbi, sbi->s_journal->j_maxlen); +- else if (ext4_has_feature_journal(sb) && !sbi->s_journal) { ++ else if (ext4_has_feature_journal(sb) && !sbi->s_journal && j_inum) { ++ /* j_inum for internal journal is non-zero */ + j_inode = ext4_get_journal_inode(sb, j_inum); + if (j_inode) { + j_blocks = j_inode->i_size >> sb->s_blocksize_bits; diff --git a/queue-5.4/net-use-indirect-call-wrappers-for-skb_copy_datagram_iter.patch b/queue-5.4/net-use-indirect-call-wrappers-for-skb_copy_datagram_iter.patch new file mode 100644 index 00000000000..a73e2811950 --- /dev/null +++ b/queue-5.4/net-use-indirect-call-wrappers-for-skb_copy_datagram_iter.patch @@ -0,0 +1,75 @@ +From 29f3490ba9d2399d3d1b20c4aa74592d92bd4e11 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Tue, 24 Mar 2020 19:23:21 -0700 +Subject: net: use indirect call wrappers for skb_copy_datagram_iter() + +From: Eric Dumazet + +commit 29f3490ba9d2399d3d1b20c4aa74592d92bd4e11 upstream. + +TCP recvmsg() calls skb_copy_datagram_iter(), which +calls an indirect function (cb pointing to simple_copy_to_iter()) +for every MSS (fragment) present in the skb. + +CONFIG_RETPOLINE=y forces a very expensive operation +that we can avoid thanks to indirect call wrappers. + +This patch gives a 13% increase of performance on +a single flow, if the bottleneck is the thread reading +the TCP socket. + +Fixes: 950fcaecd5cc ("datagram: consolidate datagram copy to iter helpers") +Signed-off-by: Eric Dumazet +Acked-by: Paolo Abeni +Acked-by: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/core/datagram.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +--- a/net/core/datagram.c ++++ b/net/core/datagram.c +@@ -51,6 +51,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -407,6 +408,11 @@ int skb_kill_datagram(struct sock *sk, s + } + EXPORT_SYMBOL(skb_kill_datagram); + ++INDIRECT_CALLABLE_DECLARE(static size_t simple_copy_to_iter(const void *addr, ++ size_t bytes, ++ void *data __always_unused, ++ struct iov_iter *i)); ++ + static int __skb_datagram_iter(const struct sk_buff *skb, int offset, + struct iov_iter *to, int len, bool fault_short, + size_t (*cb)(const void *, size_t, void *, +@@ -420,7 +426,8 @@ static int __skb_datagram_iter(const str + if (copy > 0) { + if (copy > len) + copy = len; +- n = cb(skb->data + offset, copy, data, to); ++ n = INDIRECT_CALL_1(cb, simple_copy_to_iter, ++ skb->data + offset, copy, data, to); + offset += n; + if (n != copy) + goto short_copy; +@@ -442,8 +449,9 @@ static int __skb_datagram_iter(const str + + if (copy > len) + copy = len; +- n = cb(vaddr + skb_frag_off(frag) + offset - start, +- copy, data, to); ++ n = INDIRECT_CALL_1(cb, simple_copy_to_iter, ++ vaddr + skb_frag_off(frag) + offset - start, ++ copy, data, to); + kunmap(page); + offset += n; + if (n != copy) diff --git a/queue-5.4/qed-fix-race-condition-between-scheduling-and-destroying-the-slowpath-workqueue.patch b/queue-5.4/qed-fix-race-condition-between-scheduling-and-destroying-the-slowpath-workqueue.patch new file mode 100644 index 00000000000..d7e6d49d3ca --- /dev/null +++ b/queue-5.4/qed-fix-race-condition-between-scheduling-and-destroying-the-slowpath-workqueue.patch @@ -0,0 +1,63 @@ +From 3b85720d3fd72e6ef4de252cd2f67548eb645eb4 Mon Sep 17 00:00:00 2001 +From: Yuval Basson +Date: Wed, 25 Mar 2020 22:50:43 +0200 +Subject: qed: Fix race condition between scheduling and destroying the slowpath workqueue + +From: Yuval Basson + +commit 3b85720d3fd72e6ef4de252cd2f67548eb645eb4 upstream. + +Calling queue_delayed_work concurrently with +destroy_workqueue might race to an unexpected outcome - +scheduled task after wq is destroyed or other resources +(like ptt_pool) are freed (yields NULL pointer dereference). +cancel_delayed_work prevents the race by cancelling +the timer triggered for scheduling a new task. + +Fixes: 59ccf86fe ("qed: Add driver infrastucture for handling mfw requests") +Signed-off-by: Denis Bolotin +Signed-off-by: Michal Kalderon +Signed-off-by: Yuval Basson +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/qlogic/qed/qed_main.c | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +--- a/drivers/net/ethernet/qlogic/qed/qed_main.c ++++ b/drivers/net/ethernet/qlogic/qed/qed_main.c +@@ -1087,9 +1087,6 @@ static void qed_update_pf_params(struct + #define QED_PERIODIC_DB_REC_INTERVAL_MS 100 + #define QED_PERIODIC_DB_REC_INTERVAL \ + msecs_to_jiffies(QED_PERIODIC_DB_REC_INTERVAL_MS) +-#define QED_PERIODIC_DB_REC_WAIT_COUNT 10 +-#define QED_PERIODIC_DB_REC_WAIT_INTERVAL \ +- (QED_PERIODIC_DB_REC_INTERVAL_MS / QED_PERIODIC_DB_REC_WAIT_COUNT) + + static int qed_slowpath_delayed_work(struct qed_hwfn *hwfn, + enum qed_slowpath_wq_flag wq_flag, +@@ -1123,7 +1120,7 @@ void qed_periodic_db_rec_start(struct qe + + static void qed_slowpath_wq_stop(struct qed_dev *cdev) + { +- int i, sleep_count = QED_PERIODIC_DB_REC_WAIT_COUNT; ++ int i; + + if (IS_VF(cdev)) + return; +@@ -1135,13 +1132,7 @@ static void qed_slowpath_wq_stop(struct + /* Stop queuing new delayed works */ + cdev->hwfns[i].slowpath_wq_active = false; + +- /* Wait until the last periodic doorbell recovery is executed */ +- while (test_bit(QED_SLOWPATH_PERIODIC_DB_REC, +- &cdev->hwfns[i].slowpath_task_flags) && +- sleep_count--) +- msleep(QED_PERIODIC_DB_REC_WAIT_INTERVAL); +- +- flush_workqueue(cdev->hwfns[i].slowpath_wq); ++ cancel_delayed_work(&cdev->hwfns[i].slowpath_task); + destroy_workqueue(cdev->hwfns[i].slowpath_wq); + } + } diff --git a/queue-5.4/qed-fix-use-after-free-in-qed_chain_free.patch b/queue-5.4/qed-fix-use-after-free-in-qed_chain_free.patch new file mode 100644 index 00000000000..be47b97e303 --- /dev/null +++ b/queue-5.4/qed-fix-use-after-free-in-qed_chain_free.patch @@ -0,0 +1,206 @@ +From 8063f761cd7c17fc1d0018728936e0c33a25388a Mon Sep 17 00:00:00 2001 +From: Yuval Basson +Date: Sun, 29 Mar 2020 20:32:49 +0300 +Subject: qed: Fix use after free in qed_chain_free + +From: Yuval Basson + +commit 8063f761cd7c17fc1d0018728936e0c33a25388a upstream. + +The qed_chain data structure was modified in +commit 1a4a69751f4d ("qed: Chain support for external PBL") to support +receiving an external pbl (due to iWARP FW requirements). +The pages pointed to by the pbl are allocated in qed_chain_alloc +and their virtual address are stored in an virtual addresses array to +enable accessing and freeing the data. The physical addresses however +weren't stored and were accessed directly from the external-pbl +during free. + +Destroy-qp flow, leads to freeing the external pbl before the chain is +freed, when the chain is freed it tries accessing the already freed +external pbl, leading to a use-after-free. Therefore we need to store +the physical addresses in additional to the virtual addresses in a +new data structure. + +Fixes: 1a4a69751f4d ("qed: Chain support for external PBL") +Signed-off-by: Michal Kalderon +Signed-off-by: Yuval Bason +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/qlogic/qed/qed_dev.c | 38 ++++++++++++------------------ + include/linux/qed/qed_chain.h | 24 +++++++++++------- + 2 files changed, 31 insertions(+), 31 deletions(-) + +--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c ++++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c +@@ -4648,26 +4648,20 @@ static void qed_chain_free_single(struct + + static void qed_chain_free_pbl(struct qed_dev *cdev, struct qed_chain *p_chain) + { +- void **pp_virt_addr_tbl = p_chain->pbl.pp_virt_addr_tbl; ++ struct addr_tbl_entry *pp_addr_tbl = p_chain->pbl.pp_addr_tbl; + u32 page_cnt = p_chain->page_cnt, i, pbl_size; +- u8 *p_pbl_virt = p_chain->pbl_sp.p_virt_table; + +- if (!pp_virt_addr_tbl) ++ if (!pp_addr_tbl) + return; + +- if (!p_pbl_virt) +- goto out; +- + for (i = 0; i < page_cnt; i++) { +- if (!pp_virt_addr_tbl[i]) ++ if (!pp_addr_tbl[i].virt_addr || !pp_addr_tbl[i].dma_map) + break; + + dma_free_coherent(&cdev->pdev->dev, + QED_CHAIN_PAGE_SIZE, +- pp_virt_addr_tbl[i], +- *(dma_addr_t *)p_pbl_virt); +- +- p_pbl_virt += QED_CHAIN_PBL_ENTRY_SIZE; ++ pp_addr_tbl[i].virt_addr, ++ pp_addr_tbl[i].dma_map); + } + + pbl_size = page_cnt * QED_CHAIN_PBL_ENTRY_SIZE; +@@ -4677,9 +4671,9 @@ static void qed_chain_free_pbl(struct qe + pbl_size, + p_chain->pbl_sp.p_virt_table, + p_chain->pbl_sp.p_phys_table); +-out: +- vfree(p_chain->pbl.pp_virt_addr_tbl); +- p_chain->pbl.pp_virt_addr_tbl = NULL; ++ ++ vfree(p_chain->pbl.pp_addr_tbl); ++ p_chain->pbl.pp_addr_tbl = NULL; + } + + void qed_chain_free(struct qed_dev *cdev, struct qed_chain *p_chain) +@@ -4780,19 +4774,19 @@ qed_chain_alloc_pbl(struct qed_dev *cdev + { + u32 page_cnt = p_chain->page_cnt, size, i; + dma_addr_t p_phys = 0, p_pbl_phys = 0; +- void **pp_virt_addr_tbl = NULL; ++ struct addr_tbl_entry *pp_addr_tbl; + u8 *p_pbl_virt = NULL; + void *p_virt = NULL; + +- size = page_cnt * sizeof(*pp_virt_addr_tbl); +- pp_virt_addr_tbl = vzalloc(size); +- if (!pp_virt_addr_tbl) ++ size = page_cnt * sizeof(*pp_addr_tbl); ++ pp_addr_tbl = vzalloc(size); ++ if (!pp_addr_tbl) + return -ENOMEM; + + /* The allocation of the PBL table is done with its full size, since it + * is expected to be successive. + * qed_chain_init_pbl_mem() is called even in a case of an allocation +- * failure, since pp_virt_addr_tbl was previously allocated, and it ++ * failure, since tbl was previously allocated, and it + * should be saved to allow its freeing during the error flow. + */ + size = page_cnt * QED_CHAIN_PBL_ENTRY_SIZE; +@@ -4806,8 +4800,7 @@ qed_chain_alloc_pbl(struct qed_dev *cdev + p_chain->b_external_pbl = true; + } + +- qed_chain_init_pbl_mem(p_chain, p_pbl_virt, p_pbl_phys, +- pp_virt_addr_tbl); ++ qed_chain_init_pbl_mem(p_chain, p_pbl_virt, p_pbl_phys, pp_addr_tbl); + if (!p_pbl_virt) + return -ENOMEM; + +@@ -4826,7 +4819,8 @@ qed_chain_alloc_pbl(struct qed_dev *cdev + /* Fill the PBL table with the physical address of the page */ + *(dma_addr_t *)p_pbl_virt = p_phys; + /* Keep the virtual address of the page */ +- p_chain->pbl.pp_virt_addr_tbl[i] = p_virt; ++ p_chain->pbl.pp_addr_tbl[i].virt_addr = p_virt; ++ p_chain->pbl.pp_addr_tbl[i].dma_map = p_phys; + + p_pbl_virt += QED_CHAIN_PBL_ENTRY_SIZE; + } +--- a/include/linux/qed/qed_chain.h ++++ b/include/linux/qed/qed_chain.h +@@ -97,6 +97,11 @@ struct qed_chain_u32 { + u32 cons_idx; + }; + ++struct addr_tbl_entry { ++ void *virt_addr; ++ dma_addr_t dma_map; ++}; ++ + struct qed_chain { + /* fastpath portion of the chain - required for commands such + * as produce / consume. +@@ -107,10 +112,11 @@ struct qed_chain { + + /* Fastpath portions of the PBL [if exists] */ + struct { +- /* Table for keeping the virtual addresses of the chain pages, +- * respectively to the physical addresses in the pbl table. ++ /* Table for keeping the virtual and physical addresses of the ++ * chain pages, respectively to the physical addresses ++ * in the pbl table. + */ +- void **pp_virt_addr_tbl; ++ struct addr_tbl_entry *pp_addr_tbl; + + union { + struct qed_chain_pbl_u16 u16; +@@ -287,7 +293,7 @@ qed_chain_advance_page(struct qed_chain + *(u32 *)page_to_inc = 0; + page_index = *(u32 *)page_to_inc; + } +- *p_next_elem = p_chain->pbl.pp_virt_addr_tbl[page_index]; ++ *p_next_elem = p_chain->pbl.pp_addr_tbl[page_index].virt_addr; + } + } + +@@ -537,7 +543,7 @@ static inline void qed_chain_init_params + + p_chain->pbl_sp.p_phys_table = 0; + p_chain->pbl_sp.p_virt_table = NULL; +- p_chain->pbl.pp_virt_addr_tbl = NULL; ++ p_chain->pbl.pp_addr_tbl = NULL; + } + + /** +@@ -575,11 +581,11 @@ static inline void qed_chain_init_mem(st + static inline void qed_chain_init_pbl_mem(struct qed_chain *p_chain, + void *p_virt_pbl, + dma_addr_t p_phys_pbl, +- void **pp_virt_addr_tbl) ++ struct addr_tbl_entry *pp_addr_tbl) + { + p_chain->pbl_sp.p_phys_table = p_phys_pbl; + p_chain->pbl_sp.p_virt_table = p_virt_pbl; +- p_chain->pbl.pp_virt_addr_tbl = pp_virt_addr_tbl; ++ p_chain->pbl.pp_addr_tbl = pp_addr_tbl; + } + + /** +@@ -644,7 +650,7 @@ static inline void *qed_chain_get_last_e + break; + case QED_CHAIN_MODE_PBL: + last_page_idx = p_chain->page_cnt - 1; +- p_virt_addr = p_chain->pbl.pp_virt_addr_tbl[last_page_idx]; ++ p_virt_addr = p_chain->pbl.pp_addr_tbl[last_page_idx].virt_addr; + break; + } + /* p_virt_addr points at this stage to the last page of the chain */ +@@ -716,7 +722,7 @@ static inline void qed_chain_pbl_zero_me + page_cnt = qed_chain_get_page_cnt(p_chain); + + for (i = 0; i < page_cnt; i++) +- memset(p_chain->pbl.pp_virt_addr_tbl[i], 0, ++ memset(p_chain->pbl.pp_addr_tbl[i].virt_addr, 0, + QED_CHAIN_PAGE_SIZE); + } + diff --git a/queue-5.4/series b/queue-5.4/series index c697ee59a84..70cb786d5e9 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -73,3 +73,11 @@ ext4-increase-wait-time-needed-before-reuse-of-delet.patch ext4-convert-bug_on-s-to-warn_on-s-in-mballoc.c.patch blk-mq-put-driver-tag-in-blk_mq_dispatch_rq_list-whe.patch hwmon-jc42-fix-name-to-have-no-illegal-characters.patch +taprio-do-not-use-bit-in-tca_taprio_attr_flag_-definitions.patch +qed-fix-race-condition-between-scheduling-and-destroying-the-slowpath-workqueue.patch +crypto-chelsio-fixes-a-hang-issue-during-driver-registration.patch +net-use-indirect-call-wrappers-for-skb_copy_datagram_iter.patch +qed-fix-use-after-free-in-qed_chain_free.patch +ext4-check-for-non-zero-journal-inum-in-ext4_calculate_overhead.patch +asoc-soc-core-disable-route-checks-for-legacy-devices.patch +asoc-stm32-spdifrx-fix-regmap-status-check.patch diff --git a/queue-5.4/taprio-do-not-use-bit-in-tca_taprio_attr_flag_-definitions.patch b/queue-5.4/taprio-do-not-use-bit-in-tca_taprio_attr_flag_-definitions.patch new file mode 100644 index 00000000000..60690d5cb25 --- /dev/null +++ b/queue-5.4/taprio-do-not-use-bit-in-tca_taprio_attr_flag_-definitions.patch @@ -0,0 +1,36 @@ +From 673040c3a82a7564423e09c791e242a846591e30 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Tue, 24 Mar 2020 05:19:20 +0100 +Subject: taprio: do not use BIT() in TCA_TAPRIO_ATTR_FLAG_* definitions + +From: Eugene Syromiatnikov + +commit 673040c3a82a7564423e09c791e242a846591e30 upstream. + +BIT() macro definition is internal to the Linux kernel and is not +to be used in UAPI headers; replace its usage with the _BITUL() macro +that is already used elsewhere in the header. + +Fixes: 9c66d1564676 ("taprio: Add support for hardware offloading") +Signed-off-by: Eugene Syromiatnikov +Acked-by: Vladimir Oltean +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + include/uapi/linux/pkt_sched.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/include/uapi/linux/pkt_sched.h ++++ b/include/uapi/linux/pkt_sched.h +@@ -1160,8 +1160,8 @@ enum { + * [TCA_TAPRIO_ATTR_SCHED_ENTRY_INTERVAL] + */ + +-#define TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST BIT(0) +-#define TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD BIT(1) ++#define TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST _BITUL(0) ++#define TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD _BITUL(1) + + enum { + TCA_TAPRIO_ATTR_UNSPEC,