Compare
b86eaddf467a9ddb69dbaa46eea9dda7f93347a3..2e42cade8ff1ff579e77976d9869db4df1feaf74
regmap: irq: Free the irqdomain we create
When domain support was added to regmap-irq it was not possible to remove domains, this was added later by 8ee99ada293b (irqdomain: Support removal of IRQ domains.). We did update the main removal path to free the domain but forgot the error unwinding case during creation that is now in regmap_add_irq_chip_fwnode() after some code motion, meaning that errors during instantiation result in an unused irqchip being left hanging around. Add the missing irq_remove_domain() call where the comment says it should be. Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu> Reported-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260901-regmap-irq-deallocate-domain-v1-1-4bfed4aff559@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown <broonie@kernel.org> · 2026-09-01 21:55 UTC
3 files changed,
+25
−170
- arch/arm64/boot/dts/nvidia/tegra264-p4071-0000+p3834.dtsi
- arch/arm64/boot/dts/nvidia/tegra264.dtsi
- drivers/base/regmap/regmap-irq.c
modified arch/arm64/boot/dts/nvidia/tegra264-p4071-0000+p3834.dtsi
| @@ -9,17 +9,4 @@ | |||
| 9 | 9 | chosen { | |
| 10 | 10 | stdout-path = "serial0:115200n8"; | |
| 11 | 11 | }; | |
| 12 | - | ||
| 13 | - | bus@0 { | |
| 14 | - | pwm@c6a0000 { | |
| 15 | - | status = "okay"; | |
| 16 | - | }; | |
| 17 | - | }; | |
| 18 | - | ||
| 19 | - | fan: pwm-fan { | |
| 20 | - | compatible = "pwm-fan"; | |
| 21 | - | cooling-levels = <77 102 140 192 255>; | |
| 22 | - | pwms = <&pwm4 0 40000>; | |
| 23 | - | #cooling-cells = <2>; | |
| 24 | - | }; | |
| 25 | 12 | }; | |
modified arch/arm64/boot/dts/nvidia/tegra264.dtsi
| @@ -3356,18 +3356,6 @@ | |||
| 3356 | 3356 | status = "disabled"; | |
| 3357 | 3357 | }; | |
| 3358 | 3358 | ||
| 3359 | - | pwm4: pwm@c6a0000 { | |
| 3360 | - | compatible = "nvidia,tegra264-pwm"; | |
| 3361 | - | reg = <0x0 0xc6a0000 0x0 0x10000>; | |
| 3362 | - | status = "disabled"; | |
| 3363 | - | ||
| 3364 | - | clocks = <&bpmp TEGRA264_CLK_PWM4>; | |
| 3365 | - | resets = <&bpmp TEGRA264_RESET_PWM4>; | |
| 3366 | - | reset-names = "pwm"; | |
| 3367 | - | ||
| 3368 | - | #pwm-cells = <2>; | |
| 3369 | - | }; | |
| 3370 | - | ||
| 3371 | 3359 | pinmux_aon: pinmux@c7a2000 { | |
| 3372 | 3360 | compatible = "nvidia,tegra264-pinmux-aon"; | |
| 3373 | 3361 | reg = <0x0 0x0c7a2000 0x0 0x2000>; | |
| @@ -3549,11 +3537,11 @@ | |||
| 3549 | 3537 | ||
| 3550 | 3538 | pci@c000000 { | |
| 3551 | 3539 | compatible = "nvidia,tegra264-pcie"; | |
| 3552 | - | reg = <0x00 0x0c000000 0x0 0x00004000>, | |
| 3540 | + | reg = <0xd0 0xb0000000 0x0 0x10000000>, | |
| 3541 | + | <0x00 0x0c000000 0x0 0x00004000>, | |
| 3553 | 3542 | <0x00 0x0c004000 0x0 0x00001000>, | |
| 3554 | - | <0x00 0x0c005000 0x0 0x00001000>, | |
| 3555 | - | <0xd0 0xb0000000 0x0 0x10000000>; | |
| 3556 | - | reg-names = "xal", "xtl", "xtl-pri", "ecam"; | |
| 3543 | + | <0x00 0x0c005000 0x0 0x00001000>; | |
| 3544 | + | reg-names = "ecam", "xal", "xtl", "xtl-pri"; | |
| 3557 | 3545 | #address-cells = <3>; | |
| 3558 | 3546 | #size-cells = <2>; | |
| 3559 | 3547 | device_type = "pci"; | |
| @@ -3577,16 +3565,6 @@ | |||
| 3577 | 3565 | ||
| 3578 | 3566 | nvidia,bpmp = <&bpmp 0>; | |
| 3579 | 3567 | status = "disabled"; | |
| 3580 | - | ||
| 3581 | - | pcie@0 { | |
| 3582 | - | device_type = "pci"; | |
| 3583 | - | compatible = "pciclass,0604"; | |
| 3584 | - | reg = <0x0 0x0 0x0 0x0 0x0>; | |
| 3585 | - | bus-range = <0x01 0xff>; | |
| 3586 | - | #address-cells = <3>; | |
| 3587 | - | #size-cells = <2>; | |
| 3588 | - | ranges; | |
| 3589 | - | }; | |
| 3590 | 3568 | }; | |
| 3591 | 3569 | ||
| 3592 | 3570 | pinmux_main: pinmux@c281000 { | |
| @@ -3683,66 +3661,6 @@ | |||
| 3683 | 3661 | status = "disabled"; | |
| 3684 | 3662 | }; | |
| 3685 | 3663 | ||
| 3686 | - | pwm2: pwm@c5e0000 { | |
| 3687 | - | compatible = "nvidia,tegra264-pwm"; | |
| 3688 | - | reg = <0x0 0xc5e0000 0x0 0x10000>; | |
| 3689 | - | status = "disabled"; | |
| 3690 | - | ||
| 3691 | - | clocks = <&bpmp TEGRA264_CLK_PWM2>; | |
| 3692 | - | resets = <&bpmp TEGRA264_RESET_PWM2>; | |
| 3693 | - | reset-names = "pwm"; | |
| 3694 | - | ||
| 3695 | - | #pwm-cells = <2>; | |
| 3696 | - | }; | |
| 3697 | - | ||
| 3698 | - | pwm3: pwm@c5f0000 { | |
| 3699 | - | compatible = "nvidia,tegra264-pwm"; | |
| 3700 | - | reg = <0x0 0xc5f0000 0x0 0x10000>; | |
| 3701 | - | status = "disabled"; | |
| 3702 | - | ||
| 3703 | - | clocks = <&bpmp TEGRA264_CLK_PWM3>; | |
| 3704 | - | resets = <&bpmp TEGRA264_RESET_PWM3>; | |
| 3705 | - | reset-names = "pwm"; | |
| 3706 | - | ||
| 3707 | - | #pwm-cells = <2>; | |
| 3708 | - | }; | |
| 3709 | - | ||
| 3710 | - | pwm5: pwm@c600000 { | |
| 3711 | - | compatible = "nvidia,tegra264-pwm"; | |
| 3712 | - | reg = <0x0 0xc600000 0x0 0x10000>; | |
| 3713 | - | status = "disabled"; | |
| 3714 | - | ||
| 3715 | - | clocks = <&bpmp TEGRA264_CLK_PWM5>; | |
| 3716 | - | resets = <&bpmp TEGRA264_RESET_PWM5>; | |
| 3717 | - | reset-names = "pwm"; | |
| 3718 | - | ||
| 3719 | - | #pwm-cells = <2>; | |
| 3720 | - | }; | |
| 3721 | - | ||
| 3722 | - | pwm9: pwm@c610000 { | |
| 3723 | - | compatible = "nvidia,tegra264-pwm"; | |
| 3724 | - | reg = <0x0 0xc610000 0x0 0x10000>; | |
| 3725 | - | status = "disabled"; | |
| 3726 | - | ||
| 3727 | - | clocks = <&bpmp TEGRA264_CLK_PWM9>; | |
| 3728 | - | resets = <&bpmp TEGRA264_RESET_PWM9>; | |
| 3729 | - | reset-names = "pwm"; | |
| 3730 | - | ||
| 3731 | - | #pwm-cells = <2>; | |
| 3732 | - | }; | |
| 3733 | - | ||
| 3734 | - | pwm10: pwm@c620000 { | |
| 3735 | - | compatible = "nvidia,tegra264-pwm"; | |
| 3736 | - | reg = <0x0 0xc620000 0x0 0x10000>; | |
| 3737 | - | status = "disabled"; | |
| 3738 | - | ||
| 3739 | - | clocks = <&bpmp TEGRA264_CLK_PWM10>; | |
| 3740 | - | resets = <&bpmp TEGRA264_RESET_PWM10>; | |
| 3741 | - | reset-names = "pwm"; | |
| 3742 | - | ||
| 3743 | - | #pwm-cells = <2>; | |
| 3744 | - | }; | |
| 3745 | - | ||
| 3746 | 3664 | i2c0: i2c@c630000 { | |
| 3747 | 3665 | compatible = "nvidia,tegra264-i2c"; | |
| 3748 | 3666 | reg = <0x00 0x0c630000 0x0 0x10000>; | |
| @@ -4072,12 +3990,12 @@ | |||
| 4072 | 3990 | ||
| 4073 | 3991 | pci@8400000 { | |
| 4074 | 3992 | compatible = "nvidia,tegra264-pcie"; | |
| 4075 | - | reg = <0x00 0x08400000 0x0 0x00004000>, | |
| 3993 | + | reg = <0xa8 0xb0000000 0x0 0x10000000>, | |
| 3994 | + | <0x00 0x08400000 0x0 0x00004000>, | |
| 4076 | 3995 | <0x00 0x08404000 0x0 0x00001000>, | |
| 4077 | 3996 | <0x00 0x08405000 0x0 0x00001000>, | |
| 4078 | - | <0x00 0x08410000 0x0 0x00010000>, | |
| 4079 | - | <0xa8 0xb0000000 0x0 0x10000000>; | |
| 4080 | - | reg-names = "xal", "xtl", "xtl-pri", "xpl", "ecam"; | |
| 3997 | + | <0x00 0x08410000 0x0 0x00010000>; | |
| 3998 | + | reg-names = "ecam", "xal", "xtl", "xtl-pri", "xpl"; | |
| 4081 | 3999 | #address-cells = <3>; | |
| 4082 | 4000 | #size-cells = <2>; | |
| 4083 | 4001 | device_type = "pci"; | |
| @@ -4100,26 +4018,16 @@ | |||
| 4100 | 4018 | ||
| 4101 | 4019 | nvidia,bpmp = <&bpmp 1>; | |
| 4102 | 4020 | status = "disabled"; | |
| 4103 | - | ||
| 4104 | - | pcie@0 { | |
| 4105 | - | device_type = "pci"; | |
| 4106 | - | compatible = "pciclass,0604"; | |
| 4107 | - | reg = <0x0 0x0 0x0 0x0 0x0>; | |
| 4108 | - | bus-range = <0x01 0xff>; | |
| 4109 | - | #address-cells = <3>; | |
| 4110 | - | #size-cells = <2>; | |
| 4111 | - | ranges; | |
| 4112 | - | }; | |
| 4113 | 4021 | }; | |
| 4114 | 4022 | ||
| 4115 | 4023 | pci@8420000 { | |
| 4116 | 4024 | compatible = "nvidia,tegra264-pcie"; | |
| 4117 | - | reg = <0x00 0x08420000 0x0 0x00004000>, | |
| 4025 | + | reg = <0xb0 0xb0000000 0x0 0x10000000>, | |
| 4026 | + | <0x00 0x08420000 0x0 0x00004000>, | |
| 4118 | 4027 | <0x00 0x08424000 0x0 0x00001000>, | |
| 4119 | 4028 | <0x00 0x08425000 0x0 0x00001000>, | |
| 4120 | - | <0x00 0x08430000 0x0 0x00010000>, | |
| 4121 | - | <0xb0 0xb0000000 0x0 0x10000000>; | |
| 4122 | - | reg-names = "xal", "xtl", "xtl-pri", "xpl", "ecam"; | |
| 4029 | + | <0x00 0x08430000 0x0 0x00010000>; | |
| 4030 | + | reg-names = "ecam", "xal", "xtl", "xtl-pri", "xpl"; | |
| 4123 | 4031 | #address-cells = <3>; | |
| 4124 | 4032 | #size-cells = <2>; | |
| 4125 | 4033 | device_type = "pci"; | |
| @@ -4142,26 +4050,16 @@ | |||
| 4142 | 4050 | ||
| 4143 | 4051 | nvidia,bpmp = <&bpmp 2>; | |
| 4144 | 4052 | status = "disabled"; | |
| 4145 | - | ||
| 4146 | - | pcie@0 { | |
| 4147 | - | device_type = "pci"; | |
| 4148 | - | compatible = "pciclass,0604"; | |
| 4149 | - | reg = <0x0 0x0 0x0 0x0 0x0>; | |
| 4150 | - | bus-range = <0x01 0xff>; | |
| 4151 | - | #address-cells = <3>; | |
| 4152 | - | #size-cells = <2>; | |
| 4153 | - | ranges; | |
| 4154 | - | }; | |
| 4155 | 4053 | }; | |
| 4156 | 4054 | ||
| 4157 | 4055 | pci@8440000 { | |
| 4158 | 4056 | compatible = "nvidia,tegra264-pcie"; | |
| 4159 | - | reg = <0x00 0x08440000 0x0 0x00004000>, | |
| 4057 | + | reg = <0xb8 0xb0000000 0x0 0x10000000>, | |
| 4058 | + | <0x00 0x08440000 0x0 0x00004000>, | |
| 4160 | 4059 | <0x00 0x08444000 0x0 0x00001000>, | |
| 4161 | 4060 | <0x00 0x08445000 0x0 0x00001000>, | |
| 4162 | - | <0x00 0x08450000 0x0 0x00010000>, | |
| 4163 | - | <0xb8 0xb0000000 0x0 0x10000000>; | |
| 4164 | - | reg-names = "xal", "xtl", "xtl-pri", "xpl", "ecam"; | |
| 4061 | + | <0x00 0x08450000 0x0 0x00010000>; | |
| 4062 | + | reg-names = "ecam", "xal", "xtl", "xtl-pri", "xpl"; | |
| 4165 | 4063 | #address-cells = <3>; | |
| 4166 | 4064 | #size-cells = <2>; | |
| 4167 | 4065 | device_type = "pci"; | |
| @@ -4184,26 +4082,16 @@ | |||
| 4184 | 4082 | ||
| 4185 | 4083 | nvidia,bpmp = <&bpmp 3>; | |
| 4186 | 4084 | status = "disabled"; | |
| 4187 | - | ||
| 4188 | - | pcie@0 { | |
| 4189 | - | device_type = "pci"; | |
| 4190 | - | compatible = "pciclass,0604"; | |
| 4191 | - | reg = <0x0 0x0 0x0 0x0 0x0>; | |
| 4192 | - | bus-range = <0x01 0xff>; | |
| 4193 | - | #address-cells = <3>; | |
| 4194 | - | #size-cells = <2>; | |
| 4195 | - | ranges; | |
| 4196 | - | }; | |
| 4197 | 4085 | }; | |
| 4198 | 4086 | ||
| 4199 | 4087 | pci@8460000 { | |
| 4200 | 4088 | compatible = "nvidia,tegra264-pcie"; | |
| 4201 | - | reg = <0x00 0x08460000 0x0 0x00004000>, | |
| 4089 | + | reg = <0xc0 0xb0000000 0x0 0x10000000>, | |
| 4090 | + | <0x00 0x08460000 0x0 0x00004000>, | |
| 4202 | 4091 | <0x00 0x08464000 0x0 0x00001000>, | |
| 4203 | 4092 | <0x00 0x08465000 0x0 0x00001000>, | |
| 4204 | - | <0x00 0x08470000 0x0 0x00010000>, | |
| 4205 | - | <0xc0 0xb0000000 0x0 0x10000000>; | |
| 4206 | - | reg-names = "xal", "xtl", "xtl-pri", "xpl", "ecam"; | |
| 4093 | + | <0x00 0x08470000 0x0 0x00010000>; | |
| 4094 | + | reg-names = "ecam", "xal", "xtl", "xtl-pri", "xpl"; | |
| 4207 | 4095 | #address-cells = <3>; | |
| 4208 | 4096 | #size-cells = <2>; | |
| 4209 | 4097 | device_type = "pci"; | |
| @@ -4226,26 +4114,16 @@ | |||
| 4226 | 4114 | ||
| 4227 | 4115 | nvidia,bpmp = <&bpmp 4>; | |
| 4228 | 4116 | status = "disabled"; | |
| 4229 | - | ||
| 4230 | - | pcie@0 { | |
| 4231 | - | device_type = "pci"; | |
| 4232 | - | compatible = "pciclass,0604"; | |
| 4233 | - | reg = <0x0 0x0 0x0 0x0 0x0>; | |
| 4234 | - | bus-range = <0x01 0xff>; | |
| 4235 | - | #address-cells = <3>; | |
| 4236 | - | #size-cells = <2>; | |
| 4237 | - | ranges; | |
| 4238 | - | }; | |
| 4239 | 4117 | }; | |
| 4240 | 4118 | ||
| 4241 | 4119 | pci@8480000 { | |
| 4242 | 4120 | compatible = "nvidia,tegra264-pcie"; | |
| 4243 | - | reg = <0x00 0x08480000 0x0 0x00004000>, | |
| 4121 | + | reg = <0xc8 0xb0000000 0x0 0x10000000>, | |
| 4122 | + | <0x00 0x08480000 0x0 0x00004000>, | |
| 4244 | 4123 | <0x00 0x08484000 0x0 0x00001000>, | |
| 4245 | 4124 | <0x00 0x08485000 0x0 0x00001000>, | |
| 4246 | - | <0x00 0x08490000 0x0 0x00010000>, | |
| 4247 | - | <0xc8 0xb0000000 0x0 0x10000000>; | |
| 4248 | - | reg-names = "xal", "xtl", "xtl-pri", "xpl", "ecam"; | |
| 4125 | + | <0x00 0x08490000 0x0 0x00010000>; | |
| 4126 | + | reg-names = "ecam", "xal", "xtl", "xtl-pri", "xpl"; | |
| 4249 | 4127 | #address-cells = <3>; | |
| 4250 | 4128 | #size-cells = <2>; | |
| 4251 | 4129 | device_type = "pci"; | |
| @@ -4268,16 +4146,6 @@ | |||
| 4268 | 4146 | ||
| 4269 | 4147 | nvidia,bpmp = <&bpmp 5>; | |
| 4270 | 4148 | status = "disabled"; | |
| 4271 | - | ||
| 4272 | - | pcie@0 { | |
| 4273 | - | device_type = "pci"; | |
| 4274 | - | compatible = "pciclass,0604"; | |
| 4275 | - | reg = <0x0 0x0 0x0 0x0 0x0>; | |
| 4276 | - | bus-range = <0x01 0xff>; | |
| 4277 | - | #address-cells = <3>; | |
| 4278 | - | #size-cells = <2>; | |
| 4279 | - | ranges; | |
| 4280 | - | }; | |
| 4281 | 4149 | }; | |
| 4282 | 4150 | }; | |
| 4283 | 4151 | ||
modified drivers/base/regmap/regmap-irq.c
| @@ -963,7 +963,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, | |||
| 963 | 963 | return 0; | |
| 964 | 964 | ||
| 965 | 965 | err_domain: | |
| 966 | - | /* Should really dispose of the domain but... */ | |
| 966 | + | irq_domain_remove(d->domain); | |
| 967 | 967 | err_mutex: | |
| 968 | 968 | mutex_destroy(&d->lock); | |
| 969 | 969 | lockdep_unregister_key(&d->lock_key); | |