aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2024-05-27cpufreq: qcom-nvmem: add support for IPQ5321Kathiravan Thirumoorthy1-0/+1
Like all other SoCs in IPQ5332 family, cpufreq for IPQ5321 is also determined by the eFuse, with the maximum limit of 1.1GHz. Add support for the same. Acked-by: Viresh Kumar <[email protected]> Reviewed-by: Mukesh Ojha <[email protected]> Signed-off-by: Kathiravan Thirumoorthy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27soc: qcom: socinfo: Add SoC ID for IPQ5321Kathiravan Thirumoorthy1-0/+1
Add the SoC ID for IPQ5321, which belong to the family of IPQ5332 SoC. Reviewed-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Mukesh Ojha <[email protected]> Signed-off-by: Kathiravan Thirumoorthy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27clk: qcom: Add Video Clock Controller driver for SM7150Danila Tikhonov3-0/+368
Add support for the video clock controller found on SM7150. Signed-off-by: Danila Tikhonov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27clk: qcom: Add Camera Clock Controller driver for SM7150Danila Tikhonov3-0/+2070
Add support for the camera clock controller found on SM7150. Signed-off-by: Danila Tikhonov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27clk: qcom: Add Display Clock Controller driver for SM7150Danila Tikhonov3-0/+1017
Add support for the display clock controller found on SM7150. Co-developed-by: David Wronek <[email protected]> Signed-off-by: David Wronek <[email protected]> Signed-off-by: Danila Tikhonov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27clk: qcom: gcc-sm7150: constify clk_init_data structuresDanila Tikhonov1-196/+196
The clk_init_data structures are never modified, make them const. No functional changes. Signed-off-by: Danila Tikhonov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27clk: qcom: Fix SM_GCC_7150 dependenciesDanila Tikhonov1-0/+1
Add dependencies on "ARM64 or COMPILE_TEST" for SM_GCC_7150. Signed-off-by: Danila Tikhonov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27soc: qcom: rpmh-rsc: Ensure irqs aren't disabled by rpmh_rsc_send_data() callersStephen Boyd2-4/+4
Dan pointed out that Smatch is concerned about this code because it uses spin_lock_irqsave() and then calls wait_event_lock_irq() which enables irqs before going to sleep. The comment above the function says it should be called with interrupts enabled, but we simply hope that's true without really confirming that. Let's add a might_sleep() here to confirm that interrupts and preemption aren't disabled. Once we do that, we can change the lock to be non-saving, spin_lock_irq(), to clarify that we don't expect irqs to be disabled. If irqs are disabled by callers they're going to be enabled anyway in the wait_event_lock_irq() call which would be bad. This should make Smatch happier and find bad callers faster with the might_sleep(). We can drop the WARN_ON() in the caller because we have the might_sleep() now, simplifying the code. Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Fixes: 2bc20f3c8487 ("soc: qcom: rpmh-rsc: Sleep waiting for tcs slots to be free") Cc: Douglas Anderson <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27soc: qcom: pmic_glink: Handle the return value of pmic_glink_initChen Ni1-2/+11
As platform_driver_register() and register_rpmsg_driver() can return error numbers, it should be better to check the return value and deal with the exception. Signed-off-by: Chen Ni <[email protected]> Fixes: 58ef4ece1e41 ("soc: qcom: pmic_glink: Introduce base PMIC GLINK driver") Reviewed-by: Bryan O'Donoghue <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27power: supply: Drop explicit initialization of struct ↵Uwe Kleine-König12-20/+20
i2c_device_id::driver_data to 0 These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. While add it, also remove commas after the sentinel entries. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-05-27drm/xe/vf: Use only assigned GGTT regionMichal Wajdeczko4-1/+109
Each VF is assigned a limited range of the GGTT address space. To ensure that the VF driver does not use GGTT allocations outside of the assigned region, explicitly reserve GGTT space below and above this region when initializing GGTT. Signed-off-by: Michal Wajdeczko <[email protected]> Reviewed-by: Michał Winiarski <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2024-05-27drm/xe/vf: Read VF configuration prior to GGTT initializationMichal Wajdeczko1-0/+11
Each VF will be assigned with only a limited range of the GGTT address space. Make sure that VF driver will read its own GGTT configuration before starting any GGTT initialization. Signed-off-by: Michal Wajdeczko <[email protected]> Reviewed-by: Michał Winiarski <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2024-05-27clk: qcom: Constify struct pll_vcoChristophe JAILLET28-38/+38
pll_vco structure are never modified. They are used as .vco_table in "struct clk_alpha_pll". And in this structure, we have: const struct pll_vco *vco_table; Constifying these structures moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 9905 47576 0 57481 e089 drivers/clk/qcom/mmcc-msm8994.o After: text data bss dec hex filename 10033 47440 0 57473 e081 drivers/clk/qcom/mmcc-msm8994.o Signed-off-by: Christophe JAILLET <[email protected]> Acked-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/c3c9a75ed77a5ef2e9b72081e88225d84bba91cd.1715359776.git.christophe.jaillet@wanadoo.fr Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27firmware: qcom-scm: Remove QCOM_SMC_WAITQ_FLAG_WAKE_ALLUnnathi Chalicheemala1-4/+2
This flag was never supported by firmware, so remove it. Signed-off-by: Unnathi Chalicheemala <[email protected]> Reviewed-by: Elliot Berman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27soc: qcom: pmic_glink: Increase max ports to 3Abel Vesa1-1/+1
Up until now, all Qualcomm platforms only had maximum 2 ports. The X Elite (x1e80100) adds a third one. Increase the maximum allowed to 3. Signed-off-by: Abel Vesa <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/20240527-x1e80100-soc-qcom-pmic-glink-v1-1-e5c4cda2f745@linaro.org Signed-off-by: Bjorn Andersson <[email protected]>
2024-05-27Merge tag 'pmdomain-v6.10-rc1' of ↵Linus Torvalds1-0/+11
git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm Pull pmdomain fix from Ulf Hansson: - Fix regression in gpcv2 PM domain for i.MX8 * tag 'pmdomain-v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: pmdomain: imx: gpcv2: Add delay after power up handshake
2024-05-27dm: make dm_set_zones_restrictions work on the queue limitsChristoph Hellwig3-12/+14
Don't stuff the values directly into the queue without any synchronization, but instead delay applying the queue limits in the caller and let dm_set_zones_restrictions work on the limit structure. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
2024-05-27dm: remove dm_check_zonedChristoph Hellwig1-36/+23
Fold it into the only caller in preparation to changes in the queue limits setup. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Mike Snitzer <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
2024-05-27dm: move setting zoned_enabled to dm_table_set_restrictionsChristoph Hellwig2-4/+7
Keep it together with the rest of the zoned code. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
2024-05-27pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore}Claudiu Beznea1-2/+2
On PREEMPT_RT kernels the spinlock_t maps to an rtmutex. Using raw_spin_lock_irqsave()/raw_spin_unlock_irqrestore() on &pctrl->lock.rlock breaks the PREEMPT_RT builds. To fix this use spin_lock_irqsave()/spin_unlock_irqrestore() on &pctrl->lock. Fixes: 02cd2d3be1c3 ("pinctrl: renesas: rzg2l: Configure the interrupt type on resume") Reported-by: Diederik de Haas <[email protected]> Closes: https://lore.kernel.org/all/131999629.KQPSlr0Zke@bagend Signed-off-by: Claudiu Beznea <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
2024-05-27mtd: spi-nor: get rid of SPI_NOR_NO_FRMichael Walle3-13/+17
The Everspin FRAM devices are the only user of the NO_FR flag. Drop the global flag and instead use a manufacturer fixup for the Everspin flashes to drop the fast read support. Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Tudor Ambarus <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> [[email protected]: s/evervision/everspin/g in code and commit message] Signed-off-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27mtd: spi-nor: remove .setup() callbackMichael Walle2-65/+45
With the removal of the Xilinx flashes, there is no more flash driver using that hook. The original intention was to let the driver configure special requirements like page size an opcodes. This is already possible by other means and it is unlikely a flash will overwrite the (more or less complex) setup function. Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Acked-by: Tudor Ambarus <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27mtd: spi-nor: get rid of non-power-of-2 page size handlingMichael Walle2-34/+11
The Xilinx flashes were the only users of page sizes that were not power of 2. Support for them has been dropped, thus we can also get rid of the special page size handling for it. Signed-off-by: Michael Walle <[email protected]> Acked-by: Tudor Ambarus <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> [[email protected]: fixup minor typos and grammar in commit message] Signed-off-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27gpio: prevent potential speculation leaks in gpio_device_get_desc()Hagar Hemdan1-1/+2
Userspace may trigger a speculative read of an address outside the gpio descriptor array. Users can do that by calling gpio_ioctl() with an offset out of range. Offset is copied from user and then used as an array index to get the gpio descriptor without sanitization in gpio_device_get_desc(). This change ensures that the offset is sanitized by using array_index_nospec() to mitigate any possibility of speculative information leaks. This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc. Signed-off-by: Hagar Hemdan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2024-05-27mtd: spi-nor: Remove support for Xilinx S3AN flashesMichael Walle4-172/+0
These flashes are kind of an oddball for the very old Xilinx Spartan 3 FPGAs to store their bitstream. More importantly, they reuse the Atmel JEDEC manufacturer ID and in fact the at45db081d already blocks the use of the 3S700AN flash chip. It's time to sunset support for these flashes. Signed-off-by: Michael Walle <[email protected]> Acked-by: Tudor Ambarus <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Cc: Ricardo Ribalda <[email protected]> Acked-by: Ricardo Ribalda <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27drm/imx/ldb: convert to struct drm_edidJani Nikula1-12/+12
Prefer the struct drm_edid based functions for reading the EDID and updating the connector. Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/c1f1143b5aea14aea968cda6508b275b2f7246ea.1715691257.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
2024-05-27drm/imx/tve: convert to struct drm_edidJani Nikula1-8/+6
Prefer the struct drm_edid based functions for reading the EDID and updating the connector. Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/2f59a7ad10c29c21f08223ef19221cef48623cc8.1715691257.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
2024-05-27dma-buf: handle testing kthreads creation failureFedor Pchelkin1-0/+6
kthread creation may possibly fail inside race_signal_callback(). In such a case stop the already started threads, put the already taken references to them and return with error code. Found by Linux Verification Center (linuxtesting.org). Fixes: 2989f6451084 ("dma-buf: Add selftests for dma-fence") Cc: [email protected] Signed-off-by: Fedor Pchelkin <[email protected]> Reviewed-by: T.J. Mercier <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2024-05-27EDAC/thunderx: Remove unused struct error_syndromeDr. David Alan Gilbert1-6/+0
struct error_syndrome appears never to have been used. Remove it, together with the MAX_SYNDROME_REGS it used. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-05-27drm/loongson/7a2000: convert to struct drm_edidJani Nikula1-8/+7
Prefer the struct drm_edid based functions for reading the EDID and updating the connector. Reviewed-by: Sui Jingfeng <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/b8c477279a6ae1b44df72bee230180e277087fae.1715691257.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
2024-05-27drm/loongson/7a1000: convert to struct drm_edidJani Nikula1-8/+7
Prefer the struct drm_edid based functions for reading the EDID and updating the connector. Reviewed-by: Sui Jingfeng <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/22c66af62cd5ae1998bbaf6801cda3cc689f9e3f.1715691257.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
2024-05-27drm/hisilicon/hibmc: convert to struct drm_edidJani Nikula1-7/+10
Prefer the struct drm_edid based functions for reading the EDID and updating the connector. Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/386e3a64efbdd61c3eaed3f49ea9c3ebd4fcd41d.1715691257.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
2024-05-27drm/bridge: analogix_dp: convert to struct drm_edidJani Nikula1-7/+8
Prefer the struct drm_edid based functions for reading the EDID and updating the connector. Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/6f3bd1233a0922551761666f0c96c3766e3c5f96.1715691257.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
2024-05-27mtd: rawnand: meson: read/write access for boot ROM pagesArseniy Krasnov1-10/+48
Boot ROM on Meson needs some pages to be read/written in a special mode: 384 byte ECC mode (so called "short" by Amlogic) and with scrambling enabled. Such pages are located on the chip in the following way (for example): [ p0 ][ p1 ][ p2 ][ p3 ][ p4 ][ p5 ][ p6 ][ p7 ] ... [ pN ] ^ ^ ^ ^ pX is page number "X". "^" means "special" page used by boot ROM - e.g. every 2nd page in the range of [0, 7]. Step (2 here) and last page in range is read from the device tree. Signed-off-by: Arseniy Krasnov <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2024-05-27mtd: rawnand: meson: refactor use of 'meson_nfc_cmd_access()'Arseniy Krasnov1-18/+12
Move call 'meson_nfc_cmd_seed()' and check for 'NAND_NEED_SCRAMBLING' to 'meson_nfc_cmd_access()', thus removing code duplication. Signed-off-by: Arseniy Krasnov <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2024-05-27w1: Add missing newline and fix typos in w1_bus_master commentThorsten Blum1-1/+1
- Add missing newline before @return - s/bytes/byte/ - s/handles/handle/ - s/exists/exist/ in dev_info() message Signed-off-by: Thorsten Blum <[email protected]> Link: https://lore.kernel.org/r/[email protected] [krzysztof: squash "w1: Fix typo in dev_info() message"] Signed-off-by: Krzysztof Kozlowski <[email protected]>
2024-05-27mtd: rawnand: rockchip: ensure NVDDR timings are rejectedVal Packett1-3/+3
.setup_interface first gets called with a "target" value of NAND_DATA_IFACE_CHECK_ONLY, in which case an error is expected if the controller driver does not support the timing mode (NVDDR). Fixes: a9ecc8c814e9 ("mtd: rawnand: Choose the best timings, NV-DDR included") Signed-off-by: Val Packett <[email protected]> Cc: [email protected] Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2024-05-27mtd: rawnand: Bypass a couple of sanity checks during NAND identificationMiquel Raynal1-24/+31
Early during NAND identification, mtd_info fields have not yet been initialized (namely, writesize and oobsize) and thus cannot be used for sanity checks yet. Of course if there is a misuse of nand_change_read_column_op() so early we won't be warned, but there is anyway no actual check to perform at this stage as we do not yet know the NAND geometry. So, if the fields are empty, especially mtd->writesize which is *always* set quite rapidly after identification, let's skip the sanity checks. nand_change_read_column_op() is subject to be used early for ONFI/JEDEC identification in the very unlikely case of: - bitflips appearing in the parameter page, - the controller driver not supporting simple DATA_IN cycles. As nand_change_read_column_op() uses nand_fill_column_cycles() the logic explaind above also applies in this secondary helper. Fixes: c27842e7e11f ("mtd: rawnand: onfi: Adapt the parameter page read to constraint controllers") Fixes: daca31765e8b ("mtd: rawnand: jedec: Adapt the parameter page read to constraint controllers") Cc: [email protected] Reported-by: Alexander Dahl <[email protected]> Closes: https://lore.kernel.org/linux-mtd/[email protected]/ Reported-by: Steven Seeger <[email protected]> Closes: https://lore.kernel.org/linux-mtd/DM6PR05MB4506554457CF95191A670BDEF7062@DM6PR05MB4506.namprd05.prod.outlook.com/ Signed-off-by: Miquel Raynal <[email protected]> Tested-by: Sascha Hauer <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2024-05-27mtd: rawnand: Fix the nand_read_data_op() early checkMiquel Raynal1-1/+1
The nand_read_data_op() operation, which only consists in DATA_IN cycles, is sadly not supported by all controllers despite being very basic. The core, for some time, supposed all drivers would support it. An improvement to this situation for supporting more constrained controller added a check to verify if the operation was supported before attempting it by running the function with the check_only boolean set first, and then possibly falling back to another (possibly slightly less optimized) alternative. An even newer addition moved that check very early and probe time, in order to perform the check only once. The content of the operation was not so important, as long as the controller driver would tell whether such operation on the NAND bus would be possible or not. In practice, no buffer was provided (no fake buffer or whatever) as it is anyway not relevant for the "check_only" condition. Unfortunately, early in the function, there is an if statement verifying that the input parameters are right for normal use, making the early check always unsuccessful. Fixes: 9f820fc0651c ("mtd: rawnand: Check the data only read pattern only once") Cc: [email protected] Reported-by: Alexander Dahl <[email protected]> Closes: https://lore.kernel.org/linux-mtd/[email protected]/ Reported-by: Steven Seeger <[email protected]> Closes: https://lore.kernel.org/linux-mtd/DM6PR05MB4506554457CF95191A670BDEF7062@DM6PR05MB4506.namprd05.prod.outlook.com/ Signed-off-by: Miquel Raynal <[email protected]> Reviewed-by: Alexander Dahl <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2024-05-27mtd: rawnand: Ensure ECC configuration is propagated to upper layersMiquel Raynal1-1/+8
Until recently the "upper layer" was MTD. But following incremental reworks to bring spi-nand support and more recently generic ECC support, there is now an intermediate "generic NAND" layer that also needs to get access to some values. When using "converted" ECC engines, like the software ones, these values are already propagated correctly. But otherwise when using good old raw NAND controller drivers, we need to manually set these values ourselves at the end of the "scan" operation, once these values have been negotiated. Without this propagation, later (generic) checks like the one warning users that the ECC strength is not high enough might simply no longer work. Fixes: 8c126720fe10 ("mtd: rawnand: Use the ECC framework nand_ecc_is_strong_enough() helper") Cc: [email protected] Reported-by: Sascha Hauer <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Miquel Raynal <[email protected]> Tested-by: Sascha Hauer <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2024-05-27mtd: physmap: Use *-y instead of *-objs in MakefileAndy Shevchenko1-6/+5
*-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2024-05-27drm/i915: Bury c8_planes_changed() in intel_color_check()Ville Syrjälä2-19/+10
The c8_planes_changed() check in the high level atomic code is a bit of an eyesore. Push it inside intel_color_check() so the high level code doesn't have to care about this stuff. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
2024-05-27drm/i915: Hide the intel_crtc_needs_color_update() inside intel_color_check()Ville Syrjälä2-5/+8
Move the intel_crtc_needs_color_update() into intel_color_check() so that the caller doesn't have to care about this. This will also enable us to hide the c8_planes_changed() thing better. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
2024-05-27drm/i915: Plumb the entire atomic state into intel_color_check()Ville Syrjälä3-48/+69
Bunch of stuff in intel_color_check() needs to look at both the old and new crtc states. Currently we do that by digging the full atomic state via the crtc_state->state pointer. That thing is a total footgun if I ever saw one, as it's only valid during specific parts of the atomic flow. A lot of people have been bitten by this thing in the past when trying to use it after it's no longer valid. Take a small step towards elimination of the footgun by not using it in the inte_color_check(). Instead we plumb in the entire atomic state all the way from the top. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
2024-05-27drm/nouveau/nvif: Avoid build error due to potential integer overflowsGuenter Roeck1-6/+18
Trying to build parisc:allmodconfig with gcc 12.x or later results in the following build error. drivers/gpu/drm/nouveau/nvif/object.c: In function 'nvif_object_mthd': drivers/gpu/drm/nouveau/nvif/object.c:161:9: error: 'memcpy' accessing 4294967264 or more bytes at offsets 0 and 32 overlaps 6442450881 bytes at offset -2147483617 [-Werror=restrict] 161 | memcpy(data, args->mthd.data, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/nouveau/nvif/object.c: In function 'nvif_object_ctor': drivers/gpu/drm/nouveau/nvif/object.c:298:17: error: 'memcpy' accessing 4294967240 or more bytes at offsets 0 and 56 overlaps 6442450833 bytes at offset -2147483593 [-Werror=restrict] 298 | memcpy(data, args->new.data, size); gcc assumes that 'sizeof(*args) + size' can overflow, which would result in the problem. The problem is not new, only it is now no longer a warning but an error since W=1 has been enabled for the drm subsystem and since Werror is enabled for test builds. Rearrange arithmetic and use check_add_overflow() for validating the allocation size to avoid the overflow. While at it, split assignments out of if conditions. Fixes: a61ddb4393ad ("drm: enable (most) W=1 warnings by default across the subsystem") Cc: Javier Martinez Canillas <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Danilo Krummrich <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Kees Cook <[email protected]> Cc: Christophe JAILLET <[email protected]> Cc: Joe Perches <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Danilo Krummrich <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2024-05-27drm/i915: Fix SEL_FETCH_{SIZE,OFFSET} registersVille Syrjälä1-8/+8
Fix up the SEL_FETCH_{SIZE,OFFSET} registers. A classic copy-paste fail on my part. I even had a small test to confirm that the old and new register offsets match, but somehow I must have screwed things up when running it, and likely just ended up comparing the old defines against themselves :/ Cc: Jani Nikula <[email protected]> Fixes: 4bfa8a140db3 ("drm/i915: Define SEL_FETCH_PLANE registers via PICK_EVEN_2RANGES()") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
2024-05-27thermal: trip: Trigger trip down notifications when trips involved in ↵Rafael J. Wysocki3-8/+20
mitigation become invalid When a trip point becomes invalid after being crossed on the way up, it is involved in a mitigation episode that needs to be adjusted to compensate for the trip going away. For this reason, introduce thermal_zone_trip_down() as a wrapper around thermal_trip_crossed() and make thermal_zone_set_trip_temp() call it if the new temperature of the trip at hand is equal to THERMAL_TEMP_INVALID and it has been crossed on the way up to trigger all of the necessary adjustments in user space, the thermal debug code and the zone governor. Fixes: 8c69a777e480 ("thermal: core: Fix the handling of invalid trip points") Signed-off-by: Rafael J. Wysocki <[email protected]>
2024-05-27thermal: core: Introduce thermal_trip_crossed()Rafael J. Wysocki1-10/+19
Add a helper function called thermal_trip_crossed() to be invoked by __thermal_zone_device_update() in order to notify user space, the thermal debug code and the zone governor about trip crossing. Subsequently, this will also be used in the case when a trip point becomes invalid after being crossed on the way up. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]>
2024-05-27thermal/debugfs: Allow tze_seq_show() to print statistics for invalid tripsRafael J. Wysocki1-4/+0
Commit a6258fde8de3 ("thermal/debugfs: Make tze_seq_show() skip invalid trips and trips with no stats") modified tze_seq_show() to skip invalid trips, but it overlooked the fact that a trip may become invalid during a mitigation eposide involving it, in which case its statistics should still be reported. For this reason, remove the invalid trip temperature check from the main loop in tze_seq_show(). The trips that have never been valid will still be skipped after this change because there are no statistics to report for them. Fixes: a6258fde8de3 ("thermal/debugfs: Make tze_seq_show() skip invalid trips and trips with no stats") Signed-off-by: Rafael J. Wysocki <[email protected]>
2024-05-27thermal/debugfs: Print initial trip temperature and hysteresis in tze_seq_show()Rafael J. Wysocki1-3/+11
The temperature and hysteresis of a trip point may change during a mitigation episode it is involved in (it may even become invalid altogether), so in order to avoid possible confusion related to that, store the temperature and hysteresis of trip points at the time they are crossed on the way up and print those values instead of their current temperature and hysteresis. Fixes: 7ef01f228c9f ("thermal/debugfs: Add thermal debugfs information for mitigation episodes") Signed-off-by: Rafael J. Wysocki <[email protected]>