6.14.9-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 588/783 dm vdo vio-pool: allow variable-sized metadata vios
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ken Raeburn <[email protected]>
[ Upstream commit f979da512553a41a657f2c1198277e84d66f8ce3 ]
With larger-sized metadata vio pools, vdo will sometimes need to issue I/O with a smaller size than the allocated size. Since vio_reset_bio is where the bvec array and I/O size are initialized, this reset interface must now specify what I/O size to use.
--- drivers/md/dm-vdo/io-submitter.c | 6 ++++-- drivers/md/dm-vdo/io-submitter.h | 18 +++++++++++++--- drivers/md/dm-vdo/types.h | 3 +++ drivers/md/dm-vdo/vio.c | 36 +++++++++++++++++++------------- drivers/md/dm-vdo/vio.h | 2 ++ 5 files changed, 46 insertions(+), 19 deletions(-)
drivers/md/dm-vdo/io-submitter.c +4 -2
@@ -327,6 +327,7 @@ void vdo_submit_data_vio(struct data_vio *data_vio)* @error_handler: the handler for submission or I/O errors (may be NULL) * @operation: the type of I/O to perform * @data: the buffer to read or write (may be NULL) +* @size: the I/O amount in bytes * * The vio is enqueued on a vdo bio queue so that bio submission (which may block) does not block * other vdo threads.
@@ -338,7 +339,7 @@ void vdo_submit_data_vio(struct data_vio *data_vio)*/ void __submit_metadata_vio (struct vio *vio,physical_block_number_t physical,bio_end_io_t callback,vdo_action_fn error_handler, -blk_opf_t operation,char *data) +blk_opf_t operation,char *data,int size) {int result;struct vdo_completion *completion = &vio->completion;
@@ -349,7 +350,8 @@ void __submit_metadata_vio(struct vio *vio, physical_block_number_t physical,vdo_reset_completion (completion); completion->error_handler = error_handler; - result =vio_reset_bio (vio, data, callback, operation |REQ_META , physical); + result =vio_reset_bio_with_size (vio, data, size, callback, operation |REQ_META , + physical);if (result !=VDO_SUCCESS ) {continue_vio (vio, result);return ;
drivers/md/dm-vdo/io-submitter.h +15 -3
@@ -8,6 +8,7 @@#include <linux/bio.h> +#include "constants.h" #include "types.h" struct io_submitter ;
@@ -26,14 +27,25 @@ void vdo_submit_data_vio(struct data_vio *data_vio);void __submit_metadata_vio (struct vio *vio,physical_block_number_t physical,bio_end_io_t callback,vdo_action_fn error_handler, -blk_opf_t operation,char *data); +blk_opf_t operation,char *data,int size);static inline void vdo_submit_metadata_vio (struct vio *vio,physical_block_number_t physical,bio_end_io_t callback,vdo_action_fn error_handler,blk_opf_t operation) {__submit_metadata_vio (vio, physical, callback, error_handler, - operation, vio->data); + operation, vio->data, vio->block_count *VDO_BLOCK_SIZE ); +} + +static inline void vdo_submit_metadata_vio_with_size (struct vio *vio, +physical_block_number_t physical, +bio_end_io_t callback, +vdo_action_fn error_handler, +blk_opf_t operation, +int size) +{ +__submit_metadata_vio (vio, physical, callback, error_handler, + operation, vio->data, size); } static inline void vdo_submit_flush_vio(struct vio *vio, bio_end_io_t callback,
@@ -41,7 +53,7 @@ static inline void vdo_submit_flush_vio(struct vio *vio, bio_end_io_t callback, {/* FIXME: Can we just use REQ_OP_FLUSH? */ __submit_metadata_vio (vio,0 , callback, error_handler, -REQ_OP_WRITE |REQ_PREFLUSH ,NULL ); +REQ_OP_WRITE |REQ_PREFLUSH ,NULL ,0 ); }#endif /* VDO_IO_SUBMITTER_H */
drivers/md/dm-vdo/types.h +3 -0
@@ -376,6 +376,9 @@ struct vio {/* The size of this vio in blocks */ unsigned int block_count; +/* The amount of data to be read or written, in bytes */ +unsigned int io_size; +/* The data being read or written. */ char *data;
drivers/md/dm-vdo/vio.c +22 -14
@@ -188,14 +188,23 @@ void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callb/* * Prepares the bio to perform IO with the specified buffer. May only be used on a VDO-allocated -* bio, as it assumes the bio wraps a 4k buffer that is 4k aligned, but there does not have to be a -* vio associated with the bio. +* bio, as it assumes the bio wraps a 4k-multiple buffer that is 4k aligned, but there does not +* have to be a vio associated with the bio. */ int vio_reset_bio (struct vio *vio,char *data,bio_end_io_t callback,blk_opf_t bi_opf,physical_block_number_t pbn) { -int bvec_count, offset, len, i; +return vio_reset_bio_with_size (vio, data, vio->block_count *VDO_BLOCK_SIZE , + callback, bi_opf, pbn); +} + +int vio_reset_bio_with_size (struct vio *vio,char *data,int size,bio_end_io_t callback, +blk_opf_t bi_opf,physical_block_number_t pbn) +{ +int bvec_count, offset, i;struct bio *bio = vio->bio; +int vio_size = vio->block_count *VDO_BLOCK_SIZE ; +int remaining;bio_reset (bio, bio->bi_bdev, bi_opf);vdo_set_bio_properties (bio, vio, callback, bi_opf, pbn);
@@ -205,22 +214,21 @@ int vio_reset_bio(struct vio *vio, char *data, bio_end_io_t callback, bio->bi_ioprio =0 ; bio->bi_io_vec = bio->bi_inline_vecs; bio->bi_max_vecs = vio->block_count +1 ; - len =VDO_BLOCK_SIZE * vio->block_count; +if (VDO_ASSERT (size <= vio_size,"specified size %d is not greater than allocated %d" , + size, vio_size) !=VDO_SUCCESS ) + size = vio_size; + vio->io_size = size; offset =offset_in_page (data); - bvec_count =DIV_ROUND_UP (offset + len,PAGE_SIZE ); + bvec_count =DIV_ROUND_UP (offset + size,PAGE_SIZE ); + remaining = size; -/* -* If we knew that data was always on one page, or contiguous pages, we wouldn't need the -* loop. But if we're using vmalloc, it's not impossible that the data is in different -* pages that can't be merged in bio_add_page... -*/ -for (i =0 ; (i < bvec_count) && (len >0 ); i++) { +for (i =0 ; (i < bvec_count) && (remaining >0 ); i++) {struct page *page;int bytes_added;int bytes =PAGE_SIZE - offset; -if (bytes > len) - bytes = len; +if (bytes > remaining) + bytes = remaining; page =is_vmalloc_addr (data) ?vmalloc_to_page (data) :virt_to_page (data); bytes_added =bio_add_page (bio, page, bytes, offset);
@@ -232,7 +240,7 @@ int vio_reset_bio(struct vio *vio, char *data, bio_end_io_t callback, } data += bytes; - len -= bytes; + remaining -= bytes; offset =0 ; }
drivers/md/dm-vdo/vio.h +2 -0
@@ -123,6 +123,8 @@ void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callbint vio_reset_bio (struct vio *vio,char *data,bio_end_io_t callback,blk_opf_t bi_opf,physical_block_number_t pbn); +int vio_reset_bio_with_size (struct vio *vio,char *data,int size,bio_end_io_t callback, +blk_opf_t bi_opf,physical_block_number_t pbn); void update_vio_error_stats(struct vio *vio, const char *format, ...) __printf(2, 3);
Signature · 1 line
2.39.5
Re: [PATCH 6.14 588/783] dm vdo vio-pool: allow variable-sized metadata vios
Quoted 1 line · Greg Kroah-Hartman
6.14-stable review patch. If anyone has any objections, please let me know.
There's no reason to take this patch for 6.14, it can just be dropped.
This patch adds a new interface, but the subsequent patches that use that interface are not being backported. So it won't hurt anything, but it's also useless in 6.14.
Matt
Quoted 202 lines
------------------
From: Ken Raeburn <[email protected]>
[ Upstream commit
f979da512553a41a657f2c1198277e84d66f8ce3]With larger-sized metadata vio pools, vdo will sometimes need to issue I/O with a smaller size than the allocated size. Since
vio_reset_biois where the bvec array and I/O size are initialized, this reset interface must now specify what I/O size to use.Signed-off-by Ken Raeburn <[email protected]>Signed-off-by Matthew Sakai <[email protected]>Signed-off-by Mikulas Patocka <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/md/dm-vdo/io-submitter.c | 6 ++++-- drivers/md/dm-vdo/io-submitter.h | 18 +++++++++++++--- drivers/md/dm-vdo/types.h | 3 +++ drivers/md/dm-vdo/vio.c | 36 +++++++++++++++++++------------- drivers/md/dm-vdo/vio.h | 2 ++ 5 files changed, 46 insertions(+), 19 deletions(-)drivers/md/dm-vdo/io-submitter.c +4
-2@@ -327,6 +327,7 @@ void vdo_submit_data_vio(struct data_vio *data_vio)* @error_handler: the handler for submission or I/O errors (may be NULL) * @operation: the type of I/O to perform * @data: the buffer to read or write (may be NULL) +* @size: the I/O amount in bytes * * The vio is enqueued on a vdo bio queue so that bio submission (which may block) does not block * other vdo threads. @@ -338,7 +339,7 @@ void vdo_submit_data_vio(struct data_vio *data_vio)*/ void __submit_metadata_vio (struct vio *vio,physical_block_number_t physical,bio_end_io_t callback,vdo_action_fn error_handler, -blk_opf_t operation,char *data) +blk_opf_t operation,char *data,int size) {int result;struct vdo_completion *completion = &vio->completion;@@ -349,7 +350,8 @@ void __submit_metadata_vio(struct vio *vio, physical_block_number_t physical,vdo_reset_completion (completion); completion->error_handler = error_handler; - result =vio_reset_bio (vio, data, callback, operation |REQ_META , physical); + result =vio_reset_bio_with_size (vio, data, size, callback, operation |REQ_META , + physical);if (result !=VDO_SUCCESS ) {continue_vio (vio, result);return ;drivers/md/dm-vdo/io-submitter.h +15
-3@@ -8,6 +8,7 @@#include <linux/bio.h> +#include "constants.h" #include "types.h" struct io_submitter ;@@ -26,14 +27,25 @@ void vdo_submit_data_vio(struct data_vio *data_vio);void __submit_metadata_vio (struct vio *vio,physical_block_number_t physical,bio_end_io_t callback,vdo_action_fn error_handler, -blk_opf_t operation,char *data); +blk_opf_t operation,char *data,int size);static inline void vdo_submit_metadata_vio (struct vio *vio,physical_block_number_t physical,bio_end_io_t callback,vdo_action_fn error_handler,blk_opf_t operation) {__submit_metadata_vio (vio, physical, callback, error_handler, - operation, vio->data); + operation, vio->data, vio->block_count *VDO_BLOCK_SIZE ); +} + +static inline void vdo_submit_metadata_vio_with_size (struct vio *vio, +physical_block_number_t physical, +bio_end_io_t callback, +vdo_action_fn error_handler, +blk_opf_t operation, +int size) +{ +__submit_metadata_vio (vio, physical, callback, error_handler, + operation, vio->data, size); } static inline void vdo_submit_flush_vio(struct vio *vio, bio_end_io_t callback,@@ -41,7 +53,7 @@ static inline void vdo_submit_flush_vio(struct vio *vio, bio_end_io_t callback, {/* FIXME: Can we just use REQ_OP_FLUSH? */ __submit_metadata_vio (vio,0 , callback, error_handler, -REQ_OP_WRITE |REQ_PREFLUSH ,NULL ); +REQ_OP_WRITE |REQ_PREFLUSH ,NULL ,0 ); }#endif /* VDO_IO_SUBMITTER_H */ drivers/md/dm-vdo/types.h +3
-0@@ -376,6 +376,9 @@ struct vio {/* The size of this vio in blocks */ unsigned int block_count; +/* The amount of data to be read or written, in bytes */ +unsigned int io_size; +/* The data being read or written. */ char *data;drivers/md/dm-vdo/vio.c +22
-14@@ -188,14 +188,23 @@ void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callb/* * Prepares the bio to perform IO with the specified buffer. May only be used on a VDO-allocated -* bio, as it assumes the bio wraps a 4k buffer that is 4k aligned, but there does not have to be a -* vio associated with the bio. +* bio, as it assumes the bio wraps a 4k-multiple buffer that is 4k aligned, but there does not +* have to be a vio associated with the bio. */ int vio_reset_bio (struct vio *vio,char *data,bio_end_io_t callback,blk_opf_t bi_opf,physical_block_number_t pbn) { -int bvec_count, offset, len, i; +return vio_reset_bio_with_size (vio, data, vio->block_count *VDO_BLOCK_SIZE , + callback, bi_opf, pbn); +} + +int vio_reset_bio_with_size (struct vio *vio,char *data,int size,bio_end_io_t callback, +blk_opf_t bi_opf,physical_block_number_t pbn) +{ +int bvec_count, offset, i;struct bio *bio = vio->bio; +int vio_size = vio->block_count *VDO_BLOCK_SIZE ; +int remaining;bio_reset (bio, bio->bi_bdev, bi_opf);vdo_set_bio_properties (bio, vio, callback, bi_opf, pbn);@@ -205,22 +214,21 @@ int vio_reset_bio(struct vio *vio, char *data, bio_end_io_t callback, bio->bi_ioprio =0 ; bio->bi_io_vec = bio->bi_inline_vecs; bio->bi_max_vecs = vio->block_count +1 ; - len =VDO_BLOCK_SIZE * vio->block_count; +if (VDO_ASSERT (size <= vio_size,"specified size %d is not greater than allocated %d" , + size, vio_size) !=VDO_SUCCESS ) + size = vio_size; + vio->io_size = size; offset =offset_in_page (data); - bvec_count =DIV_ROUND_UP (offset + len,PAGE_SIZE ); + bvec_count =DIV_ROUND_UP (offset + size,PAGE_SIZE ); + remaining = size; -/* -* If we knew that data was always on one page, or contiguous pages, we wouldn't need the -* loop. But if we're using vmalloc, it's not impossible that the data is in different -* pages that can't be merged in bio_add_page... -*/ -for (i =0 ; (i < bvec_count) && (len >0 ); i++) { +for (i =0 ; (i < bvec_count) && (remaining >0 ); i++) {struct page *page;int bytes_added;int bytes =PAGE_SIZE - offset; -if (bytes > len) - bytes = len; +if (bytes > remaining) + bytes = remaining; page =is_vmalloc_addr (data) ?vmalloc_to_page (data) :virt_to_page (data); bytes_added =bio_add_page (bio, page, bytes, offset);@@ -232,7 +240,7 @@ int vio_reset_bio(struct vio *vio, char *data, bio_end_io_t callback, } data += bytes; - len -= bytes; + remaining -= bytes; offset =0 ; }drivers/md/dm-vdo/vio.h +2
-0@@ -123,6 +123,8 @@ void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callbint vio_reset_bio (struct vio *vio,char *data,bio_end_io_t callback,blk_opf_t bi_opf,physical_block_number_t pbn); +int vio_reset_bio_with_size (struct vio *vio,char *data,int size,bio_end_io_t callback, +blk_opf_t bi_opf,physical_block_number_t pbn); void update_vio_error_stats(struct vio *vio, const char *format, ...) __printf(2, 3);
Greg Kroah-Hartman
maintainerRe: [PATCH 6.14 588/783] dm vdo vio-pool: allow variable-sized metadata vios
Quoted 9 lines · Matthew Sakai
Quoted 1 line · Greg Kroah-Hartman
6.14-stable review patch. If anyone has any objections, please let me know.
There's no reason to take this patch for 6.14, it can just be dropped.
This patch adds a new interface, but the subsequent patches that use that interface are not being backported. So it won't hurt anything, but it's also useless in 6.14.
Now dropped from both queues, thanks for letting us know.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 589/783 dm vdo indexer: prevent unterminated string warning
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chung Chung <[email protected]>
[ Upstream commit f4e99b846c90163d350c69d6581ac38dd5818eb8 ]
Fix array initialization that triggers a warning:
error: initializer-string for array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
--- drivers/md/dm-vdo/indexer/index-layout.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/md/dm-vdo/indexer/index-layout.c +3 -2
@@ -54,7 +54,6 @@* Each save also has a unique nonce. */ -#define MAGIC_SIZE 32#define NONCE_INFO_SIZE 32#define MAX_SAVES 2
@@ -98,9 +97,11 @@ enum region_type {#define SUPER_VERSION_CURRENT 3#define SUPER_VERSION_MAXIMUM 7 -static const u8 LAYOUT_MAGIC [MAGIC_SIZE ] ="*ALBIREO*SINGLE*FILE*LAYOUT*001*" ; +static const u8 LAYOUT_MAGIC [] ="*ALBIREO*SINGLE*FILE*LAYOUT*001*" ;static const u64 REGION_MAGIC =0x416c6252676e3031 ;/* 'AlbRgn01' */ +#define MAGIC_SIZE (sizeof(LAYOUT_MAGIC) - 1) +struct region_header {u64 magic;u64 region_blocks;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 590/783 dm vdo: use a short static string for thread name prefix
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Sakai <[email protected]>
[ Upstream commit 3280c9313c9adce01550cc9f00edfb1dc7c744da ]
Also remove MODULE_NAME and a BUG_ON check, both unneeded.
This fixes a warning about string truncation in snprintf that will never happen in practice:
drivers/md/dm-vdo/vdo.c: In function ‘vdo_make’:drivers/md/dm-vdo/vdo.c:564:5: error: ‘%s’ directive output may be truncated writing up to 55 bytes into a region of size 16 [-Werror=format-truncation=]
"%s%u", MODULE_NAME, instance);
^~
drivers/md/dm-vdo/vdo.c:563:2: note: ‘snprintf’ output between 2 and 66 bytes into a destination of size 16
snprintf(vdo->thread_name_prefix, sizeof(vdo->thread_name_prefix),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"%s%u", MODULE_NAME, instance);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--- drivers/md/dm-vdo/vdo.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/md/dm-vdo/vdo.c +1 -10
@@ -31,9 +31,7 @@#include <linux/completion.h> #include <linux/device-mapper.h> -#include <linux/kernel.h> #include <linux/lz4.h> -#include <linux/module.h> #include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/types.h>
@@ -142,12 +140,6 @@ static void finish_vdo_request_queue(void *ptr)vdo_unregister_allocating_thread (); } -#ifdef MODULE -#define MODULE_NAME THIS_MODULE->name -#else -#define MODULE_NAME "dm-vdo" -#endif /* MODULE */ -static const struct vdo_work_queue_type default_queue_type = { .start = start_vdo_request_queue, .finish = finish_vdo_request_queue,
@@ -559,8 +551,7 @@ int vdo_make(unsigned int instance, struct device_config *config, char **reason, *vdo_ptr = vdo;snprintf (vdo->thread_name_prefix,sizeof (vdo->thread_name_prefix), -"%s%u" ,MODULE_NAME , instance); -BUG_ON (vdo->thread_name_prefix[0 ] =='\0' ); +"vdo%u" , instance); result =vdo_allocate (vdo->thread_config.thread_count, struct vdo_thread, __func__, &vdo->threads);if (result !=VDO_SUCCESS ) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 591/783 drm/ast: Find VBIOS mode from regular display size
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
[ Upstream commit c81202906b5cd56db403e95db3d29c9dfc8c74c1 ]
The ast driver looks up supplied display modes from an internal list of display modes supported by the VBIOS.
Do not use the crtc_-prefixed display values from struct drm_display_mode for looking up the VBIOS mode. The fields contain raw values that the driver programs to hardware. They are affected by display settings like double-scan or interlace.
Instead use the regular vdisplay and hdisplay fields for lookup. As the programmed values can now differ from the values used for lookup, set struct drm_display_mode.crtc_vdisplay and .crtc_hdisplay from the VBIOS mode.
--- drivers/gpu/drm/ast/ast_mode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/ast/ast_mode.c +6 -4
@@ -131,7 +131,7 @@ static bool ast_get_vbios_mode_info(const struct drm_format_info *format,return false; } -switch (mode->crtc_hdisplay) { +switch (mode->hdisplay) {case 640 : vbios_mode->enh_table = &res_640x480[refresh_rate_index];break ;
@@ -145,7 +145,7 @@ static bool ast_get_vbios_mode_info(const struct drm_format_info *format, vbios_mode->enh_table = &res_1152x864[refresh_rate_index];break ;case 1280 : -if (mode->crtc_vdisplay ==800 ) +if (mode->vdisplay ==800 ) vbios_mode->enh_table = &res_1280x800[refresh_rate_index];else vbios_mode->enh_table = &res_1280x1024[refresh_rate_index];
@@ -157,7 +157,7 @@ static bool ast_get_vbios_mode_info(const struct drm_format_info *format, vbios_mode->enh_table = &res_1440x900[refresh_rate_index];break ;case 1600 : -if (mode->crtc_vdisplay ==900 ) +if (mode->vdisplay ==900 ) vbios_mode->enh_table = &res_1600x900[refresh_rate_index];else vbios_mode->enh_table = &res_1600x1200[refresh_rate_index];
@@ -166,7 +166,7 @@ static bool ast_get_vbios_mode_info(const struct drm_format_info *format, vbios_mode->enh_table = &res_1680x1050[refresh_rate_index];break ;case 1920 : -if (mode->crtc_vdisplay ==1080 ) +if (mode->vdisplay ==1080 ) vbios_mode->enh_table = &res_1920x1080[refresh_rate_index];else vbios_mode->enh_table = &res_1920x1200[refresh_rate_index];
@@ -210,6 +210,7 @@ static bool ast_get_vbios_mode_info(const struct drm_format_info *format, hborder = (vbios_mode->enh_table->flags & HBorder) ?8 :0 ; vborder = (vbios_mode->enh_table->flags & VBorder) ?8 :0 ; + adjusted_mode->crtc_hdisplay = vbios_mode->enh_table->hde; adjusted_mode->crtc_htotal = vbios_mode->enh_table->ht; adjusted_mode->crtc_hblank_start = vbios_mode->enh_table->hde + hborder; adjusted_mode->crtc_hblank_end = vbios_mode->enh_table->ht - hborder;
@@ -219,6 +220,7 @@ static bool ast_get_vbios_mode_info(const struct drm_format_info *format, vbios_mode->enh_table->hfp + vbios_mode->enh_table->hsync); + adjusted_mode->crtc_vdisplay = vbios_mode->enh_table->vde; adjusted_mode->crtc_vtotal = vbios_mode->enh_table->vt; adjusted_mode->crtc_vblank_start = vbios_mode->enh_table->vde + vborder; adjusted_mode->crtc_vblank_end = vbios_mode->enh_table->vt - vborder;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 592/783 bpf: Use kallsyms to find the function name of a struct_opss stub function
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin KaFai Lau <[email protected]>
[ Upstream commit 12fdd29d5d71d2987a1aec434b704d850a4d7fcb ]
In commit 1611603537a4 ("bpf: Create argument information for nullable arguments."), it introduced a "__nullable" tagging at the argument name of a
stub function. Some background on the commit:
it requires to tag the stub function instead of directly tagging
the "ops" of a struct. This is because the btf func_proto of the "ops" does not have the argument name and the "__nullable" is tagged at
the argument name.
To find the stub function of a "ops", it currently relies on a naming convention on the stub function "st_ops__ops_name".
e.g. tcp_congestion_ops__ssthresh. However, the new kernel sub system implementing bpf_struct_ops have missed this and have been surprised that the "__nullable" and the to-be-landed "__ref" tagging was not effective.
One option would be to give a warning whenever the stub function does not follow the naming convention, regardless if it requires arg tagging or not.
Instead, this patch uses the kallsyms_lookup approach and removes the requirement on the naming convention. The st_ops->cfi_stubs has all the stub function kernel addresses. kallsyms_lookup() is used to lookup the function name. With the function name, BTF can be used to find the BTF func_proto. The existing "__nullable" arg name searching logic will then fall through.
One notable change is,
if it failed in kallsyms_lookup or it failed in looking up the stub function name from the BTF, the bpf_struct_ops registration will fail. This is different from the previous behavior that it silently ignored the "st_ops__ops_name" function not found error.
The "tcp_congestion_ops", "sched_ext_ops", and "hid_bpf_ops" can still be registered successfully after this patch. There is struct_ops_maybe_null selftest to cover the "__nullable" tagging.
Other minor changes:
1. Removed the "%s__%s" format from the pr_warn because the naming convention is removed.
2. The existing bpf_struct_ops_supported() is also moved earlier because prepare_arg_info needs to use it to decide if the stub function is NULL before calling the prepare_arg_info.
--- kernel/bpf/bpf_struct_ops.c | 98 +++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 54 deletions(-)
kernel/bpf/bpf_struct_ops.c +44 -54
@@ -146,39 +146,6 @@ void bpf_struct_ops_image_free(void *image) }#define MAYBE_NULL_SUFFIX "__nullable" -#define MAX_STUB_NAME 128 - -/* Return the type info of a stub function, if it exists. -* -* The name of a stub function is made up of the name of the struct_ops and -* the name of the function pointer member, separated by "__". For example, -* if the struct_ops type is named "foo_ops" and the function pointer -* member is named "bar", the stub function name would be "foo_ops__bar". -*/ -static const struct btf_type * -find_stub_func_proto (const struct btf *btf,const char *st_op_name, -const char *member_name) -{ -char stub_func_name[MAX_STUB_NAME ]; -const struct btf_type *func_type; -s32 btf_id; -int cp; - - cp =snprintf (stub_func_name,MAX_STUB_NAME ,"%s__%s" , - st_op_name, member_name); -if (cp >=MAX_STUB_NAME ) { -pr_warn ("Stub function name too long\n" ); -return NULL ; - } - btf_id =btf_find_by_name_kind (btf, stub_func_name,BTF_KIND_FUNC ); -if (btf_id <0 ) -return NULL ; - func_type =btf_type_by_id (btf, btf_id); -if (!func_type) -return NULL ; - -return btf_type_by_id (btf, func_type->type);/* FUNC_PROTO */ -}/* Prepare argument info for every nullable argument of a member of a * struct_ops type.
@@ -203,27 +170,42 @@ find_stub_func_proto(const struct btf *btf, const char *st_op_name,static int prepare_arg_info (struct btf *btf,const char *st_ops_name,const char *member_name, -const struct btf_type *func_proto, +const struct btf_type *func_proto,void *stub_func_addr,struct bpf_struct_ops_arg_info *arg_info) {const struct btf_type *stub_func_proto, *pointed_type;const struct btf_param *stub_args, *args;struct bpf_ctx_arg_aux *info, *info_buf;u32 nargs, arg_no, info_cnt =0 ; +char ksym[KSYM_SYMBOL_LEN ]; +const char *stub_fname; +s32 stub_func_id;u32 arg_btf_id;int offset; - stub_func_proto =find_stub_func_proto (btf, st_ops_name, member_name); -if (!stub_func_proto) -return 0 ; + stub_fname =kallsyms_lookup ((unsigned long )stub_func_addr,NULL ,NULL ,NULL , ksym); +if (!stub_fname) { +pr_warn ("Cannot find the stub function name for the %s in struct %s\n" , + member_name, st_ops_name); +return -ENOENT ; + } + + stub_func_id =btf_find_by_name_kind (btf, stub_fname,BTF_KIND_FUNC ); +if (stub_func_id <0 ) { +pr_warn ("Cannot find the stub function %s in btf\n" , stub_fname); +return -ENOENT ; + } + + stub_func_proto =btf_type_by_id (btf, stub_func_id); + stub_func_proto =btf_type_by_id (btf, stub_func_proto->type);/* Check if the number of arguments of the stub function is the same * as the number of arguments of the function pointer. */ nargs =btf_type_vlen (func_proto);if (nargs !=btf_type_vlen (stub_func_proto)) { -pr_warn ("the number of arguments of the stub function %s__%s does not match the number of arguments of the member %s of struct %s\n" , - st_ops_name, member_name, member_name, st_ops_name); +pr_warn ("the number of arguments of the stub function %s does not match the number of arguments of the member %s of struct %s\n" , + stub_fname, member_name, st_ops_name);return -EINVAL ; }
@@ -253,21 +235,21 @@ static int prepare_arg_info(struct btf *btf, &arg_btf_id);if (!pointed_type || !btf_type_is_struct (pointed_type)) { -pr_warn ("stub function %s__%s has %s tagging to an unsupported type\n" , - st_ops_name, member_name,MAYBE_NULL_SUFFIX ); +pr_warn ("stub function %s has %s tagging to an unsupported type\n" , + stub_fname,MAYBE_NULL_SUFFIX ); goto err_out; } offset =btf_ctx_arg_offset (btf, func_proto, arg_no);if (offset <0 ) { -pr_warn ("stub function %s__%s has an invalid trampoline ctx offset for arg#%u\n" , - st_ops_name, member_name, arg_no); +pr_warn ("stub function %s has an invalid trampoline ctx offset for arg#%u\n" , + stub_fname, arg_no); goto err_out; }if (args[arg_no].type != stub_args[arg_no].type) { -pr_warn ("arg#%u type in stub function %s__%s does not match with its original func_proto\n" , - arg_no, st_ops_name, member_name); +pr_warn ("arg#%u type in stub function %s does not match with its original func_proto\n" , + arg_no, stub_fname); goto err_out; }
@@ -324,6 +306,13 @@ static bool is_module_member(const struct btf *btf, u32 id)return !strcmp (btf_name_by_offset (btf, t->name_off),"module" ); } +int bpf_struct_ops_supported (const struct bpf_struct_ops *st_ops,u32 moff) +{ +void *func_ptr = *(void **)(st_ops->cfi_stubs + moff); + +return func_ptr ?0 : -ENOTSUPP ; +} +int bpf_struct_ops_desc_init (struct bpf_struct_ops_desc *st_ops_desc,struct btf *btf,struct bpf_verifier_log *log)
@@ -387,7 +376,10 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc,for_each_member (i, t, member) {const struct btf_type *func_proto; +void **stub_func_addr; +u32 moff; + moff =__btf_member_bit_offset (t, member) /8 ; mname =btf_name_by_offset (btf, member->name_off);if (!*mname) { pr_warn("anon member in struct %s is not supported\n",
@@ -413,7 +405,11 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc, func_proto =btf_type_resolve_func_ptr (btf, member->type,NULL ); -if (!func_proto) + +/* The member is not a function pointer or +* the function pointer is not supported. +*/ +if (!func_proto ||bpf_struct_ops_supported (st_ops, moff))continue ; if (btf_distill_func_proto(log, btf,
@@ -425,8 +421,9 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc, goto errout; } + stub_func_addr = *(void **)(st_ops->cfi_stubs + moff); err =prepare_arg_info (btf, st_ops->name, mname, - func_proto, + func_proto, stub_func_addr, arg_info + i);if (err) goto errout;
@@ -1152,13 +1149,6 @@ void bpf_struct_ops_put(const void *kdata)bpf_map_put (&st_map->map); } -int bpf_struct_ops_supported (const struct bpf_struct_ops *st_ops,u32 moff) -{ -void *func_ptr = *(void **)(st_ops->cfi_stubs + moff); - -return func_ptr ?0 : -ENOTSUPP ; -} -static bool bpf_struct_ops_valid_to_reg (struct bpf_map *map) {struct bpf_struct_ops_map *st_map = (struct bpf_struct_ops_map *)map;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 593/783 bpftool: Fix readlink usage in get_fd_type
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viktor Malik <[email protected]>
[ Upstream commit 0053f7d39d491b6138d7c526876d13885cbb65f1 ]
The readlink(path, buf, sizeof(buf)) call reads at most sizeof(buf) bytes and *does not* append null-terminator to buf. With respect to that, fix two pieces in get_fd_type:
1. Change the truncation check to contain sizeof(buf) rather than sizeof(path).
2. Append null-terminator to buf.
Reported by Coverity.
--- tools/bpf/bpftool/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/bpf/bpftool/common.c +2 -1
@@ -461,10 +461,11 @@ int get_fd_type(int fd)p_err ("can't read link type: %s" ,strerror (errno));return -1 ; } -if (n ==sizeof (path)) { +if (n ==sizeof (buf)) {p_err ("can't read link type: path too long!" );return -1 ; } + buf[n] ='\0' ;if (strstr (buf,"bpf-map" ))return BPF_OBJ_MAP ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 594/783 firmware: arm_scmi: Relax duplicate name constraint across protocol ids
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <[email protected]>
[ Upstream commit 21ee965267bcbdd733be0f35344fa0f0226d7861 ]
Currently in scmi_protocol_device_request(), no duplicate scmi device name is allowed across any protocol. However scmi_dev_match_id() first matches the protocol id and then the name. So, there is no strict requirement to keep this scmi device name unique across all the protocols.
Relax the constraint on the duplicate name across the protocols and inhibit only within the same protocol id.
Message-Id: <[email protected]>
--- drivers/firmware/arm_scmi/bus.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
drivers/firmware/arm_scmi/bus.c +6 -13
@@ -42,7 +42,7 @@ static atomic_t scmi_syspower_registered = ATOMIC_INIT(0);* This helper let an SCMI driver request specific devices identified by the * @id_table to be created for each active SCMI instance. * -* The requested device name MUST NOT be already existent for any protocol; +* The requested device name MUST NOT be already existent for this protocol; * at first the freshly requested @id_table is annotated in the IDR table * @scmi_requested_devices and then the requested device is advertised to any * registered party via the @scmi_requested_devices_nh notification chain.
@@ -52,7 +52,6 @@ static atomic_t scmi_syspower_registered = ATOMIC_INIT(0);static int scmi_protocol_device_request (const struct scmi_device_id *id_table) {int ret =0 ; -unsigned int id =0 ;struct list_head *head, *phead =NULL ;struct scmi_requested_dev *rdev;
@@ -67,19 +66,13 @@ static int scmi_protocol_device_request(const struct scmi_device_id *id_table) }/* -* Search for the matching protocol rdev list and then search -* of any existent equally named device...fails if any duplicate found. +* Find the matching protocol rdev list and then search of any +* existent equally named device...fails if any duplicate found. */ mutex_lock (&scmi_requested_devices_mtx); -idr_for_each_entry (&scmi_requested_devices, head, id) { -if (!phead) { -/* A list found registered in the IDR is never empty */ - rdev = list_first_entry(head, struct scmi_requested_dev, - node); -if (rdev->id_table->protocol_id == - id_table->protocol_id) - phead = head; - } + phead =idr_find (&scmi_requested_devices, id_table->protocol_id); +if (phead) { + head = phead;list_for_each_entry (rdev, head, node) {if (!strcmp (rdev->id_table->name, id_table->name)) { pr_err("Ignoring duplicate request [%d] %s\n",
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 595/783 perf/amd/ibs: Fix perf_ibs_op.cnt_mask for CurCnt
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ravi Bangoria <[email protected]>
[ Upstream commit 46dcf85566170d4528b842bf83ffc350d71771fa ]
IBS Op uses two counters: MaxCnt and CurCnt. MaxCnt is programmed with the desired sample period. IBS hw generates sample when CurCnt reaches to MaxCnt. The size of these counter used to be 20 bits but later they were extended to 27 bits. The 7 bit extension is indicated by CPUID Fn8000_001B_EAX[6 / OpCntExt].
perf_ibs->cnt_mask variable contains bit masks for MaxCnt and CurCnt. But IBS driver does not set upper 7 bits of CurCnt in cnt_mask even when OpCntExt CPUID bit is set. Fix this.
IBS driver uses cnt_mask[CurCnt] bits only while disabling an event. Fortunately, CurCnt bits are not read from MSR while re-enabling the event, instead MaxCnt is programmed with desired period and CurCnt is set to 0. Hence, we did not see any issues so far.
--- arch/x86/events/amd/ibs.c | 3 ++- arch/x86/include/asm/perf_event.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/events/amd/ibs.c +2 -1
@@ -1318,7 +1318,8 @@ static __init int perf_ibs_op_init(void)if (ibs_caps &IBS_CAPS_OPCNTEXT ) { perf_ibs_op.max_period |=IBS_OP_MAX_CNT_EXT_MASK ; perf_ibs_op.config_mask |=IBS_OP_MAX_CNT_EXT_MASK ; - perf_ibs_op.cnt_mask |=IBS_OP_MAX_CNT_EXT_MASK ; + perf_ibs_op.cnt_mask |= (IBS_OP_MAX_CNT_EXT_MASK | +IBS_OP_CUR_CNT_EXT_MASK ); }if (ibs_caps &IBS_CAPS_ZEN4 )
arch/x86/include/asm/perf_event.h +1 -0
@@ -536,6 +536,7 @@ struct pebs_xmm {*/ #define IBS_OP_CUR_CNT (0xFFF80ULL<<32)#define IBS_OP_CUR_CNT_RAND (0x0007FULL<<32) +#define IBS_OP_CUR_CNT_EXT_MASK (0x7FULL<<52)#define IBS_OP_CNT_CTL (1ULL<<19)#define IBS_OP_VAL (1ULL<<18)#define IBS_OP_ENABLE (1ULL<<17)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 596/783 perf/amd/ibs: Fix ->config to sample period calculation for OP PMU
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ravi Bangoria <[email protected]>
[ Upstream commit 598bdf4fefff5af4ce6d26d16f7b2a20808fc4cb ]
Instead of using standard perf_event_attr->freq=0 and ->sample_period fields, IBS event in 'sample period mode' can also be opened by setting period value directly in perf_event_attr->config in a MaxCnt bit-field format.
IBS OP MaxCnt bits are defined as:
(high bits) IbsOpCtl[26:20] = IbsOpMaxCnt[26:20] (low bits) IbsOpCtl[15:0] = IbsOpMaxCnt[19:4]
Perf event sample period can be derived from MaxCnt bits as:
sample_period = (high bits) | ((low_bits) << 4);
However, current code just masks MaxCnt bits and shifts all of them, including high bits, which is incorrect. Fix it.
--- arch/x86/events/amd/ibs.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
arch/x86/events/amd/ibs.c +13 -4
@@ -274,7 +274,7 @@ static int perf_ibs_init(struct perf_event *event) {struct hw_perf_event *hwc = &event->hw;struct perf_ibs *perf_ibs; -u64 max_cnt, config; +u64 config;int ret; perf_ibs =get_ibs_pmu (event->attr.type);
@@ -321,10 +321,19 @@ static int perf_ibs_init(struct perf_event *event)if (!hwc->sample_period) hwc->sample_period =0x10 ; }else { - max_cnt = config & perf_ibs->cnt_mask; +u64 period =0 ; + +if (perf_ibs == &perf_ibs_op) { + period = (config &IBS_OP_MAX_CNT ) <<4 ; +if (ibs_caps &IBS_CAPS_OPCNTEXT ) + period |= config &IBS_OP_MAX_CNT_EXT_MASK ; + }else { + period = (config &IBS_FETCH_MAX_CNT ) <<4 ; + } + config &= ~perf_ibs->cnt_mask; - event->attr.sample_period = max_cnt <<4 ; - hwc->sample_period = event->attr.sample_period; + event->attr.sample_period = period; + hwc->sample_period = period; }if (!hwc->sample_period)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 597/783 clk: renesas: rzg2l-cpg: Refactor Runtime PM clock validation
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lad Prabhakar <[email protected]>
[ Upstream commit f6f73b891bf6beff069fcacc7b4a796e1009bf26 ]
Refactor rzg2l_cpg_attach_dev to delegate clock validation for Runtime PM to the updated rzg2l_cpg_is_pm_clk function. Ensure validation of clocks associated with the power domain while excluding external and core clocks. Prevent incorrect Runtime PM management for clocks outside the domain's scope.
Update rzg2l_cpg_is_pm_clk to operate on a per-power-domain basis. Verify clkspec.np against the domain's device node, check argument validity, and validate clock type (CPG_MOD). Use the no_pm_mod_clks array to exclude specific clocks from PM management.
--- drivers/clk/renesas/rzg2l-cpg.c | 102 +++++++++++++++++--------------- 1 file changed, 54 insertions(+), 48 deletions(-)
drivers/clk/renesas/rzg2l-cpg.c +54 -48
@@ -1549,28 +1549,6 @@ static int rzg2l_cpg_reset_controller_register(struct rzg2l_cpg_priv *priv)return devm_reset_controller_register (priv->dev, &priv->rcdev); } -static bool rzg2l_cpg_is_pm_clk (struct rzg2l_cpg_priv *priv, -const struct of_phandle_args *clkspec) -{ -const struct rzg2l_cpg_info *info = priv->info; -unsigned int id; -unsigned int i; - -if (clkspec->args_count !=2 ) -return false; - -if (clkspec->args[0 ] !=CPG_MOD ) -return false; - - id = clkspec->args[1 ] + info->num_total_core_clks; -for (i =0 ; i < info->num_no_pm_mod_clks; i++) { -if (info->no_pm_mod_clks[i] == id) -return false; - } - -return true; -} -/** * struct rzg2l_cpg_pm_domains - RZ/G2L PM domains data structure * @onecell_data: cell data
@@ -1595,45 +1573,73 @@ struct rzg2l_cpg_pd {u16 id; }; +static bool rzg2l_cpg_is_pm_clk (struct rzg2l_cpg_pd *pd, +const struct of_phandle_args *clkspec) +{ +if (clkspec->np != pd->genpd.dev.of_node || clkspec->args_count !=2 ) +return false; + +switch (clkspec->args[0 ]) { +case CPG_MOD : { +struct rzg2l_cpg_priv *priv = pd->priv; +const struct rzg2l_cpg_info *info = priv->info; +unsigned int id = clkspec->args[1 ]; + +if (id >= priv->num_mod_clks) +return false; + + id += info->num_total_core_clks; + +for (unsigned int i =0 ; i < info->num_no_pm_mod_clks; i++) { +if (info->no_pm_mod_clks[i] == id) +return false; + } + +return true; + } + +case CPG_CORE : +default : +return false; + } +} +static int rzg2l_cpg_attach_dev (struct generic_pm_domain *domain,struct device *dev) { struct rzg2l_cpg_pd *pd = container_of(domain, struct rzg2l_cpg_pd, genpd); -struct rzg2l_cpg_priv *priv = pd->priv;struct device_node *np = dev->of_node;struct of_phandle_args clkspec;bool once = true;struct clk *clk; +unsigned int i;int error; -int i =0 ; - -while (!of_parse_phandle_with_args (np,"clocks" ,"#clock-cells" , i, - &clkspec)) { -if (rzg2l_cpg_is_pm_clk (priv, &clkspec)) { -if (once) { - once = false; - error =pm_clk_create (dev); -if (error) { -of_node_put (clkspec.np); - goto err; - } - } - clk =of_clk_get_from_provider (&clkspec); + +for (i =0 ; !of_parse_phandle_with_args (np,"clocks" ,"#clock-cells" , i, &clkspec); i++) { +if (!rzg2l_cpg_is_pm_clk (pd, &clkspec)) {of_node_put (clkspec.np); -if (IS_ERR (clk)) { - error =PTR_ERR (clk); - goto fail_destroy; - } +continue ; + } - error =pm_clk_add_clk (dev, clk); +if (once) { + once = false; + error =pm_clk_create (dev);if (error) { -dev_err (dev,"pm_clk_add_clk failed %d\n" , - error); - goto fail_put; +of_node_put (clkspec.np); + goto err; } - }else { -of_node_put (clkspec.np); } - i++; + clk =of_clk_get_from_provider (&clkspec); +of_node_put (clkspec.np); +if (IS_ERR (clk)) { + error =PTR_ERR (clk); + goto fail_destroy; + } + + error =pm_clk_add_clk (dev, clk); +if (error) { +dev_err (dev,"pm_clk_add_clk failed %d\n" , error); + goto fail_put; + } }return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 598/783 wifi: rtl8xxxu: retry firmware download on error
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Soeren Moch <[email protected]>
[ Upstream commit 3d3e28feca7ac8c6cf2a390dbbe1f97e3feb7f36 ]
Occasionally there is an EPROTO error during firmware download. This error is converted to EAGAIN in the download function. But nobody tries again and so device probe fails.
Implement download retry to fix this.
This error was observed (and fix tested) on a tbs2910 board [1] with an embedded RTL8188EU (0bda:8179) device behind a USB hub.
[1] arch/arm/boot/dts/nxp/imx/imx6q-tbs2910.dts
--- drivers/net/wireless/realtek/rtl8xxxu/core.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/core.c +12 -5
@@ -860,9 +860,10 @@ rtl8xxxu_writeN(struct rtl8xxxu_priv *priv, u16 addr, u8 *buf, u16 len)return len; write_error: -dev_info (&udev->dev, -"%s: Failed to write block at addr: %04x size: %04x\n" , - __func__, addr, blocksize); +if (rtl8xxxu_debug &RTL8XXXU_DEBUG_REG_WRITE ) +dev_info (&udev->dev, +"%s: Failed to write block at addr: %04x size: %04x\n" , + __func__, addr, blocksize);return -EAGAIN ; }
@@ -4064,8 +4065,14 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)*/ rtl8xxxu_write16 (priv,REG_TRXFF_BNDY +2 , fops->trxff_boundary); - ret =rtl8xxxu_download_firmware (priv); -dev_dbg (dev,"%s: download_firmware %i\n" , __func__, ret); +for (int retry =5 ; retry >=0 ; retry--) { + ret =rtl8xxxu_download_firmware (priv); +dev_dbg (dev,"%s: download_firmware %i\n" , __func__, ret); +if (ret != -EAGAIN ) +break ; +if (retry) +dev_dbg (dev,"%s: retry firmware download\n" , __func__); + }if (ret) goto exit; ret =rtl8xxxu_start_firmware (priv);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 599/783 wifi: rtw88: Dont use static local variable in rtw8822b_set_tx_power_index_by_rate
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
[ Upstream commit 00451eb3bec763f708e7e58326468c1e575e5a66 ]
Some users want to plug two identical USB devices at the same time. This static variable could theoretically cause them to use incorrect TX power values.
Move the variable to the caller and pass a pointer to it to rtw8822b_set_tx_power_index_by_rate().
--- drivers/net/wireless/realtek/rtw88/rtw8822b.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/wireless/realtek/rtw88/rtw8822b.c +8 -6
@@ -935,11 +935,11 @@ static void query_phy_status(struct rtw_dev *rtwdev, u8 *phy_status, }static void -rtw8822b_set_tx_power_index_by_rate (struct rtw_dev *rtwdev,u8 path,u8 rs) +rtw8822b_set_tx_power_index_by_rate (struct rtw_dev *rtwdev,u8 path, +u8 rs,u32 *phy_pwr_idx) {struct rtw_hal *hal = &rtwdev->hal;static const u32 offset_txagc[2 ] = {0x1d00 ,0x1d80 }; -static u32 phy_pwr_idx;u8 rate, rate_idx, pwr_index, shift;int j;
@@ -947,12 +947,12 @@ rtw8822b_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs) rate = rtw_rate_section[rs][j]; pwr_index = hal->tx_pwr_tbl[path][rate]; shift = rate &0x3 ; - phy_pwr_idx |= ((u32 )pwr_index << (shift *8 )); + *phy_pwr_idx |= ((u32 )pwr_index << (shift *8 ));if (shift ==0x3 ) { rate_idx = rate &0xfc ;rtw_write32 (rtwdev, offset_txagc[path] + rate_idx, - phy_pwr_idx); - phy_pwr_idx =0 ; + *phy_pwr_idx); + *phy_pwr_idx =0 ; } } }
@@ -960,11 +960,13 @@ rtw8822b_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs)static void rtw8822b_set_tx_power_index (struct rtw_dev *rtwdev) {struct rtw_hal *hal = &rtwdev->hal; +u32 phy_pwr_idx =0 ;int rs, path;for (path =0 ; path < hal->rf_path_num; path++) {for (rs =0 ; rs <RTW_RATE_SECTION_MAX ; rs++) -rtw8822b_set_tx_power_index_by_rate (rtwdev, path, rs); +rtw8822b_set_tx_power_index_by_rate (rtwdev, path, rs, + &phy_pwr_idx); } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 600/783 wifi: rtw89: add wiphy_lock() to work that isnt held wiphy_lock() yet
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ping-Ke Shih <[email protected]>
[ Upstream commit ebfc9199df05d37b67f4d1b7ee997193f3d2e7c8 ]
To ensure where are protected by driver mutex can also be protected by wiphy_lock(), so afterward we can remove driver mutex safely.
--- drivers/net/wireless/realtek/rtw89/regd.c | 2 ++ drivers/net/wireless/realtek/rtw89/ser.c | 4 ++++ 2 files changed, 6 insertions(+)
drivers/net/wireless/realtek/rtw89/regd.c +2 -0
@@ -720,6 +720,7 @@ void rtw89_regd_notifier(struct wiphy *wiphy, struct regulatory_request *requeststruct ieee80211_hw *hw =wiphy_to_ieee80211_hw (wiphy);struct rtw89_dev *rtwdev = hw->priv; +wiphy_lock (wiphy);mutex_lock (&rtwdev->mutex);rtw89_leave_ps_mode (rtwdev);
@@ -737,6 +738,7 @@ void rtw89_regd_notifier(struct wiphy *wiphy, struct regulatory_request *request exit:mutex_unlock (&rtwdev->mutex); +wiphy_unlock (wiphy); }/* Maximum Transmit Power field (@raw) can be EIRP or PSD.
drivers/net/wireless/realtek/rtw89/ser.c +4 -0
@@ -156,9 +156,11 @@ static void ser_state_run(struct rtw89_ser *ser, u8 evt)rtw89_debug (rtwdev,RTW89_DBG_SER ,"ser: %s receive %s\n" ,ser_st_name (ser),ser_ev_name (ser, evt)); +wiphy_lock (rtwdev->hw->wiphy);mutex_lock (&rtwdev->mutex);rtw89_leave_lps (rtwdev);mutex_unlock (&rtwdev->mutex); +wiphy_unlock (rtwdev->hw->wiphy); ser->st_tbl[ser->state].st_func (ser, evt); }
@@ -708,9 +710,11 @@ static void ser_l2_reset_st_hdl(struct rtw89_ser *ser, u8 evt)switch (evt) {case SER_EV_STATE_IN : +wiphy_lock (rtwdev->hw->wiphy);mutex_lock (&rtwdev->mutex);ser_l2_reset_st_pre_hdl (ser);mutex_unlock (&rtwdev->mutex); +wiphy_unlock (rtwdev->hw->wiphy);ieee80211_restart_hw (rtwdev->hw);ser_set_alarm (ser,SER_RECFG_TIMEOUT ,SER_EV_L2_RECFG_TIMEOUT );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 601/783 spi: zynqmp-gqspi: Always acknowledge interrupts
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Anderson <[email protected]>
[ Upstream commit 89785306453ce6d949e783f6936821a0b7649ee2 ]
RXEMPTY can cause an IRQ, even though we may not do anything about it (such as if we are waiting for more received data). We must still handle these IRQs because we can tell they were caused by the device.
--- drivers/spi/spi-zynqmp-gqspi.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/spi/spi-zynqmp-gqspi.c +8 -12
@@ -799,7 +799,6 @@ static void zynqmp_process_dma_irq(struct zynqmp_qspi *xqspi)static irqreturn_t zynqmp_qspi_irq (int irq,void *dev_id) {struct zynqmp_qspi *xqspi = (struct zynqmp_qspi *)dev_id; -irqreturn_t ret =IRQ_NONE ;u32 status, mask, dma_status =0 ; status =zynqmp_gqspi_read (xqspi,GQSPI_ISR_OFST );
@@ -814,27 +813,24 @@ static irqreturn_t zynqmp_qspi_irq(int irq, void *dev_id) dma_status); } -if (mask &GQSPI_ISR_TXNOT_FULL_MASK ) { +if (!mask && !dma_status) +return IRQ_NONE ; + +if (mask &GQSPI_ISR_TXNOT_FULL_MASK )zynqmp_qspi_filltxfifo (xqspi,GQSPI_TX_FIFO_FILL ); - ret =IRQ_HANDLED ; - } -if (dma_status &GQSPI_QSPIDMA_DST_I_STS_DONE_MASK ) { +if (dma_status &GQSPI_QSPIDMA_DST_I_STS_DONE_MASK )zynqmp_process_dma_irq (xqspi); - ret =IRQ_HANDLED ; - }else if (!(mask &GQSPI_IER_RXEMPTY_MASK ) && - (mask &GQSPI_IER_GENFIFOEMPTY_MASK )) { +else if (!(mask &GQSPI_IER_RXEMPTY_MASK ) && + (mask &GQSPI_IER_GENFIFOEMPTY_MASK ))zynqmp_qspi_readrxfifo (xqspi,GQSPI_RX_FIFO_FILL ); - ret =IRQ_HANDLED ; - }if (xqspi->bytes_to_receive ==0 && xqspi->bytes_to_transfer ==0 && ((status &GQSPI_IRQ_MASK ) ==GQSPI_IRQ_MASK )) {zynqmp_gqspi_write (xqspi,GQSPI_IDR_OFST ,GQSPI_ISR_IDR_MASK );complete (&xqspi->data_completion); - ret =IRQ_HANDLED ; } -return ret; +return IRQ_HANDLED ; }/**
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 602/783 regulator: ad5398: Add device tree support
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Isaac Scott <[email protected]>
[ Upstream commit 5a6a461079decea452fdcae955bccecf92e07e97 ]
Previously, the ad5398 driver used only platform_data, which is deprecated in favour of device tree. This caused the AD5398 to fail to probe as it could not load its init_data. If the AD5398 has a device tree node, pull the init_data from there using of_get_regulator_init_data.
--- drivers/regulator/ad5398.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/regulator/ad5398.c +9 -3
@@ -14,6 +14,7 @@#include <linux/platform_device.h> #include <linux/regulator/driver.h> #include <linux/regulator/machine.h> +#include <linux/regulator/of_regulator.h> #define AD5398_CURRENT_EN_MASK 0x8000
@@ -221,15 +222,20 @@ static int ad5398_probe(struct i2c_client *client)const struct ad5398_current_data_format *df = (struct ad5398_current_data_format *)id->driver_data; -if (!init_data) -return -EINVAL ; - chip =devm_kzalloc (&client->dev,sizeof (*chip),GFP_KERNEL );if (!chip)return -ENOMEM ; config.dev = &client->dev; +if (client->dev.of_node) + init_data =of_get_regulator_init_data (&client->dev, + client->dev.of_node, + &ad5398_reg); +if (!init_data) +return -EINVAL ; + config.init_data = init_data; + config.of_node = client->dev.of_node; config.driver_data = chip; chip->client = client;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 603/783 wifi: ath12k: fix ath12k_hal_tx_cmd_ext_desc_setup() info1 override
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Escande <[email protected]>
[ Upstream commit df11edfba49e5fb69f4c9e7cb76082b89c417f78 ]
Since inception there is an obvious typo laying around in ath12k_hal_tx_cmd_ext_desc_setup(). Instead of initializing + adding flags to tcl_ext_cmd->info1, we initialize + override. This will be needed in the future to make broadcast frames work with ethernet encapsulation.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/dp_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/dp_tx.c +1 -1
@@ -117,7 +117,7 @@ static void ath12k_hal_tx_cmd_ext_desc_setup(struct ath12k_base *ab,le32_encode_bits (ti->data_len,HAL_TX_MSDU_EXT_INFO1_BUF_LEN ); - tcl_ext_cmd->info1 =le32_encode_bits (1 ,HAL_TX_MSDU_EXT_INFO1_EXTN_OVERRIDE ) | + tcl_ext_cmd->info1 |=le32_encode_bits (1 ,HAL_TX_MSDU_EXT_INFO1_EXTN_OVERRIDE ) |le32_encode_bits (ti->encap_type,HAL_TX_MSDU_EXT_INFO1_ENCAP_TYPE ) | le32_encode_bits(ti->encrypt_type,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 604/783 accel/qaic: Mask out SR-IOV PCI resources
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Youssef Samir <[email protected]>
[ Upstream commit 8685520474bfc0fe4be83c3cbfe3fb3e1ca1514a ]
During the initialization of the qaic device, pci_select_bars() is used to fetch a bitmask of the BARs exposed by the device. On devices that have Virtual Functions capabilities, the bitmask includes SR-IOV BARs.
Use a mask to filter out SR-IOV BARs if they exist.
--- drivers/accel/qaic/qaic_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/qaic/qaic_drv.c +1 -1
@@ -431,7 +431,7 @@ static int init_pci(struct qaic_device *qdev, struct pci_dev *pdev)int bars;int ret; - bars =pci_select_bars (pdev,IORESOURCE_MEM ); + bars =pci_select_bars (pdev,IORESOURCE_MEM ) &0x3f ;/* make sure the device has the expected BARs */ if (bars != (BIT (0 ) |BIT (2 ) |BIT (4 ))) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 605/783 drm/xe/pf: Reset GuC VF config when unprovisioning critical resource
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Wajdeczko <[email protected]>
[ Upstream commit 33f17e2cbd930a2a00eb007d9b241b6db010a880 ]
GuC firmware counts received VF configuration KLVs and may start validation of the complete VF config even if some resources where unprovisioned in the meantime, leading to unexpected errors like:
$ echo 1 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/contexts_quota $ echo 0 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/contexts_quota $ echo 1 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/doorbells_quota $ echo 0 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/doorbells_quota $ echo 1 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/ggtt_quota tee: '/sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/ggtt_quota': Input/output error
To mitigate this problem trigger explicit VF config reset after unprovisioning any of the critical resources (GGTT, context or doorbell IDs) that GuC is monitoring.
--- drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 37 +++++++++++++++++++--- 1 file changed, 33 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c +33 -4
@@ -336,6 +336,26 @@ static int pf_push_full_vf_config(struct xe_gt *gt, unsigned int vfid)return err; } +static int pf_push_vf_cfg (struct xe_gt *gt,unsigned int vfid,bool reset) +{ +int err =0 ; + +xe_gt_assert (gt, vfid); +lockdep_assert_held (xe_gt_sriov_pf_master_mutex (gt)); + +if (reset) + err =pf_send_vf_cfg_reset (gt, vfid); +if (!err) + err =pf_push_full_vf_config (gt, vfid); + +return err; +} + +static int pf_refresh_vf_cfg (struct xe_gt *gt,unsigned int vfid) +{ +return pf_push_vf_cfg (gt, vfid, true); +} +static u64 pf_get_ggtt_alignment (struct xe_gt *gt) {struct xe_device *xe =gt_to_xe (gt);
@@ -432,6 +452,10 @@ static int pf_provision_vf_ggtt(struct xe_gt *gt, unsigned int vfid, u64 size)return err;pf_release_vf_config_ggtt (gt, config); + + err =pf_refresh_vf_cfg (gt, vfid); +if (unlikely (err)) +return err; }xe_gt_assert (gt, !xe_ggtt_node_allocated (config->ggtt_region));
@@ -757,6 +781,10 @@ static int pf_provision_vf_ctxs(struct xe_gt *gt, unsigned int vfid, u32 num_ctxreturn ret;pf_release_config_ctxs (gt, config); + + ret =pf_refresh_vf_cfg (gt, vfid); +if (unlikely (ret)) +return ret; }if (!num_ctxs)
@@ -1054,6 +1082,10 @@ static int pf_provision_vf_dbs(struct xe_gt *gt, unsigned int vfid, u32 num_dbs)return ret;pf_release_config_dbs (gt, config); + + ret =pf_refresh_vf_cfg (gt, vfid); +if (unlikely (ret)) +return ret; }if (!num_dbs)
@@ -2085,10 +2117,7 @@ int xe_gt_sriov_pf_config_push(struct xe_gt *gt, unsigned int vfid, bool refreshxe_gt_assert (gt, vfid);mutex_lock (xe_gt_sriov_pf_master_mutex (gt)); -if (refresh) - err =pf_send_vf_cfg_reset (gt, vfid); -if (!err) - err =pf_push_full_vf_config (gt, vfid); + err =pf_push_vf_cfg (gt, vfid, refresh);mutex_unlock (xe_gt_sriov_pf_master_mutex (gt));if (unlikely (err)) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 606/783 wifi: ath9k: return by of_get_mac_address
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <[email protected]>
[ Upstream commit dfffb317519f88534bb82797f055f0a2fd867e7b ]
When using nvmem, ath9k could potentially be loaded before nvmem, which loads after mtd. This is an issue if DT contains an nvmem mac address.
If nvmem is not ready in time for ath9k, -EPROBE_DEFER is returned. Pass it to _probe so that ath9k can properly grab a potentially present MAC address.
--- drivers/net/wireless/ath/ath9k/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/init.c +3 -1
@@ -647,7 +647,9 @@ static int ath9k_of_init(struct ath_softc *sc) ah->ah_flags |=AH_NO_EEP_SWAP ; } -of_get_mac_address (np, common->macaddr); + ret =of_get_mac_address (np, common->macaddr); +if (ret == -EPROBE_DEFER ) +return ret;return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 607/783 wifi: ath12k: Fetch regdb.bin file from board-2.bin
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaradhana Sahu <[email protected]>
[ Upstream commit 24f587572acf7509127dbdfcbf1b681ef84eeba0 ]
Currently, ath12k_core_fetch_regdb() finds regdb.bin file through board id's but in board-2.bin file regdb.bin file is present with default board id because of which regdb.bin is not fetched.
Add support to fetch regdb.bin file from board-2.bin through default board id.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath12k/core.c +7 -5
@@ -173,7 +173,7 @@ EXPORT_SYMBOL(ath12k_core_resume);static int __ath12k_core_create_board_name (struct ath12k_base *ab,char *name,size_t name_len,bool with_variant, -bool bus_type_mode) +bool bus_type_mode,bool with_default) {/* strlen(',variant=') + strlen(ab->qmi.target.bdf_ext) */ char variant[9 +ATH12K_QMI_BDF_EXT_STR_LENGTH ] = {0 };
@@ -204,7 +204,9 @@ static int __ath12k_core_create_board_name(struct ath12k_base *ab, char *name,"bus=%s,qmi-chip-id=%d,qmi-board-id=%d%s" ,ath12k_bus_str (ab->hif.bus), ab->qmi.target.chip_id, - ab->qmi.target.board_id, variant); + with_default ? +ATH12K_BOARD_ID_DEFAULT : ab->qmi.target.board_id, + variant);break ; }
@@ -216,19 +218,19 @@ static int __ath12k_core_create_board_name(struct ath12k_base *ab, char *name,static int ath12k_core_create_board_name (struct ath12k_base *ab,char *name,size_t name_len) { -return __ath12k_core_create_board_name (ab, name, name_len, true, false); +return __ath12k_core_create_board_name (ab, name, name_len, true, false, false); }static int ath12k_core_create_fallback_board_name (struct ath12k_base *ab,char *name,size_t name_len) { -return __ath12k_core_create_board_name (ab, name, name_len, false, false); +return __ath12k_core_create_board_name (ab, name, name_len, false, false, true); }static int ath12k_core_create_bus_type_board_name (struct ath12k_base *ab,char *name,size_t name_len) { -return __ath12k_core_create_board_name (ab, name, name_len, false, true); +return __ath12k_core_create_board_name (ab, name, name_len, false, true, true); } const struct firmware *ath12k_core_firmware_request(struct ath12k_base *ab,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 608/783 drm/xe/pf: Move VFs reprovisioning to worker
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Wajdeczko <[email protected]>
[ Upstream commit a4d1c5d0b99b75263a5626d2e52d569db3844b33 ]
Since the GuC is reset during GT reset, we need to re-send the entire SR-IOV provisioning configuration to the GuC. But since this whole configuration is protected by the PF master mutex and we can't avoid making allocations under this mutex (like during LMEM provisioning), we can't do this reprovisioning from gt-reset path if we want to be reclaim-safe. Move VFs reprovisioning to a async worker that we will start from the gt-reset path.
--- drivers/gpu/drm/xe/xe_gt_sriov_pf.c | 43 +++++++++++++++++++++-- drivers/gpu/drm/xe/xe_gt_sriov_pf_types.h | 10 ++++++ 2 files changed, 51 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_gt_sriov_pf.c +41 -2
@@ -15,7 +15,11 @@#include "xe_gt_sriov_pf_helpers.h" #include "xe_gt_sriov_pf_migration.h" #include "xe_gt_sriov_pf_service.h" +#include "xe_gt_sriov_printk.h" #include "xe_mmio.h" +#include "xe_pm.h" + +static void pf_worker_restart_func (struct work_struct *w);/* * VF's metadata is maintained in the flexible array where:
@@ -41,6 +45,11 @@ static int pf_alloc_metadata(struct xe_gt *gt)return 0 ; } +static void pf_init_workers (struct xe_gt *gt) +{ +INIT_WORK (>->sriov.pf.workers.restart, pf_worker_restart_func); +} +/** * xe_gt_sriov_pf_init_early - Prepare SR-IOV PF data structures on PF. * @gt: the &xe_gt to initialize
@@ -65,6 +74,8 @@ int xe_gt_sriov_pf_init_early(struct xe_gt *gt)if (err)return err; +pf_init_workers (gt); +return 0 ; }
@@ -161,6 +172,35 @@ void xe_gt_sriov_pf_sanitize_hw(struct xe_gt *gt, unsigned int vfid)pf_clear_vf_scratch_regs (gt, vfid); } +static void pf_restart (struct xe_gt *gt) +{ +struct xe_device *xe =gt_to_xe (gt); + +xe_pm_runtime_get (xe); +xe_gt_sriov_pf_config_restart (gt); +xe_gt_sriov_pf_control_restart (gt); +xe_pm_runtime_put (xe); + +xe_gt_sriov_dbg (gt,"restart completed\n" ); +} + +static void pf_worker_restart_func (struct work_struct *w) +{ +struct xe_gt *gt =container_of (w,typeof (*gt), sriov.pf.workers.restart); + +pf_restart (gt); +} + +static void pf_queue_restart (struct xe_gt *gt) +{ +struct xe_device *xe =gt_to_xe (gt); + +xe_gt_assert (gt,IS_SRIOV_PF (xe)); + +if (!queue_work (xe->sriov.wq, >->sriov.pf.workers.restart)) +xe_gt_sriov_dbg (gt,"restart already in queue!\n" ); +} +/** * xe_gt_sriov_pf_restart - Restart SR-IOV support after a GT reset. * @gt: the &xe_gt
@@ -169,6 +209,5 @@ void xe_gt_sriov_pf_sanitize_hw(struct xe_gt *gt, unsigned int vfid)*/ void xe_gt_sriov_pf_restart (struct xe_gt *gt) { -xe_gt_sriov_pf_config_restart (gt); -xe_gt_sriov_pf_control_restart (gt); +pf_queue_restart (gt); }
drivers/gpu/drm/xe/xe_gt_sriov_pf_types.h +10 -0
@@ -35,8 +35,17 @@ struct xe_gt_sriov_metadata {struct xe_gt_sriov_state_snapshot snapshot; }; +/** +* struct xe_gt_sriov_pf_workers - GT level workers used by the PF. +*/ +struct xe_gt_sriov_pf_workers { +/** @restart: worker that executes actions post GT reset */ +struct work_struct restart; +}; +/** * struct xe_gt_sriov_pf - GT level PF virtualization data. +* @workers: workers data. * @service: service data. * @control: control data. * @policy: policy data.
@@ -45,6 +54,7 @@ struct xe_gt_sriov_metadata {* @vfs: metadata for all VFs. */ struct xe_gt_sriov_pf { +struct xe_gt_sriov_pf_workers workers;struct xe_gt_sriov_pf_service service;struct xe_gt_sriov_pf_control control;struct xe_gt_sriov_pf_policy policy;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 609/783 wifi: ath12k: Fix end offset bit definition in monitor ring descriptor
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: P Praneesh <[email protected]>
[ Upstream commit 6788a666000d600bd8f2e9f991cad9cc805e7f01 ]
End offset for the monitor destination ring descriptor is defined as 16 bits, while the firmware definition specifies only 12 bits. The remaining bits (bit 12 to bit 15) are reserved and may contain junk values, leading to invalid information retrieval. Fix this issue by updating the correct genmask values.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/hal_desc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/hal_desc.h +1 -1
@@ -2968,7 +2968,7 @@ struct hal_mon_buf_ring {#define HAL_MON_DEST_COOKIE_BUF_ID GENMASK(17, 0) -#define HAL_MON_DEST_INFO0_END_OFFSET GENMASK(15, 0) +#define HAL_MON_DEST_INFO0_END_OFFSET GENMASK(11, 0)#define HAL_MON_DEST_INFO0_FLUSH_DETECTED BIT(16)#define HAL_MON_DEST_INFO0_END_OF_PPDU BIT(17)#define HAL_MON_DEST_INFO0_INITIATOR BIT(18)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 610/783 wifi: ath12k: report station mode receive rate for IEEE 802.11be
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lingbo Kong <[email protected]>
[ Upstream commit 5e73276c814fc1a5a1bce6be743e1a07baa6d4bc ]
Currently, the receive rate of EHT of "iw dev xxx station dump" command always show an invalid value.
This is because ath12k does not pass information about the rx_status of EHT to mac80211. So, mac80211 not calculate the receive rate.
To address this issue, add logic for handling rx_status of EHT to the ath12k_dp_rx_h_rate() function.
After that, "iw dev xxx station dump" show the correct receive rate. Such as:
Station 00:03:7f:12:03:03 (on wlo1)
inactive time: 48 ms
rx bytes: 59226
rx packets: 320
tx bytes: 26556
tx packets: 191
tx retries: 99
tx failed: 0
beacon loss: 0
beacon rx: 79
rx drop misc: 68
signal: -95 dBm beacon signal avg: -20 dBm
tx bitrate: 688.2 MBit/s 40MHz EHT-MCS 13 EHT-NSS 2 EHT-GI 0
tx duration: 0 us
rx bitrate: 619.5 MBit/s 40MHz EHT-MCS 8 EHT-NSS 3 EHT-GI 0
This patch affects the station mode of WCN7850 and QCN9274.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/dp_rx.c | 22 ++++++++++++++++++++-- drivers/net/wireless/ath/ath12k/rx_desc.h | 2 ++ 2 files changed, 22 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath12k/dp_rx.c +20 -2
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/ieee80211.h>
@@ -2392,6 +2392,23 @@ static void ath12k_dp_rx_h_rate(struct ath12k *ar, struct hal_rx_desc *rx_desc, rx_status->he_gi =ath12k_he_gi_to_nl80211_he_gi (sgi); rx_status->bw =ath12k_mac_bw_to_mac80211_bw (bw);break ; +case RX_MSDU_START_PKT_TYPE_11BE : + rx_status->rate_idx = rate_mcs; + +if (rate_mcs >ATH12K_EHT_MCS_MAX ) { +ath12k_warn (ar->ab, +"Received with invalid mcs in EHT mode %d\n" , + rate_mcs); +break ; + } + + rx_status->encoding =RX_ENC_EHT ; + rx_status->nss = nss; + rx_status->eht.gi =ath12k_mac_eht_gi_to_nl80211_eht_gi (sgi); + rx_status->bw =ath12k_mac_bw_to_mac80211_bw (bw); +break ; +default : +break ; } }
@@ -2486,7 +2503,7 @@ static void ath12k_dp_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *napspin_unlock_bh (&ab->base_lock); ath12k_dbg(ab, ATH12K_DBG_DATA, - "rx skb %p len %u peer %pM %d %s sn %u %s%s%s%s%s%s%s%s%s rate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", + "rx skb %p len %u peer %pM %d %s sn %u %s%s%s%s%s%s%s%s%s%s rate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", msdu, msdu->len, peer ? peer->addr : NULL,
@@ -2497,6 +2514,7 @@ static void ath12k_dp_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *nap (status->encoding ==RX_ENC_HT ) ?"ht" :"" , (status->encoding ==RX_ENC_VHT ) ?"vht" :"" , (status->encoding ==RX_ENC_HE ) ?"he" :"" , + (status->encoding ==RX_ENC_EHT ) ?"eht" :"" , (status->bw ==RATE_INFO_BW_40 ) ?"40" :"" , (status->bw ==RATE_INFO_BW_80 ) ?"80" :"" , (status->bw == RATE_INFO_BW_160) ? "160" : "",
drivers/net/wireless/ath/ath12k/rx_desc.h +2 -0
@@ -637,6 +637,8 @@ enum rx_msdu_start_pkt_type {RX_MSDU_START_PKT_TYPE_11N ,RX_MSDU_START_PKT_TYPE_11AC ,RX_MSDU_START_PKT_TYPE_11AX , +RX_MSDU_START_PKT_TYPE_11BA , + RX_MSDU_START_PKT_TYPE_11BE, }; enum rx_msdu_start_sgi {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 611/783 wifi: ath12k: report station mode transmit rate
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lingbo Kong <[email protected]>
[ Upstream commit 8a9c06b40882ebea45563059ddc5d57acdec9dda ]
Currently, the transmit rate of "iw dev xxx station dump" command always show an invalid value.
To address this issue, ath12k parse the info of transmit complete report from firmware and indicate the transmit rate to mac80211.
This patch affects the station mode of WCN7850 and QCN9274.
After that, "iw dev xxx station dump" show the correct transmit rate. Such as:
Station 00:03:7f:12:03:03 (on wlo1)
inactive time: 872 ms
rx bytes: 219111
rx packets: 1133
tx bytes: 53767
tx packets: 462
tx retries: 51
tx failed: 0
beacon loss: 0
beacon rx: 403
rx drop misc: 74
signal: -95 dBm beacon signal avg: -18 dBm
tx bitrate: 1441.1 MBit/s 80MHz EHT-MCS 13 EHT-NSS 2 EHT-GI 0
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/core.h | 2 + drivers/net/wireless/ath/ath12k/dp_rx.h | 5 +- drivers/net/wireless/ath/ath12k/dp_tx.c | 139 +++++++++++++++++++++- drivers/net/wireless/ath/ath12k/hal_rx.h | 5 +- drivers/net/wireless/ath/ath12k/hal_tx.h | 10 +- drivers/net/wireless/ath/ath12k/mac.c | 79 ++++++++++++ drivers/net/wireless/ath/ath12k/mac.h | 5 +- drivers/net/wireless/ath/ath12k/rx_desc.h | 3 +- 8 files changed, 238 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath12k/core.h +2 -0
@@ -87,6 +87,7 @@ enum wme_ac {#define ATH12K_HT_MCS_MAX 7#define ATH12K_VHT_MCS_MAX 9#define ATH12K_HE_MCS_MAX 11 +#define ATH12K_EHT_MCS_MAX 15enum ath12k_crypt_mode {/* Only use hardware crypto engine */
@@ -501,6 +502,7 @@ struct ath12k_link_sta {struct ath12k_rx_peer_stats *rx_stats;struct ath12k_wbm_tx_stats *wbm_tx_stats;u32 bw_prev; +u32 peer_nss;/* For now the assoc link will be considered primary */ bool is_assoc_link;
drivers/net/wireless/ath/ath12k/dp_rx.h +4 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_DP_RX_H #define ATH12K_DP_RX_H
@@ -79,6 +79,9 @@ static inline u32 ath12k_he_gi_to_nl80211_he_gi(u8 sgi)case RX_MSDU_START_SGI_3_2_US : ret =NL80211_RATE_INFO_HE_GI_3_2 ;break ; +default : + ret =NL80211_RATE_INFO_HE_GI_0_8 ; +break ; }return ret;
drivers/net/wireless/ath/ath12k/dp_tx.c +135 -4
169 lines not on this page · raw message
drivers/net/wireless/ath/ath12k/hal_rx.h +4 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_HAL_RX_H
@@ -666,6 +666,9 @@ enum nl80211_he_ru_alloc ath12k_he_ru_tones_to_nl80211_he_ru_alloc(u16 ru_tones)case RU_996 : ret =NL80211_RATE_INFO_HE_RU_ALLOC_996 ;break ; +case RU_2X996 : + ret = NL80211_RATE_INFO_HE_RU_ALLOC_2x996; +break ;case RU_26 : fallthrough;default :
drivers/net/wireless/ath/ath12k/hal_tx.h +8 -2
@@ -1,7 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2022, 2024-2025 Qualcomm Innovation Center, Inc. +* All rights reserved. */ #ifndef ATH12K_HAL_TX_H
@@ -63,7 +64,12 @@ struct hal_tx_status {u8 try_cnt;u8 tid;u16 peer_id; -u32 rate_stats; +enum hal_tx_rate_stats_pkt_type pkt_type; +enum hal_tx_rate_stats_sgi sgi; +enum ath12k_supported_bw bw; +u8 mcs; +u16 tones; +u8 ofdma; };#define HAL_TX_PHY_DESC_INFO0_BF_TYPE GENMASK(17, 16)
drivers/net/wireless/ath/ath12k/mac.c +79 -0
97 lines not on this page · raw message
drivers/net/wireless/ath/ath12k/mac.h +4 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_MAC_H
@@ -108,5 +108,8 @@ int ath12k_mac_vdev_stop(struct ath12k_link_vif *arvif);void ath12k_mac_get_any_chanctx_conf_iter (struct ieee80211_hw *hw,struct ieee80211_chanctx_conf *conf,void *data); +u16 ath12k_mac_he_convert_tones_to_ru_tones (u16 tones); +enum nl80211_eht_ru_alloc ath12k_mac_eht_ru_tones_to_nl80211_eht_ru_alloc (u16 ru_tones); +enum nl80211_eht_gi ath12k_mac_eht_gi_to_nl80211_eht_gi (u8 sgi);#endif
drivers/net/wireless/ath/ath12k/rx_desc.h +2 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH12K_RX_DESC_H #define ATH12K_RX_DESC_H
@@ -1548,5 +1548,6 @@ struct hal_rx_desc {#define RU_242 9#define RU_484 18#define RU_996 37 +#define RU_2X996 74#endif /* ATH12K_RX_DESC_H */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 612/783 drm: bridge: adv7511: fill stream capabilities
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Moysan <[email protected]>
[ Upstream commit c852646f12d4cd5b4f19eeec2976c5d98c0382f8 ]
Set no_i2s_capture and no_spdif_capture flags in hdmi_codec_pdata structure to report that the ADV7511 HDMI bridge does not support i2s or spdif audio capture.
--- drivers/gpu/drm/bridge/adv7511/adv7511_audio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/bridge/adv7511/adv7511_audio.c +2 -0
@@ -245,7 +245,9 @@ static const struct hdmi_codec_pdata codec_data = { .ops = &adv7511_codec_ops, .max_i2s_channels = 2, .i2s = 1, + .no_i2s_capture = 1, .spdif = 1, + .no_spdif_capture = 1, };int adv7511_audio_init (struct device *dev,struct adv7511 *adv7511)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 613/783 drm/nouveau: fix the broken marco GSP_MSG_MAX_SIZE
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhi Wang <[email protected]>
[ Upstream commit bbae6680cfe38b033250b483722e60ccd865976f ]
The macro GSP_MSG_MAX_SIZE refers to another macro that doesn't exist. It represents the max GSP message element size.
Fix the broken marco so it can be used to replace some magic numbers in the code.
--- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c +1 -1
@@ -61,7 +61,7 @@extern struct dentry *nouveau_debugfs_root;#define GSP_MSG_MIN_SIZE GSP_PAGE_SIZE -#define GSP_MSG_MAX_SIZE GSP_PAGE_MIN_SIZE * 16 +#define GSP_MSG_MAX_SIZE (GSP_MSG_MIN_SIZE * 16)struct r535_gsp_msg {u8 auth_tag_buffer[16 ];
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 614/783 wifi: ath11k: Use dma_alloc_noncoherent for rx_tid buffer allocation
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: P Praneesh <[email protected]>
[ Upstream commit eeadc6baf8b3dcd32787cc84f0473dc2a2850370 ]
Currently, the driver allocates cacheable DMA buffers for the rx_tid structure using kzalloc() and dma_map_single(). These buffers are long-lived and can persist for the lifetime of the peer, which is not advisable. Instead of using kzalloc() and dma_map_single() for allocating cacheable DMA buffers, utilize the dma_alloc_noncoherent() helper for the allocation of long-lived cacheable DMA buffers, such as the peer's rx_tid. Since dma_alloc_noncoherent() returns unaligned physical and virtual addresses, align them internally before use within the driver. This ensures proper allocation of non-coherent memory through the kernel helper.
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
--- drivers/net/wireless/ath/ath11k/dp.h | 6 +- drivers/net/wireless/ath/ath11k/dp_rx.c | 117 +++++++++++------------- 2 files changed, 58 insertions(+), 65 deletions(-)
drivers/net/wireless/ath/ath11k/dp.h +4 -2
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2023, 2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH11K_DP_H
@@ -20,7 +20,6 @@ struct ath11k_ext_irq_grp;struct dp_rx_tid {u8 tid; -u32 *vaddr;dma_addr_t paddr;u32 size;u32 ba_win_sz;
@@ -37,6 +36,9 @@ struct dp_rx_tid {/* Timer info related to fragments */ struct timer_list frag_timer;struct ath11k_base *ab; +u32 *vaddr_unaligned; +dma_addr_t paddr_unaligned; +u32 unaligned_size; };#define DP_REO_DESC_FREE_THRESHOLD 64
drivers/net/wireless/ath/ath11k/dp_rx.c +54 -63
196 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 615/783 drm/ast: Hide Gens 1 to 3 TX detection in branch
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
[ Upstream commit 87478ba50a05a1f44508316ae109622e8a85adc9 ]
Gen7 only supports ASTDP. Gens 4 to 6 support various TX chips, except ASTDP. These boards detect the TX chips by reading the SoC scratch register as VGACRD1.
Gens 1 to 3 only support SIL164. These boards read the DVO bit from VGACRA3. Hence move this test behind a branch, so that it does not run on later generations.
--- drivers/gpu/drm/ast/ast_main.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/gpu/drm/ast/ast_main.c +15 -15
@@ -96,21 +96,21 @@ static void ast_detect_tx_chip(struct ast_device *ast, bool need_post)/* Check 3rd Tx option (digital output afaik) */ ast->tx_chip =AST_TX_NONE ; -/* -* VGACRA3 Enhanced Color Mode Register, check if DVO is already -* enabled, in that case, assume we have a SIL164 TMDS transmitter -* -* Don't make that assumption if we the chip wasn't enabled and -* is at power-on reset, otherwise we'll incorrectly "detect" a -* SIL164 when there is none. -*/ -if (!need_post) { - jreg =ast_get_index_reg_mask (ast,AST_IO_VGACRI ,0xa3 ,0xff ); -if (jreg &0x80 ) - ast->tx_chip =AST_TX_SIL164 ; - } - -if (IS_AST_GEN4 (ast) ||IS_AST_GEN5 (ast) ||IS_AST_GEN6 (ast)) { +if (AST_GEN (ast) <=3 ) { +/* +* VGACRA3 Enhanced Color Mode Register, check if DVO is already +* enabled, in that case, assume we have a SIL164 TMDS transmitter +* +* Don't make that assumption if we the chip wasn't enabled and +* is at power-on reset, otherwise we'll incorrectly "detect" a +* SIL164 when there is none. +*/ +if (!need_post) { + jreg =ast_get_index_reg_mask (ast,AST_IO_VGACRI ,0xa3 ,0xff ); +if (jreg &0x80 ) + ast->tx_chip =AST_TX_SIL164 ; + } + }else if (IS_AST_GEN4 (ast) ||IS_AST_GEN5 (ast) ||IS_AST_GEN6 (ast)) {/* * On AST GEN4+, look the configuration set by the SoC in * the SOC scratch register #1 bits 11:8 (interestingly marked
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 616/783 drm/xe: Move suballocator init to after display init
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maarten Lankhorst <[email protected]>
[ Upstream commit 380b0cdaa76bc8f5c16db16eaf48751e792ff041 ]
No allocations should be done before we have had a chance to preserve the display fb.
--- drivers/gpu/drm/xe/xe_device.c | 6 ++++++ drivers/gpu/drm/xe/xe_tile.c | 12 ++++++++---- drivers/gpu/drm/xe/xe_tile.h | 1 + 3 files changed, 15 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_device.c +6 -0
@@ -736,6 +736,12 @@ int xe_device_probe(struct xe_device *xe)if (err) goto err; +for_each_tile (tile, xe, id) { + err =xe_tile_init (tile); +if (err) + goto err; + } +for_each_gt (gt, xe, id) { last_gt = id;
drivers/gpu/drm/xe/xe_tile.c +8 -4
@@ -170,15 +170,19 @@ int xe_tile_init_noalloc(struct xe_tile *tile)if (err)return err; - tile->mem.kernel_bb_pool =xe_sa_bo_manager_init (tile,SZ_1M ,16 ); -if (IS_ERR (tile->mem.kernel_bb_pool)) -return PTR_ERR (tile->mem.kernel_bb_pool); -xe_wa_apply_tile_workarounds (tile);return xe_tile_sysfs_init (tile); } +int xe_tile_init (struct xe_tile *tile) +{ + tile->mem.kernel_bb_pool =xe_sa_bo_manager_init (tile,SZ_1M ,16 ); +if (IS_ERR (tile->mem.kernel_bb_pool)) +return PTR_ERR (tile->mem.kernel_bb_pool); + +return 0 ; +}void xe_tile_migrate_wait (struct xe_tile *tile) {xe_migrate_wait (tile->migrate);
drivers/gpu/drm/xe/xe_tile.h +1 -0
@@ -12,6 +12,7 @@ struct xe_tile;int xe_tile_init_early (struct xe_tile *tile,struct xe_device *xe,u8 id);int xe_tile_init_noalloc (struct xe_tile *tile); +int xe_tile_init (struct xe_tile *tile);void xe_tile_migrate_wait (struct xe_tile *tile);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 617/783 drm/xe: Do not attempt to bootstrap VF in execlists mode
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maarten Lankhorst <[email protected]>
[ Upstream commit f3b59457808f61d88178b0afa67cbd017d7ce79e ]
It was mentioned in a review that there is a possibility of choosing to load the module with VF in execlists mode.
Of course this doesn't work, just bomb out as hard as possible.
--- drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/xe/xe_gt_sriov_vf.c +3 -0
@@ -236,6 +236,9 @@ int xe_gt_sriov_vf_bootstrap(struct xe_gt *gt) {int err; +if (!xe_device_uc_enabled (gt_to_xe (gt))) +return -ENODEV ; + err =vf_reset_guc_state (gt);if (unlikely (err))return err;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 618/783 wifi: rtw89: coex: Separated Wi-Fi connecting event from Wi-Fi scan event
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ching-Te Ku <[email protected]>
[ Upstream commit 4a57346652154bb339c48b41166df9154cff33f5 ]
Wi-Fi connecting process don't need to assign to firmware slot control, if assign firmware slot control for Wi-Fi connecting event, firmware will not toggle slots because driver don't tell the slot schedule to firmware. Wi-Fi connecting event end should also cancel the 4way handshake status.
--- drivers/net/wireless/realtek/rtw89/coex.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw89/coex.c +6 -2
@@ -5406,7 +5406,8 @@ static void _action_wl_scan(struct rtw89_dev *rtwdev)struct rtw89_btc_wl_info *wl = &btc->cx.wl;struct rtw89_btc_wl_dbcc_info *wl_dinfo = &wl->dbcc_info; -if (RTW89_CHK_FW_FEATURE (SCAN_OFFLOAD , &rtwdev->fw)) { +if (btc->cx.state_map !=BTC_WLINKING && +RTW89_CHK_FW_FEATURE (SCAN_OFFLOAD , &rtwdev->fw)) {_action_wl_25g_mcc (rtwdev);rtw89_debug (rtwdev,RTW89_DBG_BTC ,"[BTC], Scan offload!\n" ); }else if (rtwdev->dbcc_en) {
@@ -7221,6 +7222,8 @@ void rtw89_btc_ntfy_scan_finish(struct rtw89_dev *rtwdev, u8 phy_idx)_fw_set_drv_info (rtwdev,CXDRVINFO_DBCC ); } + btc->dm.tdma_instant_excute =1 ; +_run_coex (rtwdev,BTC_RSN_NTFY_SCAN_FINISH ); }
@@ -7669,7 +7672,8 @@ void rtw89_btc_ntfy_role_info(struct rtw89_dev *rtwdev,else wl->status.map.connecting =0 ; -if (state ==BTC_ROLE_MSTS_STA_DIS_CONN ) +if (state ==BTC_ROLE_MSTS_STA_DIS_CONN || + state ==BTC_ROLE_MSTS_STA_CONN_END ) wl->status.map._4way = false;_run_coex (rtwdev,BTC_RSN_NTFY_ROLE_INFO );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 619/783 wifi: rtw89: coex: Add protect to avoid A2DP lag while Wi-Fi connecting
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ching-Te Ku <[email protected]>
[ Upstream commit 5251fd321684b591245a072b765d01a6c22a112c ]
To get a well Wi-Fi RF quality, Wi-Fi need to do RF calibrations. While Wi-Fi is doing RF calibrations, driver will pause the Bluetooth traffic to make sure the RF calibration will not be interfered by Bluetooth. However, if the RF calibrations take too much time, Bluetooth audio will perform a lag sound. Add a function to make Bluetooth can do traffic between the individual calibrations to avoid Bluetooth sound lag. And patch related A2DP coexistence mechanism actions.
--- drivers/net/wireless/realtek/rtw89/coex.c | 90 +++++++++++-------- drivers/net/wireless/realtek/rtw89/coex.h | 2 + drivers/net/wireless/realtek/rtw89/core.h | 3 +- drivers/net/wireless/realtek/rtw89/rtw8851b.c | 6 ++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 6 ++ drivers/net/wireless/realtek/rtw89/rtw8852b.c | 6 ++ .../net/wireless/realtek/rtw89/rtw8852bt.c | 6 ++ drivers/net/wireless/realtek/rtw89/rtw8852c.c | 6 ++ 8 files changed, 85 insertions(+), 40 deletions(-)
drivers/net/wireless/realtek/rtw89/coex.c +51 -39
@@ -4587,17 +4587,16 @@ static void _action_bt_a2dp(struct rtw89_dev *rtwdev)_set_ant (rtwdev,NM_EXEC ,BTC_PHY_ALL ,BTC_ANT_W2G ); +if (a2dp.vendor_id ==0x4c || dm->leak_ap || bt_linfo->slave_role) + dm->slot_dur[CXST_W1 ] =20 ; +else + dm->slot_dur[CXST_W1 ] =40 ; + + dm->slot_dur[CXST_B1 ] =BTC_B1_MAX ; +switch (btc->cx.state_map) {case BTC_WBUSY_BNOSCAN :/* wl-busy + bt-A2DP */ -if (a2dp.vendor_id ==0x4c || dm->leak_ap) { - dm->slot_dur[CXST_W1 ] =40 ; - dm->slot_dur[CXST_B1 ] =200 ; -_set_policy (rtwdev, -BTC_CXP_PAUTO_TDW1B1 ,BTC_ACT_BT_A2DP ); - }else { -_set_policy (rtwdev, -BTC_CXP_PAUTO_TD50B1 ,BTC_ACT_BT_A2DP ); - } +_set_policy (rtwdev,BTC_CXP_PAUTO_TDW1B1 ,BTC_ACT_BT_A2DP );break ;case BTC_WBUSY_BSCAN :/* wl-busy + bt-inq + bt-A2DP */ _set_policy (rtwdev,BTC_CXP_PAUTO2_TD3050 ,BTC_ACT_BT_A2DP );
@@ -4607,15 +4606,10 @@ static void _action_bt_a2dp(struct rtw89_dev *rtwdev)break ;case BTC_WSCAN_BNOSCAN :/* wl-scan + bt-A2DP */ case BTC_WLINKING :/* wl-connecting + bt-A2DP */ -if (a2dp.vendor_id ==0x4c || dm->leak_ap) { - dm->slot_dur[CXST_W1 ] =40 ; - dm->slot_dur[CXST_B1 ] =200 ; -_set_policy (rtwdev,BTC_CXP_AUTO_TDW1B1 , -BTC_ACT_BT_A2DP ); - }else { -_set_policy (rtwdev,BTC_CXP_AUTO_TD50B1 , -BTC_ACT_BT_A2DP ); - } +if (btc->cx.wl.rfk_info.con_rfk) +_set_policy (rtwdev,BTC_CXP_OFF_BT ,BTC_ACT_BT_A2DP ); +else +_set_policy (rtwdev,BTC_CXP_AUTO_TDW1B1 ,BTC_ACT_BT_A2DP );break ;case BTC_WIDLE :/* wl-idle + bt-A2DP */ _set_policy (rtwdev,BTC_CXP_AUTO_TD20B1 ,BTC_ACT_BT_A2DP );
@@ -4643,7 +4637,10 @@ static void _action_bt_a2dpsink(struct rtw89_dev *rtwdev)_set_policy (rtwdev,BTC_CXP_FIX_TD2060 ,BTC_ACT_BT_A2DPSINK );break ;case BTC_WLINKING :/* wl-connecting + bt-A2dp_Sink */ -_set_policy (rtwdev,BTC_CXP_FIX_TD3030 ,BTC_ACT_BT_A2DPSINK ); +if (btc->cx.wl.rfk_info.con_rfk) +_set_policy (rtwdev,BTC_CXP_OFF_BT ,BTC_ACT_BT_A2DPSINK ); +else +_set_policy (rtwdev,BTC_CXP_FIX_TD3030 ,BTC_ACT_BT_A2DPSINK );break ;case BTC_WIDLE :/* wl-idle + bt-A2dp_Sink */ _set_policy (rtwdev,BTC_CXP_FIX_TD2080 ,BTC_ACT_BT_A2DPSINK );
@@ -4697,21 +4694,20 @@ static void _action_bt_a2dp_hid(struct rtw89_dev *rtwdev)_set_ant (rtwdev,NM_EXEC ,BTC_PHY_ALL ,BTC_ANT_W2G ); +if (a2dp.vendor_id ==0x4c || dm->leak_ap || bt_linfo->slave_role) + dm->slot_dur[CXST_W1 ] =20 ; +else + dm->slot_dur[CXST_W1 ] =40 ; + + dm->slot_dur[CXST_B1 ] =BTC_B1_MAX ; +switch (btc->cx.state_map) {case BTC_WBUSY_BNOSCAN :/* wl-busy + bt-A2DP+HID */ case BTC_WIDLE :/* wl-idle + bt-A2DP */ -if (a2dp.vendor_id ==0x4c || dm->leak_ap) { - dm->slot_dur[CXST_W1 ] =40 ; - dm->slot_dur[CXST_B1 ] =200 ; -_set_policy (rtwdev, -BTC_CXP_PAUTO_TDW1B1 ,BTC_ACT_BT_A2DP_HID ); - }else { -_set_policy (rtwdev, -BTC_CXP_PAUTO_TD50B1 ,BTC_ACT_BT_A2DP_HID ); - } +_set_policy (rtwdev,BTC_CXP_PAUTO_TDW1B1 ,BTC_ACT_BT_A2DP_HID );break ;case BTC_WBUSY_BSCAN :/* wl-busy + bt-inq + bt-A2DP+HID */ -_set_policy (rtwdev,BTC_CXP_PAUTO2_TD3050 ,BTC_ACT_BT_A2DP_HID ); +_set_policy (rtwdev,BTC_CXP_PAUTO2_TD3070 ,BTC_ACT_BT_A2DP_HID );break ;case BTC_WSCAN_BSCAN :/* wl-scan + bt-inq + bt-A2DP+HID */
@@ -4719,15 +4715,10 @@ static void _action_bt_a2dp_hid(struct rtw89_dev *rtwdev)break ;case BTC_WSCAN_BNOSCAN :/* wl-scan + bt-A2DP+HID */ case BTC_WLINKING :/* wl-connecting + bt-A2DP+HID */ -if (a2dp.vendor_id ==0x4c || dm->leak_ap) { - dm->slot_dur[CXST_W1 ] =40 ; - dm->slot_dur[CXST_B1 ] =200 ; -_set_policy (rtwdev,BTC_CXP_AUTO_TDW1B1 , -BTC_ACT_BT_A2DP_HID ); - }else { -_set_policy (rtwdev,BTC_CXP_AUTO_TD50B1 , -BTC_ACT_BT_A2DP_HID ); - } +if (btc->cx.wl.rfk_info.con_rfk) +_set_policy (rtwdev,BTC_CXP_OFF_BT ,BTC_ACT_BT_A2DP_HID ); +else +_set_policy (rtwdev,BTC_CXP_AUTO_TDW1B1 ,BTC_ACT_BT_A2DP_HID );break ; } }
@@ -7001,7 +6992,7 @@ void _run_coex(struct rtw89_dev *rtwdev, enum btc_reason_and_action reason) goto exit; } -if (wl->status.val & btc_scanning_map.val) { +if (wl->status.val & btc_scanning_map.val && !wl->rfk_info.con_rfk) {_action_wl_scan (rtwdev); bt->scan_rx_low_pri = true; goto exit;
@@ -11040,3 +11031,24 @@ void rtw89_coex_recognize_ver(struct rtw89_dev *rtwdev)rtw89_debug (rtwdev,RTW89_DBG_BTC ,"[BTC] use version def[%d] = 0x%08x\n" , (int )(btc->ver - rtw89_btc_ver_defs), btc->ver->fw_ver_code); } + +void rtw89_btc_ntfy_preserve_bt_time (struct rtw89_dev *rtwdev,u32 ms) +{ +struct rtw89_btc_bt_link_info *bt_linfo = &rtwdev->btc.cx.bt.link_info; +struct rtw89_btc_bt_a2dp_desc a2dp = bt_linfo->a2dp_desc; + +if (test_bit (RTW89_FLAG_SER_HANDLING , rtwdev->flags)) +return ; + +if (!a2dp.exist) +return ; + +fsleep (ms *1000 ); +} +EXPORT_SYMBOL (rtw89_btc_ntfy_preserve_bt_time); + +void rtw89_btc_ntfy_conn_rfk (struct rtw89_dev *rtwdev,bool state) +{ + rtwdev->btc.cx.wl.rfk_info.con_rfk = state; +} +EXPORT_SYMBOL (rtw89_btc_ntfy_conn_rfk);
drivers/net/wireless/realtek/rtw89/coex.h +2 -0
@@ -290,6 +290,8 @@ void rtw89_coex_power_on(struct rtw89_dev *rtwdev);void rtw89_btc_set_policy (struct rtw89_dev *rtwdev,u16 policy_type);void rtw89_btc_set_policy_v1 (struct rtw89_dev *rtwdev,u16 policy_type);void rtw89_coex_recognize_ver (struct rtw89_dev *rtwdev); +void rtw89_btc_ntfy_preserve_bt_time (struct rtw89_dev *rtwdev,u32 ms); +void rtw89_btc_ntfy_conn_rfk (struct rtw89_dev *rtwdev,bool state); static inline u8 rtw89_btc_phymap(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx,
drivers/net/wireless/realtek/rtw89/core.h +2 -1
@@ -1762,7 +1762,8 @@ struct rtw89_btc_wl_rfk_info { u32 phy_map: 2; u32 band: 2; u32 type: 8; - u32 rsvd: 14; + u32 con_rfk: 1; + u32 rsvd: 13;u32 start_time;u32 proc_time;
drivers/net/wireless/realtek/rtw89/rtw8851b.c +6 -0
@@ -1596,10 +1596,16 @@ static void rtw8851b_rfk_channel(struct rtw89_dev *rtwdev,enum rtw89_chanctx_idx chanctx_idx = rtwvif_link->chanctx_idx;enum rtw89_phy_idx phy_idx = rtwvif_link->phy_idx; +rtw89_btc_ntfy_conn_rfk (rtwdev, true); +rtw8851b_rx_dck (rtwdev, phy_idx, chanctx_idx);rtw8851b_iqk (rtwdev, phy_idx, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8851b_tssi (rtwdev, phy_idx, true, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8851b_dpk (rtwdev, phy_idx, chanctx_idx); + +rtw89_btc_ntfy_conn_rfk (rtwdev, false); } static void rtw8851b_rfk_band_changed(struct rtw89_dev *rtwdev,
drivers/net/wireless/realtek/rtw89/rtw8852a.c +6 -0
@@ -1356,10 +1356,16 @@ static void rtw8852a_rfk_channel(struct rtw89_dev *rtwdev,enum rtw89_chanctx_idx chanctx_idx = rtwvif_link->chanctx_idx;enum rtw89_phy_idx phy_idx = rtwvif_link->phy_idx; +rtw89_btc_ntfy_conn_rfk (rtwdev, true); +rtw8852a_rx_dck (rtwdev, phy_idx, true, chanctx_idx);rtw8852a_iqk (rtwdev, phy_idx, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8852a_tssi (rtwdev, phy_idx, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8852a_dpk (rtwdev, phy_idx, chanctx_idx); + +rtw89_btc_ntfy_conn_rfk (rtwdev, false); } static void rtw8852a_rfk_band_changed(struct rtw89_dev *rtwdev,
drivers/net/wireless/realtek/rtw89/rtw8852b.c +6 -0
@@ -568,10 +568,16 @@ static void rtw8852b_rfk_channel(struct rtw89_dev *rtwdev,enum rtw89_chanctx_idx chanctx_idx = rtwvif_link->chanctx_idx;enum rtw89_phy_idx phy_idx = rtwvif_link->phy_idx; +rtw89_btc_ntfy_conn_rfk (rtwdev, true); +rtw8852b_rx_dck (rtwdev, phy_idx, chanctx_idx);rtw8852b_iqk (rtwdev, phy_idx, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8852b_tssi (rtwdev, phy_idx, true, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8852b_dpk (rtwdev, phy_idx, chanctx_idx); + +rtw89_btc_ntfy_conn_rfk (rtwdev, false); } static void rtw8852b_rfk_band_changed(struct rtw89_dev *rtwdev,
drivers/net/wireless/realtek/rtw89/rtw8852bt.c +6 -0
@@ -541,10 +541,16 @@ static void rtw8852bt_rfk_channel(struct rtw89_dev *rtwdev,enum rtw89_chanctx_idx chanctx_idx = rtwvif_link->chanctx_idx;enum rtw89_phy_idx phy_idx = rtwvif_link->phy_idx; +rtw89_btc_ntfy_conn_rfk (rtwdev, true); +rtw8852bt_rx_dck (rtwdev, phy_idx, chanctx_idx);rtw8852bt_iqk (rtwdev, phy_idx, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8852bt_tssi (rtwdev, phy_idx, true, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8852bt_dpk (rtwdev, phy_idx, chanctx_idx); + +rtw89_btc_ntfy_conn_rfk (rtwdev, false); } static void rtw8852bt_rfk_band_changed(struct rtw89_dev *rtwdev,
drivers/net/wireless/realtek/rtw89/rtw8852c.c +6 -0
@@ -1853,10 +1853,16 @@ static void rtw8852c_rfk_channel(struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy_idx = rtwvif_link->phy_idx;rtw8852c_mcc_get_ch_info (rtwdev, phy_idx); +rtw89_btc_ntfy_conn_rfk (rtwdev, true); +rtw8852c_rx_dck (rtwdev, phy_idx, false);rtw8852c_iqk (rtwdev, phy_idx, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8852c_tssi (rtwdev, phy_idx, chanctx_idx); +rtw89_btc_ntfy_preserve_bt_time (rtwdev,30 );rtw8852c_dpk (rtwdev, phy_idx, chanctx_idx); + +rtw89_btc_ntfy_conn_rfk (rtwdev, false);rtw89_fw_h2c_rf_ntfy_mcc (rtwdev); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 620/783 drm/xe/sa: Always call drm_suballoc_manager_fini()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Wajdeczko <[email protected]>
[ Upstream commit 9cd3f4efc870463f17f6c29114c61fb6bfcaa291 ]
After successful call to drm_suballoc_manager_init() we should make sure to call drm_suballoc_manager_fini() as it may include some cleanup code even if we didn't start using it for real.
As we can abort init() early due to kvzalloc() failure, we should either explicitly call drm_suballoc_manager_fini() or, even better, postpone drm_suballoc_manager_init() once we finish all other preparation steps, so we can rely on fini() that will do cleanup.
--- drivers/gpu/drm/xe/xe_sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_sa.c +1 -2
@@ -57,8 +57,6 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32 } sa_manager->bo = bo; sa_manager->is_iomem = bo->vmap.is_iomem; - -drm_suballoc_manager_init (&sa_manager->base, managed_size, align); sa_manager->gpu_addr =xe_bo_ggtt_addr (bo);if (bo->vmap.is_iomem) {
@@ -72,6 +70,7 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32memset (sa_manager->cpu_ptr,0 , bo->ttm.base.size); } +drm_suballoc_manager_init (&sa_manager->base, managed_size, align); ret =drmm_add_action_or_reset (&xe->drm, xe_sa_bo_manager_fini, sa_manager);if (ret)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 621/783 drm/xe/vf: Perform early GT MMIO initialization to read GMDID
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Wajdeczko <[email protected]>
[ Upstream commit 13265fe7426ec9ba5aa86baab913417ca361e8a4 ]
VFs need to communicate with the GuC to obtain the GMDID value and existing GuC functions used for that assume that the GT has it's MMIO members already setup. However, due to recent refactoring the gt->mmio is initialized later, and any attempt by the VF to use xe_mmio_read|write() from GuC functions will lead to NPD crash due to unset MMIO register address:
[] xe 0000:00:02.1: [drm] Running in SR-IOV VF mode
[] xe 0000:00:02.1: [drm] GT0: sending H2G MMIO 0x5507 [] BUG: unable to handle page fault for address: 0000000000190240
Since we are already tweaking the id and type of the primary GT to mimic it's a Media GT before initializing the GuC communication, we can also call xe_gt_mmio_init() to perform early setup of the gt->mmio which will make those GuC functions work again.
--- drivers/gpu/drm/xe/xe_pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/xe/xe_pci.c +1 -0
@@ -490,6 +490,7 @@ static void read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, gt->info.type =XE_GT_TYPE_MAIN ; } +xe_gt_mmio_init (gt);xe_guc_comm_init_early (>->uc.guc);/* Don't bother with GMDID if failed to negotiate the GuC ABI */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 622/783 drm/xe: Always setup GT MMIO adjustment data
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Wajdeczko <[email protected]>
[ Upstream commit bbd8429264baf8bc3c40cefda048560ae0eb7890 ]
While we believed that xe_gt_mmio_init() will be called just once per GT, this might not be a case due to some tweaks that need to performed by the VF driver during early probe. To avoid leaving any stale data in case of the re-run, reset the GT MMIO adjustment data for the non-media GT case.
--- drivers/gpu/drm/xe/xe_gt.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/xe/xe_gt.c +3 -0
@@ -650,6 +650,9 @@ void xe_gt_mmio_init(struct xe_gt *gt)if (gt->info.type ==XE_GT_TYPE_MEDIA ) { gt->mmio.adj_offset =MEDIA_GT_GSI_OFFSET ; gt->mmio.adj_limit =MEDIA_GT_GSI_LENGTH ; + }else { + gt->mmio.adj_offset =0 ; + gt->mmio.adj_limit =0 ; }if (IS_SRIOV_VF (gt_to_xe (gt)))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 623/783 drm/xe/guc: Drop error messages about missing GuC logs
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Harrison <[email protected]>
[ Upstream commit 174e9ce0daf6af791386e96e76e743eb59e8a401 ]
The GuC log snapshot code would complain loudly if there was no GuC log to take a snapshot of or if the snapshot alloc failed. Originally, this code was only called on demand when a user (or developer) explicitly requested a dump of the log. Hence an error message was useful.
However, it is now part of the general devcoredump file and is called for any GPU hang. Most people don't care about GuC logs and GPU hangs do not generally mean a kernel/GuC bug. More importantly, there are valid situations where there is no GuC log, e.g. SRIOV VFs.
So drop the error message.
--- drivers/gpu/drm/xe/xe_guc_log.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/xe/xe_guc_log.c +2 -6
@@ -149,16 +149,12 @@ struct xe_guc_log_snapshot *xe_guc_log_snapshot_capture(struct xe_guc_log *log,size_t remain;int i; -if (!log->bo) { -xe_gt_err (gt,"GuC log buffer not allocated\n" ); +if (!log->bo)return NULL ; - } snapshot =xe_guc_log_snapshot_alloc (log, atomic); -if (!snapshot) { -xe_gt_err (gt,"GuC log snapshot not allocated\n" ); +if (!snapshot)return NULL ; - } remain = snapshot->size;for (i =0 ; i < snapshot->num_chunks; i++) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 624/783 drm/xe: Reject BO eviction if BO is bound to current VM
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oak Zeng <[email protected]>
[ Upstream commit 0af944f0e3082ff517958b1cea76fb9b8cb379dd ]
This is a follow up fix for
https://patchwork.freedesktop.org/patch/msgid/[email protected]
The overall goal is to fail vm_bind when there is memory pressure. See more details in the commit message of above patch. Abbove patch fixes the issue when user pass in a vm_id parameter during gem_create. If user doesn't pass in a vm_id during gem_create, above patch doesn't help.
This patch further reject BO eviction (which could be triggered by bo validation) if BO is bound to the current VM. vm_bind could fail due to the eviction failure. The BO to VM reverse mapping structure is used to determine whether BO is bound to VM.
v2:
Move vm_bo definition from function scope to if(evict) clause (Thomas) Further constraint the condition by adding ctx->resv (Thomas) Add a short comment describe the change.
--- drivers/gpu/drm/xe/xe_bo.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/xe/xe_bo.c +15 -0
@@ -713,6 +713,21 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict, goto out; } +/* Reject BO eviction if BO is bound to current VM. */ +if (evict && ctx->resv) { +struct drm_gpuvm_bo *vm_bo; + +drm_gem_for_each_gpuvm_bo (vm_bo, &bo->ttm.base) { +struct xe_vm *vm =gpuvm_to_vm (vm_bo->vm); + +if (xe_vm_resv (vm) == ctx->resv && +xe_vm_in_preempt_fence_mode (vm)) { + ret = -EBUSY ; + goto out; + } + } + } +/* * Failed multi-hop where the old_mem is still marked as * TTM_PL_FLAG_TEMPORARY, should just be a dummy move.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 625/783 drm/atomic: clarify the rules around drm_atomic_state->allow_modeset
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simona Vetter <[email protected]>
[ Upstream commit c5e3306a424b52e38ad2c28c7f3399fcd03e383d ]
msm is automagically upgrading normal commits to full modesets, and that's a big no-no:
- for one this results in full on->off->on transitions on all these crtc, at least if you're using the usual helpers. Which seems to be the case, and is breaking uapi
- further even if the ctm change itself would not result in flicker, this can hide modesets for other reasons. Which again breaks the uapi
v2: I forgot the case of adding unrelated crtc state. Add that case and link to the existing kerneldoc explainers. This has come up in an irc discussion with Manasi and Ville about intel's bigjoiner mode. Also cc everyone involved in the msm irc discussion, more people joined after I sent out v1.
v3: Wording polish from Pekka and Thomas
--- include/drm/drm_atomic.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
include/drm/drm_atomic.h +21 -2
@@ -376,8 +376,27 @@ struct drm_atomic_state {* * Allow full modeset. This is used by the ATOMIC IOCTL handler to * implement the DRM_MODE_ATOMIC_ALLOW_MODESET flag. Drivers should -* never consult this flag, instead looking at the output of -* drm_atomic_crtc_needs_modeset(). +* generally not consult this flag, but instead look at the output of +* drm_atomic_crtc_needs_modeset(). The detailed rules are: +* +* - Drivers must not consult @allow_modeset in the atomic commit path. +* Use drm_atomic_crtc_needs_modeset() instead. +* +* - Drivers must consult @allow_modeset before adding unrelated struct +* drm_crtc_state to this commit by calling +* drm_atomic_get_crtc_state(). See also the warning in the +* documentation for that function. +* +* - Drivers must never change this flag, it is under the exclusive +* control of userspace. +* +* - Drivers may consult @allow_modeset in the atomic check path, if +* they have the choice between an optimal hardware configuration +* which requires a modeset, and a less optimal configuration which +* can be committed without a modeset. An example would be suboptimal +* scanout FIFO allocation resulting in increased idle power +* consumption. This allows userspace to avoid flickering and delays +* for the normal composition loop at reasonable cost. */ bool allow_modeset : 1;/**
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 626/783 drm/buddy: fix issue that force_merge cannot free all roots
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin.Cao <[email protected]>
[ Upstream commit 467dce3817bd2b62ccd6fcfd7aae76f242ac907e ]
If buddy manager have more than one roots and each root have sub-block need to be free. When drm_buddy_fini called, the first loop of force_merge will merge and free all of the sub block of first root, which offset is 0x0 and size is biggest(more than have of the mm size). In subsequent force_merge rounds, if we use 0 as start and use remaining mm size as end, the block of other roots will be skipped in __force_merge function. It will cause the other roots can not be freed.
Solution: use roots' offset as the start could fix this issue.
--- drivers/gpu/drm/drm_buddy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_buddy.c +3 -2
@@ -324,7 +324,7 @@ EXPORT_SYMBOL(drm_buddy_init);*/ void drm_buddy_fini (struct drm_buddy *mm) { -u64 root_size, size; +u64 root_size, size, start;unsigned int order;int i;
@@ -332,7 +332,8 @@ void drm_buddy_fini(struct drm_buddy *mm)for (i =0 ; i < mm->n_roots; ++i) { order =ilog2 (size) -ilog2 (mm->chunk_size); -__force_merge (mm,0 , size, order); + start =drm_buddy_block_offset (mm->roots[i]); +__force_merge (mm, start, start + size, order);WARN_ON (!drm_buddy_block_is_free (mm->roots[i]));drm_block_free (mm, mm->roots[i]);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 627/783 drm/xe: Add locks in gtidle code
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vinay Belgaumkar <[email protected]>
[ Upstream commit d160dc6f53914d729be7fcb7afbd0e9e6a3725b2 ]
The update of the residency values needs to be protected by a lock to avoid multiple entrypoints, for example when multiple userspace clients read the sysfs file. Other in-kernel clients are going to be added to sample these values, making the problem worse. Protect those updates with a raw_spinlock so it can be called by future integration with perf pmu.
--- drivers/gpu/drm/xe/xe_gt_idle.c | 23 ++++++++++++++++++++--- drivers/gpu/drm/xe/xe_gt_idle.h | 1 + drivers/gpu/drm/xe/xe_gt_idle_types.h | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/xe_gt_idle.c +20 -3
@@ -69,6 +69,8 @@ static u64 get_residency_ms(struct xe_gt_idle *gtidle, u64 cur_residency) {u64 delta, overflow_residency, prev_residency; +lockdep_assert_held (>idle->lock); + overflow_residency =BIT_ULL (32 );/*
@@ -275,8 +277,21 @@ static ssize_t idle_status_show(struct device *dev,return sysfs_emit (buff,"%s\n" ,gt_idle_state_to_string (state)); } -static DEVICE_ATTR_RO (idle_status); +u64 xe_gt_idle_residency_msec (struct xe_gt_idle *gtidle) +{ +struct xe_guc_pc *pc =gtidle_to_pc (gtidle); +u64 residency; +unsigned long flags; + +raw_spin_lock_irqsave (>idle->lock, flags); + residency =get_residency_ms (gtidle, gtidle->idle_residency (pc)); +raw_spin_unlock_irqrestore (>idle->lock, flags); + +return residency; +} + +static DEVICE_ATTR_RO (idle_status);static ssize_t idle_residency_ms_show (struct device *dev,struct device_attribute *attr,char *buff) {
@@ -285,10 +300,10 @@ static ssize_t idle_residency_ms_show(struct device *dev,u64 residency;xe_pm_runtime_get (pc_to_xe (pc)); - residency = gtidle->idle_residency (pc); + residency =xe_gt_idle_residency_msec (gtidle);xe_pm_runtime_put (pc_to_xe (pc)); -return sysfs_emit (buff,"%llu\n" ,get_residency_ms (gtidle, residency)); +return sysfs_emit (buff,"%llu\n" , residency); }static DEVICE_ATTR_RO (idle_residency_ms);
@@ -331,6 +346,8 @@ int xe_gt_idle_init(struct xe_gt_idle *gtidle)if (!kobj)return -ENOMEM ; +raw_spin_lock_init (>idle->lock); +if (xe_gt_is_media_type (gt)) {snprintf (gtidle->name,sizeof (gtidle->name),"gt%d-mc" , gt->info.id); gtidle->idle_residency = xe_guc_pc_mc6_residency;
drivers/gpu/drm/xe/xe_gt_idle.h +1 -0
@@ -17,5 +17,6 @@ void xe_gt_idle_disable_c6(struct xe_gt *gt);void xe_gt_idle_enable_pg (struct xe_gt *gt);void xe_gt_idle_disable_pg (struct xe_gt *gt);int xe_gt_idle_pg_print (struct xe_gt *gt,struct drm_printer *p); +u64 xe_gt_idle_residency_msec (struct xe_gt_idle *gtidle);#endif /* _XE_GT_IDLE_H_ */
drivers/gpu/drm/xe/xe_gt_idle_types.h +3 -0
@@ -6,6 +6,7 @@#ifndef _XE_GT_IDLE_SYSFS_TYPES_H_#define _XE_GT_IDLE_SYSFS_TYPES_H_ +#include <linux/spinlock.h> #include <linux/types.h> struct xe_guc_pc ;
@@ -31,6 +32,8 @@ struct xe_gt_idle {u64 cur_residency;/** @prev_residency: previous residency counter */ u64 prev_residency; +/** @lock: Lock protecting idle residency counters */ +raw_spinlock_t lock;/** @idle_status: get the current idle state */ enum xe_gt_idle_state (*idle_status)(struct xe_guc_pc *pc);/** @idle_residency: get idle residency counter */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 628/783 drm/panel-edp: Add Starry 116KHD024006
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 749b5b279e5636cdcef51e15d67b77162cca6caa ]
We have a few reports of sc7180-trogdor-pompom devices that have a panel in them that IDs as STA 0x0004 and has the following raw EDID:
00 ff ff ff ff ff ff 00 4e 81 04 00 00 00 00 00 10 20 01 04 a5 1a 0e 78 0a dc dd 96 5b 5b 91 28 1f 52 54 00 00 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 8e 1c 56 a0 50 00 1e 30 28 20 55 00 00 90 10 00 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fe 00 31 31 36 4b 48 44 30 32 34 30 30 36 0a 00 e6
We've been unable to locate a datasheet for this panel and our partner has not been responsive, but all Starry eDP datasheets that we can find agree on the same timing (delay_100_500_e200) so it should be safe to use that here instead of the super conservative timings. We'll still go a little extra conservative and allow hpd_absent of 200 instead of 100 because that won't add any real-world delay in most cases.
We'll associate the string from the EDID ("116KHD024006") with this panel. Given that the ID is the suspicious value of 0x0004 it seems likely that Starry doesn't always update their IDs but the string will still work to differentiate if we ever need to in the future.
--- drivers/gpu/drm/panel/panel-edp.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/panel/panel-edp.c +1 -0
@@ -1993,6 +1993,7 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('S' ,'H' ,'P' ,0x154c , &delay_200_500_p2e100,"LQ116M1JW10" ),EDP_PANEL_ENTRY ('S' ,'H' ,'P' ,0x1593 , &delay_200_500_p2e100,"LQ134N1" ), +EDP_PANEL_ENTRY ('S' ,'T' ,'A' ,0x0004 , &delay_200_500_e200,"116KHD024006" ), EDP_PANEL_ENTRY('S', 'T', 'A', 0x0100, &delay_100_500_e200, "2081116HHD028001-51D"), { /* sentinal */ }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 629/783 drm: Add valid clones check
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jessica Zhang <[email protected]>
[ Upstream commit 41b4b11da02157c7474caf41d56baae0e941d01a ]
Check that all encoders attached to a given CRTC are valid possible_clones of each other.
--- drivers/gpu/drm/drm_atomic_helper.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/gpu/drm/drm_atomic_helper.c +28 -0
@@ -574,6 +574,30 @@ mode_valid(struct drm_atomic_state *state)return 0 ; } +static int drm_atomic_check_valid_clones (struct drm_atomic_state *state, +struct drm_crtc *crtc) +{ +struct drm_encoder *drm_enc; +struct drm_crtc_state *crtc_state =drm_atomic_get_new_crtc_state (state, + crtc); + +drm_for_each_encoder_mask (drm_enc, crtc->dev, crtc_state->encoder_mask) { +if (!drm_enc->possible_clones) { +DRM_DEBUG ("enc%d possible_clones is 0\n" , drm_enc->base.id); +continue ; + } + +if ((crtc_state->encoder_mask & drm_enc->possible_clones) != + crtc_state->encoder_mask) { +DRM_DEBUG ("crtc%d failed valid clone check for mask 0x%x\n" , + crtc->base.id, crtc_state->encoder_mask); +return -EINVAL ; + } + } + +return 0 ; +} +/** * drm_atomic_helper_check_modeset - validate state object for modeset changes * @dev: DRM device
@@ -745,6 +769,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, ret =drm_atomic_add_affected_planes (state, crtc);if (ret !=0 )return ret; + + ret =drm_atomic_check_valid_clones (state, crtc); +if (ret !=0 ) +return ret; }/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 630/783 i3c: master: svc: Fix implicit fallthrough in svc_i3c_master_ibi_work()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
[ Upstream commit e8d2d287e26d9bd9114cf258a123a6b70812442e ]
Clang warns (or errors with CONFIG_WERROR=y):
drivers/i3c/master/svc-i3c-master.c:596:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
596 | default:
| ^
drivers/i3c/master/svc-i3c-master.c:596:2: note: insert 'break;' to avoid fall-through
596 | default:
| ^
| break;1 error generated.
Clang is a little more pedantic than GCC, which does not warn when falling through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst, which states that all switch/case blocks must end in either break, fallthrough, continue, goto, or return. Add the missing break to silence the warning.
--- drivers/i3c/master/svc-i3c-master.c | 1 + 1 file changed, 1 insertion(+)
drivers/i3c/master/svc-i3c-master.c +1 -0
@@ -552,6 +552,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work)break ;case SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST :svc_i3c_master_emit_stop (master); +break ;default :break ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 631/783 ASoC: sma1307: Fix error handling in sma1307_setting_loaded()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 012a6efcc805308b1d90a1056ba963eb08858645 ]
There are a couple bugs in this code:
1) The cleanup code calls kfree(sma1307->set.header) and kfree(sma1307->set.def) but those functions were allocated using devm_kzalloc(). It results in a double free. Delete all these kfree() calls.
2) A missing call to kfree(data) if the checksum was wrong on this error path:
if ((sma1307->set.checksum >> 8) != SMA1307_SETTING_CHECKSUM) { Since the "data" pointer is supposed to be freed on every return, I changed that to use the __free(kfree) cleanup attribute.
--- sound/soc/codecs/sma1307.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
sound/soc/codecs/sma1307.c +2 -9
@@ -1710,7 +1710,7 @@ static void sma1307_check_fault_worker(struct work_struct *work)static void sma1307_setting_loaded (struct sma1307_priv *sma1307,const char *file) {const struct firmware *fw; -int *data, size, offset, num_mode; +int size, offset, num_mode;int ret; ret =request_firmware (&fw, file, sma1307->dev);
@@ -1727,7 +1727,7 @@ static void sma1307_setting_loaded(struct sma1307_priv *sma1307, const char *filreturn ; } - data =kzalloc (fw->size,GFP_KERNEL ); + int *data __free(kfree) = kzalloc(fw->size, GFP_KERNEL);if (!data) {release_firmware (fw); sma1307->set.status = false;
@@ -1747,7 +1747,6 @@ static void sma1307_setting_loaded(struct sma1307_priv *sma1307, const char *fil sma1307->set.header_size, GFP_KERNEL);if (!sma1307->set.header) { -kfree (data); sma1307->set.status = false;return ; }
@@ -1768,8 +1767,6 @@ static void sma1307_setting_loaded(struct sma1307_priv *sma1307, const char *fil = devm_kzalloc(sma1307->dev, sma1307->set.def_size *sizeof (int ),GFP_KERNEL );if (!sma1307->set.def) { -kfree (data); -kfree (sma1307->set.header); sma1307->set.status = false;return ; }
@@ -1787,9 +1784,6 @@ static void sma1307_setting_loaded(struct sma1307_priv *sma1307, const char *fil sma1307->set.mode_size *2 *sizeof (int ), GFP_KERNEL);if (!sma1307->set.mode_set[i]) { -kfree (data); -kfree (sma1307->set.header); -kfree (sma1307->set.def);for (int j =0 ; j < i; j++)kfree (sma1307->set.mode_set[j]); sma1307->set.status = false;
@@ -1804,7 +1798,6 @@ static void sma1307_setting_loaded(struct sma1307_priv *sma1307, const char *fil } } -kfree (data); sma1307->set.status = true; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 632/783 pinctrl: tegra: Fix off by one in tegra_pinctrl_get_group()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 5a062c3c3b82004766bc3ece82b594d337076152 ]
This should be >= pmx->soc->ngroups instead of > to avoid an out of bounds access. The pmx->soc->groups[] array is allocated in tegra_pinctrl_probe().
--- drivers/pinctrl/tegra/pinctrl-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/tegra/pinctrl-tegra.c +1 -1
@@ -305,7 +305,7 @@ static const struct tegra_pingroup *tegra_pinctrl_get_group(struct pinctrl_dev * {struct tegra_pmx *pmx =pinctrl_dev_get_drvdata (pctldev); -if (group_index <0 || group_index > pmx->soc->ngroups) +if (group_index <0 || group_index >= pmx->soc->ngroups)return NULL ;return &pmx->soc->groups[group_index];
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 633/783 watchdog: aspeed: fix 64-bit division
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 48a136639ec233614a61653e19f559977d5da2b5 ]
On 32-bit architectures, the new calculation causes a build failure:
ld.lld-21: error: undefined symbol: __aeabi_uldivmod
Since neither value is ever larger than a register, cast both sides into a uintptr_t.
--- drivers/watchdog/aspeed_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/aspeed_wdt.c +1 -1
@@ -254,7 +254,7 @@ static void aspeed_wdt_update_bootstatus(struct platform_device *pdev,if (!of_device_is_compatible (pdev->dev.of_node,"aspeed,ast2400-wdt" )) { res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - idx = ((intptr_t )wdt->base &0x00000fff ) /resource_size (res); + idx = ((intptr_t )wdt->base &0x00000fff ) / (uintptr_t )resource_size (res); } scu_base =syscon_regmap_lookup_by_compatible (scu.compatible);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 634/783 drm/amdkfd: Correct F8_MODE for gfx950
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amber Lin <[email protected]>
[ Upstream commit 0c7e053448945e5a4379dc4396c762d7422b11ca ]
Correct F8_MODE setting for gfx950 that was removed
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c +1 -2
@@ -69,8 +69,7 @@ static bool set_cache_memory_policy_v9(struct device_queue_manager *dqm, qpd->sh_mem_config |=1 <<SH_MEM_CONFIG__RETRY_DISABLE__SHIFT ;if (KFD_GC_VERSION (dqm->dev->kfd) ==IP_VERSION (9 ,4 ,3 ) || -KFD_GC_VERSION (dqm->dev->kfd) ==IP_VERSION (9 ,4 ,4 ) || -KFD_GC_VERSION (dqm->dev->kfd) ==IP_VERSION (9 ,5 ,0 )) +KFD_GC_VERSION (dqm->dev->kfd) ==IP_VERSION (9 ,4 ,4 )) qpd->sh_mem_config |= (1 <<SH_MEM_CONFIG__F8_MODE__SHIFT ); qpd->sh_mem_ape1_limit =0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 635/783 drm/gem: Internally test import_attach for imported objects
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
[ Upstream commit 8260731ccad0451207b45844bb66eb161a209218 ]
Test struct drm_gem_object.import_attach to detect imported objects.
During object clenanup, the dma_buf field might be NULL. Testing it in an object's free callback then incorrectly does a cleanup as for native objects. Happens for calls to drm_mode_destroy_dumb_ioctl() that clears the dma_buf field in drm_gem_object_exported_dma_buf_free().
v3:
- only test for import_attach (Boris)
v2:
- use import_attach.dmabuf instead of dma_buf (Christian)
--- include/drm/drm_gem.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
include/drm/drm_gem.h +1 -2
@@ -585,8 +585,7 @@ static inline bool drm_gem_object_is_shared_for_memory_stats(struct drm_gem_obje*/ static inline bool drm_gem_is_imported (const struct drm_gem_object *obj) { -/* The dma-buf's priv field points to the original GEM object. */ -return obj->dma_buf && (obj->dma_buf->priv != obj); +return !!obj->import_attach; }#ifdef CONFIG_LOCKDEP
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 636/783 virtgpu: dont reset on shutdown
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael S. Tsirkin <[email protected]>
[ Upstream commit 183a08715af1491d381b4e22efd61578fbe05fa5 ]
It looks like GPUs are used after shutdown is invoked.
Thus, breaking virtio gpu in the shutdown callback is not a good idea - guest hangs attempting to finish console drawing, with these warnings:
[ 20.504464] WARNING: CPU: 0 PID: 568 at drivers/gpu/drm/virtio/virtgpu_vq.c:358 virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu] [ 20.505685] Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 rfkill ip_set nf_tables nfnetlink vfat fat intel_rapl_msr intel_rapl_common intel_uncore_frequency_common nfit libnvdimm kvm_intel kvm rapl iTCO_wdt iTCO_vendor_support virtio_gpu virtio_dma_buf pcspkr drm_shmem_helper i2c_i801 drm_kms_helper lpc_ich i2c_smbus virtio_balloon joydev drm fuse xfs libcrc32c ahci libahci crct10dif_pclmul crc32_pclmul crc32c_intel libata virtio_net ghash_clmulni_intel net_failover virtio_blk failover serio_raw dm_mirror dm_region_hash dm_log dm_mod [ 20.511847] CPU: 0 PID: 568 Comm: kworker/0:3 Kdump: loaded Tainted: G W ------- --- 5.14.0-578.6675_1757216455.el9.x86_64 #1 [ 20.513157] Hardware name: Red Hat KVM/RHEL, BIOS edk2-20241117-3.el9 11/17/2024 [ 20.513918] Workqueue: events drm_fb_helper_damage_work [drm_kms_helper] [ 20.514626] RIP: 0010:virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu] [ 20.515332] Code: 00 00 48 85 c0 74 0c 48 8b 78 08 48 89 ee e8 51 50 00 00 65 ff 0d 42 e3 74 3f 0f 85 69 ff ff ff 0f 1f 44 00 00 e9 5f ff ff ff <0f> 0b e9 3f ff ff ff 48 83 3c 24 00 74 0e 49 8b 7f 40 48 85 ff 74 [ 20.517272] RSP: 0018:ff34f0a8c0787ad8 EFLAGS: 00010282 [ 20.517820] RAX: 00000000fffffffb RBX: 0000000000000000 RCX: 0000000000000820 [ 20.518565] RDX: 0000000000000000 RSI: ff34f0a8c0787be0 RDI: ff218bef03a26300 [ 20.519308] RBP: ff218bef03a26300 R08: 0000000000000001 R09: ff218bef07224360 [ 20.520059] R10: 0000000000008dc0 R11: 0000000000000002 R12: ff218bef02630028 [ 20.520806] R13: ff218bef0263fb48 R14: ff218bef00cb8000 R15: ff218bef07224360 [ 20.521555] FS: 0000000000000000(0000) GS:ff218bef7ba00000(0000) knlGS:0000000000000000 [ 20.522397] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 20.522996] CR2: 000055ac4f7871c0 CR3: 000000010b9f2002 CR4: 0000000000771ef0 [ 20.523740] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 20.524477] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 [ 20.525223] PKRU: 55555554 [ 20.525515] Call Trace: [ 20.525777] <TASK> [ 20.526003] ? show_trace_log_lvl+0x1c4/0x2df [ 20.526464] ? show_trace_log_lvl+0x1c4/0x2df [ 20.526925] ? virtio_gpu_queue_fenced_ctrl_buffer+0x82/0x2c0 [virtio_gpu] [ 20.527643] ? virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu] [ 20.528282] ? __warn+0x7e/0xd0 [ 20.528621] ? virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu] [ 20.529256] ? report_bug+0x100/0x140 [ 20.529643] ? handle_bug+0x3c/0x70 [ 20.530010] ? exc_invalid_op+0x14/0x70 [ 20.530421] ? asm_exc_invalid_op+0x16/0x20 [ 20.530862] ? virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu] [ 20.531506] ? virtio_gpu_queue_ctrl_sgs+0x174/0x290 [virtio_gpu] [ 20.532148] virtio_gpu_queue_fenced_ctrl_buffer+0x82/0x2c0 [virtio_gpu] [ 20.532843] virtio_gpu_primary_plane_update+0x3e2/0x460 [virtio_gpu] [ 20.533520] drm_atomic_helper_commit_planes+0x108/0x320 [drm_kms_helper] [ 20.534233] drm_atomic_helper_commit_tail+0x45/0x80 [drm_kms_helper] [ 20.534914] commit_tail+0xd2/0x130 [drm_kms_helper] [ 20.535446] drm_atomic_helper_commit+0x11b/0x140 [drm_kms_helper] [ 20.536097] drm_atomic_commit+0xa4/0xe0 [drm] [ 20.536588] ? __pfx___drm_printfn_info+0x10/0x10 [drm] [ 20.537162] drm_atomic_helper_dirtyfb+0x192/0x270 [drm_kms_helper] [ 20.537823] drm_fbdev_shmem_helper_fb_dirty+0x43/0xa0 [drm_shmem_helper] [ 20.538536] drm_fb_helper_damage_work+0x87/0x160 [drm_kms_helper] [ 20.539188] process_one_work+0x194/0x380 [ 20.539612] worker_thread+0x2fe/0x410 [ 20.540007] ? __pfx_worker_thread+0x10/0x10 [ 20.540456] kthread+0xdd/0x100 [ 20.540791] ? __pfx_kthread+0x10/0x10 [ 20.541190] ret_from_fork+0x29/0x50 [ 20.541566] </TASK> [ 20.541802] ---[ end trace 0000000000000000 ]---
It looks like the shutdown is called in the middle of console drawing, so we should either wait for it to finish, or let drm handle the shutdown.
This patch implements this second option:
Add an option for drivers to bypass the common break+reset handling. As DRM is careful to flush/synchronize outstanding buffers, it looks like GPU can just have a NOP there.
Message-Id: <8490dbeb6f79ed039e6c11d121002618972538a3.1744293540.git.mst@redhat.com>
--- drivers/gpu/drm/virtio/virtgpu_drv.c | 9 +++++++++ drivers/virtio/virtio.c | 6 ++++++ include/linux/virtio.h | 3 +++ 3 files changed, 18 insertions(+)
drivers/gpu/drm/virtio/virtgpu_drv.c +9 -0
@@ -125,6 +125,14 @@ static void virtio_gpu_remove(struct virtio_device *vdev)drm_dev_put (dev); } +static void virtio_gpu_shutdown (struct virtio_device *vdev) +{ +/* +* drm does its own synchronization on shutdown. +* Do nothing here, opt out of device reset. +*/ +} +static void virtio_gpu_config_changed (struct virtio_device *vdev) {struct drm_device *dev = vdev->priv;
@@ -159,6 +167,7 @@ static struct virtio_driver virtio_gpu_driver = { .id_table = id_table, .probe = virtio_gpu_probe, .remove = virtio_gpu_remove, + .shutdown = virtio_gpu_shutdown, .config_changed = virtio_gpu_config_changed };
drivers/virtio/virtio.c +6 -0
@@ -407,6 +407,12 @@ static void virtio_dev_shutdown(struct device *_d)if (!drv)return ; +/* If the driver has its own shutdown method, use that. */ +if (drv->shutdown) { + drv->shutdown (dev); +return ; + } +/* * Some devices get wedged if you kick them after they are * reset. Mark all vqs as broken to make sure we don't.
include/linux/virtio.h +3 -0
@@ -220,6 +220,8 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);* occurs. * @reset_done: optional function to call after transport specific reset * operation has finished. +* @shutdown: synchronize with the device on shutdown. If provided, replaces +* the virtio core implementation. */ struct virtio_driver {struct device_driver driver;
@@ -237,6 +239,7 @@ struct virtio_driver {int (*restore)(struct virtio_device *dev);int (*reset_prepare)(struct virtio_device *dev);int (*reset_done)(struct virtio_device *dev); +void (*shutdown)(struct virtio_device *dev); };#define drv_to_virtio (__drv) container_of_const(__drv, struct virtio_driver, driver)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 637/783 x86/mm/init: Handle the special case of device private pages in add_pages(), to not increase max_pfn and trigger dma_addressing_limited() bounce buffers
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Balbir Singh <[email protected]>
[ Upstream commit 7170130e4c72ce0caa0cb42a1627c635cc262821 ]
As Bert Karwatzki reported, the following recent commit causes a performance regression on AMD iGPU and dGPU systems:
7ffb791423c7 ("x86/kaslr: Reduce KASLR entropy on most x86 systems")
It exposed a bug with nokaslr and zone device interaction.
The root cause of the bug is that, the GPU driver registers a zone device private memory region. When KASLR is disabled or the above commit is applied, the direct_map_physmem_end is set to much higher than 10 TiB typically to the 64TiB address. When zone device private memory is added to the system via add_pages(), it bumps up the max_pfn to the same value. This causes dma_addressing_limited() to return true, since the device cannot address memory all the way up to max_pfn.
This caused a regression for games played on the iGPU, as it resulted in the DMA32 zone being used for GPU allocations.
Fix this by not bumping up max_pfn on x86 systems, when pgmap is passed into add_pages(). The presence of pgmap is used to determine if device private memory is being added via add_pages().
More details:
devm_request_mem_region() and request_free_mem_region() request for device private memory. iomem_resource is passed as the base resource with start and end parameters. iomem_resource's end depends on several factors, including the platform and virtualization. On x86 for example on bare metal, this value is set to boot_cpu_data.x86_phys_bits. boot_cpu_data.x86_phys_bits can change depending on support for MKTME. By default it is set to the same as log2(direct_map_physmem_end) which is 46 to 52 bits depending on the number of levels in the page table. The allocation routines used iomem_resource's end and direct_map_physmem_end to figure out where to allocate the region.
[ arch/powerpc is also impacted by this problem, but this patch does not fix
the issue for PowerPC. ]
Testing:
1. Tested on a virtual machine with test_hmm for zone device inseration
2. A previous version of this patch was tested by Bert, please see:
https://lore.kernel.org/lkml/[email protected]/
[ mingo: Clarified the comments and the changelog. ]
--- arch/x86/mm/init_64.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
arch/x86/mm/init_64.c +12 -3
@@ -967,9 +967,18 @@ int add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages, ret =__add_pages (nid, start_pfn, nr_pages, params);WARN_ON_ONCE (ret); -/* update max_pfn, max_low_pfn and high_memory */ -update_end_of_memory_vars (start_pfn <<PAGE_SHIFT , - nr_pages <<PAGE_SHIFT ); +/* +* Special case: add_pages() is called by memremap_pages() for adding device +* private pages. Do not bump up max_pfn in the device private path, +* because max_pfn changes affect dma_addressing_limited(). +* +* dma_addressing_limited() returning true when max_pfn is the device's +* addressable memory can force device drivers to use bounce buffers +* and impact their performance negatively: +*/ +if (!params->pgmap) +/* update max_pfn, max_low_pfn and high_memory */ +update_end_of_memory_vars (start_pfn <<PAGE_SHIFT , nr_pages <<PAGE_SHIFT );return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 638/783 bpf: abort verification if env->cur_state->loop_entry != NULL
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eduard Zingerman <[email protected]>
[ Upstream commit f3c2d243a36ef23be07bc2bce7c6a5cb6e07d9e3 ]
In addition to warning abort verification with -EFAULT. If env->cur_state->loop_entry != NULL something is irrecoverably buggy.
--- kernel/bpf/verifier.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/bpf/verifier.c +4 -2
@@ -19265,8 +19265,10 @@ static int do_check(struct bpf_verifier_env *env)return err;break ; }else { -if (WARN_ON_ONCE (env->cur_state->loop_entry)) - env->cur_state->loop_entry =NULL ; +if (WARN_ON_ONCE (env->cur_state->loop_entry)) { +verbose (env,"verifier bug: env->cur_state->loop_entry != NULL\n" ); +return -EFAULT ; + } do_print_state = true;continue ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 639/783 ipv6: remove leftover ip6 cookie initializer
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
[ Upstream commit 54580ccdd8a9c6821fd6f72171d435480867e4c3 ]
As of the blamed commit ipc6.dontfrag is always initialized at the start of udpv6_sendmsg, by ipcm6_init_sk, to either 0 or 1.
Later checks against -1 are no longer needed and the branches are now dead code.
The blamed commit had removed those branches. But I had overlooked this one case.
UDP has both a lockless fast path and a slower path for corked requests. This branch remained in the fast path.
--- net/ipv6/ip6_output.c | 2 -- 1 file changed, 2 deletions(-)
net/ipv6/ip6_output.c +0 -2
@@ -2055,8 +2055,6 @@ struct sk_buff *ip6_make_skb(struct sock *sk,ip6_cork_release (cork, &v6_cork);return ERR_PTR (err); } -if (ipc6->dontfrag <0 ) - ipc6->dontfrag =inet6_test_bit (DONTFRAG , sk); err = __ip6_append_data(sk, &queue, cork, &v6_cork, ¤t->task_frag, getfrag, from,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 640/783 serial: sh-sci: Save and restore more registers
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 81100b9a7b0515132996d62a7a676a77676cb6e3 ]
On (H)SCIF with a Baud Rate Generator for External Clock (BRG), there are multiple ways to configure the requested serial speed. If firmware uses a different method than Linux, and if any debug info is printed after the Bit Rate Register (SCBRR) is restored, but before termios is reconfigured (which configures the alternative method), the system may lock-up during resume.
Fix this by saving and restoring the contents of the BRG Frequency Division (SCDL) and Clock Select (SCCKS) registers as well.
Also save and restore the HSCIF's Sampling Rate Register (HSSRR), which configures the sampling point, and the SCIFA/SCIFB's Serial Port Control and Data Registers (SCPCR/SCPDR), which configure the optional control flow signals.
After this, all registers that are not saved/restored are either:
- read-only,
- write-only,
- status registers containing flags with clear-after-set semantics,
- FIFO Data Count Trigger registers, which do not matter much for the serial console.
--- drivers/tty/serial/sh-sci.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
drivers/tty/serial/sh-sci.c +25 -0
@@ -105,10 +105,15 @@ struct plat_sci_reg { };struct sci_suspend_regs { +u16 scdl; +u16 sccks;u16 scsmr;u16 scscr;u16 scfcr;u16 scsptr; +u16 hssrr; +u16 scpcr; +u16 scpdr;u8 scbrr;u8 semr; };
@@ -3564,6 +3569,10 @@ static void sci_console_save(struct sci_port *s)struct sci_suspend_regs *regs = &s->suspend_regs;struct uart_port *port = &s->port; +if (sci_getreg (port,SCDL )->size) + regs->scdl =sci_serial_in (port,SCDL ); +if (sci_getreg (port,SCCKS )->size) + regs->sccks =sci_serial_in (port,SCCKS );if (sci_getreg (port,SCSMR )->size) regs->scsmr =sci_serial_in (port,SCSMR );if (sci_getreg (port,SCSCR )->size)
@@ -3574,6 +3583,12 @@ static void sci_console_save(struct sci_port *s) regs->scsptr =sci_serial_in (port,SCSPTR );if (sci_getreg (port,SCBRR )->size) regs->scbrr =sci_serial_in (port,SCBRR ); +if (sci_getreg (port,HSSRR )->size) + regs->hssrr =sci_serial_in (port,HSSRR ); +if (sci_getreg (port,SCPCR )->size) + regs->scpcr =sci_serial_in (port,SCPCR ); +if (sci_getreg (port,SCPDR )->size) + regs->scpdr =sci_serial_in (port,SCPDR );if (sci_getreg (port,SEMR )->size) regs->semr =sci_serial_in (port,SEMR ); }
@@ -3583,6 +3598,10 @@ static void sci_console_restore(struct sci_port *s)struct sci_suspend_regs *regs = &s->suspend_regs;struct uart_port *port = &s->port; +if (sci_getreg (port,SCDL )->size) +sci_serial_out (port,SCDL , regs->scdl); +if (sci_getreg (port,SCCKS )->size) +sci_serial_out (port,SCCKS , regs->sccks);if (sci_getreg (port,SCSMR )->size)sci_serial_out (port,SCSMR , regs->scsmr);if (sci_getreg (port,SCSCR )->size)
@@ -3593,6 +3612,12 @@ static void sci_console_restore(struct sci_port *s)sci_serial_out (port,SCSPTR , regs->scsptr);if (sci_getreg (port,SCBRR )->size)sci_serial_out (port,SCBRR , regs->scbrr); +if (sci_getreg (port,HSSRR )->size) +sci_serial_out (port,HSSRR , regs->hssrr); +if (sci_getreg (port,SCPCR )->size) +sci_serial_out (port,SCPCR , regs->scpcr); +if (sci_getreg (port,SCPDR )->size) +sci_serial_out (port,SCPDR , regs->scpdr);if (sci_getreg (port,SEMR )->size)sci_serial_out (port,SEMR , regs->semr); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 641/783 drm/amd/display: Exit idle optimizations before accessing PHY
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Bunea <[email protected]>
[ Upstream commit c488967488d7eff7b9c527d5469c424c15377502 ]
[why & how]
By default, DCN HW is in idle optimized state which does not allow access to PHY registers. If BIOS powers up the DCN, it is fine because they will power up everything. Only exit idle optimized state when not taking control from VBIOS.
--- drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +5 -0
@@ -1889,6 +1889,7 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)bool can_apply_edp_fast_boot = false;bool can_apply_seamless_boot = false;bool keep_edp_vdd_on = false; +struct dc_bios *dcb = dc->ctx->dc_bios;DC_LOGGER_INIT ();
@@ -1965,6 +1966,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) hws->funcs.edp_backlight_control (edp_link_with_sink, false); }/*resume from S3, no vbios posting, no need to power down again*/ +if (dcb && dcb->funcs && !dcb->funcs->is_accelerated_mode (dcb)) +clk_mgr_exit_optimized_pwr_state (dc, dc->clk_mgr);power_down_all_hw_blocks (dc);
@@ -1977,6 +1980,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)disable_vga_and_power_gate_all_controllers (dc);if (edp_link_with_sink && !keep_edp_vdd_on) dc->hwss.edp_power_control (edp_link_with_sink, false); +if (dcb && dcb->funcs && !dcb->funcs->is_accelerated_mode (dcb)) +clk_mgr_optimize_pwr_state (dc, dc->clk_mgr); }bios_set_scratch_acc_mode_change (dc->ctx->dc_bios,1 ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 642/783 drm/amdkfd: Fix error handling for missing PASID in kfd_process_device_init_vm
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
[ Upstream commit 2b04d04de956b44cc140d45cf8ebccfb378ce3bf ]
In the kfd_process_device_init_vm function, a valid error code is now returned when the associated Process Address Space ID (PASID) is not present.
If the address space virtual memory (avm) does not have an associated PASID, the function sets the ret variable to -EINVAL before proceeding to the error handling section. This ensures that the calling function, such as kfd_ioctl_acquire_vm, can appropriately handle the error, thereby preventing any issues during virtual memory initialization.
Fixes the below:drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:1694 kfd_process_device_init_vm()
warn: missing error code 'ret'
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c
1647 int kfd_process_device_init_vm(struct kfd_process_device *pdd,
1648 struct file *drm_file)
1649 {
...
1690
1691 if (unlikely(!avm->pasid)) {
1692 dev_warn(pdd->dev->adev->dev, "WARN: vm %p has no pasid associated",
1693 avm);--> 1694 goto err_get_pasid;
ret = -EINVAL?
1695 }
Reported by: Dan Carpenter <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdkfd/kfd_process.c +1 -0
@@ -1711,6 +1711,7 @@ int kfd_process_device_init_vm(struct kfd_process_device *pdd,if (unlikely (!avm->pasid)) {dev_warn (pdd->dev->adev->dev,"WARN: vm %p has no pasid associated" , avm); + ret = -EINVAL ; goto err_get_pasid; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 643/783 drm/amdkfd: Fix pasid value leak
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiaogang Chen <[email protected]>
[ Upstream commit 10e08943caedfb4b0b95933d248503a6f6b9fef6 ]
Curret kfd does not allocate pasid values, instead uses pasid value for each vm from graphic driver. So should not prevent graphic driver from releasing pasid values since the values are allocated by graphic driver, not kfd driver anymore. This patch does not stop graphic driver release pasid values.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 2 -- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 21 ------------------- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ------------- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 1 - drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 +---- 5 files changed, 1 insertion(+), 42 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +0 -2
@@ -303,8 +303,6 @@ int amdgpu_amdkfd_gpuvm_acquire_process_vm(struct amdgpu_device *adev,struct amdgpu_vm *avm, void **process_info, struct dma_fence **ef); -void amdgpu_amdkfd_gpuvm_release_process_vm (struct amdgpu_device *adev, -void *drm_priv);uint64_t amdgpu_amdkfd_gpuvm_get_process_page_dir (void *drm_priv);size_t amdgpu_amdkfd_get_available_memory (struct amdgpu_device *adev,uint8_t xcp_id);
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +0 -21
@@ -1578,27 +1578,6 @@ void amdgpu_amdkfd_gpuvm_destroy_cb(struct amdgpu_device *adev, } } -void amdgpu_amdkfd_gpuvm_release_process_vm (struct amdgpu_device *adev, -void *drm_priv) -{ -struct amdgpu_vm *avm; - -if (WARN_ON (!adev || !drm_priv)) -return ; - - avm =drm_priv_to_vm (drm_priv); - -pr_debug ("Releasing process vm %p\n" , avm); - -/* The original pasid of amdgpu vm has already been -* released during making a amdgpu vm to a compute vm -* The current pasid is managed by kfd and will be -* released on kfd process destroy. Set amdgpu pasid -* to 0 to avoid duplicate release. -*/ -amdgpu_vm_release_compute (adev, avm); -} -uint64_t amdgpu_amdkfd_gpuvm_get_process_page_dir (void *drm_priv) {struct amdgpu_vm *avm =drm_priv_to_vm (drm_priv);
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -14
@@ -2687,20 +2687,6 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm)return r; } -/** -* amdgpu_vm_release_compute - release a compute vm -* @adev: amdgpu_device pointer -* @vm: a vm turned into compute vm by calling amdgpu_vm_make_compute -* -* This is a correspondant of amdgpu_vm_make_compute. It decouples compute -* pasid from vm. Compute should stop use of vm after this call. -*/ -void amdgpu_vm_release_compute (struct amdgpu_device *adev,struct amdgpu_vm *vm) -{ -amdgpu_vm_set_pasid (adev, vm,0 ); - vm->is_compute_context = false; -} -static int amdgpu_vm_stats_is_zero (struct amdgpu_vm *vm) {for (int i =0 ; i < __AMDGPU_PL_NUM; ++i) {
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +0 -1
@@ -489,7 +489,6 @@ int amdgpu_vm_set_pasid(struct amdgpu_device *adev, struct amdgpu_vm *vm,long amdgpu_vm_wait_idle (struct amdgpu_vm *vm,long timeout);int amdgpu_vm_init (struct amdgpu_device *adev,struct amdgpu_vm *vm,int32_t xcp_id);int amdgpu_vm_make_compute (struct amdgpu_device *adev,struct amdgpu_vm *vm); -void amdgpu_vm_release_compute (struct amdgpu_device *adev,struct amdgpu_vm *vm);void amdgpu_vm_fini (struct amdgpu_device *adev,struct amdgpu_vm *vm);int amdgpu_vm_lock_pd (struct amdgpu_vm *vm,struct drm_exec *exec,unsigned int num_fences);
drivers/gpu/drm/amd/amdkfd/kfd_process.c +1 -4
@@ -1059,11 +1059,8 @@ static void kfd_process_destroy_pdds(struct kfd_process *p)kfd_process_device_destroy_cwsr_dgpu (pdd);kfd_process_device_destroy_ib_mem (pdd); -if (pdd->drm_file) { -amdgpu_amdkfd_gpuvm_release_process_vm ( - pdd->dev->adev, pdd->drm_priv); +if (pdd->drm_file)fput (pdd->drm_file); - }if (pdd->qpd.cwsr_kaddr && !pdd->qpd.cwsr_base) free_pages((unsigned long)pdd->qpd.cwsr_kaddr,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 644/783 wifi: mac80211: Add counter for all monitor interfaces
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Wetzel <[email protected]>
[ Upstream commit 129860044c611008be37f49d04cf41874e3659e6 ]
Count open monitor interfaces regardless of the monitor interface type. The new counter virt_monitors takes over counting interfaces depending on the virtual monitor interface while monitors is used for all active monitor interfaces.
This fixes monitor packet mirroring when using MONITOR_FLAG_ACTIVE or NO_VIRTUAL_MONITOR interfaces.
--- net/mac80211/cfg.c | 5 ++--- net/mac80211/ethtool.c | 2 +- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/iface.c | 22 +++++++++++++--------- net/mac80211/util.c | 3 ++- 5 files changed, 19 insertions(+), 15 deletions(-)
net/mac80211/cfg.c +2 -3
@@ -4370,9 +4370,8 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,if (chanctx_conf) { *chandef = link->conf->chanreq.oper; ret =0 ; - }else if (!ieee80211_hw_check (&local->hw,NO_VIRTUAL_MONITOR ) && - local->open_count >0 && - local->open_count == local->monitors && + }else if (local->open_count >0 && + local->open_count == local->virt_monitors && sdata->vif.type ==NL80211_IFTYPE_MONITOR ) { *chandef = local->monitor_chanreq.oper; ret =0 ;
net/mac80211/ethtool.c +1 -1
@@ -158,7 +158,7 @@ static void ieee80211_get_stats(struct net_device *dev,if (chanctx_conf) channel = chanctx_conf->def.chan;else if (local->open_count >0 && - local->open_count == local->monitors && + local->open_count == local->virt_monitors && sdata->vif.type ==NL80211_IFTYPE_MONITOR ) channel = local->monitor_chanreq.oper.chan;else
net/mac80211/ieee80211_i.h +1 -1
@@ -1378,7 +1378,7 @@ struct ieee80211_local {spinlock_t queue_stop_reason_lock;int open_count; -int monitors, tx_mntrs; +int monitors, virt_monitors, tx_mntrs;/* number of interfaces with corresponding FIF_ flags */ int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll, fif_probe_req;
net/mac80211/iface.c +13 -9
@@ -582,11 +582,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do/* no need to tell driver */ break ;case NL80211_IFTYPE_MONITOR : + local->monitors--; +if (!(sdata->u.mntr.flags &MONITOR_FLAG_ACTIVE ) && !ieee80211_hw_check (&local->hw,NO_VIRTUAL_MONITOR )) { - local->monitors--; -if (local->monitors ==0 ) { + local->virt_monitors--; +if (local->virt_monitors ==0 ) { local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR ; hw_reconf_flags |=IEEE80211_CONF_CHANGE_MONITOR ; }
@@ -686,7 +688,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_docase NL80211_IFTYPE_AP_VLAN :break ;case NL80211_IFTYPE_MONITOR : -if (local->monitors ==0 ) +if (local->virt_monitors ==0 )ieee80211_del_virtual_monitor (local);ieee80211_recalc_idle (local);
@@ -723,7 +725,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_doieee80211_configure_filter (local);ieee80211_hw_config (local, hw_reconf_flags); -if (local->monitors == local->open_count) +if (local->virt_monitors == local->open_count)ieee80211_add_virtual_monitor (local); }
@@ -982,7 +984,7 @@ static bool ieee80211_set_sdata_offload_flags(struct ieee80211_sub_if_data *sdat local->hw.wiphy->frag_threshold != (u32)-1) flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED ; -if (local->monitors) +if (local->virt_monitors) flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED ; }else { flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED ;
@@ -992,7 +994,7 @@ static bool ieee80211_set_sdata_offload_flags(struct ieee80211_sub_if_data *sdat ieee80211_iftype_supports_hdr_offload(sdata->vif.type)) { flags |= IEEE80211_OFFLOAD_DECAP_ENABLED; - if (local->monitors && + if (local->virt_monitors && !ieee80211_hw_check(&local->hw, SUPPORTS_CONC_MON_RX_DECAP)) flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED; } else {
@@ -1336,20 +1338,22 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)if (res) goto err_stop; }else { -if (local->monitors ==0 && local->open_count ==0 ) { +if (local->virt_monitors ==0 && local->open_count ==0 ) { res =ieee80211_add_virtual_monitor (local);if (res) goto err_stop; } - local->monitors++; + local->virt_monitors++;/* must be before the call to ieee80211_configure_filter */ -if (local->monitors ==1 ) { +if (local->virt_monitors ==1 ) { local->hw.conf.flags |=IEEE80211_CONF_MONITOR ; hw_reconf_flags |=IEEE80211_CONF_CHANGE_MONITOR ; } } + local->monitors++; +ieee80211_adjust_monitor_flags (sdata,1 );ieee80211_configure_filter (local);ieee80211_recalc_offload (local);
net/mac80211/util.c +2 -1
@@ -2156,7 +2156,8 @@ int ieee80211_reconfig(struct ieee80211_local *local) wake_up: -if (local->monitors == local->open_count && local->monitors >0 ) +if (local->virt_monitors >0 && + local->virt_monitors == local->open_count)ieee80211_add_virtual_monitor (local);/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 645/783 HID: Kconfig: Add LEDS_CLASS_MULTICOLOR dependency to HID_LOGITECH
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kate Hsuan <[email protected]>
[ Upstream commit 4465f4fa21e0e54c10896db3ed49dbd5a9aad3fd ]
The test bot found an issue with building hid-lg-g15.
All errors (new ones prefixed by >>):
powerpc-linux-ld: drivers/hid/hid-lg-g15.o: in function `lg_g510_kbd_led_write':
Quoted 1 line
Quoted 1 line
drivers/hid/hid-lg-g15.c:241:(.text+0x768): undefined reference to `led_mc_calc_color_components'
powerpc-linux-ld: drivers/hid/hid-lg-g15.o: in function `lg_g15_register_led':
Quoted 1 line
Quoted 1 line
drivers/hid/hid-lg-g15.c:686:(.text+0xa9c): undefined reference to `devm_led_classdev_multicolor_register_ext'
Since multicolor LED APIs manage the keyboard backlight settings of hid-lg-g15, the LEDS_CLASS_MULTICOLOR dependency was added to HID_LOGITECH.
--- drivers/hid/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/hid/Kconfig +1 -0
@@ -603,6 +603,7 @@ config HID_LOGITECH tristate "Logitech devices" depends on USB_HID depends on LEDS_CLASS + depends on LEDS_CLASS_MULTICOLOR default !EXPERT help Support for Logitech devices that are not fully compliant with HID standard.
Signature · 1 line
2.39.5
Re: [PATCH 6.14 645/783] HID: Kconfig: Add LEDS_CLASS_MULTICOLOR dependency to HID_LOGITECH
With 6.14.9 (maybe patch "HID: Kconfig: Add LEDS_CLASS_MULTICOLOR dependency to HID_LOGITECH") something with the configuration of "Special HID drivers" for "Logitech devices" goes wrong:
using the attached kernel config from 6.14.8 an doing a make oldconfig all configuration for Logitech devices is removed from the new .config. Also, in make nconfig the entry "Logitech devices" vanished from Device Drivers -> HID bus support -> Special HID drivers.
Any idea?
Regards,
Jörg.
Greg Kroah-Hartman
maintainerRe: [PATCH 6.14 645/783] HID: Kconfig: Add LEDS_CLASS_MULTICOLOR dependency to HID_LOGITECH
Quoted 8 lines · Jörg-Volker Peetz
With 6.14.9 (maybe patch "HID:
Kconfig: AddLEDS_CLASS_MULTICOLORdependency toHID_LOGITECH") something with the configuration of "Special HID drivers" for "Logitech devices" goes wrong:using the attached kernel config from 6.14.8 an doing a
make oldconfigall configuration for Logitech devices is removed from the new.config. Also, inmake nconfigthe entry "Logitech devices" vanished fromDevice Drivers -> HID bus support -> Special HID drivers.
Did you enable LEDS_CLASS and LEDS_CLASS_MULTICOLOR?
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 6.14 645/783] HID: Kconfig: Add LEDS_CLASS_MULTICOLOR dependency to HID_LOGITECH
Quoted 11 lines · Greg Kroah-Hartman
Quoted 8 lines · Jörg-Volker Peetz
With 6.14.9 (maybe patch "HID:
Kconfig: AddLEDS_CLASS_MULTICOLORdependency toHID_LOGITECH") something with the configuration of "Special HID drivers" for "Logitech devices" goes wrong:using the attached kernel config from 6.14.8 an doing a
make oldconfigall configuration for Logitech devices is removed from the new.config. Also, inmake nconfigthe entry "Logitech devices" vanished fromDevice Drivers -> HID bus support -> Special HID drivers.Did you enable
LEDS_CLASSandLEDS_CLASS_MULTICOLOR?
To answer my own question, based on the .config file, no:
# CONFIG_LEDS_CLASS_MULTICOLOR is not set
Try changing that.
thanks,
greg k-h
Re: [PATCH 6.14 645/783] HID: Kconfig: Add LEDS_CLASS_MULTICOLOR dependency to HID_LOGITECH
Thanks for looking into this.
I should have asked more specific:
Greg Kroah-Hartman wrote on 30/05/2025 16:09:
Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Jörg-Volker Peetz
Quoted 8 lines
With 6.14.9 (maybe patch "HID:
Kconfig: AddLEDS_CLASS_MULTICOLORdependency toHID_LOGITECH") something with the configuration of "Special HID drivers" for "Logitech devices" goes wrong:using the attached kernel config from 6.14.8 an doing a
make oldconfigall configuration for Logitech devices is removed from the new.config. Also, inmake nconfigthe entry "Logitech devices" vanished fromDevice Drivers -> HID bus support -> Special HID drivers.
Quoted 6 lines
Quoted 1 line
Did you enable
LEDS_CLASSandLEDS_CLASS_MULTICOLOR?To answer my own question, based on the .config file, no:
#CONFIG_LEDS_CLASS_MULTICOLORis not setTry changing that.
Yes, enabling these makes the "Logitech devices" entry appear again.
My concern is more about the selection logic. The "Logitech devices" entry should not vanish.
How would one know that "LEDS_CLASS_MULTICOLOR" is required to configure Logitech devices, e.g., a wireless keyboard? I think, it should be possible to select a Logitech device which in turn automatically selects LEDS_CLASS_MULTICOLOR.
Regards,
Jörg.
Quoted 6 lines
thanks,
greg k-h
Re: [PATCH 6.14 645/783] HID: Kconfig: Add LEDS_CLASS_MULTICOLOR dependency to HID_LOGITECH
Quoted 32 lines · Jörg-Volker Peetz
Thanks for looking into this.
I should have asked more specific:Greg Kroah-Hartman wrote on 30/05/2025 16:09:
Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Jörg-Volker Peetz
Quoted 8 lines
With 6.14.9 (maybe patch "HID:
Kconfig: AddLEDS_CLASS_MULTICOLORdependency toHID_LOGITECH") something with the configuration of "Special HID drivers" for "Logitech devices" goes wrong:using the attached kernel config from 6.14.8 an doing a
make oldconfigall configuration for Logitech devices is removed from the new.config. Also, inmake nconfigthe entry "Logitech devices" vanished fromDevice Drivers -> HID bus support -> Special HID drivers.Quoted 6 lines
Quoted 1 line
Did you enable
LEDS_CLASSandLEDS_CLASS_MULTICOLOR?To answer my own question, based on the .config file, no:
#CONFIG_LEDS_CLASS_MULTICOLORis not setTry changing that.
Yes, enabling these makes the "Logitech devices" entry appear again.
My concern is more about the selection logic. The "Logitech devices" entry should not vanish.
How would one know that "LEDS_CLASS_MULTICOLOR" is required to configure Logitech devices, e.g., a wireless keyboard?
I think, it should be possible to select a Logitech device which in turn automatically selectsLEDS_CLASS_MULTICOLOR.
Quoted 9 lines
Regards,
Jörg.Quoted 6 lines
thanks,
greg k-h
Hi,
I switched the driver to use the standard multicolour LED APIs to manage the keyboard backlight color, for example Logitech G510 keyboard.
So, LEDS_CLASS_MULTICOLOR is required.
Should I submit a fix patch to switch to using "selects LEDS_CLASS_MULTICOLOR" ?
Thank you :)
Signature · 2 lines
BR, Kate
Greg Kroah-Hartman
maintainerRe: [PATCH 6.14 645/783] HID: Kconfig: Add LEDS_CLASS_MULTICOLOR dependency to HID_LOGITECH
Quoted 17 lines · Kate Hsuan
Quoted 16 lines · Jörg-Volker Peetz
Thanks for looking into this.
I should have asked more specific:Greg Kroah-Hartman wrote on 30/05/2025 16:09:
Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Jörg-Volker Peetz
Quoted 8 lines
With 6.14.9 (maybe patch "HID:
Kconfig: AddLEDS_CLASS_MULTICOLORdependency toHID_LOGITECH") something with the configuration of "Special HID drivers" for "Logitech devices" goes wrong:using the attached kernel config from 6.14.8 an doing a
make oldconfigall configuration for Logitech devices is removed from the new.config. Also, inmake nconfigthe entry "Logitech devices" vanished fromDevice Drivers -> HID bus support -> Special HID drivers.
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Did you enable
LEDS_CLASSandLEDS_CLASS_MULTICOLOR?To answer my own question, based on the .config file, no:
#CONFIG_LEDS_CLASS_MULTICOLORis not setTry changing that.
Yes, enabling these makes the "Logitech devices" entry appear again.
Great!
Quoted 4 lines
Quoted 4 lines
My concern is more about the selection logic. The "Logitech devices" entry should not vanish.
How would one know that "LEDS_CLASS_MULTICOLOR" is required to configure Logitech devices, e.g., a wireless keyboard?
That's the "joy" of our build system, dependencies are rough. You can search in the config tools and it will tell you that dependency if you are wondering why something went away.
Quoted 5 lines
I switched the driver to use the standard multicolour LED APIs to manage the keyboard backlight color, for example Logitech G510 keyboard.
So,LEDS_CLASS_MULTICOLORis required.
Should I submit a fix patch to switch to using "selectsLEDS_CLASS_MULTICOLOR" ?
Please no. depends is the proper way here.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerPATCH 646/783 net-sysfs: restore behavior for not running devices
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 75bc3dab4e49b4daccb27ad6ce8ce2fcd253fc1b ]
modprobe dummy dumdummies=1
Old behavior :
$ cat /sys/class/net/dummy0/carrier cat: /sys/class/net/dummy0/carrier: Invalid argument
After blamed commit, an empty string is reported.
$ cat /sys/class/net/dummy0/carrier $
In this commit, I restore the old behavior for carrier, speed and duplex attributes.
--- net/core/net-sysfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/core/net-sysfs.c +4 -1
@@ -232,11 +232,12 @@ static ssize_t carrier_show(struct device *dev, struct device_attribute *attr, char *buf) { struct net_device *netdev = to_net_dev(dev); -int ret = -EINVAL ; +int ret;if (!rtnl_trylock ())return restart_syscall (); + ret = -EINVAL ;if (netif_running (netdev)) {/* Synchronize carrier state with link watch, * see also rtnl_getlink().
@@ -266,6 +267,7 @@ static ssize_t speed_show(struct device *dev,if (!rtnl_trylock ())return restart_syscall (); + ret = -EINVAL ;if (netif_running (netdev)) {struct ethtool_link_ksettings cmd;
@@ -292,6 +294,7 @@ static ssize_t duplex_show(struct device *dev,if (!rtnl_trylock ())return restart_syscall (); + ret = -EINVAL ;if (netif_running (netdev)) {struct ethtool_link_ksettings cmd;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 647/783 ASoC: imx-card: Adjust over allocation of memory in imx_card_parse_of()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chenyuan Yang <[email protected]>
[ Upstream commit a9a69c3b38c89d7992fb53db4abb19104b531d32 ]
Incorrect types are used as sizeof() arguments in devm_kcalloc(). It should be sizeof(dai_link_data) for link_data instead of sizeof(snd_soc_dai_link).
This is found by our static analysis tool.
--- sound/soc/fsl/imx-card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/fsl/imx-card.c +1 -1
@@ -543,7 +543,7 @@ static int imx_card_parse_of(struct imx_card_data *data)if (!card->dai_link)return -ENOMEM ; - data->link_data =devm_kcalloc (dev, num_links,sizeof (*link),GFP_KERNEL ); + data->link_data =devm_kcalloc (dev, num_links,sizeof (*link_data),GFP_KERNEL );if (!data->link_data)return -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 648/783 book3s64/radix: Fix compile errors when CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=n
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ritesh Harjani (IBM) <[email protected]>
[ Upstream commit 29bdc1f1c1df80868fb35bc69d1f073183adc6de ]
Fix compile errors when CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=n
--- arch/powerpc/mm/book3s64/radix_pgtable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/mm/book3s64/radix_pgtable.c +2 -1
@@ -976,7 +976,7 @@ int __meminit radix__vmemmap_create_mapping(unsigned long start,return 0 ; } - +#ifdef CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP bool vmemmap_can_optimize (struct vmem_altmap *altmap,struct dev_pagemap *pgmap) {if (radix_enabled ())
@@ -984,6 +984,7 @@ bool vmemmap_can_optimize(struct vmem_altmap *altmap, struct dev_pagemap *pgmap) return false; } +#endif int __meminit vmemmap_check_pmd (pmd_t *pmdp,int node,unsigned long addr,unsigned long next)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 649/783 pinctrl: meson: define the pull up/down resistor value as 60 kOhm
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Blumenstingl <[email protected]>
[ Upstream commit e56088a13708757da68ad035269d69b93ac8c389 ]
The public datasheets of the following Amlogic SoCs describe a typical resistor value for the built-in pull up/down resistor:
- Meson8/8b/8m2: not documented
- GXBB (S905): 60 kOhm
- GXL (S905X): 60 kOhm
- GXM (S912): 60 kOhm
- G12B (S922X): 60 kOhm
- SM1 (S905D3): 60 kOhm
The public G12B and SM1 datasheets additionally state min and max values:
- min value: 50 kOhm for both, pull-up and pull-down
- max value for the pull-up: 70 kOhm
- max value for the pull-down: 130 kOhm
Use 60 kOhm in the pinctrl-meson driver as well so it's shown in the debugfs output. It may not be accurate for Meson8/8b/8m2 but in reality 60 kOhm is closer to the actual value than 1 Ohm.
--- drivers/pinctrl/meson/pinctrl-meson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/meson/pinctrl-meson.c +1 -1
@@ -487,7 +487,7 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,case PIN_CONFIG_BIAS_PULL_DOWN :case PIN_CONFIG_BIAS_PULL_UP :if (meson_pinconf_get_pull (pc, pin) == param) - arg =1 ; + arg =60000 ;else return -EINVAL ;break ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 650/783 smb: server: smb2pdu: check return value of xa_store()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Salah Triki <[email protected]>
[ Upstream commit af5226abb40cae959f424f7ca614787a1c87ce48 ]
xa_store() may fail so check its return value and return error code if error occurred.
--- fs/smb/server/smb2pdu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/smb/server/smb2pdu.c +7 -2
@@ -1450,7 +1450,7 @@ static int ntlm_authenticate(struct ksmbd_work *work, {struct ksmbd_conn *conn = work->conn;struct ksmbd_session *sess = work->sess; -struct channel *chann =NULL ; +struct channel *chann =NULL , *old;struct ksmbd_user *user;u64 prev_id;int sz, rc;
@@ -1562,7 +1562,12 @@ static int ntlm_authenticate(struct ksmbd_work *work,return -ENOMEM ; chann->conn = conn; -xa_store (&sess->ksmbd_chann_list, (long )conn, chann,KSMBD_DEFAULT_GFP ); + old =xa_store (&sess->ksmbd_chann_list, (long )conn, chann, +KSMBD_DEFAULT_GFP ); +if (xa_is_err (old)) { +kfree (chann); +return xa_err (old); + } } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 651/783 platform/x86/intel: hid: Add Pantherlake support
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Saranya Gopal <[email protected]>
[ Upstream commit 12df9ec3e1955aed6a0c839f2375cd8e5d5150cf ]
Add Pantherlake ACPI device ID to the Intel HID driver.
While there, clean up the device ID table to remove the ", 0" parts.
--- drivers/platform/x86/intel/hid.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/platform/x86/intel/hid.c +11 -10
@@ -44,16 +44,17 @@ MODULE_LICENSE("GPL");MODULE_AUTHOR ("Alex Hung" );static const struct acpi_device_id intel_hid_ids[] = { - {"INT33D5" ,0 }, - {"INTC1051" ,0 }, - {"INTC1054" ,0 }, - {"INTC1070" ,0 }, - {"INTC1076" ,0 }, - {"INTC1077" ,0 }, - {"INTC1078" ,0 }, - {"INTC107B" ,0 }, - {"INTC10CB" ,0 }, - {"" ,0 }, + {"INT33D5" }, + {"INTC1051" }, + {"INTC1054" }, + {"INTC1070" }, + {"INTC1076" }, + {"INTC1077" }, + {"INTC1078" }, + {"INTC107B" }, + {"INTC10CB" }, + {"INTC10CC" }, + { } };MODULE_DEVICE_TABLE (acpi, intel_hid_ids);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 652/783 platform/x86: asus-wmi: Disable OOBE state after resume from hibernation
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Nikulin <[email protected]>
[ Upstream commit 77bdac73754e4c0c564c1ca80fe3d9c93b0e715a ]
ASUS firmware resets OOBE state during S4 suspend, so the keyboard blinks during resume from hibernation. This patch disables OOBE state after resume from hibernation.
--- drivers/platform/x86/asus-wmi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/platform/x86/asus-wmi.c +10 -1
@@ -304,6 +304,7 @@ struct asus_wmi {u32 kbd_rgb_dev;bool kbd_rgb_state_available; +bool oobe_state_available;u8 throttle_thermal_policy_mode;u32 throttle_thermal_policy_dev;
@@ -1826,7 +1827,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus) goto error; } -if (asus_wmi_dev_is_present (asus,ASUS_WMI_DEVID_OOBE )) { +if (asus->oobe_state_available) {/* * Disable OOBE state, so that e.g. the keyboard backlight * works.
@@ -4723,6 +4724,7 @@ static int asus_wmi_add(struct platform_device *pdev) asus->egpu_enable_available =asus_wmi_dev_is_present (asus,ASUS_WMI_DEVID_EGPU ); asus->dgpu_disable_available =asus_wmi_dev_is_present (asus,ASUS_WMI_DEVID_DGPU ); asus->kbd_rgb_state_available =asus_wmi_dev_is_present (asus,ASUS_WMI_DEVID_TUF_RGB_STATE ); + asus->oobe_state_available =asus_wmi_dev_is_present (asus,ASUS_WMI_DEVID_OOBE ); asus->ally_mcu_usb_switch =acpi_has_method (NULL ,ASUS_USB0_PWR_EC0_CSEE ) &&dmi_check_system (asus_ally_mcu_quirk);
@@ -4971,6 +4973,13 @@ static int asus_hotk_restore(struct device *device) }if (!IS_ERR_OR_NULL (asus->kbd_led.dev))kbd_led_update (asus); +if (asus->oobe_state_available) { +/* +* Disable OOBE state, so that e.g. the keyboard backlight +* works. +*/ +asus_wmi_set_devstate (ASUS_WMI_DEVID_OOBE ,1 ,NULL ); + }if (asus_wmi_has_fnlock_key (asus))asus_wmi_fnlock_update (asus);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 653/783 platform/x86: ideapad-laptop: add support for some new buttons
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gašper Nemgar <[email protected]>
[ Upstream commit 02c6e43397c39edd0c172859bf8c851b46be09a8 ]
Add entries to unsupported WMI codes in ideapad_keymap[] and one check for WMI code 0x13d to trigger platform_profile_cycle().
--- drivers/platform/x86/ideapad-laptop.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/platform/x86/ideapad-laptop.c +16 -0
@@ -1308,6 +1308,16 @@ static const struct key_entry ideapad_keymap[] = {/* Specific to some newer models */ { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } }, { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } }, +/* Star- (User Assignable Key) */ + { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } }, +/* Eye */ + { KE_KEY, 0x45 | IDEAPAD_WMI_KEY, { KEY_PROG3 } }, +/* Performance toggle also Fn+Q, handled inside ideapad_wmi_notify() */ + { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_PROG4 } }, +/* shift + prtsc */ + { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_CUT } }, + { KE_KEY, 0x29 | IDEAPAD_WMI_KEY, { KEY_TOUCHPAD_TOGGLE } }, + { KE_KEY, 0x2a | IDEAPAD_WMI_KEY, { KEY_ROOT_MENU } }, { KE_END }, };
@@ -2094,6 +2104,12 @@ static void ideapad_wmi_notify(struct wmi_device *wdev, union acpi_object *data)dev_dbg (&wdev->dev,"WMI fn-key event: 0x%llx\n" , data->integer.value); +/* performance button triggered by 0x3d */ +if (data->integer.value ==0x3d && priv->dytc) { +platform_profile_cycle (); +break ; + } +/* 0x02 FnLock, 0x03 Esc */ if (data->integer.value ==0x02 || data->integer.value ==0x03 )ideapad_fn_lock_led_notify (priv, data->integer.value ==0x02 );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 654/783 ASoC: cs42l43: Disable headphone clamps during type detection
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit 70ad2e6bd180f94be030aef56e59693e36d945f3 ]
The headphone clamps cause fairly loud pops during type detect because they sink current from the detection process itself. Disable the clamps whilst the type detect runs, to improve the detection pop performance.
--- sound/soc/codecs/cs42l43-jack.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/codecs/cs42l43-jack.c +7 -0
@@ -654,6 +654,10 @@ static int cs42l43_run_type_detect(struct cs42l43_codec *priv)reinit_completion (&priv->type_detect); +regmap_update_bits (cs42l43->regmap,CS42L43_STEREO_MIC_CLAMP_CTRL , +CS42L43_SMIC_HPAMP_CLAMP_DIS_FRC_VAL_MASK , +CS42L43_SMIC_HPAMP_CLAMP_DIS_FRC_VAL_MASK ); +cs42l43_start_hs_bias (priv, true);regmap_update_bits (cs42l43->regmap,CS42L43_HS2 ,CS42L43_HSDET_MODE_MASK ,0x3 <<CS42L43_HSDET_MODE_SHIFT );
@@ -665,6 +669,9 @@ static int cs42l43_run_type_detect(struct cs42l43_codec *priv) CS42L43_HSDET_MODE_MASK, 0x2 << CS42L43_HSDET_MODE_SHIFT);cs42l43_stop_hs_bias (priv); +regmap_update_bits (cs42l43->regmap,CS42L43_STEREO_MIC_CLAMP_CTRL , +CS42L43_SMIC_HPAMP_CLAMP_DIS_FRC_VAL_MASK ,0 ); +if (!time_left)return -ETIMEDOUT ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 655/783 ASoC: Intel: bytcr_rt5640: Add DMI quirk for Acer Aspire SW3-013
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit a549b927ea3f5e50b1394209b64e6e17e31d4db8 ]
Acer Aspire SW3-013 requires the very same quirk as other Acer Aspire model for making it working.
--- sound/soc/intel/boards/bytcr_rt5640.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
sound/soc/intel/boards/bytcr_rt5640.c +13 -0
@@ -576,6 +576,19 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {BYT_RT5640_SSP0_AIF2 | BYT_RT5640_MCLK_EN), }, + { /* Acer Aspire SW3-013 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW3-013"), + }, + .driver_data = (void *)(BYT_RT5640_DMIC1_MAP | +BYT_RT5640_JD_SRC_JD2_IN4N | +BYT_RT5640_OVCD_TH_2000UA | +BYT_RT5640_OVCD_SF_0P75 | +BYT_RT5640_DIFF_MIC | +BYT_RT5640_SSP0_AIF1 | + BYT_RT5640_MCLK_EN), + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 656/783 ALSA: hda/realtek: Add quirk for HP Spectre x360 15-df1xxx
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit be0c40da888840fe91b45474cb70779e6cbaf7ca ]
HP Spectre x360 15-df1xxx with SSID 13c:863e requires similar workarounds that were applied to another HP Spectre x360 models; it has a mute LED only, no micmute LEDs, and needs the speaker GPIO seup.
--- sound/pci/hda/patch_realtek.c | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
sound/pci/hda/patch_realtek.c +42 -0
@@ -6963,6 +6963,41 @@ static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec, } } +/* GPIO1 = amplifier on/off */ +static void alc285_fixup_hp_spectre_x360_df1 (struct hda_codec *codec, +const struct hda_fixup *fix, +int action) +{ +struct alc_spec *spec = codec->spec; +static const hda_nid_t conn[] = {0x02 }; +static const struct hda_pintbl pincfgs[] = { + {0x14 ,0x90170110 },/* front/high speakers */ + {0x17 ,0x90170130 },/* back/bass speakers */ + { } + }; + +// enable mute led +alc285_fixup_hp_mute_led_coefbit (codec, fix, action); + +switch (action) { +case HDA_FIXUP_ACT_PRE_PROBE : +/* needed for amp of back speakers */ + spec->gpio_mask |=0x01 ; + spec->gpio_dir |=0x01 ; +snd_hda_apply_pincfgs (codec, pincfgs); +/* share DAC to have unified volume control */ +snd_hda_override_conn_list (codec,0x14 ,ARRAY_SIZE (conn), conn); +snd_hda_override_conn_list (codec,0x17 ,ARRAY_SIZE (conn), conn); +break ; +case HDA_FIXUP_ACT_INIT : +/* need to toggle GPIO to enable the amp of back speakers */ +alc_update_gpio_data (codec,0x01 , true); +msleep (100 ); +alc_update_gpio_data (codec,0x01 , false); +break ; + } +} +static void alc285_fixup_hp_spectre_x360 (struct hda_codec *codec,const struct hda_fixup *fix,int action) {
@@ -7743,6 +7778,7 @@ enum {ALC280_FIXUP_HP_9480M ,ALC245_FIXUP_HP_X360_AMP ,ALC285_FIXUP_HP_SPECTRE_X360_EB1 , +ALC285_FIXUP_HP_SPECTRE_X360_DF1 ,ALC285_FIXUP_HP_ENVY_X360 ,ALC288_FIXUP_DELL_HEADSET_MODE , ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
@@ -9818,6 +9854,10 @@ static const struct hda_fixup alc269_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc285_fixup_hp_spectre_x360_eb1 }, + [ALC285_FIXUP_HP_SPECTRE_X360_DF1] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc285_fixup_hp_spectre_x360_df1 + }, [ALC285_FIXUP_HP_ENVY_X360] = { .type = HDA_FIXUP_FUNC, .v.func = alc285_fixup_hp_envy_x360,
@@ -10541,6 +10581,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x86c1 ,"HP Laptop 15-da3001TU" ,ALC236_FIXUP_HP_MUTE_LED_COEFBIT2 ),SND_PCI_QUIRK (0x103c ,0x86c7 ,"HP Envy AiO 32" ,ALC274_FIXUP_HP_ENVY_GPIO ),SND_PCI_QUIRK (0x103c ,0x86e7 ,"HP Spectre x360 15-eb0xxx" ,ALC285_FIXUP_HP_SPECTRE_X360_EB1 ), +SND_PCI_QUIRK (0x103c ,0x863e ,"HP Spectre x360 15-df1xxx" ,ALC285_FIXUP_HP_SPECTRE_X360_DF1 ),SND_PCI_QUIRK (0x103c ,0x86e8 ,"HP Spectre x360 15-eb0xxx" ,ALC285_FIXUP_HP_SPECTRE_X360_EB1 ),SND_PCI_QUIRK (0x103c ,0x86f9 ,"HP Spectre x360 13-aw0xxx" ,ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED ), SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
@@ -11457,6 +11498,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"}, + {.id = ALC285_FIXUP_HP_SPECTRE_X360_DF1, .name = "alc285-hp-spectre-x360-df1"}, {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"}, {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 657/783 drm/ttm: fix the warning for hit_low and evict_low
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sunil Khatri <[email protected]>
[ Upstream commit 76047483fe94414edf409dc498498abf346e22f1 ]
fix the below warning messages:ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'hit_low' not described in 'ttm_bo_swapout_walk' ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'evict_low' not described in 'ttm_bo_swapout_walk'
--- drivers/gpu/drm/ttm/ttm_bo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
@@ -1092,7 +1092,8 @@ struct ttm_bo_swapout_walk {struct ttm_lru_walk walk;/** @gfp_flags: The gfp flags to use for ttm_tt_swapout() */ gfp_t gfp_flags; - +/** @hit_low: Whether we should attempt to swap BO's with low watermark threshold */ +/** @evict_low: If we cannot swap a bo when @try_low is false (first pass) */ bool hit_low, evict_low; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 658/783 nvme-pci: add quirks for device 126f:1001
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Guan <[email protected]>
[ Upstream commit 5b960f92ac3e5b4d7f60a506a6b6735eead1da01 ]
This commit adds NVME_QUIRK_NO_DEEPEST_PS and NVME_QUIRK_BOGUS_NID for device [126f:1001].
It is similar to commit e89086c43f05 ("drivers/nvme: Add quirks for device 126f:2262")
Diff is according the dmesg, use NVME_QUIRK_IGNORE_DEV_SUBNQN.
dmesg | grep -i nvme0:
nvme nvme0: pci function 0000:01:00.0
nvme nvme0: missing or invalid SUBNQN field.
nvme nvme0: 12/0/0 default/read/poll queues
--- drivers/nvme/host/pci.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/host/pci.c +3 -0
@@ -3628,6 +3628,9 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1217, 0x8760), /* O2 Micro 64GB Steam Deck */ .driver_data = NVME_QUIRK_DMAPOOL_ALIGN_512, }, + { PCI_DEVICE(0x126f, 0x1001), /* Silicon Motion generic */ + .driver_data = NVME_QUIRK_NO_DEEPEST_PS | + NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x126f, 0x2262), /* Silicon Motion generic */ .driver_data = NVME_QUIRK_NO_DEEPEST_PS | NVME_QUIRK_BOGUS_NID, },
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 659/783 nvme-pci: add quirks for WDC Blue SN550 15b7:5009
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Guan <[email protected]>
[ Upstream commit ab35ad950d439ec3409509835d229b3d93d3c7f9 ]
Add two quirks for the WDC Blue SN550 (PCI ID 15b7:5009) based on user reports and hardware analysis:
- NVME_QUIRK_NO_DEEPEST_PS:
liaozw talked to me the problem and solved with nvme_core.default_ps_max_latency_us=0, so add the quirk. I also found some reports in the following link.
- NVME_QUIRK_BROKEN_MSI:
after get the lspci from Jack Rio.
I think that the disk also have NVME_QUIRK_BROKEN_MSI. described in commit d5887dc6b6c0 ("nvme-pci: Add quirk for broken MSIs") as sean said in link which match the MSI 1/32 and MSI-X 17.
Log:
lspci -nn | grep -i memory
03:00.0 Non-Volatile memory controller [0108]: Sandisk Corp SanDisk Ultra 3D / WD PC SN530, IX SN530, Blue SN550 NVMe SSD (DRAM-less) [15b7:5009] (rev 01) lspci -v -d 15b7:5009
03:00.0 Non-Volatile memory controller: Sandisk Corp SanDisk Ultra 3D / WD PC SN530, IX SN530, Blue SN550 NVMe SSD (DRAM-less) (rev 01) (prog-if 02 [NVM Express])
Subsystem: Sandisk Corp WD Blue SN550 NVMe SSD
Flags: bus master, fast devsel, latency 0, IRQ 35, IOMMU group 10
Memory at fe800000 (64-bit, non-prefetchable) [size=16K]
Memory at fe804000 (64-bit, non-prefetchable) [size=256]
Capabilities: [80] Power Management version 3
Capabilities: [90] MSI: Enable- Count=1/32 Maskable- 64bit+
Capabilities: [b0] MSI-X: Enable+ Count=17 Masked-
Capabilities: [c0] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [150] Device Serial Number 00-00-00-00-00-00-00-00
Capabilities: [1b8] Latency Tolerance Reporting
Capabilities: [300] Secondary PCI Express
Capabilities: [900] L1 PM Substates
Kernel driver in use: nvme
dmesg | grep nvme
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-6.12.20-amd64-desktop-rolling root=UUID= ro splash quiet nvme_core.default_ps_max_latency_us=0 DEEPIN_GFXMODE= [ 0.059301] Kernel command line: BOOT_IMAGE=/vmlinuz-6.12.20-amd64-desktop-rolling root=UUID= ro splash quiet nvme_core.default_ps_max_latency_us=0 DEEPIN_GFXMODE= [ 0.542430] nvme nvme0: pci function 0000:03:00.0 [ 0.560426] nvme nvme0: allocated 32 MiB host memory buffer. [ 0.562491] nvme nvme0: 16/0/0 default/read/poll queues [ 0.567764] nvme0n1: p1 p2 p3 p4 p5 p6 p7 p8 p9 [ 6.388726] EXT4-fs (nvme0n1p7): mounted filesystem ro with ordered data mode. Quota mode: none. [ 6.893421] EXT4-fs (nvme0n1p7): re-mounted r/w. Quota mode: none. [ 7.125419] Adding 16777212k swap on /dev/nvme0n1p8. Priority:-2 extents:1 across:16777212k SS [ 7.157588] EXT4-fs (nvme0n1p6): mounted filesystem r/w with ordered data mode. Quota mode: none. [ 7.165021] EXT4-fs (nvme0n1p9): mounted filesystem r/w with ordered data mode. Quota mode: none. [ 8.036932] nvme nvme0: using unchecked data buffer [ 8.096023] block nvme0n1: No UUID available providing old NGUID
--- drivers/nvme/host/pci.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/host/pci.c +3 -0
@@ -3654,6 +3654,9 @@ static const struct pci_device_id nvme_id_table[] = { NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x15b7, 0x5008), /* Sandisk SN530 */ .driver_data = NVME_QUIRK_BROKEN_MSI }, + { PCI_DEVICE(0x15b7, 0x5009), /* Sandisk SN550 */ + .driver_data =NVME_QUIRK_BROKEN_MSI | + NVME_QUIRK_NO_DEEPEST_PS }, { PCI_DEVICE(0x1987, 0x5012), /* Phison E12 */ .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1987, 0x5016), /* Phison E16 */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 660/783 ALSA: usb-audio: Fix duplicated name in MIDI substream names
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 0759e77a6d9bd34a874da73721ce4a7dc6665023 ]
The MIDI substream name string is constructed from the combination of the card shortname (which is taken from USB iProduct) and the USB iJack. The problem is that some devices put the product name to the iJack field, too. For example, aplaymidi -l output on the Lanchkey MK 49 are like:
% aplaymidi -l
Port Client name Port name 44:0 Launchkey MK4 49 Launchkey MK4 49 Launchkey MK4 44:1 Launchkey MK4 49 Launchkey MK4 49 Launchkey MK4
where the actual iJack name can't be seen because it's truncated due to the doubly words.
For resolving those situations, this patch compares the iJack string with the card shortname, and drops if both start with the same words. Then the result becomes like:
% aplaymidi -l
Port Client name Port name 40:0 Launchkey MK4 49 Launchkey MK4 49 MIDI In 40:1 Launchkey MK4 49 Launchkey MK4 49 DAW In
A caveat is that there are some pre-defined names for certain devices in the driver code, and this workaround shouldn't be applied to them. Similarly, when the iJack isn't specified, we should skip this check, too. The patch added those checks in addition to the string comparison.
--- sound/usb/midi.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
sound/usb/midi.c +12 -4
@@ -1885,10 +1885,18 @@ static void snd_usbmidi_init_substream(struct snd_usb_midi *umidi, } port_info =find_port_info (umidi, number); - name_format = port_info ? port_info->name : - (jack_name != default_jack_name ?"%s %s" :"%s %s %d" ); -snprintf (substream->name,sizeof (substream->name), - name_format, umidi->card->shortname, jack_name, number +1 ); +if (port_info || jack_name == default_jack_name || +strncmp (umidi->card->shortname, jack_name,strlen (umidi->card->shortname)) !=0 ) { + name_format = port_info ? port_info->name : + (jack_name != default_jack_name ?"%s %s" :"%s %s %d" ); +snprintf (substream->name,sizeof (substream->name), + name_format, umidi->card->shortname, jack_name, number +1 ); + }else { +/* The manufacturer included the iProduct name in the jack +* name, do not use both +*/ +strscpy (substream->name, jack_name); + } *rsubstream = substream; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 661/783 nvmet-tcp: dont restore null sk_state_change
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alistair Francis <[email protected]>
[ Upstream commit 46d22b47df2741996af277a2838b95f130436c13 ]
queue->state_change is set as part of nvmet_tcp_set_queue_sock(), but if the TCP connection isn't established when nvmet_tcp_set_queue_sock() is called then queue->state_change isn't set and sock->sk->sk_state_change isn't replaced.
As such we don't need to restore sock->sk->sk_state_change if queue->state_change is NULL.
This avoids NULL pointer dereferences such as this:
[ 286.462026][ C0] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 286.462814][ C0] #PF: supervisor instruction fetch in kernel mode [ 286.463796][ C0] #PF: error_code(0x0010) - not-present page [ 286.464392][ C0] PGD 8000000140620067 P4D 8000000140620067 PUD 114201067 PMD 0 [ 286.465086][ C0] Oops: Oops: 0010 [#1] SMP KASAN PTI [ 286.465559][ C0] CPU: 0 UID: 0 PID: 1628 Comm: nvme Not tainted 6.15.0-rc2+ #11 PREEMPT(voluntary) [ 286.466393][ C0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-3.fc41 04/01/2014 [ 286.467147][ C0] RIP: 0010:0x0 [ 286.467420][ C0] Code: Unable to access opcode bytes at 0xffffffffffffffd6. [ 286.467977][ C0] RSP: 0018:ffff8883ae008580 EFLAGS: 00010246 [ 286.468425][ C0] RAX: 0000000000000000 RBX: ffff88813fd34100 RCX: ffffffffa386cc43 [ 286.469019][ C0] RDX: 1ffff11027fa68b6 RSI: 0000000000000008 RDI: ffff88813fd34100 [ 286.469545][ C0] RBP: ffff88813fd34160 R08: 0000000000000000 R09: ffffed1027fa682c [ 286.470072][ C0] R10: ffff88813fd34167 R11: 0000000000000000 R12: ffff88813fd344c3 [ 286.470585][ C0] R13: ffff88813fd34112 R14: ffff88813fd34aec R15: ffff888132cdd268 [ 286.471070][ C0] FS: 00007fe3c04c7d80(0000) GS:ffff88840743f000(0000) knlGS:0000000000000000 [ 286.471644][ C0] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 286.472543][ C0] CR2: ffffffffffffffd6 CR3: 000000012daca000 CR4: 00000000000006f0 [ 286.473500][ C0] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 286.474467][ C0] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 0000000000000400 [ 286.475453][ C0] Call Trace: [ 286.476102][ C0] <IRQ> [ 286.476719][ C0] tcp_fin+0x2bb/0x440 [ 286.477429][ C0] tcp_data_queue+0x190f/0x4e60 [ 286.478174][ C0] ? __build_skb_around+0x234/0x330 [ 286.478940][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.479659][ C0] ? __pfx_tcp_data_queue+0x10/0x10 [ 286.480431][ C0] ? tcp_try_undo_loss+0x640/0x6c0 [ 286.481196][ C0] ? seqcount_lockdep_reader_access.constprop.0+0x82/0x90 [ 286.482046][ C0] ? kvm_clock_get_cycles+0x14/0x30 [ 286.482769][ C0] ? ktime_get+0x66/0x150 [ 286.483433][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.484146][ C0] tcp_rcv_established+0x6e4/0x2050 [ 286.484857][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.485523][ C0] ? ipv4_dst_check+0x160/0x2b0 [ 286.486203][ C0] ? __pfx_tcp_rcv_established+0x10/0x10 [ 286.486917][ C0] ? lock_release+0x217/0x2c0 [ 286.487595][ C0] tcp_v4_do_rcv+0x4d6/0x9b0 [ 286.488279][ C0] tcp_v4_rcv+0x2af8/0x3e30 [ 286.488904][ C0] ? raw_local_deliver+0x51b/0xad0 [ 286.489551][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.490198][ C0] ? __pfx_tcp_v4_rcv+0x10/0x10 [ 286.490813][ C0] ? __pfx_raw_local_deliver+0x10/0x10 [ 286.491487][ C0] ? __pfx_nf_confirm+0x10/0x10 [nf_conntrack] [ 286.492275][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.492900][ C0] ip_protocol_deliver_rcu+0x8f/0x370 [ 286.493579][ C0] ip_local_deliver_finish+0x297/0x420 [ 286.494268][ C0] ip_local_deliver+0x168/0x430 [ 286.494867][ C0] ? __pfx_ip_local_deliver+0x10/0x10 [ 286.495498][ C0] ? __pfx_ip_local_deliver_finish+0x10/0x10 [ 286.496204][ C0] ? ip_rcv_finish_core+0x19a/0x1f20 [ 286.496806][ C0] ? lock_release+0x217/0x2c0 [ 286.497414][ C0] ip_rcv+0x455/0x6e0 [ 286.497945][ C0] ? __pfx_ip_rcv+0x10/0x10 [ 286.498550][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.499137][ C0] ? __pfx_ip_rcv_finish+0x10/0x10 [ 286.499763][ C0] ? lock_release+0x217/0x2c0 [ 286.500327][ C0] ? dl_scaled_delta_exec+0xd1/0x2c0 [ 286.500922][ C0] ? __pfx_ip_rcv+0x10/0x10 [ 286.501480][ C0] __netif_receive_skb_one_core+0x166/0x1b0 [ 286.502173][ C0] ? __pfx___netif_receive_skb_one_core+0x10/0x10 [ 286.502903][ C0] ? lock_acquire+0x2b2/0x310 [ 286.503487][ C0] ? process_backlog+0x372/0x1350 [ 286.504087][ C0] ? lock_release+0x217/0x2c0 [ 286.504642][ C0] process_backlog+0x3b9/0x1350 [ 286.505214][ C0] ? process_backlog+0x372/0x1350 [ 286.505779][ C0] __napi_poll.constprop.0+0xa6/0x490 [ 286.506363][ C0] net_rx_action+0x92e/0xe10 [ 286.506889][ C0] ? __pfx_net_rx_action+0x10/0x10 [ 286.507437][ C0] ? timerqueue_add+0x1f0/0x320 [ 286.507977][ C0] ? sched_clock_cpu+0x68/0x540 [ 286.508492][ C0] ? lock_acquire+0x2b2/0x310 [ 286.509043][ C0] ? kvm_sched_clock_read+0xd/0x20 [ 286.509607][ C0] ? handle_softirqs+0x1aa/0x7d0 [ 286.510187][ C0] handle_softirqs+0x1f2/0x7d0 [ 286.510754][ C0] ? __pfx_handle_softirqs+0x10/0x10 [ 286.511348][ C0] ? irqtime_account_irq+0x181/0x290 [ 286.511937][ C0] ? __dev_queue_xmit+0x85d/0x3450 [ 286.512510][ C0] do_softirq.part.0+0x89/0xc0 [ 286.513100][ C0] </IRQ> [ 286.513548][ C0] <TASK> [ 286.513953][ C0] __local_bh_enable_ip+0x112/0x140 [ 286.514522][ C0] ? __dev_queue_xmit+0x85d/0x3450 [ 286.515072][ C0] __dev_queue_xmit+0x872/0x3450 [ 286.515619][ C0] ? nft_do_chain+0xe16/0x15b0 [nf_tables] [ 286.516252][ C0] ? __pfx___dev_queue_xmit+0x10/0x10 [ 286.516817][ C0] ? selinux_ip_postroute+0x43c/0xc50 [ 286.517433][ C0] ? __pfx_selinux_ip_postroute+0x10/0x10 [ 286.518061][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.518606][ C0] ? ip_output+0x164/0x4a0 [ 286.519149][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.519671][ C0] ? ip_finish_output2+0x17d5/0x1fb0 [ 286.520258][ C0] ip_finish_output2+0xb4b/0x1fb0 [ 286.520787][ C0] ? __pfx_ip_finish_output2+0x10/0x10 [ 286.521355][ C0] ? __ip_finish_output+0x15d/0x750 [ 286.521890][ C0] ip_output+0x164/0x4a0 [ 286.522372][ C0] ? __pfx_ip_output+0x10/0x10 [ 286.522872][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.523402][ C0] ? _raw_spin_unlock_irqrestore+0x4c/0x60 [ 286.524031][ C0] ? __pfx_ip_finish_output+0x10/0x10 [ 286.524605][ C0] ? __ip_queue_xmit+0x999/0x2260 [ 286.525200][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.525744][ C0] ? ipv4_dst_check+0x16a/0x2b0 [ 286.526279][ C0] ? lock_release+0x217/0x2c0 [ 286.526793][ C0] __ip_queue_xmit+0x1883/0x2260 [ 286.527324][ C0] ? __skb_clone+0x54c/0x730 [ 286.527827][ C0] __tcp_transmit_skb+0x209b/0x37a0 [ 286.528374][ C0] ? __pfx___tcp_transmit_skb+0x10/0x10 [ 286.528952][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.529472][ C0] ? seqcount_lockdep_reader_access.constprop.0+0x82/0x90 [ 286.530152][ C0] ? trace_hardirqs_on+0x12/0x120 [ 286.530691][ C0] tcp_write_xmit+0xb81/0x88b0 [ 286.531224][ C0] ? mod_memcg_state+0x4d/0x60 [ 286.531736][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.532253][ C0] __tcp_push_pending_frames+0x90/0x320 [ 286.532826][ C0] tcp_send_fin+0x141/0xb50 [ 286.533352][ C0] ? __pfx_tcp_send_fin+0x10/0x10 [ 286.533908][ C0] ? __local_bh_enable_ip+0xab/0x140 [ 286.534495][ C0] inet_shutdown+0x243/0x320 [ 286.535077][ C0] nvme_tcp_alloc_queue+0xb3b/0x2590 [nvme_tcp] [ 286.535709][ C0] ? do_raw_spin_lock+0x129/0x260 [ 286.536314][ C0] ? __pfx_nvme_tcp_alloc_queue+0x10/0x10 [nvme_tcp] [ 286.536996][ C0] ? do_raw_spin_unlock+0x54/0x1e0 [ 286.537550][ C0] ? _raw_spin_unlock+0x29/0x50 [ 286.538127][ C0] ? do_raw_spin_lock+0x129/0x260 [ 286.538664][ C0] ? __pfx_do_raw_spin_lock+0x10/0x10 [ 286.539249][ C0] ? nvme_tcp_alloc_admin_queue+0xd5/0x340 [nvme_tcp] [ 286.539892][ C0] ? __wake_up+0x40/0x60 [ 286.540392][ C0] nvme_tcp_alloc_admin_queue+0xd5/0x340 [nvme_tcp] [ 286.541047][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.541589][ C0] nvme_tcp_setup_ctrl+0x8b/0x7a0 [nvme_tcp] [ 286.542254][ C0] ? _raw_spin_unlock_irqrestore+0x4c/0x60 [ 286.542887][ C0] ? __pfx_nvme_tcp_setup_ctrl+0x10/0x10 [nvme_tcp] [ 286.543568][ C0] ? trace_hardirqs_on+0x12/0x120 [ 286.544166][ C0] ? _raw_spin_unlock_irqrestore+0x35/0x60 [ 286.544792][ C0] ? nvme_change_ctrl_state+0x196/0x2e0 [nvme_core] [ 286.545477][ C0] nvme_tcp_create_ctrl+0x839/0xb90 [nvme_tcp] [ 286.546126][ C0] nvmf_dev_write+0x3db/0x7e0 [nvme_fabrics] [ 286.546775][ C0] ? rw_verify_area+0x69/0x520 [ 286.547334][ C0] vfs_write+0x218/0xe90 [ 286.547854][ C0] ? do_syscall_64+0x9f/0x190 [ 286.548408][ C0] ? trace_hardirqs_on_prepare+0xdb/0x120 [ 286.549037][ C0] ? syscall_exit_to_user_mode+0x93/0x280 [ 286.549659][ C0] ? __pfx_vfs_write+0x10/0x10 [ 286.550259][ C0] ? do_syscall_64+0x9f/0x190 [ 286.550840][ C0] ? syscall_exit_to_user_mode+0x8e/0x280 [ 286.551516][ C0] ? trace_hardirqs_on_prepare+0xdb/0x120 [ 286.552180][ C0] ? syscall_exit_to_user_mode+0x93/0x280 [ 286.552834][ C0] ? ksys_read+0xf5/0x1c0 [ 286.553386][ C0] ? __pfx_ksys_read+0x10/0x10 [ 286.553964][ C0] ksys_write+0xf5/0x1c0 [ 286.554499][ C0] ? __pfx_ksys_write+0x10/0x10 [ 286.555072][ C0] ? trace_hardirqs_on_prepare+0xdb/0x120 [ 286.555698][ C0] ? syscall_exit_to_user_mode+0x93/0x280 [ 286.556319][ C0] ? do_syscall_64+0x54/0x190 [ 286.556866][ C0] do_syscall_64+0x93/0x190 [ 286.557420][ C0] ? rcu_read_unlock+0x17/0x60 [ 286.557986][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.558526][ C0] ? lock_release+0x217/0x2c0 [ 286.559087][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.559659][ C0] ? count_memcg_events.constprop.0+0x4a/0x60 [ 286.560476][ C0] ? exc_page_fault+0x7a/0x110 [ 286.561064][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.561647][ C0] ? lock_release+0x217/0x2c0 [ 286.562257][ C0] ? do_user_addr_fault+0x171/0xa00 [ 286.562839][ C0] ? do_user_addr_fault+0x4a2/0xa00 [ 286.563453][ C0] ? irqentry_exit_to_user_mode+0x84/0x270 [ 286.564112][ C0] ? rcu_is_watching+0x11/0xb0 [ 286.564677][ C0] ? irqentry_exit_to_user_mode+0x84/0x270 [ 286.565317][ C0] ? trace_hardirqs_on_prepare+0xdb/0x120 [ 286.565922][ C0] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 286.566542][ C0] RIP: 0033:0x7fe3c05e6504 [ 286.567102][ C0] Code: c7 00 16 00 00 00 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 80 3d c5 8b 10 00 00 74 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 55 48 89 e5 48 83 ec 20 48 89 [ 286.568931][ C0] RSP: 002b:00007fff76444f58 EFLAGS: 00000202 ORIG_RAX: 0000000000000001 [ 286.569807][ C0] RAX: ffffffffffffffda RBX: 000000003b40d930 RCX: 00007fe3c05e6504 [ 286.570621][ C0] RDX: 00000000000000cf RSI: 000000003b40d930 RDI: 0000000000000003 [ 286.571443][ C0] RBP: 0000000000000003 R08: 00000000000000cf R09: 000000003b40d930 [ 286.572246][ C0] R10: 0000000000000000 R11: 0000000000000202 R12: 000000003b40cd60 [ 286.573069][ C0] R13: 00000000000000cf R14: 00007fe3c07417f8 R15: 00007fe3c073502e [ 286.573886][ C0] </TASK>
--- drivers/nvme/target/tcp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/target/tcp.c +3 -0
@@ -1560,6 +1560,9 @@ static void nvmet_tcp_restore_socket_callbacks(struct nvmet_tcp_queue *queue) {struct socket *sock = queue->sock; +if (!queue->state_change) +return ; +write_lock_bh (&sock->sk->sk_callback_lock); sock->sk->sk_data_ready = queue->data_ready; sock->sk->sk_state_change = queue->state_change;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 662/783 io_uring/fdinfo: annotate racy sq/cq head/tail reads
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
[ Upstream commit f024d3a8ded0d8d2129ae123d7a5305c29ca44ce ]
syzbot complains about the cached sq head read, and it's totally right. But we don't need to care, it's just reading fdinfo, and reading the CQ or SQ tail/head entries are known racy in that they are just a view into that very instant and may of course be outdated by the time they are reported.
Annotate both the SQ head and CQ tail read with data_race() to avoid this syzbot complaint.
--- io_uring/fdinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
io_uring/fdinfo.c +2 -2
@@ -117,11 +117,11 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)seq_printf (m,"SqMask:\t0x%x\n" , sq_mask);seq_printf (m,"SqHead:\t%u\n" , sq_head);seq_printf (m,"SqTail:\t%u\n" , sq_tail); -seq_printf (m,"CachedSqHead:\t%u\n" , ctx->cached_sq_head); +seq_printf (m,"CachedSqHead:\t%u\n" ,data_race (ctx->cached_sq_head));seq_printf (m,"CqMask:\t0x%x\n" , cq_mask);seq_printf (m,"CqHead:\t%u\n" , cq_head);seq_printf (m,"CqTail:\t%u\n" , cq_tail); -seq_printf (m,"CachedCqTail:\t%u\n" , ctx->cached_cq_tail); +seq_printf (m,"CachedCqTail:\t%u\n" ,data_race (ctx->cached_cq_tail));seq_printf (m,"SQEs:\t%u\n" , sq_tail - sq_head); sq_entries =min (sq_tail - sq_head, ctx->sq_entries);for (i =0 ; i < sq_entries; i++) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 663/783 cifs: Fix and improve cifs_query_path_info() and cifs_query_file_info()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pali Rohár <[email protected]>
[ Upstream commit 1041c117a2c33cdffc4f695ac4b469e9124d24d5 ]
When CAP_NT_SMBS was not negotiated then do not issue CIFSSMBQPathInfo() and CIFSSMBQFileInfo() commands. CIFSSMBQPathInfo() is not supported by non-NT Win9x SMB server and CIFSSMBQFileInfo() returns from Win9x SMB server bogus data in Attributes field (for example lot of files are marked as reparse points, even Win9x does not support them and read-only bit is not marked for read-only files). Correct information is returned by CIFSFindFirst() or SMBQueryInformation() command.
So as a fallback in cifs_query_path_info() function use CIFSFindFirst() with SMB_FIND_FILE_FULL_DIRECTORY_INFO level which is supported by both NT and non-NT servers and as a last option use SMBQueryInformation() as it was before.
And in function cifs_query_file_info() immediately returns -EOPNOTSUPP when not communicating with NT server. Client then revalidate inode entry by the cifs_query_path_info() call, which is working fine. So fstat() syscall on already opened file will receive correct information.
Note that both fallback functions in non-UNICODE mode expands wildcards. Therefore those fallback functions cannot be used on paths which contain SMB wildcard characters (* ? " > <).
CIFSFindFirst() returns all 4 time attributes as opposite of SMBQueryInformation() which returns only one.
With this change it is possible to query all 4 times attributes from Win9x server and at the same time, client minimize sending of unsupported commands to server.
--- fs/smb/client/smb1ops.c | 103 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 8 deletions(-)
fs/smb/client/smb1ops.c +95 -8
@@ -541,24 +541,104 @@ static int cifs_query_path_info(const unsigned int xid,const char *full_path, struct cifs_open_info_data *data) { - int rc; + int rc = -EOPNOTSUPP;FILE_ALL_INFO fi = {}; +struct cifs_search_info search_info = {}; +bool non_unicode_wildcard = false; data->reparse_point = false; data->adjust_tz = false; -/* could do find first instead but this returns more info */ - rc =CIFSSMBQPathInfo (xid, tcon, full_path, &fi,0 /* not legacy */ , cifs_sb->local_nls, -cifs_remap (cifs_sb));/* -* BB optimize code so we do not make the above call when server claims -* no NT SMB support and the above call failed at least once - set flag -* in tcon or mount. +* First try CIFSSMBQPathInfo() function which returns more info +* (NumberOfLinks) than CIFSFindFirst() fallback function. +* Some servers like Win9x do not support SMB_QUERY_FILE_ALL_INFO over +* TRANS2_QUERY_PATH_INFORMATION, but supports it with filehandle over +* TRANS2_QUERY_FILE_INFORMATION (function CIFSSMBQFileInfo(). But SMB +* Open command on non-NT servers works only for files, does not work +* for directories. And moreover Win9x SMB server returns bogus data in +* SMB_QUERY_FILE_ALL_INFO Attributes field. So for non-NT servers, +* do not even use CIFSSMBQPathInfo() or CIFSSMBQFileInfo() function. +*/ +if (tcon->ses->capabilities &CAP_NT_SMBS ) + rc =CIFSSMBQPathInfo (xid, tcon, full_path, &fi,0 /* not legacy */ , + cifs_sb->local_nls,cifs_remap (cifs_sb)); + +/* +* Non-UNICODE variant of fallback functions below expands wildcards, +* so they cannot be used for querying paths with wildcard characters. */ -if ((rc == -EOPNOTSUPP ) || (rc == -EINVAL )) { +if (rc && !(tcon->ses->capabilities &CAP_UNICODE ) &&strpbrk (full_path,"*?\"><" )) + non_unicode_wildcard = true; + +/* +* Then fallback to CIFSFindFirst() which works also with non-NT servers +* but does not does not provide NumberOfLinks. +*/ +if ((rc == -EOPNOTSUPP || rc == -EINVAL ) && + !non_unicode_wildcard) { +if (!(tcon->ses->capabilities & tcon->ses->server->vals->cap_nt_find)) + search_info.info_level =SMB_FIND_FILE_INFO_STANDARD ; +else + search_info.info_level =SMB_FIND_FILE_FULL_DIRECTORY_INFO ; + rc =CIFSFindFirst (xid, tcon, full_path, cifs_sb,NULL , +CIFS_SEARCH_CLOSE_ALWAYS |CIFS_SEARCH_CLOSE_AT_END , + &search_info, false); +if (rc ==0 ) { +if (!(tcon->ses->capabilities & tcon->ses->server->vals->cap_nt_find)) { +FIND_FILE_STANDARD_INFO *di; +int offset = tcon->ses->server->timeAdj; + + di = (FIND_FILE_STANDARD_INFO *)search_info.srch_entries_start; + fi.CreationTime =cpu_to_le64 (cifs_UnixTimeToNT (cnvrtDosUnixTm ( + di->CreationDate, di->CreationTime, offset))); + fi.LastAccessTime =cpu_to_le64 (cifs_UnixTimeToNT (cnvrtDosUnixTm ( + di->LastAccessDate, di->LastAccessTime, offset))); + fi.LastWriteTime =cpu_to_le64 (cifs_UnixTimeToNT (cnvrtDosUnixTm ( + di->LastWriteDate, di->LastWriteTime, offset))); + fi.ChangeTime = fi.LastWriteTime; + fi.Attributes =cpu_to_le32 (le16_to_cpu (di->Attributes)); + fi.AllocationSize =cpu_to_le64 (le32_to_cpu (di->AllocationSize)); + fi.EndOfFile =cpu_to_le64 (le32_to_cpu (di->DataSize)); + }else { +FILE_FULL_DIRECTORY_INFO *di; + + di = (FILE_FULL_DIRECTORY_INFO *)search_info.srch_entries_start; + fi.CreationTime = di->CreationTime; + fi.LastAccessTime = di->LastAccessTime; + fi.LastWriteTime = di->LastWriteTime; + fi.ChangeTime = di->ChangeTime; + fi.Attributes = di->ExtFileAttributes; + fi.AllocationSize = di->AllocationSize; + fi.EndOfFile = di->EndOfFile; + fi.EASize = di->EaSize; + } + fi.NumberOfLinks =cpu_to_le32 (1 ); + fi.DeletePending =0 ; + fi.Directory = !!(le32_to_cpu (fi.Attributes) &ATTR_DIRECTORY ); +cifs_buf_release (search_info.ntwrk_buf_start); + }else if (!full_path[0 ]) { +/* +* CIFSFindFirst() does not work on root path if the +* root path was exported on the server from the top +* level path (drive letter). +*/ + rc = -EOPNOTSUPP ; + } + } + +/* +* If everything failed then fallback to the legacy SMB command +* SMB_COM_QUERY_INFORMATION which works with all servers, but +* provide just few information. +*/ +if ((rc == -EOPNOTSUPP || rc == -EINVAL ) && !non_unicode_wildcard) { rc =SMBQueryInformation (xid, tcon, full_path, &fi, cifs_sb->local_nls,cifs_remap (cifs_sb)); data->adjust_tz = true; + }else if ((rc == -EOPNOTSUPP || rc == -EINVAL ) && non_unicode_wildcard) { +/* Path with non-UNICODE wildcard character cannot exist. */ + rc = -ENOENT ; }if (!rc) {
@@ -637,6 +717,13 @@ static int cifs_query_file_info(const unsigned int xid, struct cifs_tcon *tcon,int rc;FILE_ALL_INFO fi = {}; +/* +* CIFSSMBQFileInfo() for non-NT servers returns bogus data in +* Attributes fields. So do not use this command for non-NT servers. +*/ +if (!(tcon->ses->capabilities &CAP_NT_SMBS )) +return -EOPNOTSUPP ; +if (cfile->symlink_target) { data->symlink_target =kstrdup (cfile->symlink_target,GFP_KERNEL );if (!data->symlink_target)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 664/783 cifs: Fix changing times and read-only attr over SMB1 smb_set_file_info() function
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pali Rohár <[email protected]>
[ Upstream commit f122121796f91168d0894c2710b8dd71330a34f8 ]
Function CIFSSMBSetPathInfo() is not supported by non-NT servers and returns error. Fallback code via open filehandle and CIFSSMBSetFileInfo() does not work neither because CIFS_open() works also only on NT server.
Therefore currently the whole smb_set_file_info() function as a SMB1 callback for the ->set_file_info() does not work with older non-NT SMB servers, like Win9x and others.
This change implements fallback code in smb_set_file_info() which will works with any server and allows to change time values and also to set or clear read-only attributes.
To make existing fallback code via CIFSSMBSetFileInfo() working with also non-NT servers, it is needed to change open function from CIFS_open() (which is NT specific) to cifs_open_file() which works with any server (this is just a open wrapper function which choose the correct open function supported by the server).
CIFSSMBSetFileInfo() is working also on non-NT servers, but zero time values are not treated specially. So first it is needed to fill all time values if some of them are missing, via cifs_query_path_info() call.
There is another issue, opening file in write-mode (needed for changing attributes) is not possible when the file has read-only attribute set. The only option how to clear read-only attribute is via SMB_COM_SETATTR command. And opening directory is not possible neither and here the SMB_COM_SETATTR command is the only option how to change attributes. And CIFSSMBSetFileInfo() does not honor setting read-only attribute, so for setting is also needed to use SMB_COM_SETATTR command.
Existing code in cifs_query_path_info() is already using SMB_COM_GETATTR as a fallback code path (function SMBQueryInformation()), so introduce a new function SMBSetInformation which will implement SMB_COM_SETATTR command.
My testing showed that Windows XP SMB1 client is also using SMB_COM_SETATTR command for setting or clearing read-only attribute against non-NT server. So this can prove that this is the correct way how to do it.
With this change it is possible set all 4 time values and all attributes, including clearing and setting read-only bit on non-NT SMB servers. Tested against Win98 SMB1 server.
This change fixes "touch" command which was failing when called on existing file. And fixes also "chmod +w" and "chmod -w" commands which were also failing (as they are changing read-only attribute).
Note that this change depends on following change "cifs: Improve cifs_query_path_info() and cifs_query_file_info()" as it require to query all 4 time attribute values.
--- fs/smb/client/cifspdu.h | 5 +- fs/smb/client/cifsproto.h | 4 ++ fs/smb/client/cifssmb.c | 57 +++++++++++++++++++ fs/smb/client/smb1ops.c | 112 +++++++++++++++++++++++++++++++++++--- 4 files changed, 166 insertions(+), 12 deletions(-)
fs/smb/client/cifspdu.h +2 -3
@@ -1266,10 +1266,9 @@ typedef struct smb_com_query_information_rsp {typedef struct smb_com_setattr_req {struct smb_hdr hdr;/* wct = 8 */ __le16 attr; -__le16 time_low; -__le16 time_high; +__le32 last_write_time;__le16 reserved[5 ];/* must be zero */ -__u16 ByteCount; +__le16 ByteCount;__u8 BufferFormat;/* 4 = ASCII */ unsigned char fileName[]; } __attribute__((packed))SETATTR_REQ ;
fs/smb/client/cifsproto.h +4 -0
@@ -395,6 +395,10 @@ extern int CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon);extern int CIFSSMBQFSPosixInfo (const unsigned int xid,struct cifs_tcon *tcon,struct kstatfs *FSData); +extern int SMBSetInformation (const unsigned int xid,struct cifs_tcon *tcon, +const char *fileName,__le32 attributes,__le64 write_time, +const struct nls_table *nls_codepage, +struct cifs_sb_info *cifs_sb); extern int CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon, const char *fileName, const FILE_BASIC_INFO *data, const struct nls_table *nls_codepage,
fs/smb/client/cifssmb.c +57 -0
63 lines not on this page · raw message
fs/smb/client/smb1ops.c +103 -9
149 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 665/783 ASoC: intel/sdw_utils: Add volume limit to cs42l43 speakers
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Binding <[email protected]>
[ Upstream commit 02b44a2b2bdcee03cbb92484d31e9ca1b91b2a38 ]
The volume control for cs42l43 speakers has a maximum gain of +31.5 dB. However, for many use cases, this can cause distorted audio, depending various factors, such as other signal-processing elements in the chain, for example if the audio passes through a gain control before reaching the codec or the signal path has been tuned for a particular maximum gain in the codec.
In the case of systems which use the soc_sdw_cs42l43 driver, audio will likely be distorted in all cases above 0 dB, therefore add a volume limit of 128, which is 0 dB maximum volume inside this driver.
--- sound/soc/sdw_utils/soc_sdw_cs42l43.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/soc/sdw_utils/soc_sdw_cs42l43.c +10 -0
@@ -20,6 +20,8 @@#include <sound/soc-dapm.h> #include <sound/soc_sdw_utils.h> +#define CS42L43_SPK_VOLUME_0DB 128/* 0dB Max */ +static const struct snd_soc_dapm_route cs42l43_hs_map[] = { {"Headphone" ,NULL ,"cs42l43 AMP3_OUT" }, {"Headphone" ,NULL ,"cs42l43 AMP4_OUT" },
@@ -117,6 +119,14 @@ int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soreturn -ENOMEM ; } + ret =snd_soc_limit_volume (card,"cs42l43 Speaker Digital Volume" , +CS42L43_SPK_VOLUME_0DB ); +if (ret) +dev_err (card->dev,"cs42l43 speaker volume limit failed: %d\n" , ret); +else +dev_info (card->dev,"Setting CS42L43 Speaker volume limit to %d\n" , +CS42L43_SPK_VOLUME_0DB ); + ret =snd_soc_dapm_add_routes (&card->dapm, cs42l43_spk_map,ARRAY_SIZE (cs42l43_spk_map));if (ret)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 666/783 ASoC: intel/sdw_utils: Add volume limit to cs35l56 speakers
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Binding <[email protected]>
[ Upstream commit d5463e531c128ff1b141fdba2e13345cd50028a4 ]
The volume control for cs35l56 speakers has a maximum gain of +12 dB. However, for many use cases, this can cause distorted audio, depending various factors, such as other signal-processing elements in the chain, for example if the audio passes through a gain control before reaching the amp or the signal path has been tuned for a particular maximum gain in the amp.
In the case of systems which use the soc_sdw_* driver, audio will likely be distorted in all cases above 0 dB, therefore add a volume limit of 400, which is 0 dB maximum volume inside this driver.
The volume limit should be applied to both soundwire and soundwire bridge configurations.
--- include/sound/soc_sdw_utils.h | 1 + sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c | 4 ++++ sound/soc/sdw_utils/soc_sdw_cs_amp.c | 24 ++++++++++++++++++++ 3 files changed, 29 insertions(+)
include/sound/soc_sdw_utils.h +1 -0
@@ -226,6 +226,7 @@ int asoc_sdw_cs_amp_init(struct snd_soc_card *card, bool playback);int asoc_sdw_cs_spk_feedback_rtd_init (struct snd_soc_pcm_runtime *rtd,struct snd_soc_dai *dai); +int asoc_sdw_cs35l56_volume_limit (struct snd_soc_card *card,const char *name_prefix);/* MAXIM codec support */ int asoc_sdw_maxim_init(struct snd_soc_card *card,
sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c +4 -0
@@ -60,6 +60,10 @@ static int asoc_sdw_bridge_cs35l56_asp_init(struct snd_soc_pcm_runtime *rtd)/* 4 x 16-bit sample slots and FSYNC=48000, BCLK=3.072 MHz */ for_each_rtd_codec_dais (rtd, i, codec_dai) { + ret =asoc_sdw_cs35l56_volume_limit (card, codec_dai->component->name_prefix); +if (ret) +return ret; + ret =snd_soc_dai_set_tdm_slot (codec_dai, tx_mask, rx_mask,4 ,16 );if (ret <0 )return ret;
sound/soc/sdw_utils/soc_sdw_cs_amp.c +24 -0
@@ -16,6 +16,25 @@#define CODEC_NAME_SIZE 8#define CS_AMP_CHANNELS_PER_AMP 4 +#define CS35L56_SPK_VOLUME_0DB 400/* 0dB Max */ + +int asoc_sdw_cs35l56_volume_limit (struct snd_soc_card *card,const char *name_prefix) +{ +char *volume_ctl_name; +int ret; + + volume_ctl_name =kasprintf (GFP_KERNEL ,"%s Speaker Volume" , name_prefix); +if (!volume_ctl_name) +return -ENOMEM ; + + ret =snd_soc_limit_volume (card, volume_ctl_name,CS35L56_SPK_VOLUME_0DB ); +if (ret) +dev_err (card->dev,"%s limit set failed: %d\n" , volume_ctl_name, ret); + +kfree (volume_ctl_name); +return ret; +} +EXPORT_SYMBOL_NS (asoc_sdw_cs35l56_volume_limit,"SND_SOC_SDW_UTILS" );int asoc_sdw_cs_spk_rtd_init (struct snd_soc_pcm_runtime *rtd,struct snd_soc_dai *dai) {
@@ -40,6 +59,11 @@ int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_daisnprintf (widget_name,sizeof (widget_name),"%s SPK" , codec_dai->component->name_prefix); + + ret =asoc_sdw_cs35l56_volume_limit (card, codec_dai->component->name_prefix); +if (ret) +return ret; + ret =snd_soc_dapm_add_routes (&card->dapm, &route,1 );if (ret)return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 667/783 iio: accel: fxls8962af: Fix wakeup source leaks on device unbind
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 0cd34d98dfd4f2b596415b8f12faf7b946613458 ]
Device can be unbound, so driver must also release memory for the wakeup source.
--- drivers/iio/accel/fxls8962af-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/iio/accel/fxls8962af-core.c +5 -2
@@ -1229,8 +1229,11 @@ int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq)if (ret)return ret; -if (device_property_read_bool (dev,"wakeup-source" )) -device_init_wakeup (dev, true); +if (device_property_read_bool (dev,"wakeup-source" )) { + ret =devm_device_init_wakeup (dev); +if (ret) +return dev_err_probe (dev, ret,"Failed to init wakeup\n" ); + }return devm_iio_device_register (dev, indio_dev); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 668/783 iio: adc: qcom-spmi-iadc: Fix wakeup source leaks on device unbind
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit ad3764b45c1524872b621d5667a56f6a574501bd ]
Device can be unbound, so driver must also release memory for the wakeup source.
--- drivers/iio/adc/qcom-spmi-iadc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/adc/qcom-spmi-iadc.c +3 -1
@@ -543,7 +543,9 @@ static int iadc_probe(struct platform_device *pdev)else return ret; }else { -device_init_wakeup (iadc->dev,1 ); + ret =devm_device_init_wakeup (iadc->dev); +if (ret) +return dev_err_probe (iadc->dev, ret,"Failed to init wakeup\n" ); } ret =iadc_update_offset (iadc);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 669/783 iio: imu: st_lsm6dsx: Fix wakeup source leaks on device unbind
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 4551383e78d59b34eea3f4ed28ad22df99e25d59 ]
Device can be unbound, so driver must also release memory for the wakeup source.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +5 -2
@@ -2719,8 +2719,11 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id, }if (device_property_read_bool (dev,"wakeup-source" ) || - (pdata && pdata->wakeup_source)) -device_init_wakeup (dev, true); + (pdata && pdata->wakeup_source)) { + err =devm_device_init_wakeup (dev); +if (err) +return dev_err_probe (dev, err,"Failed to init wakeup\n" ); + }return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 670/783 btrfs: compression: adjust cb->compressed_folios allocation type
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit 6f9a8ab796c6528d22de3c504c81fce7dde63d8a ]
In preparation for making the kmalloc() family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.)
The assigned type is "struct folio **" but the returned type will be "struct page **". These are the same allocation size (pointer size), but the types don't match. Adjust the allocation type to match the assignment.
--- fs/btrfs/compression.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/compression.c +1 -1
@@ -606,7 +606,7 @@ void btrfs_submit_compressed_read(struct btrfs_bio *bbio)free_extent_map (em); cb->nr_folios =DIV_ROUND_UP (compressed_len,PAGE_SIZE ); - cb->compressed_folios =kcalloc (cb->nr_folios,sizeof (struct page *),GFP_NOFS ); + cb->compressed_folios =kcalloc (cb->nr_folios,sizeof (struct folio *),GFP_NOFS );if (!cb->compressed_folios) { ret =BLK_STS_RESOURCE ; goto out_free_bio;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 671/783 btrfs: correct the order of prelim_ref arguments in btrfs__prelim_ref
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Goldwyn Rodrigues <[email protected]>
[ Upstream commit bc7e0975093567f51be8e1bdf4aa5900a3cf0b1e ]
btrfs_prelim_ref() calls the old and new reference variables in the incorrect order. This causes a NULL pointer dereference because oldref is passed as NULL to trace_btrfs_prelim_ref_insert().
Note, trace_btrfs_prelim_ref_insert() is being called with newref as oldref (and oldref as NULL) on purpose in order to print out the values of newref.
To reproduce:
echo 1 > /sys/kernel/debug/tracing/events/btrfs/btrfs_prelim_ref_insert/enable
Perform some writeback operations.
Backtrace: BUG: kernel NULL pointer dereference, address: 0000000000000018 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 115949067 P4D 115949067 PUD 11594a067 PMD 0 Oops: Oops: 0000 [#1] SMP NOPTI CPU: 1 UID: 0 PID: 1188 Comm: fsstress Not tainted 6.15.0-rc2-tester+ #47 PREEMPT(voluntary) 7ca2cef72d5e9c600f0c7718adb6462de8149622 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.3-2-gc13ff2cd-prebuilt.qemu.org 04/01/2014 RIP: 0010:trace_event_raw_event_btrfs__prelim_ref+0x72/0x130 Code: e8 43 81 9f ff 48 85 c0 74 78 4d 85 e4 0f 84 8f 00 00 00 49 8b 94 24 c0 06 00 00 48 8b 0a 48 89 48 08 48 8b 52 08 48 89 50 10 <49> 8b 55 18 48 89 50 18 49 8b 55 20 48 89 50 20 41 0f b6 55 28 88 RSP: 0018:ffffce44820077a0 EFLAGS: 00010286 RAX: ffff8c6b403f9014 RBX: ffff8c6b55825730 RCX: 304994edf9cf506b RDX: d8b11eb7f0fdb699 RSI: ffff8c6b403f9010 RDI: ffff8c6b403f9010 RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000010 R10: 00000000ffffffff R11: 0000000000000000 R12: ffff8c6b4e8fb000 R13: 0000000000000000 R14: ffffce44820077a8 R15: ffff8c6b4abd1540 FS: 00007f4dc6813740(0000) GS:ffff8c6c1d378000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000018 CR3: 000000010eb42000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: <TASK> prelim_ref_insert+0x1c1/0x270 find_parent_nodes+0x12a6/0x1ee0 ? __entry_text_end+0x101f06/0x101f09 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 btrfs_is_data_extent_shared+0x167/0x640 ? fiemap_process_hole+0xd0/0x2c0 extent_fiemap+0xa5c/0xbc0 ? __entry_text_end+0x101f05/0x101f09 btrfs_fiemap+0x7e/0xd0 do_vfs_ioctl+0x425/0x9d0 __x64_sys_ioctl+0x75/0xc0
--- include/trace/events/btrfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/trace/events/btrfs.h +1 -1
@@ -1928,7 +1928,7 @@ DECLARE_EVENT_CLASS(btrfs__prelim_ref, TP_PROTO(const struct btrfs_fs_info *fs_info, const struct prelim_ref *oldref, const struct prelim_ref *newref, u64 tree_size), -TP_ARGS (fs_info, newref, oldref, tree_size), +TP_ARGS (fs_info, oldref, newref, tree_size),TP_STRUCT__entry_btrfs ( __field( u64, root_id )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 672/783 btrfs: handle empty eb->folios in num_extent_folios()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Burkov <[email protected]>
[ Upstream commit d6fe0c69b3aa5c985380b794bdf8e6e9b1811e60 ]
num_extent_folios() unconditionally calls folio_order() on eb->folios[0]. If that is NULL this will be a segfault. It is reasonable for it to return 0 as the number of folios in the eb when the first entry is NULL, so do that instead.
--- fs/btrfs/extent_io.h | 2 ++ 1 file changed, 2 insertions(+)
fs/btrfs/extent_io.h +2 -0
@@ -297,6 +297,8 @@ static inline int num_extent_pages(const struct extent_buffer *eb)*/ static inline int num_extent_folios (const struct extent_buffer *eb) { +if (!eb->folios[0 ]) +return 0 ;if (folio_order (eb->folios[0 ]))return 1 ;return num_extent_pages (eb);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 673/783 btrfs: avoid NULL pointer dereference if no valid csum tree
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
[ Upstream commit f95d186255b319c48a365d47b69bd997fecb674e ]
[BUG]
When trying read-only scrub on a btrfs with rescue=idatacsums mount option, it will crash with the following call trace:
BUG: kernel NULL pointer dereference, address: 0000000000000208 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page CPU: 1 UID: 0 PID: 835 Comm: btrfs Tainted: G O 6.15.0-rc3-custom+ #236 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 02/02/2022 RIP: 0010:btrfs_lookup_csums_bitmap+0x49/0x480 [btrfs] Call Trace: <TASK> scrub_find_fill_first_stripe+0x35b/0x3d0 [btrfs] scrub_simple_mirror+0x175/0x290 [btrfs] scrub_stripe+0x5f7/0x6f0 [btrfs] scrub_chunk+0x9a/0x150 [btrfs] scrub_enumerate_chunks+0x333/0x660 [btrfs] btrfs_scrub_dev+0x23e/0x600 [btrfs] btrfs_ioctl+0x1dcf/0x2f80 [btrfs] __x64_sys_ioctl+0x97/0xc0 do_syscall_64+0x4f/0x120 entry_SYSCALL_64_after_hwframe+0x76/0x7e
[CAUSE]
Mount option "rescue=idatacsums" will completely skip loading the csum tree, so that any data read will not find any data csum thus we will ignore data checksum verification.
Normally call sites utilizing csum tree will check the fs state flag NO_DATA_CSUMS bit, but unfortunately scrub does not check that bit at all.
This results in scrub to call btrfs_search_slot() on a NULL pointer and triggered above crash.
[FIX]
Check both extent and csum tree root before doing any tree search.
--- fs/btrfs/scrub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/scrub.c +2 -2
@@ -1541,8 +1541,8 @@ static int scrub_find_fill_first_stripe(struct btrfs_block_group *bg,u64 extent_gen;int ret; -if (unlikely (!extent_root)) { -btrfs_err (fs_info,"no valid extent root for scrub" ); +if (unlikely (!extent_root || !csum_root)) { +btrfs_err (fs_info,"no valid extent or csum root for scrub" );return -EUCLEAN ; } memset(stripe->sectors, 0, sizeof(struct scrub_sector_verification) *
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 674/783 tools: ynl-gen: validate 0 len strings from kernel
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Wei <[email protected]>
[ Upstream commit 4720f9707c783f642332dee3d56dccaefa850e42 ]
Strings from the kernel are guaranteed to be null terminated and ynl_attr_validate() checks for this. But it doesn't check if the string has a len of 0, which would cause problems when trying to access data[len - 1]. Fix this by checking that len is positive.
--- tools/net/ynl/lib/ynl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/net/ynl/lib/ynl.c +1 -1
@@ -364,7 +364,7 @@ int ynl_attr_validate(struct ynl_parse_arg *yarg, const struct nlattr *attr) "Invalid attribute (binary %s)", policy->name);return -1 ;case YNL_PT_NUL_STR : -if ((!policy->len || len <= policy->len) && !data[len -1 ]) +if (len && (!policy->len || len <= policy->len) && !data[len -1 ])break ;yerr (yarg->ys,YNL_ERROR_ATTR_INVALID ,"Invalid attribute (string %s)" , policy->name);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 675/783 block: only update request sector if needed
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Thumshirn <[email protected]>
[ Upstream commit db492e24f9b05547ba12b4783f09c9d943cf42fe ]
In case of a ZONE APPEND write, regardless of native ZONE APPEND or the emulation layer in the zone write plugging code, the sector the data got written to by the device needs to be updated in the bio.
At the moment, this is done for every native ZONE APPEND write and every request that is flagged with 'BIO_ZONE_WRITE_PLUGGING'. But thus superfluously updates the sector for regular writes to a zoned block device.
Check if a bio is a native ZONE APPEND write or if the bio is flagged as 'BIO_EMULATES_ZONE_APPEND', meaning the block layer's zone write plugging code handles the ZONE APPEND and translates it into a regular write and back. Only if one of these two criterion is met, update the sector in the bio upon completion.
--- block/blk.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk.h +2 -1
@@ -480,7 +480,8 @@ static inline void blk_zone_update_request_bio(struct request *rq,* the original BIO sector so that blk_zone_write_plug_bio_endio() can * lookup the zone write plug. */ -if (req_op (rq) ==REQ_OP_ZONE_APPEND ||bio_zone_write_plugging (bio)) +if (req_op (rq) ==REQ_OP_ZONE_APPEND || +bio_flagged (bio,BIO_EMULATES_ZONE_APPEND )) bio->bi_iter.bi_sector = rq->__sector; }void blk_zone_write_plug_bio_endio (struct bio *bio);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 676/783 wifi: iwlwifi: add support for Killer on MTL
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit ebedf8b7f05b9c886d68d63025db8d1b12343157 ]
For now, we need another entry for these devices, this will be changed completely for 6.16.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +2 -0
@@ -587,6 +587,8 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info iwl_dev_info_table[] = {IWL_DEV_INFO (0x7A70 ,0x1692 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name),IWL_DEV_INFO (0x7AF0 ,0x1691 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name),IWL_DEV_INFO (0x7AF0 ,0x1692 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), +IWL_DEV_INFO (0x7F70 ,0x1691 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name), +IWL_DEV_INFO (0x7F70 ,0x1692 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name),IWL_DEV_INFO (0x271C ,0x0214 , iwl9260_2ac_cfg, iwl9260_1_name), IWL_DEV_INFO(0x7E40, 0x1691, iwl_cfg_ma, iwl_ax411_killer_1690s_name),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 677/783 x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST or Rust >= 1.88
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paweł Anikiel <[email protected]>
[ Upstream commit 5595c31c370957aabe739ac3996aedba8267603f ]
Calling core::fmt::write() from rust code while FineIBT is enabled results in a kernel panic:
[ 4614.199779] kernel BUG at arch/x86/kernel/cet.c:132! [ 4614.205343] Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 4614.211781] CPU: 2 UID: 0 PID: 6057 Comm: dmabuf_dump Tainted: G U O 6.12.17-android16-0-g6ab38c534a43 #1 9da040f27673ec3945e23b998a0f8bd64c846599 [ 4614.227832] Tainted: [U]=USER, [O]=OOT_MODULE [ 4614.241247] RIP: 0010:do_kernel_cp_fault+0xea/0xf0 ... [ 4614.398144] RIP: 0010:_RNvXs5_NtNtNtCs3o2tGsuHyou_4core3fmt3num3impyNtB9_7Display3fmt+0x0/0x20 [ 4614.407792] Code: 48 f7 df 48 0f 48 f9 48 89 f2 89 c6 5d e9 18 fd ff ff 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 41 81 ea 14 61 af 2c 74 03 0f 0b 90 <66> 0f 1f 00 55 48 89 e5 48 89 f2 48 8b 3f be 01 00 00 00 5d e9 e7 [ 4614.428775] RSP: 0018:ffffb95acfa4ba68 EFLAGS: 00010246 [ 4614.434609] RAX: 0000000000000000 RBX: 0000000000000010 RCX: 0000000000000000 [ 4614.442587] RDX: 0000000000000007 RSI: ffffb95acfa4ba70 RDI: ffffb95acfa4bc88 [ 4614.450557] RBP: ffffb95acfa4bae0 R08: ffff0a00ffffff05 R09: 0000000000000070 [ 4614.458527] R10: 0000000000000000 R11: ffffffffab67eaf0 R12: ffffb95acfa4bcc8 [ 4614.466493] R13: ffffffffac5d50f0 R14: 0000000000000000 R15: 0000000000000000 [ 4614.474473] ? __cfi__RNvXs5_NtNtNtCs3o2tGsuHyou_4core3fmt3num3impyNtB9_7Display3fmt+0x10/0x10 [ 4614.484118] ? _RNvNtCs3o2tGsuHyou_4core3fmt5write+0x1d2/0x250
This happens because core::fmt::write() calls core::fmt::rt::Argument::fmt(), which currently has CFI disabled:
library/core/src/fmt/rt.rs:
171 // FIXME: Transmuting formatter in new and indirectly branching to/calling
172 // it here is an explicit CFI violation.
173 #[allow(inline_no_sanitize)]
174 #[no_sanitize(cfi, kcfi)]
175 #[inline]
176 pub(super) unsafe fn fmt(&self, f: &mut Formatter<'_>) -> Result {This causes a Control Protection exception, because FineIBT has sealed off the original function's endbr64.
This makes rust currently incompatible with FineIBT. Add a Kconfig dependency that prevents FineIBT from getting turned on by default if rust is enabled.
[ Rust 1.88.0 (scheduled for 2025-06-26) should have this fixed [1],
and thus we relaxed the condition with Rust >= 1.88.
When objtool lands checking for this with e.g. [2], the plan is to ideally run that in upstream Rust's CI to prevent regressions early [3], since we do not control core's source code.
Alice tested the Rust PR backported to an older compiler.
Peter would like that Rust provides a stable core which can be pulled into the kernel: "Relying on that much out of tree code is 'unfortunate'".
- Miguel ]
--- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/x86/Kconfig +1 -0
@@ -2430,6 +2430,7 @@ config STRICT_SIGALTSTACK_SIZE config CFI_AUTO_DEFAULT bool "Attempt to use FineIBT by default at boot time" depends on FINEIBT + depends on !RUST || RUSTC_VERSION >= 108800 default y help Attempt to use FineIBT by default at boot time. If enabled,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 678/783 xenbus: Allow PVH dom0 a non-local xenstore
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Andryuk <[email protected]>
[ Upstream commit 90989869baae47ee2aa3bcb6f6eb9fbbe4287958 ]
Make xenbus_init() allow a non-local xenstore for a PVH dom0 - it is currently forced to XS_LOCAL. With Hyperlaunch booting dom0 and a xenstore stubdom, dom0 can be handled as a regular XS_HVM following the late init path.
Ideally we'd drop the use of xen_initial_domain() and just check for the event channel instead. However, ARM has a xen,enhanced no-xenstore mode, where the event channel and PFN would both be 0. Retain the xen_initial_domain() check, and use that for an additional check when the event channel is 0.
Check the full 64bit HVM_PARAM_STORE_EVTCHN value to catch the off chance that high bits are set for the 32bit event channel.
Message-ID: <[email protected]>
--- drivers/xen/xenbus/xenbus_probe.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/xen/xenbus/xenbus_probe.c +8 -6
@@ -966,9 +966,15 @@ static int __init xenbus_init(void)if (xen_pv_domain ()) xen_store_domain_type =XS_PV ;if (xen_hvm_domain ()) + { xen_store_domain_type =XS_HVM ; -if (xen_hvm_domain () &&xen_initial_domain ()) - xen_store_domain_type =XS_LOCAL ; + err =hvm_get_parameter (HVM_PARAM_STORE_EVTCHN , &v); +if (err) + goto out_error; + xen_store_evtchn = (int )v; +if (!v &&xen_initial_domain ()) + xen_store_domain_type =XS_LOCAL ; + }if (xen_pv_domain () && !xen_start_info->store_evtchn) xen_store_domain_type =XS_LOCAL ;if (xen_pv_domain () && xen_start_info->store_evtchn)
@@ -987,10 +993,6 @@ static int __init xenbus_init(void) xen_store_interface =gfn_to_virt (xen_store_gfn);break ;case XS_HVM : - err =hvm_get_parameter (HVM_PARAM_STORE_EVTCHN , &v); -if (err) - goto out_error; - xen_store_evtchn = (int )v; err =hvm_get_parameter (HVM_PARAM_STORE_PFN , &v);if (err) goto out_error;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 679/783 drm/amd/display: Call FP Protect Before Mode Programming/Mode Support
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Austin Zheng <[email protected]>
[ Upstream commit eba692ca3abca258b3214a6e4126afefad1822f0 ]
[Why]
Memory allocation occurs within dml21_validate() for adding phantom planes. May cause kernel to be tainted due to usage of FP Start.
[How]
Move FP start from dml21_validate to before mode programming/mode support. Calculations requiring floating point are all done within mode programming or mode support.
--- drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c +4 -4
@@ -234,7 +234,9 @@ static bool dml21_mode_check_and_programming(const struct dc *in_dc, struct dc_sif (!result)return false; +DC_FP_START (); result =dml2_build_mode_programming (mode_programming); +DC_FP_END ();if (!result)return false;
@@ -277,7 +279,9 @@ static bool dml21_check_mode_support(const struct dc *in_dc, struct dc_state *co mode_support->dml2_instance = dml_init->dml2_instance;dml21_map_dc_state_into_dml_display_cfg (in_dc, context, dml_ctx); dml_ctx->v21.mode_programming.dml2_instance->scratch.build_mode_programming_locals.mode_programming_params.programming = dml_ctx->v21.mode_programming.programming; +DC_FP_START (); is_supported =dml2_check_mode_supported (mode_support); +DC_FP_END ();if (!is_supported)return false;
@@ -288,16 +292,12 @@ bool dml21_validate(const struct dc *in_dc, struct dc_state *context, struct dml {bool out = false; -DC_FP_START (); -/* Use dml_validate_only for fast_validate path */ if (fast_validate) out =dml21_check_mode_support (in_dc, context, dml_ctx);else out =dml21_mode_check_and_programming (in_dc, context, dml_ctx); -DC_FP_END (); -return out; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 680/783 __legitimize_mnt(): check for MNT_SYNC_UMOUNT should be under mount_lock
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit 250cf3693060a5f803c5f1ddc082bb06b16112a9 ]
... or we risk stealing final mntput from sync umount - raising mnt_count after umount(2) has verified that victim is not busy, but before it has set MNT_SYNC_UMOUNT; in that case __legitimize_mnt() doesn't see that it's safe to quietly undo mnt_count increment and leaves dropping the reference to caller, where it'll be a full-blown mntput().
Check under mount_lock is needed; leaving the current one done before taking that makes no sense - it's nowhere near common enough to bother with.
--- fs/namespace.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
fs/namespace.c +1 -5
@@ -781,12 +781,8 @@ int __legitimize_mnt(struct vfsmount *bastard, unsigned seq)smp_mb ();// see mntput_no_expire() and do_umount() if (likely (!read_seqretry (&mount_lock, seq)))return 0 ; -if (bastard->mnt_flags &MNT_SYNC_UMOUNT ) { -mnt_add_count (mnt,-1 ); -return 1 ; - }lock_mount_hash (); -if (unlikely (bastard->mnt_flags &MNT_DOOMED )) { +if (unlikely (bastard->mnt_flags & (MNT_SYNC_UMOUNT |MNT_DOOMED ))) {mnt_add_count (mnt,-1 );unlock_mount_hash ();return 1 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 681/783 soundwire: bus: Fix race on the creation of the IRQ domain
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit fd15594ba7d559d9da741504c322b9f57c4981e5 ]
The SoundWire IRQ domain needs to be created before any slaves are added to the bus, such that the domain is always available when needed. Move the call to sdw_irq_create() before the calls to sdw_acpi_find_slaves() and sdw_of_find_slaves().
--- drivers/soundwire/bus.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/soundwire/bus.c +5 -4
@@ -121,6 +121,10 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,set_bit (SDW_GROUP13_DEV_NUM , bus->assigned);set_bit (SDW_MASTER_DEV_NUM , bus->assigned); + ret =sdw_irq_create (bus, fwnode); +if (ret) +return ret; +/* * SDW is an enumerable bus, but devices can be powered off. So, * they won't be able to report as present.
@@ -137,6 +141,7 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,if (ret <0 ) {dev_err (bus->dev,"Finding slaves failed:%d\n" , ret); +sdw_irq_delete (bus);return ret; }
@@ -155,10 +160,6 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent, bus->params.curr_bank =SDW_BANK0 ; bus->params.next_bank =SDW_BANK1 ; - ret =sdw_irq_create (bus, fwnode); -if (ret) -return ret; -return 0 ; }EXPORT_SYMBOL (sdw_bus_master_add);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 682/783 espintcp: fix skb leaks
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sabrina Dubroca <[email protected]>
[ Upstream commit 63c1f19a3be3169e51a5812d22a6d0c879414076 ]
A few error paths are missing a kfree_skb.
--- net/ipv4/esp4.c | 4 +++- net/ipv6/esp6.c | 4 +++- net/xfrm/espintcp.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-)
net/ipv4/esp4.c +3 -1
@@ -199,8 +199,10 @@ static int esp_output_tcp_finish(struct xfrm_state *x, struct sk_buff *skb) sk =esp_find_tcp_sk (x); err =PTR_ERR_OR_ZERO (sk); -if (err) +if (err) { +kfree_skb (skb); goto out; + }bh_lock_sock (sk);if (sock_owned_by_user (sk))
net/ipv6/esp6.c +3 -1
@@ -216,8 +216,10 @@ static int esp_output_tcp_finish(struct xfrm_state *x, struct sk_buff *skb) sk =esp6_find_tcp_sk (x); err =PTR_ERR_OR_ZERO (sk); -if (err) +if (err) { +kfree_skb (skb); goto out; + }bh_lock_sock (sk);if (sock_owned_by_user (sk))
net/xfrm/espintcp.c +3 -1
@@ -171,8 +171,10 @@ int espintcp_queue_out(struct sock *sk, struct sk_buff *skb)struct espintcp_ctx *ctx =espintcp_getctx (sk);if (skb_queue_len (&ctx->out_queue) >= -READ_ONCE (net_hotdata.max_backlog)) +READ_ONCE (net_hotdata.max_backlog)) { +kfree_skb (skb);return -ENOBUFS ; + }__skb_queue_tail (&ctx->out_queue, skb);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 683/783 espintcp: remove encap socket caching to avoid reference leak
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sabrina Dubroca <[email protected]>
[ Upstream commit 028363685bd0b7a19b4a820f82dd905b1dc83999 ]
The current scheme for caching the encap socket can lead to reference leaks when we try to delete the netns.
The reference chain is: xfrm_state -> enacp_sk -> netns
Since the encap socket is a userspace socket, it holds a reference on the netns. If we delete the espintcp state (through flush or individual delete) before removing the netns, the reference on the socket is dropped and the netns is correctly deleted. Otherwise, the netns may not be reachable anymore (if all processes within the ns have terminated), so we cannot delete the xfrm state to drop its reference on the socket.
This patch results in a small (~2% in my tests) performance regression.
A GC-type mechanism could be added for the socket cache, to clear references if the state hasn't been used "recently", but it's a lot more complex than just not caching the socket.
--- include/net/xfrm.h | 1 - net/ipv4/esp4.c | 49 ++++--------------------------------------- net/ipv6/esp6.c | 49 ++++--------------------------------------- net/xfrm/xfrm_state.c | 3 --- 4 files changed, 8 insertions(+), 94 deletions(-)
include/net/xfrm.h +0 -1
@@ -236,7 +236,6 @@ struct xfrm_state {/* Data for encapsulator */ struct xfrm_encap_tmpl *encap; -struct sock __rcu *encap_sk;/* NAT keepalive */ u32 nat_keepalive_interval;/* seconds */
net/ipv4/esp4.c +4 -45
83 lines not on this page · raw message
net/ipv6/esp6.c +4 -45
83 lines not on this page · raw message
net/xfrm/xfrm_state.c +0 -3
@@ -838,9 +838,6 @@ int __xfrm_state_delete(struct xfrm_state *x)xfrm_nat_keepalive_state_updated (x);spin_unlock (&net->xfrm.xfrm_state_lock); -if (x->encap_sk) -sock_put (rcu_dereference_raw (x->encap_sk)); -xfrm_dev_state_delete (x);/* All xfrm_state objects are created by xfrm_state_alloc.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 684/783 xfrm: Fix UDP GRO handling for some corner cases
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tobias Brunner <[email protected]>
[ Upstream commit e3fd0577768584ece824c8b661c40fb3d912812a ]
This fixes an issue that's caused if there is a mismatch between the data offset in the GRO header and the length fields in the regular sk_buff due to the pskb_pull()/skb_push() calls. That's because the UDP GRO layer stripped off the UDP header via skb_gro_pull() already while the UDP header was explicitly not pulled/pushed in this function.
For example, an IKE packet that triggered this had len=data_len=1268 and the data_offset in the GRO header was 28 (IPv4 + UDP). So pskb_pull() was called with an offset of 28-8=20, which reduced len to 1248 and via pskb_may_pull() and __pskb_pull_tail() it also set data_len to 1248. As the ESP offload module was not loaded, the function bailed out and called skb_push(), which restored len to 1268, however, data_len remained at 1248.
So while skb_headlen() was 0 before, it was now 20. The latter caused a difference of 8 instead of 28 (or 0 if pskb_pull()/skb_push() was called with the complete GRO data_offset) in gro_try_pull_from_frag0() that triggered a call to gro_pull_from_frag0() that corrupted the packet.
This change uses a more GRO-like approach seen in other GRO receivers via skb_gro_header() to just read the actual data we are interested in and does not try to "restore" the UDP header at this point to call the existing function. If the offload module is not loaded, it immediately bails out, otherwise, it only does a quick check to see if the packet is an IKE or keepalive packet instead of calling the existing function.
--- net/ipv4/xfrm4_input.c | 18 ++++++++++-------- net/ipv6/xfrm6_input.c | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-)
net/ipv4/xfrm4_input.c +10 -8
@@ -182,11 +182,15 @@ struct sk_buff *xfrm4_gro_udp_encap_rcv(struct sock *sk, struct list_head *head,int offset =skb_gro_offset (skb);const struct net_offload *ops;struct sk_buff *pp =NULL ; -int ret; - - offset = offset -sizeof (struct udphdr ); +int len, dlen; +__u8 *udpdata; +__be32 *udpdata32; -if (!pskb_pull (skb, offset)) + len = skb->len - offset; + dlen = offset +min (len,8 ); + udpdata =skb_gro_header (skb, dlen, offset); + udpdata32 = (__be32 *)udpdata; +if (unlikely (!udpdata))return NULL ;rcu_read_lock ();
@@ -194,11 +198,10 @@ struct sk_buff *xfrm4_gro_udp_encap_rcv(struct sock *sk, struct list_head *head,if (!ops || !ops->callbacks.gro_receive) goto out; - ret =__xfrm4_udp_encap_rcv (sk, skb, false); -if (ret) +/* check if it is a keepalive or IKE packet */ +if (len <=sizeof (struct ip_esp_hdr ) || udpdata32[0 ] ==0 ) goto out; -skb_push (skb, offset);NAPI_GRO_CB (skb)->proto =IPPROTO_UDP ; pp =call_gro_receive (ops->callbacks.gro_receive, head, skb);
@@ -208,7 +211,6 @@ struct sk_buff *xfrm4_gro_udp_encap_rcv(struct sock *sk, struct list_head *head, out:rcu_read_unlock (); -skb_push (skb, offset);NAPI_GRO_CB (skb)->same_flow =0 ;NAPI_GRO_CB (skb)->flush =1 ;
net/ipv6/xfrm6_input.c +10 -8
@@ -179,14 +179,18 @@ struct sk_buff *xfrm6_gro_udp_encap_rcv(struct sock *sk, struct list_head *head,int offset =skb_gro_offset (skb);const struct net_offload *ops;struct sk_buff *pp =NULL ; -int ret; +int len, dlen; +__u8 *udpdata; +__be32 *udpdata32;if (skb->protocol ==htons (ETH_P_IP ))return xfrm4_gro_udp_encap_rcv (sk, head, skb); - offset = offset -sizeof (struct udphdr ); - -if (!pskb_pull (skb, offset)) + len = skb->len - offset; + dlen = offset +min (len,8 ); + udpdata =skb_gro_header (skb, dlen, offset); + udpdata32 = (__be32 *)udpdata; +if (unlikely (!udpdata))return NULL ;rcu_read_lock ();
@@ -194,11 +198,10 @@ struct sk_buff *xfrm6_gro_udp_encap_rcv(struct sock *sk, struct list_head *head,if (!ops || !ops->callbacks.gro_receive) goto out; - ret =__xfrm6_udp_encap_rcv (sk, skb, false); -if (ret) +/* check if it is a keepalive or IKE packet */ +if (len <=sizeof (struct ip_esp_hdr ) || udpdata32[0 ] ==0 ) goto out; -skb_push (skb, offset);NAPI_GRO_CB (skb)->proto =IPPROTO_UDP ; pp =call_gro_receive (ops->callbacks.gro_receive, head, skb);
@@ -208,7 +211,6 @@ struct sk_buff *xfrm6_gro_udp_encap_rcv(struct sock *sk, struct list_head *head, out:rcu_read_unlock (); -skb_push (skb, offset);NAPI_GRO_CB (skb)->same_flow =0 ;NAPI_GRO_CB (skb)->flush =1 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 685/783 dmaengine: idxd: Fix allowing write() from different address spaces
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vinicius Costa Gomes <[email protected]>
[ Upstream commit 8dfa57aabff625bf445548257f7711ef294cd30e ]
Check if the process submitting the descriptor belongs to the same address space as the one that opened the file, reject otherwise.
--- drivers/dma/idxd/cdev.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/dma/idxd/cdev.c +9 -0
@@ -407,6 +407,9 @@ static int idxd_cdev_mmap(struct file *filp, struct vm_area_struct *vma)if (!idxd->user_submission_safe && !capable (CAP_SYS_RAWIO ))return -EPERM ; +if (current->mm != ctx->mm) +return -EPERM ; + rc =check_vma (wq, vma, __func__);if (rc <0 )return rc;
@@ -473,6 +476,9 @@ static ssize_t idxd_cdev_write(struct file *filp, const char __user *buf, size_tssize_t written =0 ;int i; +if (current->mm != ctx->mm) +return -EPERM ; +for (i =0 ; i < len/sizeof (struct dsa_hw_desc ); i++) {int rc =idxd_submit_user_descriptor (ctx, udesc + i);
@@ -493,6 +499,9 @@ static __poll_t idxd_cdev_poll(struct file *filp,struct idxd_device *idxd = wq->idxd;__poll_t out =0 ; +if (current->mm != ctx->mm) +return -EPERM ; +poll_wait (filp, &wq->err_queue, wait);spin_lock (&idxd->dev_lock);if (idxd->sw_err.valid)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 686/783 x86/sev: Fix operator precedence in GHCB_MSR_VMPL_REQ_LEVEL macro
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seongman Lee <[email protected]>
[ Upstream commit f7387eff4bad33d12719c66c43541c095556ae4e ]
The GHCB_MSR_VMPL_REQ_LEVEL macro lacked parentheses around the bitmask expression, causing the shift operation to bind too early. As a result, when requesting VMPL1 (e.g., GHCB_MSR_VMPL_REQ_LEVEL(1)), incorrect values such as 0x000000016 were generated instead of the intended 0x100000016 (the requested VMPL level is specified in GHCBData[39:32]).
Fix the precedence issue by grouping the masked value before applying the shift.
[ bp: Massage commit message. ]
--- arch/x86/include/asm/sev-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/sev-common.h +1 -1
@@ -116,7 +116,7 @@ enum psc_op {#define GHCB_MSR_VMPL_REQ 0x016 #define GHCB_MSR_VMPL_REQ_LEVEL(v) \ /* GHCBData[39:32] */ \ - (((u64)(v) & GENMASK_ULL(7, 0) << 32) | \ + ((((u64)(v) & GENMASK_ULL(7, 0)) << 32) | \ /* GHCBDdata[11:0] */ \GHCB_MSR_VMPL_REQ )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 687/783 kernel/fork: only call untrack_pfn_clear() on VMAs duplicated for fork()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <[email protected]>
[ Upstream commit e9f180d7cfde23b9f8eebd60272465176373ab2c ]
Not intuitive, but vm_area_dup() located in kernel/fork.c is not only used for duplicating VMAs during fork(), but also for duplicating VMAs when splitting VMAs or when mremap()'ing them.
VM_PFNMAP mappings can at least get ordinarily mremap()'ed (no change in size) and apparently also shrunk during mremap(), which implies duplicating the VMA in __split_vma() first.
In case of ordinary mremap() (no change in size), we first duplicate the VMA in copy_vma_and_data()->copy_vma() to then call untrack_pfn_clear() on the old VMA: we effectively move the VM_PAT reservation. So the untrack_pfn_clear() call on the new VMA duplicating is wrong in that context.
Splitting of VMAs seems problematic, because we don't duplicate/adjust the reservation when splitting the VMA. Instead, in memtype_erase() -- called during zapping/munmap -- we shrink a reservation in case only the end address matches: Assume we split a VMA into A and B, both would share a reservation until B is unmapped.
So when unmapping B, the reservation would be updated to cover only A. When unmapping A, we would properly remove the now-shrunk reservation. That scenario describes the mremap() shrinking (old_size > new_size), where we split + unmap B, and the untrack_pfn_clear() on the new VMA when is wrong.
What if we manage to split a VM_PFNMAP VMA into A and B and unmap A first? It would be broken because we would never free the reservation. Likely, there are ways to trigger such a VMA split outside of mremap().
Affecting other VMA duplication was not intended, vm_area_dup() being used outside of kernel/fork.c was an oversight. So let's fix that for; how to handle VMA splits better should be investigated separately.
With a simple reproducer that uses mprotect() to split such a VMA I can trigger
x86/PAT: pat_mremap:26448 freeing invalid memtype [mem 0x00000000-0x00000fff]
--- kernel/fork.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
kernel/fork.c +5 -4
@@ -504,10 +504,6 @@ struct vm_area_struct *vm_area_dup(struct vm_area_struct *orig)vma_numab_state_init (new);dup_anon_vma_name (orig, new); -/* track_pfn_copy() will later take care of copying internal state. */ -if (unlikely (new->vm_flags &VM_PFNMAP )) -untrack_pfn_clear (new); -return new; }
@@ -698,6 +694,11 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, tmp =vm_area_dup (mpnt);if (!tmp) goto fail_nomem; + +/* track_pfn_copy() will later take care of copying internal state. */ +if (unlikely (tmp->vm_flags &VM_PFNMAP )) +untrack_pfn_clear (tmp); + retval =vma_dup_policy (mpnt, tmp);if (retval) goto fail_nomem_policy;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 688/783 remoteproc: qcom_wcnss: Fix on platforms without fallback regulators
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matti Lehtimäki <[email protected]>
[ Upstream commit 4ca45af0a56d00b86285d6fdd720dca3215059a7 ]
Recent change to handle platforms with only single power domain broke pronto-v3 which requires power domains and doesn't have fallback voltage regulators in case power domains are missing. Add a check to verify the number of fallback voltage regulators before using the code which handles single power domain situation.
--- drivers/remoteproc/qcom_wcnss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/remoteproc/qcom_wcnss.c +2 -1
@@ -456,7 +456,8 @@ static int wcnss_init_regulators(struct qcom_wcnss *wcnss,if (wcnss->num_pds) { info += wcnss->num_pds;/* Handle single power domain case */ - num_vregs += num_pd_vregs - wcnss->num_pds; +if (wcnss->num_pds < num_pd_vregs) + num_vregs += num_pd_vregs - wcnss->num_pds; }else { num_vregs += num_pd_vregs; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 689/783 clk: sunxi-ng: d1: Add missing divider for MMC mod clocks
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andre Przywara <[email protected]>
[ Upstream commit 98e6da673cc6dd46ca9a599802bd2c8f83606710 ]
The D1/R528/T113 SoCs have a hidden divider of 2 in the MMC mod clocks, just as other recent SoCs. So far we did not describe that, which led to the resulting MMC clock rate to be only half of its intended value.
Use a macro that allows to describe a fixed post-divider, to compensate for that divisor.
This brings the MMC performance on those SoCs to its expected level, so about 23 MB/s for SD cards, instead of the 11 MB/s measured so far.
--- drivers/clk/sunxi-ng/ccu-sun20i-d1.c | 44 ++++++++++++++++------------ drivers/clk/sunxi-ng/ccu_mp.h | 22 ++++++++++++++ 2 files changed, 47 insertions(+), 19 deletions(-)
drivers/clk/sunxi-ng/ccu-sun20i-d1.c +25 -19
@@ -412,19 +412,23 @@ static const struct clk_parent_data mmc0_mmc1_parents[] = { { .hw = &pll_periph0_2x_clk.common.hw }, { .hw = &pll_audio1_div2_clk.common.hw }, }; -static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc0_clk, "mmc0", mmc0_mmc1_parents, 0x830, -0 ,4 ,/* M */ -8 ,2 ,/* P */ -24 ,3 ,/* mux */ -BIT (31 ),/* gate */ - 0); - -static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc1_clk, "mmc1", mmc0_mmc1_parents, 0x834, -0 ,4 ,/* M */ -8 ,2 ,/* P */ -24 ,3 ,/* mux */ -BIT (31 ),/* gate */ - 0); +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc0_clk, "mmc0", + mmc0_mmc1_parents,0x830 , +0 ,4 ,/* M */ +8 ,2 ,/* P */ +24 ,3 ,/* mux */ +BIT (31 ),/* gate */ +2 ,/* post-div */ + 0); + +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", + mmc0_mmc1_parents,0x834 , +0 ,4 ,/* M */ +8 ,2 ,/* P */ +24 ,3 ,/* mux */ +BIT (31 ),/* gate */ +2 ,/* post-div */ + 0);static const struct clk_parent_data mmc2_parents[] = { { .fw_name = "hosc" },
@@ -433,12 +437,14 @@ static const struct clk_parent_data mmc2_parents[] = { { .hw = &pll_periph0_800M_clk.common.hw }, { .hw = &pll_audio1_div2_clk.common.hw }, }; -static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc2_clk, "mmc2", mmc2_parents, 0x838, -0 ,4 ,/* M */ -8 ,2 ,/* P */ -24 ,3 ,/* mux */ -BIT (31 ),/* gate */ - 0); +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc2_parents, +0x838 , +0 ,4 ,/* M */ +8 ,2 ,/* P */ +24 ,3 ,/* mux */ +BIT (31 ),/* gate */ +2 ,/* post-div */ + 0); static SUNXI_CCU_GATE_HWS(bus_mmc0_clk, "bus-mmc0", psi_ahb_hws, 0x84c, BIT(0), 0);
drivers/clk/sunxi-ng/ccu_mp.h +22 -0
@@ -52,6 +52,28 @@ struct ccu_mp { } \ } +#define SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV (_struct, _name, _parents, \ + _reg, \ + _mshift, _mwidth, \ + _pshift, _pwidth, \ + _muxshift, _muxwidth, \ + _gate, _postdiv, _flags)\ + struct ccu_mp _struct = { \ + .enable = _gate, \ + .m = _SUNXI_CCU_DIV(_mshift, _mwidth), \ + .p = _SUNXI_CCU_DIV(_pshift, _pwidth), \ + .mux = _SUNXI_CCU_MUX(_muxshift, _muxwidth), \ + .fixed_post_div = _postdiv, \ + .common = { \ + .reg = _reg, \ + .features = CCU_FEATURE_FIXED_POSTDIV, \ + .hw.init = CLK_HW_INIT_PARENTS_DATA(_name, \ + _parents, \ + &ccu_mp_ops, \ + _flags), \ + } \ + } + #define SUNXI_CCU_MP_WITH_MUX_GATE(_struct, _name, _parents, _reg, \ _mshift, _mwidth, \ _pshift, _pwidth, \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 690/783 xfrm: Sanitize marks before insert
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Chaignon <[email protected]>
[ Upstream commit 0b91fda3a1f044141e1e615456ff62508c32b202 ]
Prior to this patch, the mark is sanitized (applying the state's mask to the state's value) only on inserts when checking if a conflicting XFRM state or policy exists.
We discovered in Cilium that this same sanitization does not occur in the hot-path __xfrm_state_lookup. In the hot-path, the sk_buff's mark is simply compared to the state's value:
if ((mark & x->mark.m) != x->mark.v)
continue;Therefore, users can define unsanitized marks (ex. 0xf42/0xf00) which will never match any packet.
This commit updates __xfrm_state_insert and xfrm_policy_insert to store the sanitized marks, thus removing this footgun.
This has the side effect of changing the ip output, as the returned mark will have the mask applied to it when printed.
--- net/xfrm/xfrm_policy.c | 3 +++ net/xfrm/xfrm_state.c | 3 +++ 2 files changed, 6 insertions(+)
net/xfrm/xfrm_policy.c +3 -0
@@ -1581,6 +1581,9 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)struct xfrm_policy *delpol;struct hlist_head *chain; +/* Sanitize mark before store */ + policy->mark.v &= policy->mark.m; +spin_lock_bh (&net->xfrm.xfrm_policy_lock); chain =policy_hash_bysel (net, &policy->selector, policy->family, dir);if (chain)
net/xfrm/xfrm_state.c +3 -0
@@ -1718,6 +1718,9 @@ static void __xfrm_state_insert(struct xfrm_state *x)list_add (&x->km.all, &net->xfrm.state_all); +/* Sanitize mark before store */ + x->mark.v &= x->mark.m; + h =xfrm_dst_hash (net, &x->id.daddr, &x->props.saddr, x->props.reqid, x->props.family); XFRM_STATE_INSERT(bydst, &x->bydst, net->xfrm.state_bydst + h,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 691/783 dmaengine: idxd: Fix ->poll() return value
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <[email protected]>
[ Upstream commit ae74cd15ade833adc289279b5c6f12e78f64d4d7 ]
The fix to block access from different address space did not return a correct value for ->poll() change. kernel test bot reported that a return value of type __poll_t is expected rather than int. Fix to return POLLNVAL to indicate invalid request.
--- drivers/dma/idxd/cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/idxd/cdev.c +1 -1
@@ -500,7 +500,7 @@ static __poll_t idxd_cdev_poll(struct file *filp,__poll_t out =0 ;if (current->mm != ctx->mm) -return -EPERM ; +return POLLNVAL ;poll_wait (filp, &wq->err_queue, wait);spin_lock (&idxd->dev_lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 692/783 dmaengine: fsl-edma: Fix return code for unhandled interrupts
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
[ Upstream commit 5e27af0514e2249a9ccc9a762abd3b74e03a1f90 ]
For fsl,imx93-edma4 two DMA channels share the same interrupt. So in case fsl_edma3_tx_handler is called for the "wrong" channel, the return code must be IRQ_NONE. This signalize that the interrupt wasn't handled.
--- drivers/dma/fsl-edma-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/fsl-edma-main.c +1 -1
@@ -57,7 +57,7 @@ static irqreturn_t fsl_edma3_tx_handler(int irq, void *dev_id) intr =edma_readl_chreg (fsl_chan, ch_int);if (!intr) -return IRQ_HANDLED ; +return IRQ_NONE ;edma_writel_chreg (fsl_chan,1 , ch_int);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 693/783 driver core: Split devres APIs to device/devres.h
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit a21cad9312767d26b5257ce0662699bb202cdda1 ]
device.h is a huge header which is hard to follow and easy to miss something. Improve that by splitting devres APIs to device/devres.h.
In particular this helps to speedup the build of the code that includes device.h solely for a devres APIs.
While at it, cast the error pointers to __iomem using IOMEM_ERR_PTR() and fix sparse warnings.
Stable-dep-of: 7dd7f39fce00 ("ASoC: SOF: Intel: hda: Fix UAF when reloading module")
--- include/linux/device.h | 119 +------------------------------- include/linux/device/devres.h | 124 ++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 118 deletions(-) create mode 100644 include/linux/device/devres.h
include/linux/device.h +1 -118
@@ -26,9 +26,9 @@#include <linux/atomic.h> #include <linux/uidgid.h> #include <linux/gfp.h> -#include <linux/overflow.h> #include <linux/device/bus.h> #include <linux/device/class.h> +#include <linux/device/devres.h> #include <linux/device/driver.h> #include <linux/cleanup.h> #include <asm/device.h>
@@ -281,123 +281,6 @@ int __must_check device_create_bin_file(struct device *dev,void device_remove_bin_file (struct device *dev,const struct bin_attribute *attr); -/* device resource management */ -typedef void (*dr_release_t )(struct device *dev,void *res); -typedef int (*dr_match_t )(struct device *dev,void *res,void *match_data); - -void *__devres_alloc_node (dr_release_t release,size_t size,gfp_t gfp, -int nid,const char *name) __malloc; -#define devres_alloc (release, size, gfp) \ - __devres_alloc_node(release, size, gfp, NUMA_NO_NODE, #release) -#define devres_alloc_node (release, size, gfp, nid) \ - __devres_alloc_node(release, size, gfp, nid, #release) - -void devres_for_each_res (struct device *dev,dr_release_t release, -dr_match_t match,void *match_data, -void (*fn)(struct device *,void *,void *), -void *data); -void devres_free (void *res); -void devres_add (struct device *dev,void *res); -void *devres_find (struct device *dev,dr_release_t release, -dr_match_t match,void *match_data); -void *devres_get (struct device *dev,void *new_res, -dr_match_t match,void *match_data); -void *devres_remove (struct device *dev,dr_release_t release, -dr_match_t match,void *match_data); -int devres_destroy (struct device *dev,dr_release_t release, -dr_match_t match,void *match_data); -int devres_release (struct device *dev,dr_release_t release, -dr_match_t match,void *match_data); - -/* devres group */ -void *__must_check devres_open_group (struct device *dev,void *id,gfp_t gfp); -void devres_close_group (struct device *dev,void *id); -void devres_remove_group (struct device *dev,void *id); -int devres_release_group (struct device *dev,void *id); - -/* managed devm_k.alloc/kfree for device drivers */ -void *devm_kmalloc (struct device *dev,size_t size,gfp_t gfp)__alloc_size(2) ; -void *devm_krealloc (struct device *dev,void *ptr,size_t size, -gfp_t gfp)__must_check __realloc_size (3 ); -__printf(3, 0) char *devm_kvasprintf(struct device *dev, gfp_t gfp, -const char *fmt,va_list ap) __malloc; -__printf(3, 4) char *devm_kasprintf(struct device *dev, gfp_t gfp, -const char *fmt, ...) __malloc; -static inline void *devm_kzalloc (struct device *dev,size_t size,gfp_t gfp) -{ -return devm_kmalloc (dev, size, gfp | __GFP_ZERO); -} -static inline void *devm_kmalloc_array (struct device *dev, -size_t n,size_t size,gfp_t flags) -{ -size_t bytes; - -if (unlikely (check_mul_overflow (n, size, &bytes))) -return NULL ; - -return devm_kmalloc (dev, bytes, flags); -} -static inline void *devm_kcalloc (struct device *dev, -size_t n,size_t size,gfp_t flags) -{ -return devm_kmalloc_array (dev, n, size, flags | __GFP_ZERO); -} -static inline __realloc_size(3, 4) void * __must_check -devm_krealloc_array(struct device *dev, void *p, size_t new_n, size_t new_size, gfp_t flags) -{ - size_t bytes; - -if (unlikely (check_mul_overflow (new_n, new_size, &bytes))) -return NULL ; - -return devm_krealloc (dev, p, bytes, flags); -} - -void devm_kfree (struct device *dev,const void *p); -char *devm_kstrdup (struct device *dev,const char *s,gfp_t gfp) __malloc; -const char *devm_kstrdup_const (struct device *dev,const char *s,gfp_t gfp); -void *devm_kmemdup (struct device *dev,const void *src,size_t len,gfp_t gfp) -__realloc_size (3 ); - -unsigned long devm_get_free_pages (struct device *dev, -gfp_t gfp_mask,unsigned int order); -void devm_free_pages (struct device *dev,unsigned long addr); - -#ifdef CONFIG_HAS_IOMEM -void __iomem *devm_ioremap_resource (struct device *dev, -const struct resource *res); -void __iomem *devm_ioremap_resource_wc (struct device *dev, -const struct resource *res); - -void __iomem *devm_of_iomap (struct device *dev, -struct device_node *node,int index, -resource_size_t *size); -#else - -static inline -void __iomem *devm_ioremap_resource (struct device *dev, -const struct resource *res) -{ -return ERR_PTR (-EINVAL ); -} - -static inline -void __iomem *devm_ioremap_resource_wc (struct device *dev, -const struct resource *res) -{ -return ERR_PTR (-EINVAL ); -} - -static inline -void __iomem *devm_of_iomap (struct device *dev, -struct device_node *node,int index, -resource_size_t *size) -{ -return ERR_PTR (-EINVAL ); -} - -#endif -/* allows to add/remove a custom action to devres stack */ int devm_remove_action_nowarn (struct device *dev,void (*action)(void *),void *data);
include/linux/device/devres.h new file +124 -0
124 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 694/783 devres: Introduce devm_kmemdup_array()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raag Jadav <[email protected]>
[ Upstream commit a103b833ac3806b816bc993cba77d0b17cf801f1 ]
Introduce '_array' variant of devm_kmemdup() which is more robust and consistent with alloc family of helpers.
Stable-dep-of: 7dd7f39fce00 ("ASoC: SOF: Intel: hda: Fix UAF when reloading module")
--- include/linux/device/devres.h | 5 +++++ 1 file changed, 5 insertions(+)
include/linux/device/devres.h +5 -0
@@ -79,6 +79,11 @@ void devm_kfree(struct device *dev, const void *p); void * __realloc_size(3) devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp); +static inline void *devm_kmemdup_array (struct device *dev,const void *src, +size_t n,size_t size,gfp_t flags) +{ +return devm_kmemdup (dev, src,size_mul (size, n), flags); +} char * __mallocdevm_kstrdup (struct device *dev,const char *s,gfp_t gfp);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 695/783 ASoC: SOF: Intel: hda: Fix UAF when reloading module
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tavian Barnes <[email protected]>
[ Upstream commit 7dd7f39fce0022b386ef1ea5ffef92ecc7dfc6af ]
hda_generic_machine_select() appends -idisp to the tplg filename by allocating a new string with devm_kasprintf(), then stores the string right back into the global variable snd_soc_acpi_intel_hda_machines. When the module is unloaded, this memory is freed, resulting in a global variable pointing to freed memory. Reloading the module then triggers a use-after-free:
BUG: KFENCE: use-after-free read in string+0x48/0xe0
Use-after-free read at 0x00000000967e0109 (in kfence-#99):
string+0x48/0xe0 vsnprintf+0x329/0x6e0 devm_kvasprintf+0x54/0xb0 devm_kasprintf+0x58/0x80 hda_machine_select.cold+0x198/0x17a2 [snd_sof_intel_hda_generic] sof_probe_work+0x7f/0x600 [snd_sof] process_one_work+0x17b/0x330 worker_thread+0x2ce/0x3f0 kthread+0xcf/0x100 ret_from_fork+0x31/0x50 ret_from_fork_asm+0x1a/0x30
kfence-#99: 0x00000000198a940f-0x00000000ace47d9d, size=64, cache=kmalloc-64
allocated by task 333 on cpu 8 at 17.798069s (130.453553s ago):
devm_kmalloc+0x52/0x120 devm_kvasprintf+0x66/0xb0 devm_kasprintf+0x58/0x80 hda_machine_select.cold+0x198/0x17a2 [snd_sof_intel_hda_generic] sof_probe_work+0x7f/0x600 [snd_sof] process_one_work+0x17b/0x330 worker_thread+0x2ce/0x3f0 kthread+0xcf/0x100 ret_from_fork+0x31/0x50 ret_from_fork_asm+0x1a/0x30
freed by task 1543 on cpu 4 at 141.586686s (6.665010s ago):
release_nodes+0x43/0xb0 devres_release_all+0x90/0xf0 device_unbind_cleanup+0xe/0x70 device_release_driver_internal+0x1c1/0x200 driver_detach+0x48/0x90 bus_remove_driver+0x6d/0xf0 pci_unregister_driver+0x42/0xb0 __do_sys_delete_module+0x1d1/0x310 do_syscall_64+0x82/0x190 entry_SYSCALL_64_after_hwframe+0x76/0x7e
Fix it by copying the match array with devm_kmemdup_array() before we modify it.
--- sound/soc/sof/intel/hda.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
sound/soc/sof/intel/hda.c +15 -1
@@ -1011,7 +1011,21 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,if (!*mach && codec_num <=2 ) {bool tplg_fixup = false; - hda_mach = snd_soc_acpi_intel_hda_machines; +/* +* make a local copy of the match array since we might +* be modifying it +*/ + hda_mach =devm_kmemdup_array (sdev->dev, + snd_soc_acpi_intel_hda_machines, +2 ,/* we have one entry + sentinel in the array */ +sizeof (snd_soc_acpi_intel_hda_machines[0 ]), +GFP_KERNEL ); +if (!hda_mach) { +dev_err (bus->dev, +"%s: failed to duplicate the HDA match table\n" , + __func__); +return ; + }dev_info (bus->dev,"using HDA machine driver %s now\n" , hda_mach->drv_name);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 696/783 irqchip/riscv-imsic: Start local sync timer on correct CPU
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Bresticker <[email protected]>
[ Upstream commit 08fb624802d8786253994d8ebdbbcdaa186f04f5 ]
When starting the local sync timer to synchronize the state of a remote CPU it should be added on the CPU to be synchronized, not the initiating CPU. This results in interrupt delivery being delayed until the timer eventually runs (due to another mask/unmask/migrate operation) on the target CPU.
--- drivers/irqchip/irq-riscv-imsic-state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/irqchip/irq-riscv-imsic-state.c +5 -5
@@ -186,17 +186,17 @@ static bool __imsic_local_sync(struct imsic_local_priv *lpriv) }#ifdef CONFIG_SMP -static void __imsic_local_timer_start (struct imsic_local_priv *lpriv) +static void __imsic_local_timer_start (struct imsic_local_priv *lpriv,unsigned int cpu) {lockdep_assert_held (&lpriv->lock);if (!timer_pending (&lpriv->timer)) { lpriv->timer.expires = jiffies +1 ; -add_timer_on (&lpriv->timer,smp_processor_id ()); +add_timer_on (&lpriv->timer, cpu); } }#else -static inline void __imsic_local_timer_start (struct imsic_local_priv *lpriv) +static inline void __imsic_local_timer_start (struct imsic_local_priv *lpriv,unsigned int cpu) { }#endif
@@ -211,7 +211,7 @@ void imsic_local_sync_all(bool force_all)if (force_all)bitmap_fill (lpriv->dirty_bitmap, imsic->global.nr_ids +1 );if (!__imsic_local_sync (lpriv)) -__imsic_local_timer_start (lpriv); +__imsic_local_timer_start (lpriv,smp_processor_id ());raw_spin_unlock_irqrestore (&lpriv->lock, flags); }
@@ -256,7 +256,7 @@ static void __imsic_remote_sync(struct imsic_local_priv *lpriv, unsigned int cpu return; } -__imsic_local_timer_start (lpriv); +__imsic_local_timer_start (lpriv, cpu); } }#else
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 697/783 perf/x86/intel: Fix segfault with PEBS-via-PT with sample_freq
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
[ Upstream commit 99bcd91fabada0dbb1d5f0de44532d8008db93c6 ]
Currently, using PEBS-via-PT with a sample frequency instead of a sample period, causes a segfault. For example:
BUG: kernel NULL pointer dereference, address: 0000000000000195
<NMI>
? __die_body.cold+0x19/0x27
? page_fault_oops+0xca/0x290
? exc_page_fault+0x7e/0x1b0
? asm_exc_page_fault+0x26/0x30
? intel_pmu_pebs_event_update_no_drain+0x40/0x60
? intel_pmu_pebs_event_update_no_drain+0x32/0x60
intel_pmu_drain_pebs_icl+0x333/0x350
handle_pmi_common+0x272/0x3c0
intel_pmu_handle_irq+0x10a/0x2e0
perf_event_nmi_handler+0x2a/0x50That happens because intel_pmu_pebs_event_update_no_drain() assumes all the pebs_enabled bits represent counter indexes, which is not always the case. In this particular case, bits 60 and 61 are set for PEBS-via-PT purposes.
The behaviour of PEBS-via-PT with sample frequency is questionable because although a PMI is generated (PEBS_PMI_AFTER_EACH_RECORD), the period is not adjusted anyway.
Putting that aside, fix intel_pmu_pebs_event_update_no_drain() by passing the mask of counter bits instead of 'size'. Note, prior to the Fixes commit, 'size' would be limited to the maximum counter index, so the issue was not hit.
--- arch/x86/events/intel/ds.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/x86/events/intel/ds.c +5 -4
@@ -2280,8 +2280,9 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs, struct perf_sample_ setup_pebs_fixed_sample_data); } -static void intel_pmu_pebs_event_update_no_drain (struct cpu_hw_events *cpuc,int size) +static void intel_pmu_pebs_event_update_no_drain (struct cpu_hw_events *cpuc,u64 mask) { +u64 pebs_enabled = cpuc->pebs_enabled & mask;struct perf_event *event;int bit;
@@ -2292,7 +2293,7 @@ static void intel_pmu_pebs_event_update_no_drain(struct cpu_hw_events *cpuc, int* It needs to call intel_pmu_save_and_restart_reload() to * update the event->count for this case. */ -for_each_set_bit (bit, (unsigned long *)&cpuc->pebs_enabled, size) { +for_each_set_bit (bit, (unsigned long *)&pebs_enabled,X86_PMC_IDX_MAX ) { event = cpuc->events[bit];if (event->hw.flags &PERF_X86_EVENT_AUTO_RELOAD )intel_pmu_save_and_restart_reload (event,0 );
@@ -2327,7 +2328,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d }if (unlikely (base >= top)) { -intel_pmu_pebs_event_update_no_drain (cpuc, size); +intel_pmu_pebs_event_update_no_drain (cpuc, mask);return ; }
@@ -2441,7 +2442,7 @@ static void intel_pmu_drain_pebs_icl(struct pt_regs *iregs, struct perf_sample_d (hybrid (cpuc->pmu, fixed_cntr_mask64) <<INTEL_PMC_IDX_FIXED );if (unlikely (base >= top)) { -intel_pmu_pebs_event_update_no_drain (cpuc,X86_PMC_IDX_MAX ); +intel_pmu_pebs_event_update_no_drain (cpuc, mask);return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 698/783 Bluetooth: L2CAP: Fix not checking l2cap_chan security level
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 7af8479d9eb4319b4ba7b47a8c4d2c55af1c31e1 ]
l2cap_check_enc_key_size shall check the security level of the l2cap_chan rather than the hci_conn since for incoming connection request that may be different as hci_conn may already been encrypted using a different security level.
--- net/bluetooth/l2cap_core.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
net/bluetooth/l2cap_core.c +8 -7
@@ -1411,7 +1411,8 @@ static void l2cap_request_info(struct l2cap_conn *conn) sizeof(req), &req); } -static bool l2cap_check_enc_key_size (struct hci_conn *hcon) +static bool l2cap_check_enc_key_size (struct hci_conn *hcon, +struct l2cap_chan *chan) {/* The minimum encryption key size needs to be enforced by the * host stack before establishing any L2CAP connections. The
@@ -1425,7 +1426,7 @@ static bool l2cap_check_enc_key_size(struct hci_conn *hcon)int min_key_size = hcon->hdev->min_enc_key_size;/* On FIPS security level, key size must be 16 bytes */ -if (hcon->sec_level ==BT_SECURITY_FIPS ) +if (chan->sec_level ==BT_SECURITY_FIPS ) min_key_size =16 ; return (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags) ||
@@ -1453,7 +1454,7 @@ static void l2cap_do_start(struct l2cap_chan *chan) !__l2cap_no_conn_pending(chan))return ; -if (l2cap_check_enc_key_size (conn->hcon)) +if (l2cap_check_enc_key_size (conn->hcon, chan))l2cap_start_connection (chan);else __set_chan_timer (chan,L2CAP_DISC_TIMEOUT );
@@ -1528,7 +1529,7 @@ static void l2cap_conn_start(struct l2cap_conn *conn)continue ; } -if (l2cap_check_enc_key_size (conn->hcon)) +if (l2cap_check_enc_key_size (conn->hcon, chan))l2cap_start_connection (chan);else l2cap_chan_close (chan,ECONNREFUSED );
@@ -3957,7 +3958,7 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd,/* Check if the ACL is secure enough (if not SDP) */ if (psm !=cpu_to_le16 (L2CAP_PSM_SDP ) && (!hci_conn_check_link_mode (conn->hcon) || - !l2cap_check_enc_key_size (conn->hcon))) { + !l2cap_check_enc_key_size (conn->hcon, pchan))) { conn->disc_reason =HCI_ERROR_AUTH_FAILURE ; result =L2CAP_CR_SEC_BLOCK ; goto response;
@@ -7317,7 +7318,7 @@ static void l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) }if (chan->state ==BT_CONNECT ) { -if (!status &&l2cap_check_enc_key_size (hcon)) +if (!status &&l2cap_check_enc_key_size (hcon, chan))l2cap_start_connection (chan);else __set_chan_timer (chan,L2CAP_DISC_TIMEOUT );
@@ -7327,7 +7328,7 @@ static void l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)struct l2cap_conn_rsp rsp;__u16 res, stat; -if (!status &&l2cap_check_enc_key_size (hcon)) { +if (!status &&l2cap_check_enc_key_size (hcon, chan)) {if (test_bit (FLAG_DEFER_SETUP , &chan->flags)) { res =L2CAP_CR_PEND ; stat =L2CAP_CS_AUTHOR_PEND ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 699/783 Bluetooth: btusb: use skb_pull to avoid unsafe access in QCA dump handling
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: En-Wei Wu <[email protected]>
[ Upstream commit 4bcb0c7dc25446b99fc7a8fa2a143d69f3314162 ]
Use skb_pull() and skb_pull_data() to safely parse QCA dump packets.
This avoids direct pointer math on skb->data, which could lead to invalid access if the packet is shorter than expected.
--- drivers/bluetooth/btusb.c | 98 ++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 58 deletions(-)
drivers/bluetooth/btusb.c +40 -58
@@ -3014,9 +3014,8 @@ static void btusb_coredump_qca(struct hci_dev *hdev)static int handle_dump_pkt_qca (struct hci_dev *hdev,struct sk_buff *skb) {int ret =0 ; +unsigned int skip =0 ;u8 pkt_type; -u8 *sk_ptr; -unsigned int sk_len;u16 seqno;u32 dump_size;
@@ -3025,18 +3024,13 @@ static int handle_dump_pkt_qca(struct hci_dev *hdev, struct sk_buff *skb)struct usb_device *udev = btdata->udev; pkt_type =hci_skb_pkt_type (skb); - sk_ptr = skb->data; - sk_len = skb->len; + skip =sizeof (struct hci_event_hdr ); +if (pkt_type ==HCI_ACLDATA_PKT ) + skip +=sizeof (struct hci_acl_hdr ); -if (pkt_type ==HCI_ACLDATA_PKT ) { - sk_ptr +=HCI_ACL_HDR_SIZE ; - sk_len -=HCI_ACL_HDR_SIZE ; - } - - sk_ptr +=HCI_EVENT_HDR_SIZE ; - sk_len -=HCI_EVENT_HDR_SIZE ; +skb_pull (skb, skip); + dump_hdr = (struct qca_dump_hdr *)skb->data; - dump_hdr = (struct qca_dump_hdr *)sk_ptr; seqno =le16_to_cpu (dump_hdr->seqno);if (seqno ==0 ) {set_bit (BTUSB_HW_SSR_ACTIVE , &btdata->flags);
@@ -3056,16 +3050,15 @@ static int handle_dump_pkt_qca(struct hci_dev *hdev, struct sk_buff *skb) btdata->qca_dump.ram_dump_size = dump_size; btdata->qca_dump.ram_dump_seqno =0 ; - sk_ptr += offsetof(struct qca_dump_hdr , data0); - sk_len -= offsetof(struct qca_dump_hdr , data0); + +skb_pull (skb, offsetof(struct qca_dump_hdr , data0));usb_disable_autosuspend (udev);bt_dev_info (hdev,"%s memdump size(%u)\n" , (pkt_type ==HCI_ACLDATA_PKT ) ?"ACL" :"event" , dump_size); }else { - sk_ptr += offsetof(struct qca_dump_hdr , data); - sk_len -= offsetof(struct qca_dump_hdr , data); +skb_pull (skb, offsetof(struct qca_dump_hdr , data)); }if (!btdata->qca_dump.ram_dump_size) {
@@ -3085,7 +3078,6 @@ static int handle_dump_pkt_qca(struct hci_dev *hdev, struct sk_buff *skb)return ret; } -skb_pull (skb, skb->len - sk_len);hci_devcd_append (hdev, skb); btdata->qca_dump.ram_dump_seqno++;if (seqno ==QCA_LAST_SEQUENCE_NUM ) {
@@ -3113,68 +3105,58 @@ static int handle_dump_pkt_qca(struct hci_dev *hdev, struct sk_buff *skb)/* Return: true if the ACL packet is a dump packet, false otherwise. */ static bool acl_pkt_is_dump_qca (struct hci_dev *hdev,struct sk_buff *skb) { -u8 *sk_ptr; -unsigned int sk_len; -struct hci_event_hdr *event_hdr;struct hci_acl_hdr *acl_hdr;struct qca_dump_hdr *dump_hdr; +struct sk_buff *clone =skb_clone (skb,GFP_ATOMIC ); +bool is_dump = false; - sk_ptr = skb->data; - sk_len = skb->len; - - acl_hdr =hci_acl_hdr (skb); -if (le16_to_cpu (acl_hdr->handle) !=QCA_MEMDUMP_ACL_HANDLE ) +if (!clone)return false; - sk_ptr +=HCI_ACL_HDR_SIZE ; - sk_len -=HCI_ACL_HDR_SIZE ; - event_hdr = (struct hci_event_hdr *)sk_ptr; - -if ((event_hdr->evt !=HCI_VENDOR_PKT ) || - (event_hdr->plen != (sk_len -HCI_EVENT_HDR_SIZE ))) -return false; + acl_hdr =skb_pull_data (clone,sizeof (*acl_hdr)); +if (!acl_hdr || (le16_to_cpu (acl_hdr->handle) !=QCA_MEMDUMP_ACL_HANDLE )) + goto out; - sk_ptr +=HCI_EVENT_HDR_SIZE ; - sk_len -=HCI_EVENT_HDR_SIZE ; + event_hdr =skb_pull_data (clone,sizeof (*event_hdr)); +if (!event_hdr || (event_hdr->evt !=HCI_VENDOR_PKT )) + goto out; - dump_hdr = (struct qca_dump_hdr *)sk_ptr; -if ((sk_len < offsetof(struct qca_dump_hdr , data)) || - (dump_hdr->vse_class !=QCA_MEMDUMP_VSE_CLASS ) || - (dump_hdr->msg_type !=QCA_MEMDUMP_MSG_TYPE )) -return false; + dump_hdr =skb_pull_data (clone,sizeof (*dump_hdr)); +if (!dump_hdr || (dump_hdr->vse_class !=QCA_MEMDUMP_VSE_CLASS ) || + (dump_hdr->msg_type !=QCA_MEMDUMP_MSG_TYPE )) + goto out; -return true; + is_dump = true; +out: +consume_skb (clone); +return is_dump; }/* Return: true if the event packet is a dump packet, false otherwise. */ static bool evt_pkt_is_dump_qca (struct hci_dev *hdev,struct sk_buff *skb) { -u8 *sk_ptr; -unsigned int sk_len; -struct hci_event_hdr *event_hdr;struct qca_dump_hdr *dump_hdr; +struct sk_buff *clone =skb_clone (skb,GFP_ATOMIC ); +bool is_dump = false; - sk_ptr = skb->data; - sk_len = skb->len; - - event_hdr =hci_event_hdr (skb); - -if ((event_hdr->evt !=HCI_VENDOR_PKT ) - || (event_hdr->plen != (sk_len -HCI_EVENT_HDR_SIZE ))) +if (!clone)return false; - sk_ptr +=HCI_EVENT_HDR_SIZE ; - sk_len -=HCI_EVENT_HDR_SIZE ; + event_hdr =skb_pull_data (clone,sizeof (*event_hdr)); +if (!event_hdr || (event_hdr->evt !=HCI_VENDOR_PKT )) + goto out; - dump_hdr = (struct qca_dump_hdr *)sk_ptr; -if ((sk_len < offsetof(struct qca_dump_hdr , data)) || - (dump_hdr->vse_class !=QCA_MEMDUMP_VSE_CLASS ) || - (dump_hdr->msg_type !=QCA_MEMDUMP_MSG_TYPE )) -return false; + dump_hdr =skb_pull_data (clone,sizeof (*dump_hdr)); +if (!dump_hdr || (dump_hdr->vse_class !=QCA_MEMDUMP_VSE_CLASS ) || + (dump_hdr->msg_type !=QCA_MEMDUMP_MSG_TYPE )) + goto out; -return true; + is_dump = true; +out: +consume_skb (clone); +return is_dump; }static int btusb_recv_acl_qca (struct hci_dev *hdev,struct sk_buff *skb)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 700/783 ptp: ocp: Limit signal/freq counts in summary output functions
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sagi Maimon <[email protected]>
[ Upstream commit c9e455581e2ba87ee38c126e8dc49a424b9df0cf ]
The debugfs summary output could access uninitialized elements in the freq_in[] and signal_out[] arrays, causing NULL pointer dereferences and triggering a kernel Oops (page_fault_oops). This patch adds u8 fields (nr_freq_in, nr_signal_out) to track the number of initialized elements, with a maximum of 4 per array. The summary output functions are updated to respect these limits, preventing out-of-bounds access and ensuring safe array handling.
Widen the label variables because the change confuses GCC about max length of the strings.
--- drivers/ptp/ptp_ocp.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/ptp/ptp_ocp.c +17 -7
@@ -315,6 +315,8 @@ struct ptp_ocp_serial_port {#define OCP_BOARD_ID_LEN 13#define OCP_SERIAL_LEN 6#define OCP_SMA_NUM 4 +#define OCP_SIGNAL_NUM 4 +#define OCP_FREQ_NUM 4enum {PORT_GNSS ,
@@ -342,8 +344,8 @@ struct ptp_ocp {struct dcf_master_reg __iomem *dcf_out;struct dcf_slave_reg __iomem *dcf_in;struct tod_reg __iomem *nmea_out; -struct frequency_reg __iomem *freq_in[4 ]; -struct ptp_ocp_ext_src *signal_out[4 ]; +struct frequency_reg __iomem *freq_in[OCP_FREQ_NUM ]; +struct ptp_ocp_ext_src *signal_out[OCP_SIGNAL_NUM ];struct ptp_ocp_ext_src *pps;struct ptp_ocp_ext_src *ts0;struct ptp_ocp_ext_src *ts1;
@@ -378,10 +380,12 @@ struct ptp_ocp {u32 utc_tai_offset;u32 ts_window_adjust;u64 fw_cap; -struct ptp_ocp_signal signal[4 ]; +struct ptp_ocp_signal signal[OCP_SIGNAL_NUM ];struct ptp_ocp_sma_connector sma[OCP_SMA_NUM ];const struct ocp_sma_op *sma_op;struct dpll_device *dpll; +int signals_nr; +int freq_in_nr; };#define OCP_REQ_TIMESTAMP BIT(0)
@@ -2697,6 +2701,8 @@ ptp_ocp_fb_board_init(struct ptp_ocp *bp, struct ocp_resource *r) bp->eeprom_map = fb_eeprom_map; bp->fw_version =ioread32 (&bp->image->version); bp->sma_op = &ocp_fb_sma_op; + bp->signals_nr =4 ; + bp->freq_in_nr =4 ;ptp_ocp_fb_set_version (bp);
@@ -2862,6 +2868,8 @@ ptp_ocp_art_board_init(struct ptp_ocp *bp, struct ocp_resource *r) bp->fw_version =ioread32 (&bp->reg->version); bp->fw_tag =2 ; bp->sma_op = &ocp_art_sma_op; + bp->signals_nr =4 ; + bp->freq_in_nr =4 ;/* Enable MAC serial port during initialisation */ iowrite32 (1 , &bp->board_config->mro50_serial_activate);
@@ -2888,6 +2896,8 @@ ptp_ocp_adva_board_init(struct ptp_ocp *bp, struct ocp_resource *r) bp->flash_start =0xA00000 ; bp->eeprom_map = fb_eeprom_map; bp->sma_op = &ocp_adva_sma_op; + bp->signals_nr =2 ; + bp->freq_in_nr =2 ; version =ioread32 (&bp->image->version);/* if lower 16 bits are empty, this is the fw loader. */
@@ -4008,7 +4018,7 @@ _signal_summary_show(struct seq_file *s, struct ptp_ocp *bp, int nr) {struct signal_reg __iomem *reg = bp->signal_out[nr]->mem;struct ptp_ocp_signal *signal = &bp->signal[nr]; -char label[8 ]; +char label[16 ];bool on;u32 val;
@@ -4034,7 +4044,7 @@ static void _frequency_summary_show(struct seq_file *s, int nr, struct frequency_reg __iomem *reg) { - char label[8]; + char label[16];bool on;u32 val;
@@ -4178,11 +4188,11 @@ ptp_ocp_summary_show(struct seq_file *s, void *data) }if (bp->fw_cap &OCP_CAP_SIGNAL ) -for (i =0 ; i <4 ; i++) +for (i =0 ; i < bp->signals_nr; i++)_signal_summary_show (s, bp, i);if (bp->fw_cap &OCP_CAP_FREQ ) -for (i =0 ; i <4 ; i++) +for (i =0 ; i < bp->freq_in_nr; i++)_frequency_summary_show (s, i, bp->freq_in[i]);if (bp->irig_out) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 701/783 bridge: netfilter: Fix forwarding of fragmented packets
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 91b6dbced0ef1d680afdd69b14fc83d50ebafaf3 ]
When netfilter defrag hooks are loaded (due to the presence of conntrack rules, for example), fragmented packets entering the bridge will be defragged by the bridge's pre-routing hook (br_nf_pre_routing() -> ipv4_conntrack_defrag()).
Later on, in the bridge's post-routing hook, the defragged packet will be fragmented again. If the size of the largest fragment is larger than what the kernel has determined as the destination MTU (using ip_skb_dst_mtu()), the defragged packet will be dropped.
Before commit ac6627a28dbf ("net: ipv4: Consolidate ipv4_mtu and ip_dst_mtu_maybe_forward"), ip_skb_dst_mtu() would return dst_mtu() as the destination MTU. Assuming the dst entry attached to the packet is the bridge's fake rtable one, this would simply be the bridge's MTU (see fake_mtu()).
However, after above mentioned commit, ip_skb_dst_mtu() ends up returning the route's MTU stored in the dst entry's metrics. Ideally, in case the dst entry is the bridge's fake rtable one, this should be the bridge's MTU as the bridge takes care of updating this metric when its MTU changes (see br_change_mtu()).
Unfortunately, the last operation is a no-op given the metrics attached to the fake rtable entry are marked as read-only. Therefore, ip_skb_dst_mtu() ends up returning 1500 (the initial MTU value) and defragged packets are dropped during fragmentation when dealing with large fragments and high MTU (e.g., 9k).
Fix by moving the fake rtable entry's metrics to be per-bridge (in a similar fashion to the fake rtable entry itself) and marking them as writable, thereby allowing MTU changes to be reflected.
--- net/bridge/br_nf_core.c | 7 ++----- net/bridge/br_private.h | 1 + 2 files changed, 3 insertions(+), 5 deletions(-)
net/bridge/br_nf_core.c +2 -5
@@ -65,17 +65,14 @@ static struct dst_ops fake_dst_ops = {* ipt_REJECT needs it. Future netfilter modules might * require us to fill additional fields. */ -static const u32 br_dst_default_metrics[RTAX_MAX ] = { - [RTAX_MTU -1 ] =1500 , -}; -void br_netfilter_rtable_init (struct net_bridge *br) {struct rtable *rt = &br->fake_rtable;rcuref_init (&rt->dst.__rcuref,1 ); rt->dst.dev = br->dev; -dst_init_metrics (&rt->dst, br_dst_default_metrics, true); +dst_init_metrics (&rt->dst, br->metrics, false); +dst_metric_set (&rt->dst,RTAX_MTU , br->dev->mtu); rt->dst.flags =DST_NOXFRM |DST_FAKE_RTABLE ; rt->dst.ops = &fake_dst_ops; }
net/bridge/br_private.h +1 -0
@@ -505,6 +505,7 @@ struct net_bridge {struct rtable fake_rtable; struct rt6_info fake_rt6_info; }; +u32 metrics[RTAX_MAX ];#endif u16 group_fwd_mask;u16 group_fwd_mask_required;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 702/783 mr: consolidate the ipmr_can_free_table() checks.
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Abeni <[email protected]>
[ Upstream commit c46286fdd6aa1d0e33c245bcffe9ff2428a777bd ]
Guoyu Yin reported a splat in the ipmr netns cleanup path:
WARNING: CPU: 2 PID: 14564 at net/ipv4/ipmr.c:440 ipmr_free_table net/ipv4/ipmr.c:440 [inline] WARNING: CPU: 2 PID: 14564 at net/ipv4/ipmr.c:440 ipmr_rules_exit+0x135/0x1c0 net/ipv4/ipmr.c:361 Modules linked in: CPU: 2 UID: 0 PID: 14564 Comm: syz.4.838 Not tainted 6.14.0 #1 Hardware name: QEMU Ubuntu 24.04 PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:ipmr_free_table net/ipv4/ipmr.c:440 [inline] RIP: 0010:ipmr_rules_exit+0x135/0x1c0 net/ipv4/ipmr.c:361 Code: ff df 48 c1 ea 03 80 3c 02 00 75 7d 48 c7 83 60 05 00 00 00 00 00 00 5b 5d 41 5c 41 5d 41 5e e9 71 67 7f 00 e8 4c 2d 8a fd 90 <0f> 0b 90 eb 93 e8 41 2d 8a fd 0f b6 2d 80 54 ea 01 31 ff 89 ee e8 RSP: 0018:ffff888109547c58 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff888108c12dc0 RCX: ffffffff83e09868 RDX: ffff8881022b3300 RSI: ffffffff83e098d4 RDI: 0000000000000005 RBP: ffff888104288000 R08: 0000000000000000 R09: ffffed10211825c9 R10: 0000000000000001 R11: ffff88801816c4a0 R12: 0000000000000001 R13: ffff888108c13320 R14: ffff888108c12dc0 R15: fffffbfff0b74058 FS: 00007f84f39316c0(0000) GS:ffff88811b100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f84f3930f98 CR3: 0000000113b56000 CR4: 0000000000350ef0 Call Trace: <TASK> ipmr_net_exit_batch+0x50/0x90 net/ipv4/ipmr.c:3160 ops_exit_list+0x10c/0x160 net/core/net_namespace.c:177 setup_net+0x47d/0x8e0 net/core/net_namespace.c:394 copy_net_ns+0x25d/0x410 net/core/net_namespace.c:516 create_new_namespaces+0x3f6/0xaf0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc3/0x180 kernel/nsproxy.c:228 ksys_unshare+0x78d/0x9a0 kernel/fork.c:3342 __do_sys_unshare kernel/fork.c:3413 [inline] __se_sys_unshare kernel/fork.c:3411 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3411 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa6/0x1a0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f84f532cc29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f84f3931038 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 00007f84f5615fa0 RCX: 00007f84f532cc29 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000400 RBP: 00007f84f53fba18 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f84f5615fa0 R15: 00007fff51c5f328 </TASK>
The running kernel has CONFIG_IP_MROUTE_MULTIPLE_TABLES disabled, and the sanity check for such build is still too loose.
Address the issue consolidating the relevant sanity check in a single helper regardless of the kernel configuration. Also share it between the ipv4 and ipv6 code.
--- include/linux/mroute_base.h | 5 +++++ net/ipv4/ipmr.c | 12 +----------- net/ipv6/ip6mr.c | 12 +----------- 3 files changed, 7 insertions(+), 22 deletions(-)
include/linux/mroute_base.h +5 -0
@@ -262,6 +262,11 @@ struct mr_table {int mroute_reg_vif_num; }; +static inline bool mr_can_free_table (struct net *net) +{ +return !check_net (net) || !net_initialized (net); +} +#ifdef CONFIG_IP_MROUTE_COMMON void vif_device_init(struct vif_device *v, struct net_device *dev,
net/ipv4/ipmr.c +1 -11
@@ -120,11 +120,6 @@ static void ipmr_expire_process(struct timer_list *t); lockdep_rtnl_is_held() || \ list_empty(&net->ipv4.mr_tables)) -static bool ipmr_can_free_table (struct net *net) -{ -return !check_net (net) || !net_initialized (net); -} -static struct mr_table *ipmr_mr_table_iter (struct net *net,struct mr_table *mrt) {
@@ -317,11 +312,6 @@ EXPORT_SYMBOL(ipmr_rule_default);#define ipmr_for_each_table (mrt, net) \ for (mrt = net->ipv4.mrt; mrt; mrt = NULL) -static bool ipmr_can_free_table (struct net *net) -{ -return !check_net (net); -} -static struct mr_table *ipmr_mr_table_iter (struct net *net,struct mr_table *mrt) {
@@ -437,7 +427,7 @@ static void ipmr_free_table(struct mr_table *mrt) {struct net *net =read_pnet (&mrt->net); -WARN_ON_ONCE (!ipmr_can_free_table (net)); +WARN_ON_ONCE (!mr_can_free_table (net));timer_shutdown_sync (&mrt->ipmr_expire_timer); mroute_clean_tables(mrt, MRT_FLUSH_VIFS | MRT_FLUSH_VIFS_STATIC |
net/ipv6/ip6mr.c +1 -11
@@ -108,11 +108,6 @@ static void ipmr_expire_process(struct timer_list *t); lockdep_rtnl_is_held() || \ list_empty(&net->ipv6.mr6_tables)) -static bool ip6mr_can_free_table (struct net *net) -{ -return !check_net (net) || !net_initialized (net); -} -static struct mr_table *ip6mr_mr_table_iter (struct net *net,struct mr_table *mrt) {
@@ -306,11 +301,6 @@ EXPORT_SYMBOL(ip6mr_rule_default);#define ip6mr_for_each_table (mrt, net) \ for (mrt = net->ipv6.mrt6; mrt; mrt = NULL) -static bool ip6mr_can_free_table (struct net *net) -{ -return !check_net (net); -} -static struct mr_table *ip6mr_mr_table_iter (struct net *net,struct mr_table *mrt) {
@@ -416,7 +406,7 @@ static void ip6mr_free_table(struct mr_table *mrt) {struct net *net =read_pnet (&mrt->net); -WARN_ON_ONCE (!ip6mr_can_free_table (net)); +WARN_ON_ONCE (!mr_can_free_table (net));timer_shutdown_sync (&mrt->ipmr_expire_timer); mroute_clean_tables(mrt, MRT6_FLUSH_MIFS | MRT6_FLUSH_MIFS_STATIC |
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 703/783 ice: fix vf->num_mac count with port representors
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Keller <[email protected]>
[ Upstream commit bbd95160a03dbfcd01a541f25c27ddb730dfbbd5 ]
The ice_vc_repr_add_mac() function indicates that it does not store the MAC address filters in the firmware. However, it still increments vf->num_mac. This is incorrect, as vf->num_mac should represent the number of MAC filters currently programmed to firmware.
Indeed, we only perform this increment if the requested filter is a unicast address that doesn't match the existing vf->hw_lan_addr. In addition, ice_vc_repr_del_mac() does not decrement the vf->num_mac counter. This results in the counter becoming out of sync with the actual count.
As it turns out, vf->num_mac is currently only used in legacy made without port representors. The single place where the value is checked is for enforcing a filter limit on untrusted VFs.
Upcoming patches to support VF Live Migration will use this value when determining the size of the TLV for MAC address filters. Fix the representor mode function to stop incrementing the counter incorrectly.
--- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_virtchnl.c +0 -1
@@ -4211,7 +4211,6 @@ static int ice_vc_repr_add_mac(struct ice_vf *vf, u8 *msg) }ice_vfhw_mac_add (vf, &al->list[i]); - vf->num_mac++;break ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 704/783 ice: Fix LACP bonds without SRIOV environment
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Ertman <[email protected]>
[ Upstream commit 6c778f1b839b63525b30046c9d1899424a62be0a ]
If an aggregate has the following conditions:
- The SRIOV LAG DDP package has been enabled
- The bond is in 802.3ad LACP mode
- The bond is disqualified from supporting SRIOV VF LAG
- Both interfaces were added simultaneously to the bond (same command)
Then there is a chance that the two interfaces will be assigned different LACP Aggregator ID's. This will cause a failure of the LACP control over the bond.
To fix this, we can detect if the primary interface for the bond (as defined by the driver) is not in switchdev mode, and exit the setup flow if so.
Reproduction steps:
%> ip link add bond0 type bond mode 802.3ad miimon 100 %> ip link set bond0 up
%> ifenslave bond0 eth0 eth1
%> cat /proc/net/bonding/bond0 | grep Agg
Check for Aggregator IDs that differ.
--- drivers/net/ethernet/intel/ice/ice_lag.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/ice/ice_lag.c +6 -0
@@ -1321,12 +1321,18 @@ static void ice_lag_changeupper_event(struct ice_lag *lag, void *ptr)*/ if (!primary_lag) { lag->primary = true; +if (!ice_is_switchdev_running (lag->pf)) +return ; +/* Configure primary's SWID to be shared */ ice_lag_primary_swid (lag, true); primary_lag = lag; }else {u16 swid; +if (!ice_is_switchdev_running (primary_lag->pf)) +return ; + swid = primary_lag->pf->hw.port_info->sw_id;ice_lag_set_swid (swid, lag, true);ice_lag_add_prune_list (primary_lag, lag->pf);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 705/783 idpf: fix null-ptr-deref in idpf_features_check
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavan Kumar Linga <[email protected]>
[ Upstream commit 2dabe349f7882ff1407a784d54d8541909329088 ]
idpf_features_check is used to validate the TX packet. skb header length is compared with the hardware supported value received from the device control plane. The value is stored in the adapter structure and to access it, vport pointer is used. During reset all the vports are released and the vport pointer that the netdev private structure points to is NULL.
To avoid null-ptr-deref, store the max header length value in netdev private structure. This also helps to cache the value and avoid accessing adapter pointer in hot path.
BUG: kernel NULL pointer dereference, address: 0000000000000068 ... RIP: 0010:idpf_features_check+0x6d/0xe0 [idpf] Call Trace: <TASK> ? __die+0x23/0x70 ? page_fault_oops+0x154/0x520 ? exc_page_fault+0x76/0x190 ? asm_exc_page_fault+0x26/0x30 ? idpf_features_check+0x6d/0xe0 [idpf] netif_skb_features+0x88/0x310 validate_xmit_skb+0x2a/0x2b0 validate_xmit_skb_list+0x4c/0x70 sch_direct_xmit+0x19d/0x3a0 __dev_queue_xmit+0xb74/0xe70 ...
--- drivers/net/ethernet/intel/idpf/idpf.h | 2 ++ drivers/net/ethernet/intel/idpf/idpf_lib.c | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/idpf/idpf.h +2 -0
@@ -143,6 +143,7 @@ enum idpf_vport_state {* @vport_id: Vport identifier * @link_speed_mbps: Link speed in mbps * @vport_idx: Relative vport index +* @max_tx_hdr_size: Max header length hardware can support * @state: See enum idpf_vport_state * @netstats: Packet and byte stats * @stats_lock: Lock to protect stats update
@@ -153,6 +154,7 @@ struct idpf_netdev_priv {u32 vport_id;u32 link_speed_mbps;u16 vport_idx; +u16 max_tx_hdr_size;enum idpf_vport_state state;struct rtnl_link_stats64 netstats;spinlock_t stats_lock;
drivers/net/ethernet/intel/idpf/idpf_lib.c +6 -4
@@ -723,6 +723,7 @@ static int idpf_cfg_netdev(struct idpf_vport *vport) np->vport = vport; np->vport_idx = vport->idx; np->vport_id = vport->vport_id; + np->max_tx_hdr_size =idpf_get_max_tx_hdr_size (adapter); vport->netdev = netdev;return idpf_init_mac_addr (vport, netdev);
@@ -740,6 +741,7 @@ static int idpf_cfg_netdev(struct idpf_vport *vport) np->adapter = adapter; np->vport_idx = vport->idx; np->vport_id = vport->vport_id; + np->max_tx_hdr_size =idpf_get_max_tx_hdr_size (adapter);spin_lock_init (&np->stats_lock);
@@ -2202,8 +2204,8 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb, struct net_device *netdev, netdev_features_t features) { -struct idpf_vport *vport =idpf_netdev_to_vport (netdev); -struct idpf_adapter *adapter = vport->adapter; +struct idpf_netdev_priv *np =netdev_priv (netdev); +u16 max_tx_hdr_size = np->max_tx_hdr_size;size_t len;/* No point in doing any of this if neither checksum nor GSO are
@@ -2226,7 +2228,7 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb, goto unsupported; len =skb_network_header_len (skb); -if (unlikely (len >idpf_get_max_tx_hdr_size (adapter))) +if (unlikely (len > max_tx_hdr_size)) goto unsupported;if (!skb->encapsulation)
@@ -2239,7 +2241,7 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb,/* IPLEN can support at most 127 dwords */ len =skb_inner_network_header_len (skb); -if (unlikely (len >idpf_get_max_tx_hdr_size (adapter))) +if (unlikely (len > max_tx_hdr_size)) goto unsupported;/* No need to validate L4LEN as TCP is the only protocol with a
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 706/783 loop: dont require ->write_iter for writable files in loop_configure
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
[ Upstream commit 355341e4359b2d5edf0ed5e117f7e9e7a0a5dac0 ]
Block devices can be opened read-write even if they can't be written to for historic reasons. Remove the check requiring file->f_op->write_iter when the block devices was opened in loop_configure. The call to loop_check_backing_file just below ensures the ->write_iter is present for backing files opened for writing, which is the only check that is actually needed.
--- drivers/block/loop.c | 3 --- 1 file changed, 3 deletions(-)
drivers/block/loop.c +0 -3
@@ -973,9 +973,6 @@ static int loop_configure(struct loop_device *lo, blk_mode_t mode,if (!file)return -EBADF ; -if ((mode &BLK_OPEN_WRITE ) && !file->f_op->write_iter) -return -EINVAL ; - error =loop_check_backing_file (file);if (error)return error;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 707/783 pinctrl: qcom: switch to devm_register_sys_off_handler()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 41e452e6933d14146381ea25cff5e4d1ac2abea1 ]
Error-handling paths in msm_pinctrl_probe() don't call
a function required to unroll restart handler registration, unregister_restart_handler(). Instead of adding calls to this function, switch the msm pinctrl code into using devm_register_sys_off_handler().
--- drivers/pinctrl/qcom/pinctrl-msm.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/pinctrl/qcom/pinctrl-msm.c +12 -11
@@ -44,7 +44,6 @@* @pctrl: pinctrl handle. * @chip: gpiochip handle. * @desc: pin controller descriptor -* @restart_nb: restart notifier block. * @irq: parent irq for the TLMM irq_chip. * @intr_target_use_scm: route irq to application cpu using scm calls * @lock: Spinlock to protect register resources as well
@@ -64,7 +63,6 @@ struct msm_pinctrl {struct pinctrl_dev *pctrl;struct gpio_chip chip;struct pinctrl_desc desc; -struct notifier_block restart_nb;int irq;
@@ -1471,10 +1469,9 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)return 0 ; } -static int msm_ps_hold_restart (struct notifier_block *nb,unsigned long action, -void *data) +static int msm_ps_hold_restart (struct sys_off_data *data) { - struct msm_pinctrl *pctrl = container_of(nb, struct msm_pinctrl, restart_nb); +struct msm_pinctrl *pctrl = data->cb_data;writel (0 , pctrl->regs[0 ] +PS_HOLD_OFFSET );mdelay (1000 );
@@ -1485,7 +1482,11 @@ static struct msm_pinctrl *poweroff_pctrl;static void msm_ps_hold_poweroff (void ) { -msm_ps_hold_restart (&poweroff_pctrl->restart_nb,0 ,NULL ); +struct sys_off_data data = { + .cb_data = poweroff_pctrl, + }; + +msm_ps_hold_restart (&data); }static void msm_pinctrl_setup_pm_reset (struct msm_pinctrl *pctrl)
@@ -1495,9 +1496,11 @@ static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)for (i =0 ; i < pctrl->soc->nfunctions; i++)if (!strcmp (func[i].name,"ps_hold" )) { - pctrl->restart_nb.notifier_call = msm_ps_hold_restart; - pctrl->restart_nb.priority =128 ; -if (register_restart_handler (&pctrl->restart_nb)) +if (devm_register_sys_off_handler (pctrl->dev, +SYS_OFF_MODE_RESTART , +128 , + msm_ps_hold_restart, + pctrl))dev_err (pctrl->dev,"failed to setup restart handler.\n" ); poweroff_pctrl = pctrl;
@@ -1599,8 +1602,6 @@ void msm_pinctrl_remove(struct platform_device *pdev)struct msm_pinctrl *pctrl =platform_get_drvdata (pdev);gpiochip_remove (&pctrl->chip); - -unregister_restart_handler (&pctrl->restart_nb); }EXPORT_SYMBOL (msm_pinctrl_remove);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 708/783 net: dwmac-sun8i: Use parsed internal PHY address instead of 1
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Kocialkowski <[email protected]>
[ Upstream commit 47653e4243f2b0a26372e481ca098936b51ec3a8 ]
While the MDIO address of the internal PHY on Allwinner sun8i chips is generally 1, of_mdio_parse_addr is used to cleanly parse the address from the device-tree instead of hardcoding it.
A commit reworking the code ditched the parsed value and hardcoded the value 1 instead, which didn't really break anything but is more fragile and not future-proof.
Restore the initial behavior using the parsed address returned from the helper.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +1 -1
@@ -964,7 +964,7 @@ static int sun8i_dwmac_set_syscon(struct device *dev,/* of_mdio_parse_addr returns a valid (0 ~ 31) PHY * address. No need to mask it again. */ - reg |=1 <<H3_EPHY_ADDR_SHIFT ; + reg |= ret <<H3_EPHY_ADDR_SHIFT ; }else {/* For SoCs without internal PHY the PHY selection bit should be * set to 0 (external PHY).
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 709/783 net: lan743x: Restore SGMII CTRL register on resume
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thangaraj Samynathan <[email protected]>
[ Upstream commit 293e38ff4e4c2ba53f3fd47d8a4a9f0f0414a7a6 ]
SGMII_CTRL register, which specifies the active interface, was not properly restored when resuming from suspend. This led to incorrect interface selection after resume particularly in scenarios involving the FPGA.
To fix this:
- Move the SGMII_CTRL setup out of the probe function.
- Initialize the register in the hardware initialization helper function, which is called during both device initialization and resume.
This ensures the interface configuration is consistently restored after suspend/resume cycles.
--- drivers/net/ethernet/microchip/lan743x_main.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/net/ethernet/microchip/lan743x_main.c +10 -9
@@ -3495,6 +3495,7 @@ static int lan743x_hardware_init(struct lan743x_adapter *adapter, struct pci_dev *pdev) {struct lan743x_tx *tx; +u32 sgmii_ctl;int index;int ret;
@@ -3507,6 +3508,15 @@ static int lan743x_hardware_init(struct lan743x_adapter *adapter,spin_lock_init (&adapter->eth_syslock_spinlock);mutex_init (&adapter->sgmii_rw_lock);pci11x1x_set_rfe_rd_fifo_threshold (adapter); + sgmii_ctl =lan743x_csr_read (adapter,SGMII_CTL ); +if (adapter->is_sgmii_en) { + sgmii_ctl |=SGMII_CTL_SGMII_ENABLE_ ; + sgmii_ctl &= ~SGMII_CTL_SGMII_POWER_DN_ ; + }else { + sgmii_ctl &= ~SGMII_CTL_SGMII_ENABLE_ ; + sgmii_ctl |=SGMII_CTL_SGMII_POWER_DN_ ; + } +lan743x_csr_write (adapter,SGMII_CTL , sgmii_ctl); }else { adapter->max_tx_channels =LAN743X_MAX_TX_CHANNELS ; adapter->used_tx_channels =LAN743X_USED_TX_CHANNELS ;
@@ -3558,7 +3568,6 @@ static int lan743x_hardware_init(struct lan743x_adapter *adapter,static int lan743x_mdiobus_init (struct lan743x_adapter *adapter) { -u32 sgmii_ctl;int ret; adapter->mdiobus =devm_mdiobus_alloc (&adapter->pdev->dev);
@@ -3570,10 +3579,6 @@ static int lan743x_mdiobus_init(struct lan743x_adapter *adapter) adapter->mdiobus->priv = (void *)adapter;if (adapter->is_pci11x1x) {if (adapter->is_sgmii_en) { - sgmii_ctl =lan743x_csr_read (adapter,SGMII_CTL ); - sgmii_ctl |=SGMII_CTL_SGMII_ENABLE_ ; - sgmii_ctl &= ~SGMII_CTL_SGMII_POWER_DN_ ; -lan743x_csr_write (adapter,SGMII_CTL , sgmii_ctl);netif_dbg (adapter, drv, adapter->netdev,"SGMII operation\n" ); adapter->mdiobus->read = lan743x_mdiobus_read_c22;
@@ -3584,10 +3589,6 @@ static int lan743x_mdiobus_init(struct lan743x_adapter *adapter)netif_dbg (adapter, drv, adapter->netdev,"lan743x-mdiobus-c45\n" ); }else { - sgmii_ctl =lan743x_csr_read (adapter,SGMII_CTL ); - sgmii_ctl &= ~SGMII_CTL_SGMII_ENABLE_ ; - sgmii_ctl |=SGMII_CTL_SGMII_POWER_DN_ ; -lan743x_csr_write (adapter,SGMII_CTL , sgmii_ctl);netif_dbg (adapter, drv, adapter->netdev,"RGMII operation\n" );// Only C22 support when RGMII I/F
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 710/783 xsk: Bring back busy polling support in XDP_COPY
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samiullah Khawaja <[email protected]>
[ Upstream commit b95ed5517354a5f451fb9b3771776ca4c0b65ac3 ]
Commit 5ef44b3cb43b ("xsk: Bring back busy polling support") fixed the busy polling support in xsk for XDP_ZEROCOPY after it was broken in commit 86e25f40aa1e ("net: napi: Add napi_config"). The busy polling support with XDP_COPY remained broken since the napi_id setup in xsk_rcv_check was removed.
Bring back the setup of napi_id for XDP_COPY so socket level SO_BUSYPOLL can be used to poll the underlying napi.
Do the setup of napi_id for XDP_COPY in xsk_bind, as it is done currently for XDP_ZEROCOPY. The setup of napi_id for XDP_COPY in xsk_bind is safe because xsk_rcv_check checks that the rx queue at which the packet arrives is equal to the queue_id that was supplied in bind. This is done for both XDP_COPY and XDP_ZEROCOPY mode.
Tested using AF_XDP support in virtio-net by running the xsk_rr AF_XDP benchmarking tool shared here:
https://lore.kernel.org/all/[email protected]/T/
Enabled socket busy polling using following commands in qemu,
``` sudo ethtool -L eth0 combined 1 echo 400 | sudo tee /proc/sys/net/core/busy_read echo 100 | sudo tee /sys/class/net/eth0/napi_defer_hard_irqs echo 15000 | sudo tee /sys/class/net/eth0/gro_flush_timeout ```
--- net/xdp/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/xdp/xsk.c +1 -1
@@ -1301,7 +1301,7 @@ static int xsk_bind(struct socket *sock, struct sockaddr *addr, int addr_len) xs->queue_id = qid;xp_add_xsk (xs->pool, xs); -if (xs->zc && qid < dev->real_num_rx_queues) { +if (qid < dev->real_num_rx_queues) {struct netdev_rx_queue *rxq; rxq =__netif_get_rx_queue (dev, qid);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 711/783 io_uring: fix overflow resched cqe reordering
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <[email protected]>
[ Upstream commit a7d755ed9ce9738af3db602eb29d32774a180bc7 ]
Leaving the CQ critical section in the middle of a overflow flushing can cause cqe reordering since the cache cq pointers are reset and any new cqe emitters that might get called in between are not going to be forced into io_cqe_cache_refill().
--- io_uring/io_uring.c | 1 + 1 file changed, 1 insertion(+)
io_uring/io_uring.c +1 -0
@@ -632,6 +632,7 @@ static void __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool dying)* to care for a non-real case. */ if (need_resched ()) { + ctx->cqe_sentinel = ctx->cqe_cached;io_cq_unlock_post (ctx);mutex_unlock (&ctx->uring_lock);cond_resched ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 712/783 idpf: fix idpf_vport_splitq_napi_poll()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 407e0efdf8baf1672876d5948b75049860a93e59 ]
idpf_vport_splitq_napi_poll() can incorrectly return @budget after napi_complete_done() has been called.
This violates NAPI rules, because after napi_complete_done(), current thread lost napi ownership.
Move the test against POLL_MODE before the napi_complete_done().
--- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/idpf/idpf_txrx.c +9 -9
@@ -4031,6 +4031,14 @@ static int idpf_vport_splitq_napi_poll(struct napi_struct *napi, int budget)return budget; } +/* Switch to poll mode in the tear-down path after sending disable +* queues virtchnl message, as the interrupts will be disabled after +* that. +*/ +if (unlikely (q_vector->num_txq &&idpf_queue_has (POLL_MODE , + q_vector->tx[0 ]))) +return budget; + work_done =min_t (int, work_done, budget -1 );/* Exit the polling mode, but don't re-enable interrupts if stack might
@@ -4041,15 +4049,7 @@ static int idpf_vport_splitq_napi_poll(struct napi_struct *napi, int budget)else idpf_vport_intr_set_wb_on_itr (q_vector); -/* Switch to poll mode in the tear-down path after sending disable -* queues virtchnl message, as the interrupts will be disabled after -* that -*/ -if (unlikely (q_vector->num_txq &&idpf_queue_has (POLL_MODE , - q_vector->tx[0 ]))) -return budget; -else -return work_done; +return work_done; }/**
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 713/783 sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 3f981138109f63232a5fb7165938d4c945cc1b9d ]
When enqueuing the first packet to an HFSC class, hfsc_enqueue() calls the child qdisc's peek() operation before incrementing sch->q.qlen and sch->qstats.backlog. If the child qdisc uses qdisc_peek_dequeued(), this may trigger an immediate dequeue and potential packet drop. In such cases, qdisc_tree_reduce_backlog() is called, but the HFSC qdisc's qlen and backlog have not yet been updated, leading to inconsistent queue accounting. This can leave an empty HFSC class in the active list, causing further consequences like use-after-free.
This patch fixes the bug by moving the increment of sch->q.qlen and sch->qstats.backlog before the call to the child qdisc's peek() operation. This ensures that queue length and backlog are always accurate when packet drops or dequeues are triggered during the peek.
--- net/sched/sch_hfsc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/sched/sch_hfsc.c +3 -3
@@ -1569,6 +1569,9 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)return err; } + sch->qstats.backlog += len; + sch->q.qlen++; +if (first && !cl->cl_nactive) {if (cl->cl_flags &HFSC_RSC )init_ed (cl, len);
@@ -1584,9 +1587,6 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free) } - sch->qstats.backlog += len; - sch->q.qlen++; -return NET_XMIT_SUCCESS ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 714/783 octeontx2-pf: use xdp_return_frame() to free xdp buffers
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suman Ghosh <[email protected]>
[ Upstream commit 94c80f748873514af27b9fac3f72acafcde3bcd6 ]
xdp_return_frames() will help to free the xdp frames and their associated pages back to page pool.
Stable-dep-of: 184fb40f731b ("octeontx2-pf: Avoid adding dcbnl_ops for LBK and SDP vf")
--- .../marvell/octeontx2/nic/otx2_common.h | 4 +- .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 7 ++- .../marvell/octeontx2/nic/otx2_txrx.c | 53 +++++++++++-------- .../marvell/octeontx2/nic/otx2_txrx.h | 1 + 4 files changed, 38 insertions(+), 27 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +3 -1
@@ -21,6 +21,7 @@#include <linux/time64.h> #include <linux/dim.h> #include <uapi/linux/if_macsec.h> +#include <net/page_pool/helpers.h> #include <mbox.h> #include <npc.h>
@@ -1095,7 +1096,8 @@ int otx2_del_macfilter(struct net_device *netdev, const u8 *mac);int otx2_add_macfilter (struct net_device *netdev,const u8 *mac);int otx2_enable_rxvlan (struct otx2_nic *pf,bool enable);int otx2_install_rxvlan_offload_flow (struct otx2_nic *pfvf); -bool otx2_xdp_sq_append_pkt (struct otx2_nic *pfvf,u64 iova,int len,u16 qidx); +bool otx2_xdp_sq_append_pkt (struct otx2_nic *pfvf,struct xdp_frame *xdpf, +u64 iova,int len,u16 qidx,u16 flags);u16 otx2_get_max_mtu (struct otx2_nic *pfvf);int otx2_handle_ntuple_tc_features (struct net_device *netdev,netdev_features_t features);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +3 -4
@@ -2691,7 +2691,6 @@ static int otx2_get_vf_config(struct net_device *netdev, int vf,static int otx2_xdp_xmit_tx (struct otx2_nic *pf,struct xdp_frame *xdpf,int qidx) { -struct page *page;u64 dma_addr;int err =0 ;
@@ -2701,11 +2700,11 @@ static int otx2_xdp_xmit_tx(struct otx2_nic *pf, struct xdp_frame *xdpf,if (dma_mapping_error (pf->dev, dma_addr))return -ENOMEM ; - err =otx2_xdp_sq_append_pkt (pf, dma_addr, xdpf->len, qidx); + err =otx2_xdp_sq_append_pkt (pf, xdpf, dma_addr, xdpf->len, + qidx,XDP_REDIRECT );if (!err) {otx2_dma_unmap_page (pf, dma_addr, xdpf->len,DMA_TO_DEVICE ); - page =virt_to_page (xdpf->data); -put_page (page); +xdp_return_frame (xdpf);return -ENOMEM ; }return 0 ;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +31 -22
116 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h +1 -0
@@ -76,6 +76,7 @@ struct otx2_rcv_queue {struct sg_list {u16 num_segs; +u16 flags;u64 skb;u64 size[OTX2_MAX_FRAGS_IN_SQE ];u64 dma_addr[OTX2_MAX_FRAGS_IN_SQE ];
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 715/783 octeontx2-pf: Add AF_XDP non-zero copy support
In reply to Greg Kroah-Hartman6.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suman Ghosh <[email protected]>
[ Upstream commit b4164de5041b51cda3438e75bce668e2556057c3 ]
Set xdp rx ring memory type as MEM_TYPE_PAGE_POOL for af-xdp to work. This is needed since xdp_return_frame internally will use page pools.
Stable-dep-of: 184fb40f731b ("octeontx2-pf: Avoid adding dcbnl_ops for LBK and SDP vf")
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +7 -1
@@ -1047,6 +1047,7 @@ static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx)int err, pool_id, non_xdp_queues;struct nix_aq_enq_req *aq;struct otx2_cq_queue *cq; +struct otx2_pool *pool; cq = &qset->cq[qidx]; cq->cq_idx = qidx;
@@ -1055,8 +1056,13 @@ static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx) cq->cq_type =CQ_RX ; cq->cint_idx = qidx; cq->cqe_cnt = qset->rqe_cnt; -if (pfvf->xdp_prog) +if (pfvf->xdp_prog) { + pool = &qset->pool[qidx];xdp_rxq_info_reg (&cq->xdp_rxq, pfvf->netdev, qidx,0 ); +xdp_rxq_info_reg_mem_model (&cq->xdp_rxq, +MEM_TYPE_PAGE_POOL , + pool->page_pool); + } }else if (qidx < non_xdp_queues) { cq->cq_type =CQ_TX ; cq->cint_idx = qidx - pfvf->hw.rx_queues;
Signature · 1 line
2.39.5