summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
3 daysscsi: device_handlers: hp_sw: Use combined sense codesDamien Le Moal
Refactor the HP sw device handler driver to use the 16-bit sense_code field of struct scsi_sense_hdr and struct scsi_failure and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-14-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: st: Use combined sense codesDamien Le Moal
Refactor the SCSI tape driver to use the 16-bit sense_code field of struct scsi_sense_hdr and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-13-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: ch: Use combined sense codesDamien Le Moal
Refactor the SCSI media changer driver to use the 16-bit sense_code field of struct scsi_sense_hdr and struct scsi_failure and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-12-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: ses: Use combined sense codesDamien Le Moal
Refactor the SCSI stroage enclosure driver to use the 16-bit sense_code field of struct scsi_failure and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-11-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: sr: Use combined sense codesDamien Le Moal
Refactor the SCSI CDROM driver to use the 16-bit sense_code field of struct scsi_sense_hdr and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-10-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: sd: Use combined sense codesDamien Le Moal
Refactor the SCSI disk driver to use as much as possible the 16-bit sense_code field of struct scsi_sense_hdr and struct scsi_failure and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-9-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: core: Use combined sense codesDamien Le Moal
Refactor the SCSI core code to use the 16-bit sense_code field of struct scsi_sense_hdr and struct scsi_failure and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended, with the exception of a correction of the array any_sense_failure_defs in scsi_lib_test_any_sense() which erroenously sets result to SCMD_FAILURE_RESULT_ANY instead of SAM_STAT_CHECK_CONDITION and does not sets sense_key to SCMD_FAILURE_SENSE_KEY_ANY. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-8-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: core: Use struct scsi_sense_hdr to log sense keys and codesDamien Le Moal
Instead of passing the sense key, additional sense code and additional sense code qualifier as separate parameters, change the functions scsi_extd_sense_format(), scsi_format_extd_sense(), and usb_stor_show_sense() to take a pointer to a struct scsi_sense_hdr to access the sense key and sense code with a single argument. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-7-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: core: Rename sense field of struct scsi_failureDamien Le Moal
Rename the sense field of struct scsi_failure to sense_key. This makes it clear that this field stores the sense key, and also unifies this structure field names with the names used in struct scsi_sense_hdr. To be consistent with this change, the macro SCMD_FAILURE_SENSE_ANY is renamed SCMD_FAILURE_SENSE_KEY_ANY. Of note is that the definition of the array any_sense_failure_defs in scsi_lib_test_any_sense() is modified to change the initialization of the result field to use SCMD_FAILURE_RESULT_ANY and add the .sense_key field initialization to SCMD_FAILURE_SENSE_KEY_ANY to match the test target case. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-5-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: core: constants: Rename internal struct field namesDamien Le Moal
To make the code more clear, rename the code12 field of struct error_info to the more natural name "code" and the fields code1, code2_min and code2_max of struct error_info2 to the more explicit asc, ascq_min and ascq_max. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-4-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysscsi: core: constants: Use defined sense codesDamien Le Moal
The SENSE_CODE() macro is used for defining the array of struct error_info which associates a string description to an additional sense code and its combinations with additional sense code qualifiers. These are however hardcoded values. Now that all 16-bit sense codes are defined as macros in include/scsi/scsi_sense.h, modify sense_codes.h to use the defined sense code macros. While doing this, 2 missing entries are added for the codes OVERLAPPING_ATOMIC_COMMAND_IN_PROGRESS and DEPOPULATION_RESTORATION_INTERRUPTED. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-3-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysi2c: mux: Propagate firmware nodes to channel adaptersAhmad Byagowi
Device Tree channel nodes are associated with the adapters created by i2c-mux, but equivalent firmware-node descriptions are not. Use generic firmware-node operations for the existing channel lookup and associate the returned node with the adapter. Do not restrict the lookup by firmware-node type, so Device Tree, software nodes, and ACPI descriptions all follow the same property traversal. The existing acpi_preset_companion() call remains in place for the standard ACPI channel association. Keep a separate reference to the node returned by the generic lookup because acpi_preset_companion() may replace the device's primary firmware node. Release the saved reference after adapter deletion. Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://patch.msgid.link/00b33b4b352848ff87dd9089190b35d8732676f3.1788623619.git.ahmadexp@gmail.com
3 daysi2c: mux: Factor out channel node lookupAhmad Byagowi
Move the existing Device Tree channel-node lookup into a helper in preparation for using generic firmware-node operations. This is a pure refactoring with no functional change. Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://patch.msgid.link/adf12f66229d5faa0bc75571da1c3f53a1c81dd8.1788623619.git.ahmadexp@gmail.com
3 daysdrm/i915/hotplug: avoid HPD polling if the device is PME capableVinod Govindapillai
In supported devices, HPDs can generate PME and which in turn can invoke runtime resume calls for xe. No need to keep the HPD polling in such PME capable devices. v2: use intel_display_rpm_pme_enabled() directly (JaniN) Bspec: 52979, 52980, 68857, 68867, 68970 Assisted-by: GitHub_Copilot:claude-opus-5 Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Link: https://patch.msgid.link/20260915092518.639448-6-vinod.govindapillai@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 daysdrm/i915/irq: conditional HPD IRQ resets based on PME capabilityVinod Govindapillai
If a device supports generating PME from HPDs, resetting HPD IRQs will be counter productive as HPDs itself will be lost. During suspend routines, all the IRQs are reset. So if the device is capable of generating PME rom HPDs, keep the HPD related IRQs from reset based on the PME capability of the device on a target power state. PME capability will be assessed and updated separately. v2: change keep_hpd to reset_hpd v3: use intel_display_rpm_pme_enabled() directly (JaniN) v4: remove the unused include file from the previous revision Bspec: 52979, 52980, 68857, 68867, 68970 Assisted-by: GitHub_Copilot:claude-opus-5 Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Link: https://patch.msgid.link/20260915092518.639448-5-vinod.govindapillai@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 daysdrm/i915/xe: plug the pme_enabed implementation for xeVinod Govindapillai
Plug the pme_enabled query for xe. It will return the current PME status for the device. For supported platforms, PME is enabled during runtime suspend calls if the device is PME is capable. v2: use the xe_pm_pme_enabled() Assisted-by: GitHub_Copilot:claude-opus-5 Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Link: https://patch.msgid.link/20260915092518.639448-4-vinod.govindapillai@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 daysdrm/i915: add pme_enabled() to the parent interfaceVinod Govindapillai
PME capabiliy need to be assessed very early during runtime suspend routine to avoid resetting HPDs during IRQ resets. As display runtime pm routines are being executed in the independent intel display driver entry points, we need to have independent access to the pme status as well. Add a provision to query the optional pme_enabled to the parent interface so that it could be called independently based on xe/i915's pme_enabled() implementation. Assisted-by: GitHub_Copilot:claude-opus-5 Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Link: https://patch.msgid.link/20260915092518.639448-3-vinod.govindapillai@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 daysdrm/xe/pm: introduce PM PME supportVinod Govindapillai
Introduce PME support for PME capable devices. Whether device is PME capable is assessed during PCI probe routine. And the whether PME is enabled for a specific context is assessed during the PM runtime suspend call if the device is PME capable. If the PME is enabled, HPDs can generate PME which in turn call the runtime resume call and do the wakeup routines. Till now the driver was relying on HPD polling to wakeup in case of any HPDs. HPD polling can be avoided in platforms with PME support and instead rely on this PCI PME for HPD induced wakeup. v2: access functions for xe.pme.enabled status and clear the pme. enabled in case of error in xe_pm_runtime_suspend() v3: use the local pme_enabled flag to clear the device wakeup incase of error v4: call the devm_device_init_wakeup() only if device is PME capable to avoid false wakeup capable reporting in platforms where PME is not supported. Squash the patch which handled the lockdep deadlock handling Bspec: 52979, 52980, 68857, 68867, 68970 Assisted-by: GitHub_Copilot:claude-opus-5 Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Link: https://patch.msgid.link/20260915092518.639448-2-vinod.govindapillai@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 daysscsi: sd_zbc: Reject disks with too many zonesZHOU Jiaxiang
sd_zbc_read_zones() computes the number of zones with 64-bit arithmetic and stores the result in the unsigned int nr_zones field of struct zoned_disk_info, silently truncating counts that exceed 32 bits. The truncated count is later used to size per-zone resources, while the device may still report more zones than fit. Moreover, sd_zbc_report_zones() counts the reported zones with a signed int zone_idx, which overflows past INT_MAX. Reject devices reporting more than INT_MAX zones at scan time; such a device is not realistic for any medium that exists today, and accepting it produces inconsistent zone bookkeeping. Fixes: 89d947561077 ("sd: Implement support for ZBC devices") Signed-off-by: ZHOU Jiaxiang <me@fxti.xyz> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://patch.msgid.link/C41798AB5AA6BF2B+20260916135822.32584-3-me@fxti.xyz Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
3 daysUSB: serial: quatech2: fix baud rate overflowJohan Hovold
The requested baud rate is incorrectly truncated to 16 bits so that line speeds above 65535 bps cannot be set. Use 32 bits for the rate while rejecting rates outside of [50,921600] to avoid having the 16-bit divisor overflow. Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver") Cc: stable@vger.kernel.org # 3.5 Cc: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Johan Hovold <johan@kernel.org>
3 daysUSB: serial: ssu100: fix baud rate overflowJohan Hovold
The requested baud rate is incorrectly truncated to 16 bits so that line speeds above 65535 bps cannot be set. Use 32 bits for the rate and remainder while rejecting rates outside of [50,460800] to avoid having the divisor or remainder overflow. This issue was flagged by an LLM. Fixes: 52af95459939 ("USB: add USB serial ssu100 driver") Cc: stable@vger.kernel.org # 2.6.36 Cc: Bill Pemberton <wfp5p@virginia.edu> Assisted-by: LLM Signed-off-by: Johan Hovold <johan@kernel.org>
3 dayspinctrl: fix typo in log messageHemanth Selam
Correct the misspelling in a message the user sees, reported by scripts/checkpatch.pl using the list in scripts/spelling.txt. Only the message text changes, no code changes. Assisted-by: LLM Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
3 dayspinctrl: fix typos in commentsHemanth Selam
Fix typos in comments, reported by scripts/checkpatch.pl using the misspelling list in scripts/spelling.txt. Only touches comments, no code changes. Assisted-by: LLM Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
3 daysUSB: serial: cp210x: add Corsair AX1500i Power SupplyJérémy Carrat
The Corsair AX1500i power supply exposes its Corsair Link monitoring interface on a mini-USB port through an on-board CP2103, using a Corsair-specific product ID. Without the ID in the table no driver binds and no tty is created. Tested by forcing the driver association with echo 1b1c 1c02 > /sys/bus/usb-serial/drivers/cp210x/new_id and then setting the serial port to 115200 8N1. Adding the ID is sufficient to talk to the device: the tty reaches a USB-to-SMBus bridge sitting behind the UART, which identifies itself as "USB to SMB Bridge (Firmware by Ross Fosler)" version 0.9 and relays PMBus reads to the power supply controller. Input voltage and current, input and output power, internal temperature and fan speed were all read back on an AX1500i. [ 7.806181] usb 3-14: New USB device found, idVendor=1b1c, idProduct=1c02, bcdDevice= 1.00 [ 698.526754] usbcore: registered new interface driver cp210x [ 698.526767] usbserial: USB Serial support registered for cp210x [ 698.527863] cp210x 3-14:1.0: cp210x converter detected [ 698.529263] usb 3-14: cp210x converter now attached to ttyUSB0 The related AX1600i (1b1c:1c11, iProduct "USB API") is expected to be the same kind of device but has not been tested here, so it is not added. Cc: stable@vger.kernel.org Signed-off-by: Jérémy Carrat <jeremy.carrat@icloud.com> Signed-off-by: Johan Hovold <johan@kernel.org>
3 daysACPI: tables: handle failed initrd override mappingsSlavin Liu
The runtime AML table-loading path can invoke initrd override after permanent mappings are enabled. Mapping bookkeeping can then fail. Return AE_NO_MEMORY in that case to prevent a NULL pointer dereference when attempting to read the table length. Detected by static analysis and reviewed with AI-assisted source auditing. Fixes: b2a35003dfbc ("ACPI: Implement physical address table override") Assisted-by: LLM Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn> [ rjw: Added empty code line after conditional, changelog edits ] Link: https://patch.msgid.link/20260913125123.109803-1-bolin.liu@seu.edu.cn Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 dayspinctrl: sunxi: keep a shadow copy of the data register output latchesIlya Titov
On Allwinner SoCs, reading a bank's data register returns the pin level, not the output latch, for pins that are muxed as inputs. Writing a GPIO therefore corrupts the output latches of all input-muxed pins in the same bank: the read-modify-write in sunxi_pinctrl_gpio_set() reads back their pin levels and writes those into their latches. This breaks emulated open-drain lines (e.g. a bit-banged I2C bus from i2c-gpio). Such a line is released high by muxing it as input and letting the pull-up raise it, so any concurrent GPIO write in the same bank stores 1 into its latch. Driving the line low afterwards is a non-atomic data-then-mux sequence in sunxi_pinctrl_gpio_direction_output(); if the poisoning write lands between the two steps, the pin actively drives high (push-pull) instead of low. Observed in practice as sporadic glitches on a T507 board bit-banging I2C on port E while other PE GPIOs are toggled. On a scope the failure is unmistakable: on a clock pulse where SCL should fall to GND, the line instead steps *above* its idle high level for the whole low phase — the pad drives a strong push-pull 3.3 V high, higher than the level the pull-up sustains on the loaded bus — before the next transition recovers it. The same can hit SDA, corrupting data instead of clocks. Steps to reproduce on any sunxi board with a bit-banged (i2c-gpio) bus: # background: toggle any other GPIO of the same bank, e.g. line 21 gpioset -c <chip> --toggle 100us 21=0 & # foreground: keep the bit-banged bus busy while :; do i2cdetect -y <bus> 0x50 0x57; done # watch SCL/SDA with a scope or logic analyzer: sporadic clock-low # phases driven high (above the pull-up level) instead of low The bank spinlock cannot help: the racing write is a perfectly valid whole-register RMW that faithfully writes back what the hardware returned. There are no set/clear registers on this IP to write a single bit atomically. Fix it the same way gpio-mmio handles hardware whose data register read does not return the output latch: keep a shadow copy of each bank's latches, base the read-modify-write on the shadow, and only write the register. The shadow is seeded from the hardware at probe time so pins left in output mode by the bootloader keep their state. Pins that reach output mode through the gpiolib paths write their value (and thereby their shadow bit) before the mux switch in sunxi_pinctrl_gpio_direction_output(); pins muxed to gpio_out directly through a pinmux node bypass that path, so sunxi_pmx_set() refreshes their shadow bit from the latch (readable once the pin is in output mode) to keep them driving their pre-existing level. Seeding the shadow reads the PIO registers at probe time, which requires the bus clock to be enabled. The clock was only requested at the very end of probe, after devm_pinctrl_register() had already claimed the pin hogs described in the device tree - which mux pins, and thus access registers, with the clock still gated. Move the request ahead of both. Boards whose bootloader leaves the PIO clock running are unaffected, which is why the pre-existing hog problem has gone unnoticed since commit 950707c0eb5c ("pinctrl: sunxi: add clock support"). Fixes: df7b34f4c3d2 ("pinctrl: sunxi: Fix gpio_set behaviour") Cc: stable@vger.kernel.org Signed-off-by: Ilya Titov <ilya.titov@wirenboard.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
3 dayscrypto: crypto4xx - use int for ppc4xx_trng_probe()Rosen Penev
Pass an error message to crypto4xx_probe() , which will allow handling failure. The inline function returns 0 as trng is optional functionality. Same with the of_node. Add an extra goto in crypto4xx_probe() to unregister algs as registering them happens before trng. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 dayscrypto: talitos - pass talitos_private to irq handlersRosen Penev
The irq handlers only need priv, which they can get from the dev_get_drvdata() they currently perform on the struct device passed as data. Pass priv directly as the irq handler data and drop the dev_get_drvdata() call, while deriving dev from priv->dev where still needed. Assisted-by: opencode:deepseek-v4-flash-free Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 dayscrypto: drivers - fix typos in commentsHemanth Selam
Fix typos in comments, reported by scripts/checkpatch.pl using the misspelling list in scripts/spelling.txt. Only touches comments, no code changes. Assisted-by: Cursor:claude-opus-5 Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 dayscrypto: atmel-tdes - simplify DMA buffer initializationThorsten Blum
Calculate the buffer length in a single statement and simplify the error handling. Inline the dma_mapping_error() checks and return -ENOMEM from the common error path. If mapping the output buffer fails, unmap the previously mapped input buffer first. Also use dev_err() to log errors and %zu to format size_t, and clarify the error messages. Signed-off-by: Thorsten Blum <blum@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 dayscrypto: ccp - use named initializers for acpi_device_idPawel Zalewski (The Capable Hub)
Use a named initializer for the acpi_device_id fields which makes the code more readable and consistent with how lists are initialized in the rest of the kernel code base. While we are at it - unify the list terminator to have a single space between the brackets and no trailing comma. Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk> Acked-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 dayscrypto: eip93 - fix ssl mac bit field definitionAleksander Jan Bajkowski
Checked the register definitions with the documentation[1]. Turns out that the EIP93_SA_CMD_SSL_MAC bit field has a bad value. It's used in SSL offload mode. This driver doesn't support SSL offload yet, so this causes no problems. 1. MT7621 ProgrammingGuide DMA Fixes: 9739f5f93b78 ("crypto: eip93 - Add Inside Secure SafeXcel EIP-93 crypto engine support") Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 dayscrypto: atmel-tdes - sync output bounce buffer before DMAKarl Mehltretter
The slow path maps its output bounce buffer once at probe time with dma_map_single() and DMA_FROM_DEVICE, then reuses the mapping for every request. After the CPU copies a result from the buffer, dma_sync_single_for_device() must hand the buffer back to the device before the next DMA transfer. The driver omits this call, so cache lines from the previous result can remain valid while the device writes the next one. This bug was masked by the completion paths calling dma_sync_single_for_device() immediately before the CPU copied the output, where dma_sync_single_for_cpu() was required. For DMA_FROM_DEVICE on ARM926, dma_sync_single_for_device() invokes arm926_dma_map_area(), which invalidates the cache lines. The misplaced call therefore discarded the stale lines before every copy-out. Commit c8a9a647532f ("crypto: atmel-tdes - fix DMA sync direction") correctly changed the completion paths to call dma_sync_single_for_cpu(). On ARM926, that function invokes arm926_dma_unmap_area(), which is a no-op. The missing pre-DMA dma_sync_single_for_device() was therefore exposed on ARM926-based SAM9X60 and SAM9X7 SoCs. With CONFIG_CRYPTO_SELFTESTS=y all four DES/TDES algorithms fail on SAM9X75: alg: skcipher: atmel-ecb-tdes encryption test failed (wrong result) on test vector 2, cfg="unaligned buffer, offset=1" Call dma_sync_single_for_device() for the output buffer before starting DMA in both atmel_tdes_crypt_pdc() and atmel_tdes_crypt_dma(). Fixes: c8a9a647532f ("crypto: atmel-tdes - fix DMA sync direction") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Reviewed-by: Thorsten Blum <blum@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 daysdrm/xe/i2c: Disable IRQ on unbindRaag Jadav
Currently, struct xe_i2c is freed before SGUnit IRQ is disabled in unbind path, leaving a potential UAF in case I2C IRQ is hit during this small window. Explicitly disable I2C IRQ in xe_i2c_remove() and fix this. Fixes: 0bb78ce09926 ("drm/xe/i2c: Wire up reset/postinstall for I2C IRQ") Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://patch.msgid.link/20260911121547.2407261-1-raag.jadav@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> (cherry picked from commit 8ba5c8b8ab3fd362267c11df2cd5a90ee46f6e24) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 daysdrm/xe/nvm: add system controller regionAlexander Usyskin
Add region 5 (System Controller) to the list of regions available on device. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260914-nvm_add_sysctl_region-v1-1-75d710daf5d0@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 daysACPI: sysfs: use strscpy() instead of strcpy()Ruslan Vagner
strcpy() is deprecated in the kernel, so use strscpy() with the compile-time known size of the trace_method_name buffer instead of it. The existing length check already rejects overlong input, so the behavior is unchanged. Signed-off-by: Ruslan Vagner <rusya92266@gmail.com> [ rjw: Changelog edits ] Link: https://patch.msgid.link/CAF9RqJ4ip_egVwRKnwn3=X-Qxuwz0u_9pNrgfujBw8RSf2DTPQ@mail.gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 daysdrm/i915/dp: use EXPORT_SYMBOL_IF_KUNIT() for kunit helpersJani Nikula
Use EXPORT_SYMBOL_IF_KUNIT() instead of the regular EXPORT_SYMBOL() to export the symbols to the kunit namespace. Otherwise, the symbols get exported for all the kernel to see, and the corresponding MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING") in the tests is meaningless. Fixes: 2eb9982ff179 ("drm/i915/kunit: Export link training and caps funcs for testing") Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20260915160620.779372-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 daysdrm/i915/dp_mst: Fix configuring TUs for a disconnected streamImre Deak
During an atomic commit after all the MST stream CRTC state is computed the driver ensures that the sum of TUs of all the streams on a given MST topology link is within limits (63 for 8b10 and 64 for 128b132b). For a disconnected stream the DRM MST core's BW verification doesn't ensure this, because the topology state it uses for this is destroyed as soon as the stream (i.e. MST connector/port) is disconnected. The driver should keep the link state valid even for such disconnected streams, as userspace may disable them one-by-one only in a deferred way. Ensure the link's sum of TUs stays within limits in this case by simply reusing the maximum link BPP limit from the stream's (i.e. CRTC's) old state. The disconnection can happen either via the whole topology getting disconnected or via only the given stream's port getting disconnected. Check for both of these conditions separately, as a connector gets unregistered after a link disconnect event only in a deferred way. Cc: stable@vger.kernel.org # v6.10+ Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16073 Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16384 Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20260907174413.741851-2-imre.deak@intel.com
3 daysdrm/i915/dp_mst: Fix configuring FEC for a disconnected streamImre Deak
During an atomic commit after all the MST stream CRTC state is computed the driver ensures that the FEC is configured the same way (enabled or disabled) for all the streams on a given MST topology's link. drm_dp_mst_port_downstream_of_parent() used to determine if a stream is downstream of an MST port will return false if the whole topology is disconnected, since in that case it can't verify that the port/ parent_port passed to it is in the given MST topology. This is a problem during the above FEC configuration check, since intel_dp_mst_check_dsc_change()->get_pipes_downstream_of_mst_ports() will not return all the stream CRTCs/pipes for the topology as expected. Since passing parent_port==NULL to get_pipes_downstream_of_mst_port() is meant to return all the streams for the given topology (i.e. mst_mgr) skip checking if an MST port is downstream of a parent port in this case. This fixes a problem where the FEC configuration check explained above failed to ensure that all streams' FEC is configured the same way if the topology was disconnected, leading to a FEC state mismatch error. Cc: stable@vger.kernel.org # v6.10+ Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16073 Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16384 Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20260907174413.741851-1-imre.deak@intel.com
3 daysdrm/tve200: remove unused includesLuca Ceresoli
The drm_panel API is completely unused in this file. Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260903-drm-bridge-every-panel-v2-17-2ab8ee24538e@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
3 daysdrm/omap: dsi: remove unused includesLuca Ceresoli
The drm_panel API is completely unused in these two files. Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260903-drm-bridge-every-panel-v2-15-2ab8ee24538e@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
3 daysMerge branches 'pnp', 'acpi-sbs' and 'acpi-video' into linux-nextRafael J. Wysocki
* pnp: PNP: Detach device after resource transition failure * acpi-sbs: ACPI: SBS: Fix NULL pointer dereference on allocation failure * acpi-video: ACPI: video: add backlight=native DMI quirk on Acer Nitro AN515-58
3 daysdrm/i915/quirks: Limit eDP rate to HBR2 on HP Pavilion Plus 14-ew1Ankit Nautiyal
The eDP panel on the HP Pavilion Plus Laptop 14-ew1xxx advertises HBR3 while leaving the TPS4 support bit clear. The output however flickers, once link is trained with HBR3. Until commit 8c9006283e4b ("Revert "drm/i915/dp: Reject HBR3 when sink doesn't support TPS4"") such sinks were capped at HBR2 by the TPS4 check which incidentally kept this panel stable. That check was reverted because other panels legitimately need HBR3 without advertising TPS4, and the per-machine QUIRK_EDP_LIMIT_RATE_HBR2 was introduced to handle the affected machines instead. Add the machine to the list of devices that need the QUIRK_EDP_LIMIT_RATE_HBR2. Fixes: 8c9006283e4b ("Revert "drm/i915/dp: Reject HBR3 when sink doesn't support TPS4"") Reported-by: Annoy Cc <annoycc@gmail.com> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16743 Cc: <stable@vger.kernel.org> # v6.18+ Tested-by: Annoy Cc <annoycc@gmail.com> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Nemesa Garg <nemesa.garg@intel.com> Link: https://patch.msgid.link/20260907034555.2753846-1-ankit.k.nautiyal@intel.com
3 dayscrypto: atmel-ecc - simplify atmel_ecdh_compute_shared_secretThorsten Blum
Free work_data and return ret directly to simplify the control flow. Signed-off-by: Thorsten Blum <blum@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 dayscrypto: qat - allow KPT disable when service is not asymNitesh Venkatesh
The KPT (Key Protection Technology) enable sysfs attribute rejects any write when the currently enabled service is not 'asym', including writes that disable KPT. This blocks a legitimate recovery flow: 1. Configure the 'asym' service and enable KPT. 2. Bring the device up, then down. 3. Reconfigure the service to 'sym' and bring the device up. 4. KPT is still reported as enabled, but is not active because the asymmetric service is no longer configured. 5. Bring the device back down so the KPT enable attribute becomes writable. 6. Writing '0' to the KPT enable attribute to clear the stale flag fails with: "KPT can only be enabled when the asymmetric service is enabled" The asym-service check is only meaningful when enabling KPT; disabling must always be permitted so a stale enable flag can be cleared after the service configuration has changed. Parse the user-supplied boolean before the service check and gate the check on the enable direction. Disable requests are now accepted regardless of the currently configured service, provided the device is in the down state (which the attribute already requires for any write). Fixes: fb98254a5eb9 ("crypto: qat - add KPT support for GEN6 devices") Signed-off-by: Nitesh Venkatesh <nitesh.venkatesh@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Ahsan Atta <ahsan.atta@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 daysMerge branch 'i2c/i2c' into i2c/i2c-nextAndi Shyti
3 daysi2c: qcom-geni: Add dynamic transfer timeout based on transfer length and ↵Aniket Randive
frequency The driver uses a static XFER_TIMEOUT of HZ (1 second) for all transfers regardless of message length or bus frequency, causing unnecessary delays on error paths. Use i2c_update_timeout() API to calculate transfer timeouts dynamically based on message length and bus frequency. update the timeout per message for FIFO, SE-DMA and GPI single descriptor transfers. For GPI multi descriptor transfers, calculate the timeout from the combined length of all messages, as completion is reported only after the entire batch has finished. A 10x safety margin over the theoretical wire time is applied, with a 300ms floor to account for I2C clock stretching and other situations where a slave may keep SCL asserted for an extended period, including faulty devices holding the bus. Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com> Reviewed-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://patch.msgid.link/20260911-master-v9-2-77ac458344e2@oss.qualcomm.com
3 daysRevert "drm/i915/display: Clear SEL_FETCH_PLANE_CTL on plane disable"Nemesa Garg
This reverts commit 7f1172a2ac0d7e50850785e2e65789c8aac8411a. This commit replaced the crtc_state->enable_psr2_sel_fetch guard in icl_plane_disable_sel_fetch_arm() and i9xx_cursor_disable_sel_fetch_arm() with HAS_PSR2_SEL_FETCH(). This is a display version check and says nothing about the pipe, so every plane and cursor disable on a display 12+ platform started writing SEL_FETCH_PLANE_CTL() / SEL_FETCH_CUR_CTL(), including on pipes that do not implement them. It shows up as an unclaimed register access on pipes driving HDMI where selective fetch was never enabled. The stale selective fetch enable bit that commit addressed is handled in the next patch. Fixes: 7f1172a2ac0d ("drm/i915/display: Clear SEL_FETCH_PLANE_CTL on plane disable") Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16876 Signed-off-by: Nemesa Garg <nemesa.garg@intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://patch.msgid.link/20260909110332.3528029-2-nemesa.garg@intel.com (cherry picked from commit d393529394167e0f5f706657eebe84d8529ce4fc) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 daysi2c: core: Add i2c_update_timeout() helper for dynamic transfer timeoutsAniket Randive
The transfer timeout for an I2C controller should reflect the actual message length and bus frequency rather than a static 1-second value. A static timeout causes unnecessary delays on error paths for short messages, and may be insufficient for very long transfers. Add i2c_update_timeout() to i2c-core which computes a transfer-specific timeout and stores it directly in the standard adap->timeout field. The formula accounts for 9 bits per byte (8 data + 1 ACK) at the configured bus frequency. The caller supplies a safety multiplier and a minimum floor so that each driver retains full control over its timing policy without those values becoming public API. Storing the result in adap->timeout makes it visible to all consumers of that field, including the arbitration-loss retry loop in __i2c_transfer(). The function is gated by CONFIG_I2C_DYNAMIC_TIMEOUT. When the config is disabled, i2c_update_timeout() compiles to a no-op inline stub so drivers that call it build cleanly and the existing static 1-second default is preserved unchanged. A timeout explicitly configured by userspace via the I2C_TIMEOUT ioctl is stored in a new adap->user_timeout field and always takes precedence over the kernel-computed value. When userspace has not configured a timeout, the computed value is used. The ioctl keeps writing adap->timeout as well, so adapters that never call i2c_update_timeout() continue to honour it exactly as before. As i2c_update_timeout() is an exported helper, guard against a zero bus frequency from a misbehaving caller with WARN_ON_ONCE() and return early, leaving the existing timeout untouched as a safe fallback rather than dividing by zero. Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com> Reviewed-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://patch.msgid.link/20260911-master-v9-1-77ac458344e2@oss.qualcomm.com
3 dayscrypto: caam - map job ring registers without claiming regionRosen Penev
devm_platform_ioremap_resource() ends up calling request_mem_region(), which fails with -EBUSY on i.MX SoCs: There the job rings are modelled as sub-regions of their parent fsl,sec-v4.0 register window, and caam_probe() already reserves the whole window exclusively via devm_of_iomap() before the children are populated. Every job ring therefore collides with its own parent and fails to probe, taking the hardware RNG offline (seen on i.MX6, i.MX7 and i.MX8 boards such as colibri-imx7 and verdin-imx8mp). Map the job ring registers with devm_ioremap() instead, which does not claim the (already owned) region. Fixes: 9a955c0a7d11 ("crypto: caam - simplify probe resource and IRQ handling") Assisted-by: opencode:big-pickle Signed-off-by: Rosen Penev <rosenp@gmail.com> Reported-by: Emanuele Ghidoli <ghidoliemanuele@gmail.com> Tested-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Tested-by: Richard Leitner <richard.leitner@linux.dev> # i.MX8MP Tested-by: Sahil Malhotra <sahil.malhotra@nxp.com> # i.MX8MM-EVK Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>