Revision tags: v6.6.25, v6.6.24, v6.6.23, v6.6.16, v6.6.15, v6.6.14, v6.6.13, v6.6.12, v6.6.11, v6.6.10, v6.6.9, v6.6.8, v6.6.7, v6.6.6, v6.6.5, v6.6.4, v6.6.3, v6.6.2, v6.5.11, v6.6.1, v6.5.10, v6.6, v6.5.9, v6.5.8, v6.5.7, v6.5.6, v6.5.5, v6.5.4, v6.5.3, v6.5.2, v6.1.51, v6.5.1, v6.1.50, v6.5, v6.1.49, v6.1.48, v6.1.46, v6.1.45, v6.1.44, v6.1.43, v6.1.42, v6.1.41, v6.1.40, v6.1.39 |
|
#
963b54df |
| 11-Jul-2023 |
Isaac J. Manjarres <isaacmanjarres@google.com> |
regmap-irq: Fix out-of-bounds access when allocating config buffers
When allocating the 2D array for handling IRQ type registers in regmap_add_irq_chip_fwnode(), the intent is to allocate a matrix w
regmap-irq: Fix out-of-bounds access when allocating config buffers
When allocating the 2D array for handling IRQ type registers in regmap_add_irq_chip_fwnode(), the intent is to allocate a matrix with num_config_bases rows and num_config_regs columns.
This is currently handled by allocating a buffer to hold a pointer for each row (i.e. num_config_bases). After that, the logic attempts to allocate the memory required to hold the register configuration for each row. However, instead of doing this allocation for each row (i.e. num_config_bases allocations), the logic erroneously does this allocation num_config_regs number of times.
This scenario can lead to out-of-bounds accesses when num_config_regs is greater than num_config_bases. Fix this by updating the terminating condition of the loop that allocates the memory for holding the register configuration to allocate memory only for each row in the matrix.
Amit Pundir reported a crash that was occurring on his db845c device due to memory corruption (see "Closes" tag for Amit's report). The KASAN report below helped narrow it down to this issue:
[ 14.033877][ T1] ================================================================== [ 14.042507][ T1] BUG: KASAN: invalid-access in regmap_add_irq_chip_fwnode+0x594/0x1364 [ 14.050796][ T1] Write of size 8 at addr 06ffff8081021850 by task init/1
[ 14.242004][ T1] The buggy address belongs to the object at ffffff8081021850 [ 14.242004][ T1] which belongs to the cache kmalloc-8 of size 8 [ 14.255669][ T1] The buggy address is located 0 bytes inside of [ 14.255669][ T1] 8-byte region [ffffff8081021850, ffffff8081021858)
Fixes: faa87ce9196d ("regmap-irq: Introduce config registers for irq types") Reported-by: Amit Pundir <amit.pundir@linaro.org> Closes: https://lore.kernel.org/all/CAMi1Hd04mu6JojT3y6wyN2YeVkPR5R3qnkKJ8iR8if_YByCn4w@mail.gmail.com/ Tested-by: John Stultz <jstultz@google.com> Tested-by: Amit Pundir <amit.pundir@linaro.org> # tested on Dragonboard 845c Cc: stable@vger.kernel.org # v6.0+ Cc: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Cc: Saravana Kannan <saravanak@google.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: "Isaac J. Manjarres" <isaacmanjarres@google.com> Link: https://lore.kernel.org/r/20230711193059.2480971-1-isaacmanjarres@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.1.38, v6.1.37, v6.1.36, v6.4, v6.1.35, v6.1.34, v6.1.33, v6.1.32 |
|
#
02534c8e |
| 01-Jun-2023 |
Charles Keepax <ckeepax@opensource.cirrus.com> |
regmap: regmap-irq: Move handle_post_irq to before pm_runtime_put
Typically handle_post_irq is going to be used to manage some additional chip specific hardware operations required on each IRQ, thes
regmap: regmap-irq: Move handle_post_irq to before pm_runtime_put
Typically handle_post_irq is going to be used to manage some additional chip specific hardware operations required on each IRQ, these are very likely to want the chip to be resumed. For example the current in tree user max77620 uses this to toggle a global mask bit, which would obviously want the device resumed. It is worth noting this device does not specify the runtime_pm flag in regmap_irq_chip, so there is no actual issue.
Move the callback to before the pm_runtime_put, so it will be called whilst the device is still resumed.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230601101036.1499612-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.1.31, v6.1.30, v6.1.29, v6.1.28 |
|
#
0a3a5687 |
| 11-May-2023 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Drop backward compatibility for inverted mask/unmask
All users must now specify .mask_unmask_non_inverted = true to ensure they are using the expected semantics: 1s disable IRQs in the m
regmap-irq: Drop backward compatibility for inverted mask/unmask
All users must now specify .mask_unmask_non_inverted = true to ensure they are using the expected semantics: 1s disable IRQs in the mask registers, and enable IRQs in the unmask registers.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.kernel.org/r/20230511091342.26604-5-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org
show more ...
|
#
a240d23e |
| 11-May-2023 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Minor adjustments to .handle_mask_sync()
If a .handle_mask_sync() callback is provided it supersedes all inbuilt handling of mask registers, and judging by the commit 69af4bcaa08d ("regm
regmap-irq: Minor adjustments to .handle_mask_sync()
If a .handle_mask_sync() callback is provided it supersedes all inbuilt handling of mask registers, and judging by the commit 69af4bcaa08d ("regmap-irq: Add handle_mask_sync() callback") it is intended to completely replace all default IRQ masking logic.
The implementation has two minor inconsistencies, which can be fixed without breaking compatibility:
(1) mask_base must be set to enable .handle_mask_sync(), even though mask_base is otherwise unused. This is easily fixed because mask_base is already optional.
(2) Unmask registers aren't accounted for -- they are part of the default IRQ masking logic and are just a bit-inverted version of mask registers. It would be a bad idea to allow them to be used at the same time as .handle_mask_sync(), as the result would be confusing and unmaintainable, so make sure this can't happen.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.kernel.org/r/20230511091342.26604-4-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org
show more ...
|
#
72cc0f52 |
| 11-May-2023 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Remove support for not_fixed_stride
No remaining users, use a custom .get_irq_reg() callback instead.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.ker
regmap-irq: Remove support for not_fixed_stride
No remaining users, use a custom .get_irq_reg() callback instead.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.kernel.org/r/20230511091342.26604-3-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org
show more ...
|
#
f05cbadc |
| 11-May-2023 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Remove type registers
No remaining users, these have been replaced by config registers.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.kernel.org/r/2023
regmap-irq: Remove type registers
No remaining users, these have been replaced by config registers.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.kernel.org/r/20230511091342.26604-2-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org
show more ...
|
#
f33a751d |
| 09-May-2023 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Remove virtual registers
No remaining users, and it's been replaced by config registers.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.kernel.org/r/202
regmap-irq: Remove virtual registers
No remaining users, and it's been replaced by config registers.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.kernel.org/r/20230509110100.3980123-3-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org
show more ...
|
Revision tags: v6.1.27, v6.1.26, v6.3, v6.1.25, v6.1.24 |
|
#
69da5aa9 |
| 07-Apr-2023 |
William Breathitt Gray <william.gray@linaro.org> |
regmap-irq: Drop map from handle_mask_sync() parameters
Remove the map parameter from the struct regmap_irq_chip callback handle_mask_sync() because it can be passed via the irq_drv_data parameter i
regmap-irq: Drop map from handle_mask_sync() parameters
Remove the map parameter from the struct regmap_irq_chip callback handle_mask_sync() because it can be passed via the irq_drv_data parameter instead. The gpio-104-dio-48e driver is the only consumer of this callback and is thus updated accordingly.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org Signed-off-by: William Breathitt Gray <william.gray@linaro.org Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com Link: https://lore.kernel.org/r/1f44fb0fbcd3dccea3371215b00f1b9a956c1a12.1679323449.git.william.gray@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org
show more ...
|
Revision tags: v6.1.23 |
|
#
7697c64b |
| 05-Apr-2023 |
William Breathitt Gray <william.gray@linaro.org> |
regmap: Pass irq_drv_data as a parameter for set_type_config()
Allow the struct regmap_irq_chip set_type_config() callback to access irq_drv_data by passing it as a parameter.
Signed-off-by: Willia
regmap: Pass irq_drv_data as a parameter for set_type_config()
Allow the struct regmap_irq_chip set_type_config() callback to access irq_drv_data by passing it as a parameter.
Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20e15cd3afae80922b7e0577c7741df86b3390c5.1680708357.git.william.gray@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.1.22, v6.1.21, v6.1.20, v6.1.19, v6.1.18, v6.1.17, v6.1.16, v6.1.15 |
|
#
4d60cac9 |
| 27-Feb-2023 |
William Breathitt Gray <william.gray@linaro.org> |
regmap-irq: Add no_status support
Some devices lack status registers, yet expect to handle interrupts. Introduce a no_status flag to indicate such a configuration, where rather than read a status re
regmap-irq: Add no_status support
Some devices lack status registers, yet expect to handle interrupts. Introduce a no_status flag to indicate such a configuration, where rather than read a status register to verify, all interrupts received are assumed to be active.
Cc: Mark Brown <broonie@kernel.org> Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Link: https://lore.kernel.org/r/bd501b4b5ff88da24d467f75e8c71b4e0e6f21e2.1677515341.git.william.gray@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.1.14, v6.1.13, v6.2 |
|
#
c74e7af1 |
| 16-Feb-2023 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Remove unused mask_invert flag
mask_invert is deprecated and no longer used; it can now be removed.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kern
regmap-irq: Remove unused mask_invert flag
mask_invert is deprecated and no longer used; it can now be removed.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20230216223200.150679-2-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
483e6ea1 |
| 16-Feb-2023 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Remove unused type_invert flag
type_invert is deprecated and no longer used; it can now be removed.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kern
regmap-irq: Remove unused type_invert flag
type_invert is deprecated and no longer used; it can now be removed.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20230216223200.150679-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.1.12, v6.1.11, v6.1.10, v6.1.9, v6.1.8, v6.1.7, v6.1.6, v6.1.5, v6.0.19, v6.0.18, v6.1.4, v6.1.3, v6.0.17, v6.1.2, v6.0.16, v6.1.1, v6.0.15, v6.0.14, v6.0.13, v6.1, v6.0.12, v6.0.11, v6.0.10, v5.15.80 |
|
#
69af4bca |
| 22-Nov-2022 |
William Breathitt Gray <william.gray@linaro.org> |
regmap-irq: Add handle_mask_sync() callback
Provide a public callback handle_mask_sync() that drivers can use when they have more complex IRQ masking logic. The default implementation is regmap_irq_
regmap-irq: Add handle_mask_sync() callback
Provide a public callback handle_mask_sync() that drivers can use when they have more complex IRQ masking logic. The default implementation is regmap_irq_handle_mask_sync(), used if the chip doesn't provide its own callback.
Cc: Mark Brown <broonie@kernel.org> Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Link: https://lore.kernel.org/r/e083474b3d467a86e6cb53da8072de4515bd6276.1669100542.git.william.gray@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.0.9, v5.15.79, v6.0.8, v5.15.78 |
|
#
84498d1f |
| 07-Nov-2022 |
Yassine Oudjana <y.oudjana@protonmail.com> |
regmap-irq: Use the new num_config_regs property in regmap_add_irq_chip_fwnode
Commit faa87ce9196d ("regmap-irq: Introduce config registers for irq types") added the num_config_regs, then commit 9ed
regmap-irq: Use the new num_config_regs property in regmap_add_irq_chip_fwnode
Commit faa87ce9196d ("regmap-irq: Introduce config registers for irq types") added the num_config_regs, then commit 9edd4f5aee84 ("regmap-irq: Deprecate type registers and virtual registers") suggested to replace num_type_reg with it. However, regmap_add_irq_chip_fwnode wasn't modified to use the new property. Later on, commit 255a03bb1bb3 ("ASoC: wcd9335: Convert irq chip to config regs") removed the old num_type_reg property from the WCD9335 driver's struct regmap_irq_chip, causing a null pointer dereference in regmap_irq_set_type when it tried to index d->type_buf as it was never allocated in regmap_add_irq_chip_fwnode:
[ 39.199374] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[ 39.200006] Call trace: [ 39.200014] regmap_irq_set_type+0x84/0x1c0 [ 39.200026] __irq_set_trigger+0x60/0x1c0 [ 39.200040] __setup_irq+0x2f4/0x78c [ 39.200051] request_threaded_irq+0xe8/0x1a0
Use num_config_regs in regmap_add_irq_chip_fwnode instead of num_type_reg, and fall back to it if num_config_regs isn't defined to maintain backward compatibility.
Fixes: faa87ce9196d ("regmap-irq: Introduce config registers for irq types") Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Link: https://lore.kernel.org/r/20221107202114.823975-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v6.0.7, v5.15.77, v5.15.76, v6.0.6, v6.0.5, v5.15.75, v6.0.4, v6.0.3, v6.0.2, v5.15.74, v5.15.73, v6.0.1, v5.15.72, v6.0, v5.15.71, v5.15.70, v5.15.69, v5.15.68, v5.15.67, v5.15.66, v5.15.65, v5.15.64, v5.15.63, v5.15.62, v5.15.61, v5.15.60, v5.15.59, v5.19, v5.15.58, v5.15.57, v5.15.56, v5.15.55, v5.15.54, v5.15.53 |
|
#
773d09b4 |
| 04-Jul-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Fix bug in regmap_irq_get_irq_reg_linear()
irq_reg_stride in struct regmap_irq_chip is often 0, but that actually means to use the default stride of 1. The effective stride is stored in
regmap-irq: Fix bug in regmap_irq_get_irq_reg_linear()
irq_reg_stride in struct regmap_irq_chip is often 0, but that actually means to use the default stride of 1. The effective stride is stored in struct regmap_irq_chip_data->irq_reg_stride and will get the corrected default value.
The default ->get_irq_reg() callback was using the stride from the chip definition, which is wrong; fix it to use the effective stride from the chip data instead.
Link: https://lore.kernel.org/lkml/acaaf77f-3282-8544-dd3c-7915fc1a6a4f@samsung.com/ Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220704112847.23844-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
Revision tags: v5.15.52, v5.15.51, v5.15.50 |
|
#
48e014ee |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Deprecate the not_fixed_stride flag
This flag is a bit of a hack and the same thing can be accomplished using a custom ->get_irq_reg() callback. Add a warning to catch any use of the fla
regmap-irq: Deprecate the not_fixed_stride flag
This flag is a bit of a hack and the same thing can be accomplished using a custom ->get_irq_reg() callback. Add a warning to catch any use of the flag.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-13-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
bdf9b86c |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Add get_irq_reg() callback
Replace the internal sub_irq_reg() function with a public callback that drivers can use when they have more complex register layouts. The default implementatio
regmap-irq: Add get_irq_reg() callback
Replace the internal sub_irq_reg() function with a public callback that drivers can use when they have more complex register layouts. The default implementation is regmap_irq_get_irq_reg_linear(), used if the chip doesn't provide its own callback.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-12-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
e8ffb12e |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Fix inverted handling of unmask registers
To me "unmask" suggests that we write 1s to the register when an interrupt is enabled. This also makes sense because it's the opposite of what t
regmap-irq: Fix inverted handling of unmask registers
To me "unmask" suggests that we write 1s to the register when an interrupt is enabled. This also makes sense because it's the opposite of what the "mask" register does (write 1s to disable an interrupt).
But regmap-irq does the opposite: for a disabled interrupt, it writes 1s to "unmask" and 0s to "mask". This is surprising and deviates from the usual way mask registers are handled.
Additionally, mask_invert didn't interact with unmask registers properly -- it caused them to be ignored entirely.
Fix this by making mask and unmask registers orthogonal, using the following behavior:
* Mask registers are written with 1s for disabled interrupts. * Unmask registers are written with 1s for enabled interrupts.
This behavior supports both normal or inverted mask registers and separate set/clear registers via different combinations of mask_base/unmask_base.
The old unmask register behavior is deprecated. Drivers need to opt-in to the new behavior by setting mask_unmask_non_inverted. Warnings are issued if the driver relies on deprecated behavior. Chips that only set one of mask_base/unmask_base don't have to use the mask_unmask_non_inverted flag because that use case was previously not supported.
The mask_invert flag is also deprecated in favor of describing inverted mask registers as unmask registers.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-11-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
9edd4f5a |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Deprecate type registers and virtual registers
Config registers can be used to replace both type and virtual registers, so mark both features are deprecated and issue a warning if they'r
regmap-irq: Deprecate type registers and virtual registers
Config registers can be used to replace both type and virtual registers, so mark both features are deprecated and issue a warning if they're used.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-10-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
faa87ce9 |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Introduce config registers for irq types
Config registers provide a more uniform approach to handling irq type registers. They are essentially an extension of the virtual registers used
regmap-irq: Introduce config registers for irq types
Config registers provide a more uniform approach to handling irq type registers. They are essentially an extension of the virtual registers used by the qcom-pm8008 driver.
Config registers can be represented as a 2D array:
config_base[0] reg0,0 reg0,1 reg0,2 reg0,3 config_base[1] reg1,0 reg1,1 reg1,2 reg1,3 config_base[2] reg2,0 reg2,1 reg2,2 reg2,3
There are 'num_config_bases' base registers, each of which is used to address 'num_config_regs' registers. The addresses are calculated in the same way as for other bases. It is assumed that an irq's type is controlled by one column of registers; that column is identified by the irq's 'type_reg_offset'.
The set_type_config() callback is responsible for updating the config register contents. It receives an array of buffers (each represents a row of registers) and the index of the column to update, along with the 'struct regmap_irq' description and requested irq type.
Buffered values are written to registers in regmap_irq_sync_unlock(). Note that the entire register contents are overwritten, which is a minor change in behavior from type registers via 'type_base'.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-9-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
f7cc5062 |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Refactor checks for status bulk read support
There are several conditions that must be satisfied to support bulk read of status registers. Move the check into a function to avoid duplica
regmap-irq: Refactor checks for status bulk read support
There are several conditions that must be satisfied to support bulk read of status registers. Move the check into a function to avoid duplicating it in two places.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-8-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
ad22b3e9 |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Remove mask_writeonly and regmap_irq_update_bits()
Commit a71411dbf6c8 ("regmap: irq: add chip option mask_writeonly") introduced the mask_writeonly option, but it isn't used now and it
regmap-irq: Remove mask_writeonly and regmap_irq_update_bits()
Commit a71411dbf6c8 ("regmap: irq: add chip option mask_writeonly") introduced the mask_writeonly option, but it isn't used now and it appears it's never been used by any in-tree drivers. The motivation for the option is mentioned in the commit message,
Some irq controllers have writeonly/multipurpose register layouts. In those cases we read invalid data back. [...]
The option causes mask register updates to use regmap_write_bits() instead of regmap_update_bits().
However, regmap_write_bits() doesn't solve the reading invalid data problem. It's still a read-modify-write op like regmap_update_bits(). The difference is that 'update bits' will only write the new value if it is different from the current value, while 'write bits' will write the new value unconditionally, even if it's the same as the current value.
This seems like a bit of a specialized use case and probably isn't that useful for regmap-irq, so let's just remove the option and go back to using an 'update bits' op for the mask registers. We can always add the option back if some driver ends up needing it in the future.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-7-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
6b0c3174 |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Remove inappropriate uses of regmap_irq_update_bits()
regmap_irq_update_bits() is misnamed and should only be used for updating mask registers, since it checks the mask_writeonly flag. H
regmap-irq: Remove inappropriate uses of regmap_irq_update_bits()
regmap_irq_update_bits() is misnamed and should only be used for updating mask registers, since it checks the mask_writeonly flag. However, it was also used for updating wake and type registers.
It's safe to replace these uses with regmap_update_bits() because there are no users of the mask_writeonly flag.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-6-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
610fdd66 |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Remove an unnecessary restriction on type_in_mask
Check types_supported instead of checking type_rising/falling_val when using type_in_mask interrupts. This makes the intent clearer and
regmap-irq: Remove an unnecessary restriction on type_in_mask
Check types_supported instead of checking type_rising/falling_val when using type_in_mask interrupts. This makes the intent clearer and allows a type_in_mask irq to support level or edge triggers, rather than only edge triggers.
Update the documentation and comments to reflect the new behavior.
This shouldn't affect existing drivers, because if they didn't set types_supported properly the type buffer wouldn't be updated.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-5-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|
#
cffc2be3 |
| 23-Jun-2022 |
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> |
regmap-irq: Cleanup sizeof(...) use in memory allocation
Instead of mentioning unsigned int directly, use a sizeof(...) involving the buffer we're allocating to ensure the types don't get out of syn
regmap-irq: Cleanup sizeof(...) use in memory allocation
Instead of mentioning unsigned int directly, use a sizeof(...) involving the buffer we're allocating to ensure the types don't get out of sync.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20220623211420.918875-4-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
show more ...
|