From: Sasha Levin Date: Sun, 24 May 2020 13:51:26 +0000 (-0400) Subject: Fixes for 4.4 X-Git-Tag: v4.4.225~28 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=f14f3297a21ee92630f5bc76bb242af5e3444342;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.4 Signed-off-by: Sasha Levin --- diff --git a/queue-4.4/edac-ghes-use-cper-module-handles-to-locate-dimms.patch b/queue-4.4/edac-ghes-use-cper-module-handles-to-locate-dimms.patch new file mode 100644 index 00000000000..dc0f12bb997 --- /dev/null +++ b/queue-4.4/edac-ghes-use-cper-module-handles-to-locate-dimms.patch @@ -0,0 +1,104 @@ +From bb30c3d1a3a28bcfe13c404d93dc6a51bc1e04b2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 19 Sep 2018 01:59:00 +0000 +Subject: EDAC, ghes: Use CPER module handles to locate DIMMs + +From: Fan Wu + +[ Upstream commit c798c88f3962ddff89c7aa818986caeecd46ab4c ] + +Use SMBIOS module handle type 17, on platforms which provide valid +ones, to locate the corresponding DIMM and thus have per-DIMM error +counter updates. + +Signed-off-by: Fan Wu +[ Massage commit message. ] +Signed-off-by: Borislav Petkov +Reviewed-by: Tyler Baicar +Reviewed-by: James Morse +Tested-by: Toshi Kani +Cc: Mauro Carvalho Chehab +Cc: baicar.tyler@gmail.com +Cc: john.garry@huawei.com +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-edac +Cc: shiju.jose@huawei.com +Cc: tanxiaofei@huawei.com +Cc: wanghuiqiang@huawei.com +Link: http://lkml.kernel.org/r/1537322340-1860-1-git-send-email-wufan@codeaurora.org +Signed-off-by: Sasha Levin +--- + drivers/edac/ghes_edac.c | 23 +++++++++++++++++++++++ + include/linux/edac.h | 2 ++ + 2 files changed, 25 insertions(+) + +diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c +index 4ddbf6604e2a..4249b9ada3a6 100644 +--- a/drivers/edac/ghes_edac.c ++++ b/drivers/edac/ghes_edac.c +@@ -74,6 +74,18 @@ static void ghes_edac_count_dimms(const struct dmi_header *dh, void *arg) + (*num_dimm)++; + } + ++static int get_dimm_smbios_index(u16 handle) ++{ ++ struct mem_ctl_info *mci = ghes_pvt->mci; ++ int i; ++ ++ for (i = 0; i < mci->tot_dimms; i++) { ++ if (mci->dimms[i]->smbios_handle == handle) ++ return i; ++ } ++ return -1; ++} ++ + static void ghes_edac_dmidecode(const struct dmi_header *dh, void *arg) + { + struct ghes_edac_dimm_fill *dimm_fill = arg; +@@ -161,6 +173,8 @@ static void ghes_edac_dmidecode(const struct dmi_header *dh, void *arg) + entry->total_width, entry->data_width); + } + ++ dimm->smbios_handle = entry->handle; ++ + dimm_fill->count++; + } + } +@@ -307,12 +321,21 @@ void ghes_edac_report_mem_error(struct ghes *ghes, int sev, + p += sprintf(p, "bit_pos:%d ", mem_err->bit_pos); + if (mem_err->validation_bits & CPER_MEM_VALID_MODULE_HANDLE) { + const char *bank = NULL, *device = NULL; ++ int index = -1; ++ + dmi_memdev_name(mem_err->mem_dev_handle, &bank, &device); + if (bank != NULL && device != NULL) + p += sprintf(p, "DIMM location:%s %s ", bank, device); + else + p += sprintf(p, "DIMM DMI handle: 0x%.4x ", + mem_err->mem_dev_handle); ++ ++ index = get_dimm_smbios_index(mem_err->mem_dev_handle); ++ if (index >= 0) { ++ e->top_layer = index; ++ e->enable_per_layer_report = true; ++ } ++ + } + if (p > e->location) + *(p - 1) = '\0'; +diff --git a/include/linux/edac.h b/include/linux/edac.h +index 9bb4f3311e13..16dd9d351969 100644 +--- a/include/linux/edac.h ++++ b/include/linux/edac.h +@@ -559,6 +559,8 @@ struct dimm_info { + u32 nr_pages; /* number of pages on this dimm */ + + unsigned csrow, cschannel; /* Points to the old API data */ ++ ++ u16 smbios_handle; /* Handle for SMBIOS type 17 */ + }; + + /** +-- +2.25.1 + diff --git a/queue-4.4/libnvdimm-btt-remove-unnecessary-code-in-btt_freelis.patch b/queue-4.4/libnvdimm-btt-remove-unnecessary-code-in-btt_freelis.patch new file mode 100644 index 00000000000..94bb89b649a --- /dev/null +++ b/queue-4.4/libnvdimm-btt-remove-unnecessary-code-in-btt_freelis.patch @@ -0,0 +1,51 @@ +From 526f9f89888822ab5d52bf610f261a2b233dd06c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 27 Feb 2019 17:06:26 -0700 +Subject: libnvdimm/btt: Remove unnecessary code in btt_freelist_init + +From: Vishal Verma + +[ Upstream commit 2f8c9011151337d0bc106693f272f9bddbccfab2 ] + +We call btt_log_read() twice, once to get the 'old' log entry, and again +to get the 'new' entry. However, we have no use for the 'old' entry, so +remove it. + +Cc: Dan Williams +Signed-off-by: Vishal Verma +Signed-off-by: Dan Williams +Signed-off-by: Sasha Levin +--- + drivers/nvdimm/btt.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c +index 957234272ef7..727eaf203463 100644 +--- a/drivers/nvdimm/btt.c ++++ b/drivers/nvdimm/btt.c +@@ -443,9 +443,9 @@ static int btt_log_init(struct arena_info *arena) + + static int btt_freelist_init(struct arena_info *arena) + { +- int old, new, ret; ++ int new, ret; + u32 i, map_entry; +- struct log_entry log_new, log_old; ++ struct log_entry log_new; + + arena->freelist = kcalloc(arena->nfree, sizeof(struct free_entry), + GFP_KERNEL); +@@ -453,10 +453,6 @@ static int btt_freelist_init(struct arena_info *arena) + return -ENOMEM; + + for (i = 0; i < arena->nfree; i++) { +- old = btt_log_read(arena, i, &log_old, LOG_OLD_ENT); +- if (old < 0) +- return old; +- + new = btt_log_read(arena, i, &log_new, LOG_NEW_ENT); + if (new < 0) + return new; +-- +2.25.1 + diff --git a/queue-4.4/ppp-mppe-revert-ppp-mppe-add-softdep-to-arc4.patch b/queue-4.4/ppp-mppe-revert-ppp-mppe-add-softdep-to-arc4.patch new file mode 100644 index 00000000000..1c4671098f8 --- /dev/null +++ b/queue-4.4/ppp-mppe-revert-ppp-mppe-add-softdep-to-arc4.patch @@ -0,0 +1,47 @@ +From 68b75523d457e9c5a4c5e7ced20580e9964f1403 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 12 Jul 2019 16:39:31 -0700 +Subject: ppp: mppe: Revert "ppp: mppe: Add softdep to arc4" + +From: Eric Biggers + +[ Upstream commit 25a09ce79639a8775244808c17282c491cff89cf ] + +Commit 0e5a610b5ca5 ("ppp: mppe: switch to RC4 library interface"), +which was merged through the crypto tree for v5.3, changed ppp_mppe.c to +use the new arc4_crypt() library function rather than access RC4 through +the dynamic crypto_skcipher API. + +Meanwhile commit aad1dcc4f011 ("ppp: mppe: Add softdep to arc4") was +merged through the net tree and added a module soft-dependency on "arc4". + +The latter commit no longer makes sense because the code now uses the +"libarc4" module rather than "arc4", and also due to the direct use of +arc4_crypt(), no module soft-dependency is required. + +So revert the latter commit. + +Cc: Takashi Iwai +Cc: Ard Biesheuvel +Signed-off-by: Eric Biggers +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ppp/ppp_mppe.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c +index 6376edd89ceb..05005c660d4d 100644 +--- a/drivers/net/ppp/ppp_mppe.c ++++ b/drivers/net/ppp/ppp_mppe.c +@@ -62,7 +62,6 @@ MODULE_AUTHOR("Frank Cusack "); + MODULE_DESCRIPTION("Point-to-Point Protocol Microsoft Point-to-Point Encryption support"); + MODULE_LICENSE("Dual BSD/GPL"); + MODULE_ALIAS("ppp-compress-" __stringify(CI_MPPE)); +-MODULE_SOFTDEP("pre: arc4"); + MODULE_VERSION("1.0.2"); + + static unsigned int +-- +2.25.1 + diff --git a/queue-4.4/revert-gfs2-don-t-demote-a-glock-until-its-revokes-a.patch b/queue-4.4/revert-gfs2-don-t-demote-a-glock-until-its-revokes-a.patch new file mode 100644 index 00000000000..d79e2b55e0e --- /dev/null +++ b/queue-4.4/revert-gfs2-don-t-demote-a-glock-until-its-revokes-a.patch @@ -0,0 +1,48 @@ +From 51bc26343a3ed5ba40811c3a0f0fe41ceefd13d4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 May 2020 15:01:25 -0500 +Subject: Revert "gfs2: Don't demote a glock until its revokes are written" + +From: Bob Peterson + +[ Upstream commit b14c94908b1b884276a6608dea3d0b1b510338b7 ] + +This reverts commit df5db5f9ee112e76b5202fbc331f990a0fc316d6. + +This patch fixes a regression: patch df5db5f9ee112 allowed function +run_queue() to bypass its call to do_xmote() if revokes were queued for +the glock. That's wrong because its call to do_xmote() is what is +responsible for calling the go_sync() glops functions to sync both +the ail list and any revokes queued for it. By bypassing the call, +gfs2 could get into a stand-off where the glock could not be demoted +until its revokes are written back, but the revokes would not be +written back because do_xmote() was never called. + +It "sort of" works, however, because there are other mechanisms like +the log flush daemon (logd) that can sync the ail items and revokes, +if it deems it necessary. The problem is: without file system pressure, +it might never deem it necessary. + +Signed-off-by: Bob Peterson +Signed-off-by: Sasha Levin +--- + fs/gfs2/glock.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c +index f80ffccb0316..1eb737c466dd 100644 +--- a/fs/gfs2/glock.c ++++ b/fs/gfs2/glock.c +@@ -541,9 +541,6 @@ __acquires(&gl->gl_lockref.lock) + goto out_unlock; + if (nonblock) + goto out_sched; +- smp_mb(); +- if (atomic_read(&gl->gl_revokes) != 0) +- goto out_sched; + set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags); + GLOCK_BUG_ON(gl, gl->gl_demote_state == LM_ST_EXCLUSIVE); + gl->gl_target = gl->gl_demote_state; +-- +2.25.1 + diff --git a/queue-4.4/series b/queue-4.4/series index c9102cde0d8..6b47f3a5a4f 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -30,3 +30,7 @@ padata-purge-get_cpu-and-reorder_via_wq-from-padata_.patch alsa-pcm-fix-incorrect-hw_base-increase.patch ext4-lock-the-xattr-block-before-checksuming-it.patch platform-x86-alienware-wmi-fix-kfree-on-potentially-uninitialized-pointer.patch +libnvdimm-btt-remove-unnecessary-code-in-btt_freelis.patch +ppp-mppe-revert-ppp-mppe-add-softdep-to-arc4.patch +edac-ghes-use-cper-module-handles-to-locate-dimms.patch +revert-gfs2-don-t-demote-a-glock-until-its-revokes-a.patch