aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-06-04media: av7110: coding style fixes: comparsationsStefan Herdler3-10/+10
This patch fixes the following checkpatch warnings: WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written ... Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: coding style fixes: assignmentsStefan Herdler5-17/+43
This patch fixes the following checkpatch errors: ERROR:ASSIGN_IN_IF: do not use assignment in if condition CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: coding style fixes: bracesStefan Herdler6-33/+36
This patch fixes the following checkpatch warnings and errors: WARNING:BRACES: braces {} are not necessary for any arm of this statement WARNING:BRACES: braces {} are not necessary for single statement blocks CHECK:BRACES: braces {} should be used on all arms of this statement CHECK:BRACES: Unbalanced braces around else statement Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: coding style fixes: commentsStefan Herdler7-25/+39
This patch fixes the following checkpatch warnings: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1 WARNING:EMBEDDED_FILENAME: It's generally not useful to have the filename in the file Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: coding style fixes: whitespace (strict)Stefan Herdler11-114/+114
This patch fixes the following checkpatch warnings: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis CHECK:SPACING: No space is necessary after a cast CHECK:SPACING: space preferred before that '|' (ctx:VxE) CHECK:SPACING: spaces preferred around that '&' (ctx:VxV) CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) CHECK:SPACING: spaces preferred around that '+' (ctx:VxV) CHECK:SPACING: spaces preferred around that '-' (ctx:VxV) CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) CHECK:SPACING: spaces preferred around that '>>' (ctx:VxV) CHECK:SPACING: spaces preferred around that '|' (ctx:VxV) Additional whitespace fixes found by "checkpatch.pl --strict". Whitespace changes only. "git diff -w" shows no changes. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: coding style fixes: newlineStefan Herdler7-52/+54
This patch fixes the following checkpatch warnings: ERROR:ELSE_AFTER_BRACE: else should follow close brace '}' ERROR:OPEN_BRACE: open brace '{' following enum go on the same line ERROR:OPEN_BRACE: open brace '{' following struct go on the same line ERROR:OPEN_BRACE: that open brace { should be on the previous line ERROR:TRAILING_STATEMENTS: trailing statements should be on next line CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line Newline and whitespace changes only. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: coding style fixes: whitespaceStefan Herdler9-104/+104
This patch fixes the following checkpatch warnings: ERROR:SPACING: need consistent spacing around '&' (ctx:WxO) ERROR:SPACING: need consistent spacing around '&' (ctx:WxV) ERROR:SPACING: need consistent spacing around '-' (ctx:WxV) ERROR:SPACING: space prohibited after that '~' (ctx:OxW) ERROR:SPACING: space prohibited after that open parenthesis '(' ERROR:SPACING: space prohibited before that close parenthesis ')' ERROR:SPACING: space prohibited before that ':' (ctx:WxE) ERROR:SPACING: space prohibited before that ',' (ctx:WxW) ERROR:SPACING: space required after that ',' (ctx:VxV) ERROR:SPACING: space required before that '-' (ctx:OxV) ERROR:SPACING: space required before that '~' (ctx:OxV) ERROR:SPACING: space required before the open brace '{' ERROR:SPACING: space required before the open parenthesis '(' ERROR:SPACING: spaces required around that '&&' (ctx:ExV) ERROR:SPACING: spaces required around that '!=' (ctx:VxO) ERROR:SPACING: spaces required around that '&=' (ctx:VxO) ERROR:SPACING: spaces required around that '==' (ctx:VxO) ERROR:SPACING: spaces required around that '!=' (ctx:VxV) ERROR:SPACING: spaces required around that '+=' (ctx:VxV) ERROR:SPACING: spaces required around that '-=' (ctx:VxV) ERROR:SPACING: spaces required around that '<' (ctx:VxV) ERROR:SPACING: spaces required around that '<=' (ctx:VxV) ERROR:SPACING: spaces required around that '=' (ctx:VxV) ERROR:SPACING: spaces required around that '>' (ctx:VxV) ERROR:SPACING: spaces required around that '>=' (ctx:VxV) ERROR:SPACING: spaces required around that '|=' (ctx:VxV) WARNING:LEADING_SPACE: please, no spaces at the start of a line WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline WARNING:SPACING: space prohibited before semicolon WARNING:SPACING: space prohibited between function name and open parenthesis '(' WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (16, 23) WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (16, 32) WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (32, 39) WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (39, 47) WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (47, 55) WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 18) WARNING:TABSTOP: Statements should start on a tabstop CHECK:SPACING: No space is necessary after a cast CHECK:SPACING: space preferred before that '|' (ctx:VxE) CHECK:SPACING: spaces preferred around that '&' (ctx:VxV) CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) CHECK:SPACING: spaces preferred around that '+' (ctx:VxV) CHECK:SPACING: spaces preferred around that '-' (ctx:VxV) CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) CHECK:SPACING: spaces preferred around that '>>' (ctx:VxV) CHECK:SPACING: spaces preferred around that '|' (ctx:VxV) Whitespace changes only. "git diff -w" shows no changes. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: coding style fixes: blank linesStefan Herdler10-114/+33
This patch fixes the following checkpatch warnings: CHECK:LINE_SPACING: Please don't use multiple blank lines CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations CHECK:BRACES: Blank lines aren't necessary after an open brace '{' CHECK:BRACES: Blank lines aren't necessary before a close brace '}' WARNING:LINE_SPACING: Missing a blank line after declarations Added or removed blank lines only. "git diff --ignore-blank-lines" shows no changes. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: coding style fixes: pointer_locationStefan Herdler5-58/+58
This patch fixes the following checkpatch warnings: ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar" ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar" ERROR:POINTER_LOCATION: "(foo*)" should be "(foo *)" Whitespace changes only. "git diff -w" shows no changes. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: sp8870: coding style fixes: loggingStefan Herdler2-21/+27
This patch fixes the following checkpatch warnings: WARNING:PREFER_PR_LEVEL: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... WARNING:PRINTK_WITHOUT_KERN_LEVEL: printk() should include KERN_<LEVEL> facility level WARNING:TRACING_LOGGING: Unnecessary ftrace-like logging - prefer using ftrace ERROR:TRAILING_STATEMENTS: trailing statements should be on next line Convert logging to the recommend pr_* macros. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: sp8870: coding style fixes: miscellaneousStefan Herdler2-13/+14
This patch fixes the following checkpatch: ERROR:ASSIGN_IN_IF: do not use assignment in if condition WARNING:BRACES: braces {} are not necessary for any arm of this statement WARNING:CONST_STRUCT: struct dvb_frontend_ops should normally be const WARNING:EXPORT_SYMBOL: EXPORT_SYMBOL(foo); should immediately follow its function/variable CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*state)...) over kzalloc(sizeof(struct sp8870_state)...) CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written ... CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: sp8870: coding style fixes: newline, comments and bracesStefan Herdler2-29/+34
This patch fixes the following checkpatch warnings: ERROR:OPEN_BRACE: open brace '{' following struct go on the same line ERROR:TRAILING_STATEMENTS: trailing statements should be on next line [*] WARNING:LINE_SPACING: Missing a blank line after declarations WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines CHECK:BRACES: Blank lines aren't necessary after an open brace '{' CHECK:LINE_SPACING: Please don't use multiple blank lines CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations Except the 2 comment-blocks, newline changes only. [* The remaining trailing statement will be fixed in the logging patch.] Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: sp8870: coding style fixes: whitespaceStefan Herdler2-43/+43
This patch fixes the following checkpatch warnings: ERROR:BRACKET_SPACE: space prohibited before open square bracket '[' ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar" ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar" ERROR:SPACING: space prohibited before that ',' (ctx:WxW) ERROR:SPACING: space required before the open brace '{' WARNING:SPACING: space prohibited between function name and open parenthesis '(' CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis Whitespace changes only. "git diff -w" shows no changes. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: remove budget-patch driverStefan Herdler3-689/+0
This patch removes the budget-patch stand alone driver only. This patch does *not* remove the budget-patch support from the av7110 (= dvb-ttpci) driver. This patch does also *not* remove the support for the full-ts mod. The budget-patch is an obsolete, experimental hardware modification, which aimed to receive the whole transport stream of a transponder by bypassing the av7110. This modification never worked reliably enough to be used in a productive environment. "almost no packet loss" [budget-patch.c #522] is still a packet loss. The successor of the budget-patch is the full-ts mod, which is reliable. The full-ts mod circuit is found on the never rev. 2.2 and 2.3 DVB-S cards ex factory. The full-ts mod support is (only) in the av7110 (= dvb-ttpci) driver. The budget-patch driver is a stand alone driver, which turns the card into a budget card. It doesn't appear to be ever intended for the average user. "Card is required to have loaded firmware to tune properly. Firmware can be loaded by insertion and removal of standard av7110 driver prior to loading this driver." [Kconfig] There is support for the budget-patch in the av7110 (= dvb-ttpci) driver too, which isn't affected by this patch. The budget-patch is obsolete and replaced by the full-ts mod quiet a while now. Remove the budget-patch driver left over from development. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: av7110: remove old documentation filesStefan Herdler50-3303/+0
The documentation has been update and is now at: linux/Documentation/userspace-api/media/dvb/legacy_dvb_osd.rst linux/Documentation/userspace-api/media/dvb/legacy_dvb_audio.rst linux/Documentation/userspace-api/media/dvb/legacy_dvb_video.rst The .rst files of the old documentation aren't necessary any more, remove them. Signed-off-by: Stefan Herdler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04HID: logitech-hidpp: add missing MODULE_DESCRIPTION() macroJeff Johnson1-0/+1
make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-logitech-hidpp.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2024-06-04HID: intel-ish-hid: fix endian-conversionArnd Bergmann2-45/+57
The newly added file causes a ton of sparse warnings about the incorrect use of __le32 and similar types: drivers/hid/intel-ish-hid/ishtp/loader.h:41:23: error: invalid bitfield specifier for type restricted __le32. drivers/hid/intel-ish-hid/ishtp/loader.h:42:27: error: invalid bitfield specifier for type restricted __le32. drivers/hid/intel-ish-hid/ishtp/loader.h:43:24: error: invalid bitfield specifier for type restricted __le32. drivers/hid/intel-ish-hid/ishtp/loader.h:44:24: error: invalid bitfield specifier for type restricted __le32. drivers/hid/intel-ish-hid/ishtp/loader.h:45:22: error: invalid bitfield specifier for type restricted __le32. drivers/hid/intel-ish-hid/ishtp/loader.c:172:33: warning: restricted __le32 degrades to integer drivers/hid/intel-ish-hid/ishtp/loader.c:178:50: warning: incorrect type in assignment (different base types) drivers/hid/intel-ish-hid/ishtp/loader.c:178:50: expected restricted __le32 [usertype] length drivers/hid/intel-ish-hid/ishtp/loader.c:178:50: got unsigned long drivers/hid/intel-ish-hid/ishtp/loader.c:179:50: warning: incorrect type in assignment (different base types) drivers/hid/intel-ish-hid/ishtp/loader.c:179:50: expected restricted __le32 [usertype] fw_off drivers/hid/intel-ish-hid/ishtp/loader.c:179:50: got unsigned int [usertype] offset drivers/hid/intel-ish-hid/ishtp/loader.c:180:17: warning: cast from restricted __le32 drivers/hid/intel-ish-hid/ishtp/loader.c:183:24: warning: invalid assignment: += drivers/hid/intel-ish-hid/ishtp/loader.c:183:24: left side has type unsigned int drivers/hid/intel-ish-hid/ishtp/loader.c:183:24: right side has type restricted __le32 Add the necessary conversions and use temporary variables where appropriate to avoid converting back. Fixes: 579a267e4617 ("HID: intel-ish-hid: Implement loading firmware from host feature") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Zhang Lixu <[email protected]> Tested-by: Zhang Lixu <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2024-06-04HID: nintendo: Fix an error handling path in nintendo_hid_probe()Christophe JAILLET1-2/+4
joycon_leds_create() has a ida_alloc() call. So if an error occurs after it, a corresponding ida_free() call is needed, as already done in the .remove function. This is not 100% perfect, because if ida_alloc() fails, then 'ctlr->player_id' will forced to be U32_MAX, and an error will be logged when ida_free() is called. Considering that this can't happen in real life, no special handling is done to handle it. Fixes: 5307de63d71d ("HID: nintendo: use ida for LED player id") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Silvan Jegen <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2024-06-04HID: logitech-dj: Fix memory leak in logi_dj_recv_switch_to_dj_mode()José Expósito1-1/+3
Fix a memory leak on logi_dj_recv_send_report() error path. Fixes: 6f20d3261265 ("HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()") Signed-off-by: José Expósito <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2024-06-04KVM: arm64: Ensure that SME controls are disabled in protected modeFuad Tabba2-0/+18
KVM (and pKVM) do not support SME guests. Therefore KVM ensures that the host's SME state is flushed and that SME controls for enabling access to ZA storage and for streaming are disabled. pKVM needs to protect against a buggy/malicious host. Ensure that it wouldn't run a guest when protected mode is enabled should any of the SME controls be enabled. Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04KVM: arm64: Refactor CPACR trap bit setting/clearing to use ELx formatFuad Tabba6-19/+14
When setting/clearing CPACR bits for EL0 and EL1, use the ELx format of the bits, which covers both. This makes the code clearer, and reduces the chances of accidentally missing a bit. No functional change intended. Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04KVM: arm64: Consolidate initializing the host data's fpsimd_state/sve in pKVMFuad Tabba5-21/+22
Now that we have introduced finalize_init_hyp_mode(), lets consolidate the initializing of the host_data fpsimd_state and sve state. Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04KVM: arm64: Eagerly restore host fpsimd/sve state in pKVMFuad Tabba4-5/+93
When running in protected mode we don't want to leak protected guest state to the host, including whether a guest has used fpsimd/sve. Therefore, eagerly restore the host state on guest exit when running in protected mode, which happens only if the guest has used fpsimd/sve. Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04KVM: arm64: Allocate memory mapped at hyp for host sve state in pKVMFuad Tabba7-0/+124
Protected mode needs to maintain (save/restore) the host's sve state, rather than relying on the host kernel to do that. This is to avoid leaking information to the host about guests and the type of operations they are performing. As a first step towards that, allocate memory mapped at hyp, per cpu, for the host sve state. The following patch will use this memory to save/restore the host state. Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04KVM: arm64: Specialize handling of host fpsimd state on trapFuad Tabba3-1/+13
In subsequent patches, n/vhe will diverge on saving the host fpsimd/sve state when taking a guest fpsimd/sve trap. Add a specialized helper to handle it. No functional change intended. Reviewed-by: Mark Brown <[email protected]> Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04KVM: arm64: Abstract set/clear of CPTR_EL2 bits behind helperFuad Tabba4-19/+73
The same traps controlled by CPTR_EL2 or CPACR_EL1 need to be toggled in different parts of the code, but the exact bits and their polarity differ between these two formats and the mode (vhe/nvhe/hvhe). To reduce the amount of duplicated code and the chance of getting the wrong bit/polarity or missing a field, abstract the set/clear of CPTR_EL2 bits behind a helper. Since (h)VHE is the way of the future, use the CPACR_EL1 format, which is a subset of the VHE CPTR_EL2, as a reference. No functional change intended. Suggested-by: Oliver Upton <[email protected]> Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04KVM: arm64: Fix prototype for __sve_save_state/__sve_restore_stateFuad Tabba2-3/+4
Since the prototypes for __sve_save_state/__sve_restore_state at hyp were added, the underlying macro has acquired a third parameter for saving/restoring ffr. Fix the prototypes to account for the third parameter, and restore the ffr for the guest since it is saved. Suggested-by: Mark Brown <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04KVM: arm64: Reintroduce __sve_save_stateFuad Tabba2-0/+7
Now that the hypervisor is handling the host sve state in protected mode, it needs to be able to save it. This reverts commit e66425fc9ba3 ("KVM: arm64: Remove unused __sve_save_state"). Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
2024-06-04io_uring: fix possible deadlock in io_register_iowq_max_workers()Hagar Hemdan1-0/+4
The io_register_iowq_max_workers() function calls io_put_sq_data(), which acquires the sqd->lock without releasing the uring_lock. Similar to the commit 009ad9f0c6ee ("io_uring: drop ctx->uring_lock before acquiring sqd->lock"), this can lead to a potential deadlock situation. To resolve this issue, the uring_lock is released before calling io_put_sq_data(), and then it is re-acquired after the function call. This change ensures that the locks are acquired in the correct order, preventing the possibility of a deadlock. Suggested-by: Maximilian Heyne <[email protected]> Signed-off-by: Hagar Hemdan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
2024-06-04io_uring/io-wq: avoid garbage value of 'match' in io_wq_enqueue()Su Hui1-5/+5
Clang static checker (scan-build) warning: o_uring/io-wq.c:line 1051, column 3 The expression is an uninitialized value. The computed value will also be garbage. 'match.nr_pending' is used in io_acct_cancel_pending_work(), but it is not fully initialized. Change the order of assignment for 'match' to fix this problem. Fixes: 42abc95f05bf ("io-wq: decouple work_list protection from the big wqe->lock") Signed-off-by: Su Hui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
2024-06-04io_uring/napi: fix timeout calculationJens Axboe1-11/+13
Not quite sure what __io_napi_adjust_timeout() was attemping to do, it's adjusting both the NAPI timeout and the general overall timeout, and calculating a value that is never used. The overall timeout is a super set of the NAPI timeout, and doesn't need adjusting. The only thing we really need to care about is that the NAPI timeout doesn't exceed the overall timeout. If a user asked for a timeout of eg 5 usec and NAPI timeout is 10 usec, then we should not spin for 10 usec. While in there, sanitize the time checking a bit. If we have a negative value in the passed in timeout, discard it. Round up the value as well, so we don't end up with a NAPI timeout for the majority of the wait, with only a tiny sleep value at the end. Hence the only case we need to care about is if the NAPI timeout is larger than the overall timeout. If it is, cap the NAPI timeout at what the overall timeout is. Cc: [email protected] Fixes: 8d0c12a80cde ("io-uring: add napi busy poll support") Reported-by: Lewis Baker <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2024-06-04iommu/amd: Fix Invalid wait context issueVasant Hegde2-42/+28
With commit c4cb23111103 ("iommu/amd: Add support for enable/disable IOPF") we are hitting below issue. This happens because in IOPF enablement path it holds spin lock with irq disable and then tries to take mutex lock. dmesg: ----- [ 0.938739] ============================= [ 0.938740] [ BUG: Invalid wait context ] [ 0.938742] 6.10.0-rc1+ #1 Not tainted [ 0.938745] ----------------------------- [ 0.938746] swapper/0/1 is trying to lock: [ 0.938748] ffffffff8c9f01d8 (&port_lock_key){....}-{3:3}, at: serial8250_console_write+0x78/0x4a0 [ 0.938767] other info that might help us debug this: [ 0.938768] context-{5:5} [ 0.938769] 7 locks held by swapper/0/1: [ 0.938772] #0: ffff888101a91310 (&group->mutex){+.+.}-{4:4}, at: bus_iommu_probe+0x70/0x160 [ 0.938790] #1: ffff888101d1f1b8 (&domain->lock){....}-{3:3}, at: amd_iommu_attach_device+0xa5/0x700 [ 0.938799] #2: ffff888101cc3d18 (&dev_data->lock){....}-{3:3}, at: amd_iommu_attach_device+0xc5/0x700 [ 0.938806] #3: ffff888100052830 (&iommu->lock){....}-{2:2}, at: amd_iommu_iopf_add_device+0x3f/0xa0 [ 0.938813] #4: ffffffff8945a340 (console_lock){+.+.}-{0:0}, at: _printk+0x48/0x50 [ 0.938822] #5: ffffffff8945a390 (console_srcu){....}-{0:0}, at: console_flush_all+0x58/0x4e0 [ 0.938867] #6: ffffffff82459f80 (console_owner){....}-{0:0}, at: console_flush_all+0x1f0/0x4e0 [ 0.938872] stack backtrace: [ 0.938874] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.10.0-rc1+ #1 [ 0.938877] Hardware name: HP HP EliteBook 745 G3/807E, BIOS N73 Ver. 01.39 04/16/2019 Fix above issue by re-arranging code in attach device path: - move device PASID/IOPF enablement outside lock in AMD IOMMU driver. This is safe as core layer holds group->mutex lock before calling iommu_ops->attach_dev. Reported-by: Borislav Petkov <[email protected]> Reported-by: Mikhail Gavrilov <[email protected]> Reported-by: Chris Bainbridge <[email protected]> Fixes: c4cb23111103 ("iommu/amd: Add support for enable/disable IOPF") Tested-by: Borislav Petkov <[email protected]> Tested-by: Chris Bainbridge <[email protected]> Tested-by: Mikhail Gavrilov <[email protected]> Signed-off-by: Vasant Hegde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
2024-06-04iommu/amd: Check EFR[EPHSup] bit before enabling PPRVasant Hegde1-1/+2
Check for EFR[EPHSup] bit before enabling PPR. This bit must be set to enable PPR. Reported-by: Borislav Petkov <[email protected]> Fixes: c4cb23111103 ("iommu/amd: Add support for enable/disable IOPF") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218900 Tested-by: Borislav Petkov <[email protected]> Tested-by: Jean-Christophe Guillain <[email protected]> Signed-off-by: Vasant Hegde <[email protected]> Reviewed-by: Suravee Suthikulpanit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
2024-06-04iommu/amd: Fix workqueue nameVasant Hegde1-2/+1
Workqueue name length is crossing WQ_NAME_LEN limit. Fix it by changing name format. New format : "iopf_queue/amdvi-<iommu-devid>" kernel warning: [ 11.146912] workqueue: name exceeds WQ_NAME_LEN. Truncating to: iopf_queue/amdiommu-0xc002-iopf Reported-by: Borislav Petkov <[email protected]> Fixes: 61928bab9d26 ("iommu/amd: Define per-IOMMU iopf_queue") Signed-off-by: Vasant Hegde <[email protected]> Acked-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
2024-06-04iommu: Return right value in iommu_sva_bind_device()Lu Baolu1-1/+1
iommu_sva_bind_device() should return either a sva bond handle or an ERR_PTR value in error cases. Existing drivers (idxd and uacce) only check the return value with IS_ERR(). This could potentially lead to a kernel NULL pointer dereference issue if the function returns NULL instead of an error pointer. In reality, this doesn't cause any problems because iommu_sva_bind_device() only returns NULL when the kernel is not configured with CONFIG_IOMMU_SVA. In this case, iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA) will return an error, and the device drivers won't call iommu_sva_bind_device() at all. Fixes: 26b25a2b98e4 ("iommu: Bind process address spaces to devices") Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jean-Philippe Brucker <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Vasant Hegde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
2024-06-04iommu/dma: Fix domain initRobin Murphy1-4/+4
Despite carefully rewording the kerneldoc to describe the new direct interaction with dma_range_map, it seems I managed to confuse myself in removing the redundant force_aperture check and ended up making the code not do that at all. This led to dma_range_maps inadvertently being able to set iovad->start_pfn = 0, and all the nonsensical chaos which ensues from there. Restore the correct behaviour of constraining base_pfn to the domain aperture regardless of dma_range_map, and not trying to apply dma_range_map constraints to the basic IOVA domain since they will be properly handled with reserved regions later. Reported-by: Jon Hunter <[email protected]> Reported-by: Jerry Snitselaar <[email protected]> Fixes: ad4750b07d34 ("iommu/dma: Make limit checks self-contained") Signed-off-by: Robin Murphy <[email protected]> Tested-by: Jerry Snitselaar <[email protected]> Reviewed-by: Jerry Snitselaar <[email protected]> Link: https://lore.kernel.org/r/721fa6baebb0924aa40db0b8fb86bcb4538434af.1716232484.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
2024-06-04iommu/amd: Fix sysfs leak in iommu initKun(llfl)1-0/+9
During the iommu initialization, iommu_init_pci() adds sysfs nodes. However, these nodes aren't remove in free_iommu_resources() subsequently. Fixes: 39ab9555c241 ("iommu: Add sysfs bindings for struct iommu_device") Signed-off-by: Kun(llfl) <[email protected]> Reviewed-by: Suravee Suthikulpanit <[email protected]> Link: https://lore.kernel.org/r/c8e0d11c6ab1ee48299c288009cf9c5dae07b42d.1715215003.git.llfl@linux.alibaba.com Signed-off-by: Joerg Roedel <[email protected]>
2024-06-04net: tls: fix marking packets as decryptedJakub Kicinski1-0/+3
For TLS offload we mark packets with skb->decrypted to make sure they don't escape the host without getting encrypted first. The crypto state lives in the socket, so it may get detached by a call to skb_orphan(). As a safety check - the egress path drops all packets with skb->decrypted and no "crypto-safe" socket. The skb marking was added to sendpage only (and not sendmsg), because tls_device injected data into the TCP stack using sendpage. This special case was missed when sendpage got folded into sendmsg. Fixes: c5c37af6ecad ("tcp: Convert do_tcp_sendpages() to use MSG_SPLICE_PAGES") Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2024-06-04EDAC/igen6: Convert PCIBIOS_* return codes to errnosIlpo Järvinen1-2/+2
errcmd_enable_error_reporting() uses pci_{read,write}_config_word() that return PCIBIOS_* codes. The return code is then returned all the way into the probe function igen6_probe() that returns it as is. The probe functions, however, should return normal errnos. Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it from errcmd_enable_error_reporting(). Fixes: 10590a9d4f23 ("EDAC/igen6: Add EDAC driver for Intel client SoCs using IBECC") Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Qiuxu Zhuo <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
2024-06-04EDAC/amd64: Convert PCIBIOS_* return codes to errnosIlpo Järvinen1-3/+5
gpu_get_node_map() uses pci_read_config_dword() that returns PCIBIOS_* codes. The return code is then returned all the way into the module init function amd64_edac_init() that returns it as is. The module init functions, however, should return normal errnos. Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it from gpu_get_node_map(). For consistency, convert also the other similar cases which return PCIBIOS_* codes even if they do not have any bugs at the moment. Fixes: 4251566ebc1c ("EDAC/amd64: Cache and use GPU node map") Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
2024-06-04HID: core: remove unnecessary WARN_ON() in implement()Nikita Zhandarovich1-1/+0
Syzkaller hit a warning [1] in a call to implement() when trying to write a value into a field of smaller size in an output report. Since implement() already has a warn message printed out with the help of hid_warn() and value in question gets trimmed with: ... value &= m; ... WARN_ON may be considered superfluous. Remove it to suppress future syzkaller triggers. [1] WARNING: CPU: 0 PID: 5084 at drivers/hid/hid-core.c:1451 implement drivers/hid/hid-core.c:1451 [inline] WARNING: CPU: 0 PID: 5084 at drivers/hid/hid-core.c:1451 hid_output_report+0x548/0x760 drivers/hid/hid-core.c:1863 Modules linked in: CPU: 0 PID: 5084 Comm: syz-executor424 Not tainted 6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 RIP: 0010:implement drivers/hid/hid-core.c:1451 [inline] RIP: 0010:hid_output_report+0x548/0x760 drivers/hid/hid-core.c:1863 ... Call Trace: <TASK> __usbhid_submit_report drivers/hid/usbhid/hid-core.c:591 [inline] usbhid_submit_report+0x43d/0x9e0 drivers/hid/usbhid/hid-core.c:636 hiddev_ioctl+0x138b/0x1f00 drivers/hid/usbhid/hiddev.c:726 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f ... Fixes: 95d1c8951e5b ("HID: simplify implement() a bit") Reported-by: <[email protected]> Suggested-by: Alan Stern <[email protected]> Signed-off-by: Nikita Zhandarovich <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2024-06-04media: ov5693: Drop privacy-LED GPIO controlHans de Goede1-10/+0
Drop privacy-LED GPIO control, after the privacy-LED GPIO control was added to the ov5693 driver it was decided to model privacy-LEDs as LED class devices and have them be controlled by the v4l2-core. So this is dead code since on devices with privacy LEDs the led is not a GPIO on the ov5693 fwnode, but rather is a LED class devices controlled by the v4l2-core. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04drivers: media: max96717: stop the csi receiver before the sourceJulien Massot1-12/+11
Stopping the CSI source before stopping the serializer CSI port may make the serializer not respond. Then all the next writes to the device will fail. max96717 1-0040: Error writing reg 0x0308: -121 max96717 1-0040: Error writing reg 0x0006: -121 Fix that by stopping the CSI receiver first and then CSI source. Seen on max96717f revision 4. Signed-off-by: Julien Massot <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: i2c: add MAX96714 driverJulien Massot4-0/+1049
This driver handles the MAX96714 deserializer in tunnel mode. The CSI output will replicate all the CSI traffic forwarded by the remote serializer. The MAX96714 driver can handle MAX96714 and MAX96714F variants with the same "maxim,max96714f" compatible. Signed-off-by: Julien Massot <[email protected]> [Sakari Ailus: Adapt to changed i2c_mux_add_adapter arguments.] Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: i2c: add MAX96717 driverJulien Massot4-0/+953
This driver handles the MAX96717 serializer in tunnel mode. All incoming CSI traffic will be tunneled through the GMSL2 link. The MAX96717 driver can handle MAX96717 and MAX96717F variants with the same "maxim,max96717f" compatible. Signed-off-by: Julien Massot <[email protected]> [Sakari Ailus: Adapt to changed i2c_mux_add_adapter arguments.] Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04dt-bindings: media: add Maxim MAX96714 GMSL2 DeserializerJulien Massot1-0/+174
Add DT bindings for Maxim MAX96714 GMSL2 Deserializer. Reviewed-by: Conor Dooley <[email protected]> Signed-off-by: Julien Massot <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04dt-bindings: media: add Maxim MAX96717 GMSL2 SerializerJulien Massot1-0/+157
Add DT bindings for Maxim MAX96717 GMSL2 Serializer. Reviewed-by: Conor Dooley <[email protected]> Signed-off-by: Julien Massot <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: rkisp1: Mark subdev state pointers as constLaurent Pinchart2-8/+8
Several subdev state pointers are used to access the state read-only. Mark them as const. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Reviewed-by: Nicolas Dufresne <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: v4l2-subdev: Provide const-aware subdev state accessorsLaurent Pinchart1-18/+36
It would be useful to mark instances of v4l2_subdev_state structures as const when code needs to access them read-only. This isn't currently possible, as the v4l2_subdev_state_get_*() accessor functions take a non-const pointer to the state. Use _Generic() to provide two different versions of the accessors, for const and non-const states respectively. The former returns a const pointer to the requested format, rectangle or interval, implementing const-correctness. The latter returns a non-const pointer, preserving the current behaviour for drivers. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> [Sakari Ailus: Drop the word "below" from the text.] Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-04media: v4l2-subdev: Fix v4l2_subdev_state_get_format() documentationLaurent Pinchart1-3/+3
The documentation of the v4l2_subdev_state_get_format() macro incorrectly references __v4l2_subdev_state_get_format() instead of __v4l2_subdev_state_gen_call(). Fix it, and also update the list of similar macros to add the missing v4l2_subdev_state_get_interval(). Suggested-by: Sakari Ailus <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>