| Age | Commit message (Collapse) | Author |
|
FW expects all keys to be removed before removing a station.
On NAN teardown, iwl_mld_stop_nan() removed the NAN
internal stations while their IGTK/BIGTK were still in FW.
mac80211 frees NAN keys only after drv_stop_nan() returns, so
they are available while NAN is still up.
Remove the NAN group keys before deleting the NAN internal stations.
Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20260921233731.6d541e506ee4.Idaed08b15314b26abb4dc9f4a8a41e61a021597e@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
Some Google devices with ASUS board vendor need to be included in the
TAS approved DMI list so TAS policy is applied for this platform
combination.
Add a new GOOGLE-ASUS match entry using DMI_SYS_VENDOR=Google and
DMI_BOARD_VENDOR=ASUS in the approved list. This change only extends
platform coverage and does not alter existing matching behavior.
Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Assisted-by: GitHubCopilot:GPT-5.3-Codex
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20260921233731.43ea7ba69e05.Ib2ec495e6dea3db1db783d43171505bd03d24cf6@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
Make this dependency explicit. We use the ieee80211_p2p_noa_desc
structure in the FW API file.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20260921233731.13c9033a18cf.I2d3f3b8e2d4c7af0961726219974db2485e8312e@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
hcmd.h relies on mld.h. Make this dependency explicit.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20260921233731.252cd5ae36b1.I5ea033fff1dcabd46e7d66f15c140dce2c5c9a1f@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
A DRAM buffer allocation shouldn't have an ID of 0. If a broken TLV
contained such an id, this buffer will be allocated and a command will
be sent to the FW. regardless of the FW asserting on that or not, this
buffer will never be freed,
since in the free path we do check for INVALID...
Link: https://patch.msgid.link/20260921233731.ebd907861742.Ib74687a84e65d2e5295d338600283978a7018375@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
iwl_dbg_tlv_alloc_region() did not validate reg->dram_alloc_id for
IWL_FW_INI_REGION_DRAM_BUFFER regions, and the DRAM monitor dump
consumers in fw/dbg.c used it directly to index the fw_mon_ini array.
Check that dram_alloc_id is in range at TLV parse time, and add bounds
checks in iwl_dump_ini_mon_dram_iter(), iwl_dump_ini_mon_dram_ranges()
and iwl_dump_ini_mon_dram_get_size() before accessing the array.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20260921233730.4c896fab0bb7.I3296a5523ce58df085ea0867694ea157c00945bd@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
This is not really secure and we won't really need on old devices
(driven by iwlmvm) anyway.
Just remove the code.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20260921233730.60f5274c7116.Ieec87672d84763b599e2d322525f68acff63e701@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
iwl_trans_pcie_txq_disable() computed SCD_TX_STTS_QUEUE_OFFSET(txq_id)
and dereferenced trans_pcie->txqs.txq[txq_id] before checking that
txq_id is within range or that the queue was allocated.
Bail out with a WARN_ON when txq_id is out of range or the queue is not
allocated, and only compute the status address after the checks pass.
We don't really want to disable the command queue either, so check that
as well.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20260921233730.c96ee7e007bc.Ie593dfd5451be69a5e6deca248a4b443e168ac88@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
The INI/Yoyo debug TLVs are parsed from an untrusted firmware-debug
file. The dispatcher only guarantees that the
TLV length covers the 8-byte common header, yet several per-type
handlers dereferenced fields located beyond that header before
checking the TLV length.
Add the missing minimum-length check in iwl_dbg_tlv_config_set() so
the short TLV is rejected before it is stored, and move the field
reads in the other handlers to after their existing length checks so
no field is dereferenced before the buffer is known to be large
enough.
Signed-off-by: Shahar Tzarfati <shahar.tzarfati@intel.com>
Assisted-by: GitHub-Copilot:claude-opus-4-8
Link: https://patch.msgid.link/20260921233730.6127e849e40a.If963f766dbe29cbb8c226e163ab678be97240730@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
The INI debug dump get_size handlers compute the region size as
hdr_size + ranges * (size + sizeof(range)) using u32 arithmetic.
Both the per-range size and the number of ranges originate from
debug TLVs with no upper bound, so the multiplication and additions
can overflow u32. A small value passes the
size < sizeof(*header) check in iwl_dump_ini_mem_prep().
Add the size computation in each handler using
check_add_overflow()/check_mul_overflow() and return 0 when the
result would overflow. For the block handler the variable per-pair
sizes are summed with check_add_overflow() before computing size,
since that accumulation can overflow on its own.
Signed-off-by: Shahar Tzarfati <shahar.tzarfati@intel.com>
Assisted-by: GitHub-Copilot:claude-opus-4-8
Link: https://patch.msgid.link/20260921233730.0644f76cd8af.Id0d26b11fcdb33a5eff7824343caa6dc23385fd5@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
When we receive the TLC notif, we try to fetch the band from the vif
link. However, in NAN we don't have the bss_conf (link_conf[0] is
technically pointing to vif::bss_conf, but it doesn't point to a
channel).
For now we don't have a way to fetch the channel used by this TLC
instance (a NAN station can have multiple), but in the future we will
have a TLC object in the driver and then we will have a phy id in it.
For now, just take either the minimum between both lmacs or the only
existing one.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20260921233730.18fefde9f26d.I8bc0c16de230f3bd45b80101db0936f1e4aea516@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
This delay is given in the same format as in the CIP capabilities.
Update the comment to make it clear that the resolution is 4 us.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20260921233730.0947a2665f17.Ic994dae3eddf50955eac4cf79cb6388887c75b67@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
When a NAN link is activated, the TLC config command was sent for all
the NAN stations. The TLC config was sent on all phys used by NAN.
However, when a new NAN channel is added when there is already a NAN
station (e.g. during schedule update), the station is not yet
attached to the link of this phy (until the new schedule is
applied by firmware). Sending a TLC command for the station on the
new phy at this stage results in an assert because in firmware the
station is not yet attached with the phy of this channel.
Fix it by sending the TLC command only after configuring the station
for the new phy.
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Link: https://patch.msgid.link/20260921233730.24cefdd72e7d.Ib32c29716c805531f881c61d13931f5b3d7084a9@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
In case we keep getting data from the AP, wait for 6 missed beacons
since last Rx before disconnecting.
This will give the firmware a chance to send NDPs to the AP and avoid
disconnecting if the AP is still there.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20260921233730.025f2655b3b1.Ieceece6d8f660399e844ea4dadac414243e35d07@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
Introduce support for (re)association request/response encryption if
supported by the firmware.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Link: https://patch.msgid.link/20260921233730.25ccedf95d32.Ie2834534bd644593b61a063d4ec5f7e323be4370@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
|
__MODULE_STRING() has been an alias for __stringify() since "[PATCH]
MODULE_PARM support for older modules" [1] in 2002-12. That change also
moved it to the graveyard section at the end of linux/module.h
Replace the remaining uses of __MODULE_STRING() with __stringify() in
preparation for its removal.
Link: https://git.kernel.org/tglx/history/c/136839a1b4 [1]
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Andi Shyti <andi.shyti@kernel.org>
Acked-by: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Mika Westerberg <westeri@kernel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
|
|
rzg3e_thermal_suspend() powers off an active sensor and then ignores
failure to assert its reset. System sleep can therefore continue without
the clean reset state expected by resume.
Return the reset error and, when the sensor had been active, try to
restore power before failing suspend. This is best-effort recovery:
reset assertion failure may leave partial hardware state, so restoring
power is not guaranteed to succeed. Preserve the original reset error.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: dc67521c20b7 ("thermal/drivers/renesas/rzg3e: Fix add thermal driver for the Renesas RZ/G3E SoC")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20261014031814.7230-1-hppiscas@163.com
|
|
ti_bandgap_get_sensor_data() kernel-doc
ti_bandgap_get_sensor_data() returns an ERR_PTR() if the bandgap
instance or sensor ID is invalid. Otherwise it returns the stored sensor
data, which can be NULL if no data has been set or the stored value has
been cleared.
This mismatch was already present in omap_bandgap_get_sensor_data() when
the driver was introduced in staging.
Document the validation errors while retaining NULL as a possible stored
value.
Fixes: 8feaf0ce1a04 ("staging: OMAP4+: thermal: introduce bandgap temperature sensor")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260912062252.42762-1-kmehltretter@gmail.com
|
|
The kernel-doc for thermal_fwnode_cooling_device_register() still names the
old device tree arguments np and of_index, and
devm_thermal_fwnode_cooling_device_register() documents fw_index rather
than fwn_index. Rename them to match the code and reword the device tree
reference as a firmware node one.
Signed-off-by: Aryan Sinha <sinha.aryan03@gmail.com>
Link: https://patch.msgid.link/20261012152037.33461-1-sinha.aryan03@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
|
|
Add support for tsens v1 block that exists on MSM8952 with
11 tsens sensors. Sensor Offsets are taken from downstream.
Signed-off-by: Muzaffer Kadir <muzafferkadir@mainlining.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://android.googlesource.com/kernel/msm.git/+/refs/tags/android-wear-7.0.0_r0.3/drivers/thermal/msm-tsens.c#1621
Link: https://patch.msgid.link/20261011-msm8952-initial-support-v5-4-1857074992ec@mainlining.org
|
|
The t7-thermal variant now exposes two clocks (bus and core) in its
devicetree binding, but the driver only knows how to get and manage
a single struct clk. Using devm_clk_get() would silently ignore the
second clock, so switch to devm_clk_bulk_get_all() and the matching
clk_bulk_prepare_enable()/clk_bulk_disable_unprepare() calls. This
lets the driver transparently handle however many clocks a given
compatible declares, without needing per-variant clock-handling code,
and keeps working for existing SoCs that only have one.
Fixes: 18d65de8157c ("thermal/drivers/amlogic: Add support for secure monitor calibration readout")
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260923-fix-t7-thermal-clock-v2-2-bff7a09eb487@aliel.fr
|
|
AN7583 has three temperature sensors and the driver has constants for
all of them, but it registers one zone and reads only the bandgap sensor.
Register a zone per sensor; the thermal sensor cell selects it. A device
tree may describe fewer zones than sensors. EN7581 still registers one
zone.
Idle and with both cores loaded on a Nokia XG-040G-MF:
bandgap 56.9 C -> 59.3 C
GbE 58.7 C -> 61.5 C
CPU 57.0 C -> 61.1 C
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260929165209.69669-5-sochnev.v.74@gmail.com
|
|
A read selects the sensor and walks three diodes with a 10 ms settle on
each. The zone lock serialises reads of one zone. With a zone per AN7583
sensor, added later in this series, reads of different zones interleave
and convert samples taken at another mux position.
Mux writes are dropped silently unless PLLRG_PROTECT is lifted, and its
save and restore do not nest. The cached TADC value also skips a write
after another reader has moved the mux.
With the AN7583 sensors read as parallel zones during CPU frequency
changes, a zone crossed its critical trip on a chip at 55 C and the
board shut down.
Serialise the sequence, drop the cache, check the selection after
writing and after sampling, and return -EAGAIN if it does not hold.
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260929165209.69669-3-sochnev.v.74@gmail.com
|
|
On AN7583, bits 3:1 of 0x2e4 select the sensor (0 bandgap, 5 GbE, 6 CPU)
and bits 3:2 of 0x2a0 select the diode (0 D0, 1 ZERO, 2 D1). The driver
names them the other way round: MUX_TADC is 0x2e4, MUX_SENSOR is 0x2a0.
v5 of the AN7583 series swapped the airoha_set_thermal_mux() arguments
to match these names. The diode index now goes to the sensor selector,
so the zone reads mux positions 1, 0 and 2 (PAD_AVS, bandgap, core
voltage) instead of the bandgap diodes. On a Nokia XG-040G-MF the result
crosses the critical trip and the board powers off during boot.
Swap the field definitions. MUX_TADC then selects the diode, as on
EN7581, and the existing call order is correct.
Fixes: b20d9782756a ("thermal/drivers/airoha: Add support for AN7583 Thermal Sensor")
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260929165209.69669-2-sochnev.v.74@gmail.com
|
|
sprd_thm_probe() reads each sensor child node's "reg" property into
sen->id and uses it without validation: to compute the sensor's
register offsets in sprd_thm_sensor_init(), as the thermal zone id, and
finally as an index into thm->sensor[], which has SPRD_THM_MAX_SENSOR
(8) entries:
ret = of_property_read_u32(sen_child, "reg", &sen->id);
...
thm->sensor[sen->id] = sen;
Only the number of sensor nodes is checked against SPRD_THM_MAX_SENSOR.
A "reg" value of 8 or more, or one that is negative once stored in the
int sen->id, makes the register offsets point outside the sensor range
and the final store land outside thm->sensor[], overwriting the fields
that follow it in struct sprd_thermal_data or other memory.
Reject an out-of-range id right after reading it, before it is used.
This does not address sparse ids, such as a single sensor with id 7:
they leave holes in thm->sensor[] that the later loops over
0..nr_sensors-1 dereference. That needs a separate fix.
Found by static analysis tool CodeQL.
Fixes: 554fdbaf19b1 ("thermal: sprd: Add Spreadtrum thermal driver support")
Assisted-by: LLM codeql
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260926042757.2109927-1-geoffreyhe2@gmail.com
|
|
Both carrier prints open code the on/off ternary. Use the helper from
string_choices.h instead. No change in output.
Signed-off-by: Aryan Sinha <sinha.aryan03@gmail.com>
Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
|
|
nxpwifi_sdio_poll_card_status() returns the result of the last
register read when polling times out.
If the final register read succeeds, the timeout is incorrectly
reported as success.
Return -ETIMEDOUT when polling runs out of retries.
Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
|
|
DP1000 has 16 outbound iATU windows and each window can map up to 4GB. One
window is used for CFG accesses, one for I/O space and one for the 32-bit
MEM aperture, leaving only 13 windows for the 64-bit MEM aperture.
This limits the 64-bit MEM aperture that can be described with outbound
iATU windows. DP1000 routes MEM transactions without using outbound iATU
windows, so skip generic DWC MEM outbound iATU setup to allow a larger
64-bit MEM aperture.
DP1000 does not use ECAM for this controller. Config space accesses keep
using the normal DWC config access path and CFG outbound iATU programming.
I/O space is also unchanged and still uses an outbound iATU window. The new
flag only skips generic MEM-window programming.
The DP1000 integration has SoC wrapper address decode for the PCIe MEM
apertures described by the "ranges" property. CPU physical accesses to
those MEM apertures are routed directly as PCIe MEM transactions with the
corresponding PCIe bus address, without consuming outbound iATU windows.
Set 'dw_pcie_rp->bypass_ob_mem_iatu' for this controller.
Signed-off-by: Xincheng Zhang <zhangxincheng@ultrarisc.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260905025635.211390-3-zhangxincheng@ultrarisc.com
|
|
Some DWC-based controllers do not require outbound iATU windows for MEM
transactions. For those platforms, programming outbound iATU windows for
host bridge MEM ranges is unnecessary and may constrain the available MEM
aperture.
The DWC PCIe RP Controller Databook v6.00a, section 3.12.2, describes the
default outbound no-match behavior as pass-through. Section 3.12.5.6, "No
Address Match Result", says the address is not translated and programmable
TLP header fields come from the application transmit interface.
This no-match path cannot translate between different parent-bus and PCI
addresses, so require skipped MEM ranges to be identity-mapped.
Add dw_pcie_rp->bypass_ob_mem_iatu so drivers can skip generic MEM iATU
setup while using the common DWC host init path.
Existing drivers keep the current behavior because the flag defaults to
false. The I/O iATU setup does not use the MEM resource iterator, and the
iterator may be uninitialized when MEM setup is skipped. Avoid using it in
the I/O iATU error path.
Signed-off-by: Xincheng Zhang <zhangxincheng@ultrarisc.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260905025635.211390-2-zhangxincheng@ultrarisc.com
|
|
The buttress code that reads the tile fuse register is shared by all
generations, so the register field definition should not differ between
them. Extend the TILE_CONFIG mask from [6:1] to [7:1] and use it
everywhere, instead of having a different field width per generation.
The tile count range check in tile_disable_check() depended on the
previous field width. It only logs a warning, and it would now warn on a
valid value, so drop it together with the tile count defines it used.
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20261012083802.2778448-6-karol.wachowski@linux.intel.com
|
|
Put the MTL and LNL buttress registers in a single header, like the IP
registers. No register shares its offset between MTL and LNL, so the
MTL ones are simply followed by the LNL ones.
Also fix the DUP_IDLE typo (should be DPU_IDLE).
No functional change.
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20261012083802.2778448-5-karol.wachowski@linux.intel.com
|
|
With a single register header, many 37xx and 40xx functions became
identical, including the IRQ handler. Keep one copy of each and call
the IRQ handler directly instead of through a function pointer.
No functional change.
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20261012083802.2778448-4-karol.wachowski@linux.intel.com
|
|
Most registers in the 37xx and 40xx IP headers are the same, with only
the prefix differing, which forces a lot of code to be duplicated per
generation.
Merge them into ivpu_hw_ip_reg.h. Each register is defined once with the
prefix of the first generation that has it. New or changed fields use
the prefix of the generation that introduced them. The CPU_SS registers
that moved in 40xx are defined right below the 37xx ones. This leaves
some 37xx and 40xx code paths identical, which the next patch merges.
No functional change.
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20261012083802.2778448-3-karol.wachowski@linux.intel.com
|
|
The buttress FREQ_CHANGE interrupt is not enabled by the driver, but
there is no way to turn it on for testing and debugging.
Store the buttress interrupt mask in struct ivpu_hw_info, so it is set up
once during HW info initialization instead of being a compile time
constant, and use it everywhere the mask is needed. Add the
IVPU_TEST_MODE_FREQ_CHANGE_ENABLE test mode that adds FREQ_CHANGE to this
mask.
No functional change with the test mode disabled.
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20261012083802.2778448-2-karol.wachowski@linux.intel.com
|
|
Copy the API version array from the firmware image header into
struct ivpu_fw_info while the header is being parsed, and use the
cached copy afterwards. This way the raw firmware image header is only
accessed during image parsing, which is a step towards releasing the
firmware image once it has been loaded.
Since the API version is now available in vdev->fw before the
compatibility checks run, drop the redundant fw_hdr parameter from
IVPU_FW_CHECK_API_COMPAT(), IVPU_FW_CHECK_API_VER_LT() and the helpers
behind them, as well as from ivpu_fw_sched_mode_select().
Also make DRM_IVPU_PARAM_FW_API_VERSION read the cached copy instead of
dereferencing the firmware image directly.
No functional change.
Co-developed-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20261012080933.2771862-1-karol.wachowski@linux.intel.com
|
|
pci_pwrctrl_power_on_devices() might return -EPROBE_DEFER resulting in
an error message. Use dev_err_probe() to silence this non-error message.
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260619112535.1127850-1-alexander.stein@ew.tq-group.com
|
|
Replace direct dma_chan::device::dev access with the proper
dmaengine_get_dma_device() for consumer API.
chan->device->dev is not always the device used for DMA mapping. Some DMA
engines support per-channel IOMMU mappings, so different channels may use
different DMA devices. dmaengine_get_dma_device() returns the correct
device for each channel.
This also prepares for making the DMA engine provider data structures
private. DMA consumers should not access DMA engine internals directly.
Link: https://lore.kernel.org/20260917205016.1293317-1-Frank.Li@oss.nxp.com
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Assisted-by: LLM
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Dan Carpenter <error27@gmail.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Vinod Koul <vkoul@kernel.org>
|
|
nmi_panic() used to accept variable arguments until commit ebc41f20d77f
("panic: change nmi_panic from macro to function") flattened it to a final
message string. vpanic() did not exist back then, so the function had to
format through panic("%s", msg).
Bring the variable arguments back and format with vpanic() directly.
The next patch makes nmi_panic() try the panic_force_cpu= redirect
before claiming panic_cpu. panic_try_force_cpu() needs to print the
message but it is used also by panic() which accepts variable argument
list. The string could be formatted only when a CPU gets assigned to
process the redirection. Otherwise, there might be a race when writing
to the `panic_force_buf`.
No current caller passes a string with format specifiers. The closest one
is hpwdt_pretimeout(), which builds panic_msg with hex_byte_pack() and has
only two variants, both plain strings. But the new __printf() annotation
on nmi_panic() would warn with -Wformat-security there because the buffer
is passed directly as the format argument, so switch it to nmi_panic(regs,
"%s", panic_msg).
[pmladek@suse.com: changelog fix]
Link: https://lore.kernel.org/arJxFybmtD7OBIcL@pathway.suse.cz
Link: https://lore.kernel.org/20260916182957.7788-5-brads@mainlining.org
Signed-off-by: Bradley Morgan <brads@mainlining.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Suggested-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: Guenetr Roeck <linux@roeck-us.net>
Cc: Sashiko <sashiko-bot@kernel.org>
Cc: Wang Jinchao <wangjinchao600@gmail.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: <stable@vger.kernel.org>
|
|
A use-after-free vulnerability was identified in mport_mm_close() in
drivers/rapidio/devices/rio_mport_cdev.c, identical to the pattern
previously addressed in dma_req_free().
This is observable from userspace when an application creates an mmap
mapping via the RapidIO character device and subsequently unmaps it (or
terminates, triggering exit_mmap()). During munmap, mport_mm_close() is
invoked and drops the mapping reference via kref_put().
If kref_put() drops the last reference, mport_release_mapping() is called,
which frees the underlying rio_mport_mapping structure. The subsequent
mutex_unlock() then dereferences map->md to unlock buf_mutex, leading to a
use-after-free:
mport_mm_close()
-> mutex_lock(&map->md->buf_mutex);
...
-> kref_put(&map->ref, mport_release_mapping); /* map is freed */
-> mutex_unlock(&map->md->buf_mutex); /* UAF: map used */
Fix this by caching map->md before kref_put() and using the cached pointer
for mutex unlocking, ensuring that freed memory is not accessed.
Link: https://lore.kernel.org/20260914042327.49798-1-james010kim@gmail.com
Fixes: e8de370188d0 ("rapidio: add mport char device driver")
Signed-off-by: James Kim <james010kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: <stable@vger.kernel.org>
|
|
Nigel Kirkland <nkirkland2304@gmail.com> says:
This patch set contains important bug fixes related to cleanup
handling in both normal and error paths, and refactoring of duplicate
code.
The patches were cut against Martin's 7.4/scsi-queue tree.
Link: https://patch.msgid.link/20261013001648.62289-1-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
Update lpfc version to 15.0.0.1
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Tested-by: Ewan D. Milne <emilne@redhat.com>
Link: https://patch.msgid.link/20261013001648.62289-9-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
The domain controller FC_ID can change whenever a fabric switch with an
ISL link is replaced or the admin reconfigures the fabric switch with
active links. In such situations, reference count updates should be
applied to the correct nodelist structure.
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Link: https://patch.msgid.link/20261013001648.62289-8-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
The lpfc_set_disctmo() routine is not used for all cases when the driver
needs to restart discovery on the fc_disctmo timer. Not doing so, makes
discovery timer actions invisible in some cases as they do not get
logged. This patch substitutes calls on fc_disctmo to use
lpfc_set_disctmo() in lpfc_els_rcv_rscn().
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Tested-by: Ewan D. Milne <emilne@redhat.com>
Link: https://patch.msgid.link/20261013001648.62289-7-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
The lpfc_els_abort() routine has a code path that cancels outstanding
I/Os on the ELS ring when attempted aborts fail. The failed aborts are
queued to a drv_cmpl_list and then cancelled after the ELS
pring->txcmplq is fully traversed. However if the abort failure returns
IOCB_ABORTING, then the driver should not have cancelled it. Doing so
starts two threads working on the same iocb and ndlp, leading to
unintended race conditions.
Fix by capturing the IOCB_ABORTING return value in lpfc_els_abort() and
not adding it to the list of IOCBs for cancelling. We should allow the
IOCB scheduled for abort to complete naturally. This avoids
simultaneous threads acting on the same IOCB and ndlp objects.
The lpfc_free_iocb_list() is moved to execute after
lpfc_sli4_hba_unset() allowing the routine to flush I/O before freeing
it. And, in lpfc_pci_remove_one_s4() a call to flush the phba->wq is
added. This makes the unload logic consistent with offline handling
logic.
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Tested-by: Ewan D. Milne <emilne@redhat.com>
Link: https://patch.msgid.link/20261013001648.62289-6-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
The current initial kref count drop logic for an ndlp that fails FDISC
assumes that the ndlp has never registered with transport layer and thus
the lpfc_dev_loss_tmo_callbk never called. However, a failed FDISC can
occur after a successful transport layer registration too. So,
lpfc_dev_loss_tmo_callbk can occur and there is a potential
use-after-free on the ndlp.
Check ndlp->fc4_xpt_flags if previously registered with an upper layer
transport and check ndlp->nlp_flags if there is a LPFC_EVT_DEV_LOSS work
pending. If not previously registered nor LPFC_EVT_DEV_LOSS work pending,
then set the NLP_DROPPED flag as before and decrement the initial kref on
FDISC error. However, if ndlp has been previously registered, then let the
pre-existing logic for each transport's respective dev_loss_tmo_callbk
perform the initial kref decrement.
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Link: https://patch.msgid.link/20261013001648.62289-5-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
A kernel oops at dma_unmap_sg_attrs() may occur due to a race between an
aborted SCSI I/O completion and a SCSI error handler issued TUR using
the same repurposed scsi_cmnd structure.
The LPFC_DRIVER_ABORTED cmd_flag is set when inflight I/Os are aborted
via lpfc_sli_abort_taskmgmt(), and this flag is not cleared until after
scsi_done() is called. The inflight I/O test is changed to check SCSI
I/O for either LFPC_IO_ON_TXCMPLQ or LPFC_DRIVER_ABORTED. If either
cmd_flag is set, then the I/O should still be counted.
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Tested-by: Ewan D. Milne <emilne@redhat.com>
Link: https://patch.msgid.link/20261013001648.62289-4-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
It is possible that a dev_loss_tmo callback fires during an HBA reset.
The ELS pring structure is cleared by the HBA reset path and the
dev_loss_tmo callback executing lpfc_els_abort() could be using a stale
ELS pring pointer. To significantly reduce exposure, check if HBA_SETUP
flag is set before proceeding to use the ELS pring pointer in
lpfc_els_abort(). There is no point to issue aborts when the SLI port is
not setup anyways.
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Reveiwed-by: Ewan D. Milne <emilne@redhat.com>
Tested-by: Ewan D. Milne <emilne@redhat.com>
Link: https://patch.msgid.link/20261013001648.62289-3-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
In lpfc_cmpl_ct_cmd_vmid(), there is an early call to
lpfc_ct_free_iocb() when cmd is SLI_CTAS_DALLAPP_ID. Within
lpfc_ct_free_iocb() the cmdiocb->rsp_dmabuf will be freed. This means
any ctrsp ptr dereference for SLI_CT_RESPONSE_FS_RJT or even
ctrsp->ReasonCode and ctrsp->Explanation when handling a CT LS_RJT
response is a use-after-free.
Remove the early lpfc_ct_free_iocb call for SLI_CTAS_DALLAPP_ID. There
already is a free_res label that calls lpfc_ct_free_iocb so there
doesn't need to be an early lpfc_ct_free_iocb at the start of
lpfc_cmpl_ct_cmd_vmid.
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Tested-by: Ewan D. Milne <emilne@redhat.com>
Link: https://patch.msgid.link/20261013001648.62289-2-nkirkland2304@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
Bart Van Assche <bvanassche@acm.org> says:
Hi Martin,
This patch series enables compiler-based lock context analysis for the
scsi_debug driver. Conditional locking is eliminated across command
response and error injection functions so that static analysis can verify
lock acquisitions and releases. Internal locking helper functions are
annotated with __acquires(),__releases(), __acquires_shared() and
__releases_shared() attributes. An error-path lock leak in
resp_write_same() is fixed. Finally, lock context analysis is enabled in
drivers/scsi/Makefile.
Please consider this patch series for the next merge window.
Thanks,
Bart.
Link: https://patch.msgid.link/cover.1791924924.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|
|
Enable lock context analysis now that all lock context analysis warnings
have been fixed.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.garry@linux.dev>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/46613e281866679cff455c3cbab842e48ad2a3d3.1791924924.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
|