From: Sasha Levin Date: Sat, 2 Nov 2024 22:25:58 +0000 (-0400) Subject: Fixes for 6.6 X-Git-Tag: v4.19.323~109 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4adf85675c7541fd4e1db8c46b3c57b495b5d453;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.6 Signed-off-by: Sasha Levin --- diff --git a/queue-6.6/cxl-events-fix-trace-dram-event-record.patch b/queue-6.6/cxl-events-fix-trace-dram-event-record.patch new file mode 100644 index 00000000000..63b1185d885 --- /dev/null +++ b/queue-6.6/cxl-events-fix-trace-dram-event-record.patch @@ -0,0 +1,77 @@ +From 53fc4015fad4b2ad141071750fc2e92528959f72 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 14 Oct 2024 15:30:03 +0100 +Subject: cxl/events: Fix Trace DRAM Event Record + +From: Shiju Jose + +[ Upstream commit 53ab8678e7180834be29cf56cd52825fc3427c02 ] + +CXL spec rev 3.0 section 8.2.9.2.1.2 defines the DRAM Event Record. + +Fix decode memory event type field of DRAM Event Record. +For e.g. if value is 0x1 it will be reported as an Invalid Address +(General Media Event Record - Memory Event Type) instead of Scrub Media +ECC Error (DRAM Event Record - Memory Event Type) and so on. + +Fixes: 2d6c1e6d60ba ("cxl/mem: Trace DRAM Event Record") +Signed-off-by: Shiju Jose +Link: https://patch.msgid.link/20241014143003.1170-1-shiju.jose@huawei.com +Signed-off-by: Ira Weiny +Signed-off-by: Sasha Levin +--- + drivers/cxl/core/trace.h | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h +index bdf24867d5174..1e1e50d39bf63 100644 +--- a/drivers/cxl/core/trace.h ++++ b/drivers/cxl/core/trace.h +@@ -278,7 +278,7 @@ TRACE_EVENT(cxl_generic_event, + #define CXL_GMER_MEM_EVT_TYPE_ECC_ERROR 0x00 + #define CXL_GMER_MEM_EVT_TYPE_INV_ADDR 0x01 + #define CXL_GMER_MEM_EVT_TYPE_DATA_PATH_ERROR 0x02 +-#define show_mem_event_type(type) __print_symbolic(type, \ ++#define show_gmer_mem_event_type(type) __print_symbolic(type, \ + { CXL_GMER_MEM_EVT_TYPE_ECC_ERROR, "ECC Error" }, \ + { CXL_GMER_MEM_EVT_TYPE_INV_ADDR, "Invalid Address" }, \ + { CXL_GMER_MEM_EVT_TYPE_DATA_PATH_ERROR, "Data Path Error" } \ +@@ -359,7 +359,7 @@ TRACE_EVENT(cxl_general_media, + "device=%x comp_id=%s validity_flags='%s'", + __entry->dpa, show_dpa_flags(__entry->dpa_flags), + show_event_desc_flags(__entry->descriptor), +- show_mem_event_type(__entry->type), ++ show_gmer_mem_event_type(__entry->type), + show_trans_type(__entry->transaction_type), + __entry->channel, __entry->rank, __entry->device, + __print_hex(__entry->comp_id, CXL_EVENT_GEN_MED_COMP_ID_SIZE), +@@ -376,6 +376,17 @@ TRACE_EVENT(cxl_general_media, + * DRAM Event Record defines many fields the same as the General Media Event + * Record. Reuse those definitions as appropriate. + */ ++#define CXL_DER_MEM_EVT_TYPE_ECC_ERROR 0x00 ++#define CXL_DER_MEM_EVT_TYPE_SCRUB_MEDIA_ECC_ERROR 0x01 ++#define CXL_DER_MEM_EVT_TYPE_INV_ADDR 0x02 ++#define CXL_DER_MEM_EVT_TYPE_DATA_PATH_ERROR 0x03 ++#define show_dram_mem_event_type(type) __print_symbolic(type, \ ++ { CXL_DER_MEM_EVT_TYPE_ECC_ERROR, "ECC Error" }, \ ++ { CXL_DER_MEM_EVT_TYPE_SCRUB_MEDIA_ECC_ERROR, "Scrub Media ECC Error" }, \ ++ { CXL_DER_MEM_EVT_TYPE_INV_ADDR, "Invalid Address" }, \ ++ { CXL_DER_MEM_EVT_TYPE_DATA_PATH_ERROR, "Data Path Error" } \ ++) ++ + #define CXL_DER_VALID_CHANNEL BIT(0) + #define CXL_DER_VALID_RANK BIT(1) + #define CXL_DER_VALID_NIBBLE BIT(2) +@@ -449,7 +460,7 @@ TRACE_EVENT(cxl_dram, + "validity_flags='%s'", + __entry->dpa, show_dpa_flags(__entry->dpa_flags), + show_event_desc_flags(__entry->descriptor), +- show_mem_event_type(__entry->type), ++ show_dram_mem_event_type(__entry->type), + show_trans_type(__entry->transaction_type), + __entry->channel, __entry->rank, __entry->nibble_mask, + __entry->bank_group, __entry->bank, +-- +2.43.0 + diff --git a/queue-6.6/series b/queue-6.6/series index b426676fd5a..b750547299d 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -57,3 +57,6 @@ firmware-arm_sdei-fix-the-input-parameter-of-cpuhp_r.patch afs-automatically-generate-trace-tag-enums.patch afs-fix-missing-subdir-edit-when-renamed-between-par.patch acpi-cppc-make-rmw_lock-a-raw_spin_lock.patch +smb-client-fix-parsing-of-device-numbers.patch +smb-client-set-correct-device-number-on-nfs-reparse-.patch +cxl-events-fix-trace-dram-event-record.patch diff --git a/queue-6.6/smb-client-fix-parsing-of-device-numbers.patch b/queue-6.6/smb-client-fix-parsing-of-device-numbers.patch new file mode 100644 index 00000000000..e0abead3660 --- /dev/null +++ b/queue-6.6/smb-client-fix-parsing-of-device-numbers.patch @@ -0,0 +1,72 @@ +From 64353a63d73e84fe6ffb7c9fc0561efc1b9ed880 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Sep 2024 21:57:43 -0300 +Subject: smb: client: fix parsing of device numbers + +From: Paulo Alcantara + +[ Upstream commit 663f295e35594f4c2584fc68c28546b747b637cd ] + +Report correct major and minor numbers from special files created with +NFS reparse points. + +Signed-off-by: Paulo Alcantara (Red Hat) +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/client/reparse.c | 6 +++--- + fs/smb/client/reparse.h | 9 +-------- + 2 files changed, 4 insertions(+), 11 deletions(-) + +diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c +index 7429b96a6ae5e..a4e25b99411ec 100644 +--- a/fs/smb/client/reparse.c ++++ b/fs/smb/client/reparse.c +@@ -497,7 +497,7 @@ static void wsl_to_fattr(struct cifs_open_info_data *data, + else if (!strncmp(name, SMB2_WSL_XATTR_MODE, nlen)) + fattr->cf_mode = (umode_t)le32_to_cpu(*(__le32 *)v); + else if (!strncmp(name, SMB2_WSL_XATTR_DEV, nlen)) +- fattr->cf_rdev = wsl_mkdev(v); ++ fattr->cf_rdev = reparse_mkdev(v); + } while (next); + out: + fattr->cf_dtype = S_DT(fattr->cf_mode); +@@ -518,13 +518,13 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb, + if (le16_to_cpu(buf->ReparseDataLength) != sizeof(buf->InodeType) + 8) + return false; + fattr->cf_mode |= S_IFCHR; +- fattr->cf_rdev = reparse_nfs_mkdev(buf); ++ fattr->cf_rdev = reparse_mkdev(buf->DataBuffer); + break; + case NFS_SPECFILE_BLK: + if (le16_to_cpu(buf->ReparseDataLength) != sizeof(buf->InodeType) + 8) + return false; + fattr->cf_mode |= S_IFBLK; +- fattr->cf_rdev = reparse_nfs_mkdev(buf); ++ fattr->cf_rdev = reparse_mkdev(buf->DataBuffer); + break; + case NFS_SPECFILE_FIFO: + fattr->cf_mode |= S_IFIFO; +diff --git a/fs/smb/client/reparse.h b/fs/smb/client/reparse.h +index 2c0644bc4e65a..158e7b7aae646 100644 +--- a/fs/smb/client/reparse.h ++++ b/fs/smb/client/reparse.h +@@ -18,14 +18,7 @@ + */ + #define IO_REPARSE_TAG_INTERNAL ((__u32)~0U) + +-static inline dev_t reparse_nfs_mkdev(struct reparse_posix_data *buf) +-{ +- u64 v = le64_to_cpu(*(__le64 *)buf->DataBuffer); +- +- return MKDEV(v >> 32, v & 0xffffffff); +-} +- +-static inline dev_t wsl_mkdev(void *ptr) ++static inline dev_t reparse_mkdev(void *ptr) + { + u64 v = le64_to_cpu(*(__le64 *)ptr); + +-- +2.43.0 + diff --git a/queue-6.6/smb-client-set-correct-device-number-on-nfs-reparse-.patch b/queue-6.6/smb-client-set-correct-device-number-on-nfs-reparse-.patch new file mode 100644 index 00000000000..0356e712e1b --- /dev/null +++ b/queue-6.6/smb-client-set-correct-device-number-on-nfs-reparse-.patch @@ -0,0 +1,37 @@ +From 991beab590a7d5463f6b1e83972f1d456b9566ed Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Sep 2024 21:53:35 -0300 +Subject: smb: client: set correct device number on nfs reparse points + +From: Paulo Alcantara + +[ Upstream commit a9de67336a4aa3ff2e706ba023fb5f7ff681a954 ] + +Fix major and minor numbers set on special files created with NFS +reparse points. + +Signed-off-by: Paulo Alcantara (Red Hat) +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/client/reparse.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c +index a4e25b99411ec..c848b5e88d32f 100644 +--- a/fs/smb/client/reparse.c ++++ b/fs/smb/client/reparse.c +@@ -108,8 +108,8 @@ static int nfs_set_reparse_buf(struct reparse_posix_data *buf, + buf->InodeType = cpu_to_le64(type); + buf->ReparseDataLength = cpu_to_le16(len + dlen - + sizeof(struct reparse_data_buffer)); +- *(__le64 *)buf->DataBuffer = cpu_to_le64(((u64)MAJOR(dev) << 32) | +- MINOR(dev)); ++ *(__le64 *)buf->DataBuffer = cpu_to_le64(((u64)MINOR(dev) << 32) | ++ MAJOR(dev)); + iov->iov_base = buf; + iov->iov_len = len + dlen; + return 0; +-- +2.43.0 +