Drivers: hv: Never allocate anything besides framebuffer from framebuffer memory region
Subsystems (5)
Sasha Levin
maintainerPATCH 5/5 drm/rockchip: Fix return type of cdn_dp_connector_mode_valid
In reply to Sasha LevinFrom: Nathan Huckleberry <[email protected]>
[ Upstream commit b0b9408f132623dc88e78adb5282f74e4b64bb57 ]
The mode_valid field in drm_connector_helper_funcs is expected to be of type:
enum drm_mode_status (* mode_valid) (struct drm_connector *connector,
struct drm_display_mode *mode);
The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition.
The return type of cdn_dp_connector_mode_valid should be changed from int to enum drm_mode_status.
--- drivers/gpu/drm/rockchip/cdn-dp-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/rockchip/cdn-dp-core.c +3 -2
@@ -275,8 +275,9 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)return ret; } -static int cdn_dp_connector_mode_valid (struct drm_connector *connector, -struct drm_display_mode *mode) +static enum drm_mode_status +cdn_dp_connector_mode_valid (struct drm_connector *connector, +struct drm_display_mode *mode) {struct cdn_dp_device *dp =connector_to_dp (connector);struct drm_display_info *display_info = &dp->connector.display_info;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 4/5 drm/amd/display: Limit user regamma to a valid value
In reply to Sasha LevinFrom: Yao Wang1 <[email protected]>
[ Upstream commit 3601d620f22e37740cf73f8278eabf9f2aa19eb7 ]
[Why]
For HDR mode, we get total 512 tf_point and after switching to SDR mode we actually get 400 tf_point and the rest of points(401~512) still use dirty value from HDR mode. We should limit the rest of the points to max value.
[How]
Limit the value when coordinates_x.x > 1, just like what we do in translate_from_linear_space for other re-gamma build paths.
--- drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +4 -0
@@ -1486,6 +1486,7 @@ static void interpolate_user_regamma(uint32_t hw_points_num,struct fixed31_32 lut2;struct fixed31_32 delta_lut;struct fixed31_32 delta_index; +const struct fixed31_32 one =dc_fixpt_from_int (1 ); i =0 ;/* fixed_pt library has problems handling too small values */
@@ -1514,6 +1515,9 @@ static void interpolate_user_regamma(uint32_t hw_points_num, }else hw_x = coordinates_x[i].x; +if (dc_fixpt_le (one, hw_x)) + hw_x = one; + norm_x =dc_fixpt_mul (norm_factor, hw_x); index =dc_fixpt_floor (norm_x);if (index <0 || index >255 )
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 3/5 drm/amdgpu: use dirty framebuffer helper
In reply to Sasha LevinFrom: Hamza Mahfooz <[email protected]>
[ Upstream commit 66f99628eb24409cb8feb5061f78283c8b65f820 ]
Currently, we aren't handling DRM_IOCTL_MODE_DIRTYFB. So, use drm_atomic_helper_dirtyfb() as the dirty callback in the amdgpu_fb_funcs struct.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -0
@@ -35,6 +35,7 @@#include <linux/pci.h> #include <linux/pm_runtime.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_damage_helper.h> #include <drm/drm_edid.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_helper.h>
@@ -495,6 +496,7 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,static const struct drm_framebuffer_funcs amdgpu_fb_funcs = { .destroy = drm_gem_fb_destroy, .create_handle = drm_gem_fb_create_handle, + .dirty = drm_atomic_helper_dirtyfb, }; uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 2/5 gpio: ixp4xx: Make irqchip immutable
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit 94e9bc73d85aa6ecfe249e985ff57abe0ab35f34 ]
This turns the IXP4xx GPIO irqchip into an immutable irqchip, a bit different from the standard template due to being hierarchical.
Tested on the IXP4xx which uses drivers/ata/pata_ixp4xx_cf.c for a rootfs on compact flash with IRQs from this GPIO block to the CF ATA controller.
--- drivers/gpio/gpio-ixp4xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/gpio/gpio-ixp4xx.c +14 -3
@@ -67,6 +67,14 @@ static void ixp4xx_gpio_irq_ack(struct irq_data *d)__raw_writel (BIT (d->hwirq), g->base +IXP4XX_REG_GPIS ); } +static void ixp4xx_gpio_mask_irq (struct irq_data *d) +{ +struct gpio_chip *gc =irq_data_get_irq_chip_data (d); + +irq_chip_mask_parent (d); +gpiochip_disable_irq (gc, d->hwirq); +} +static void ixp4xx_gpio_irq_unmask (struct irq_data *d) {struct gpio_chip *gc =irq_data_get_irq_chip_data (d);
@@ -76,6 +84,7 @@ static void ixp4xx_gpio_irq_unmask(struct irq_data *d)if (!(g->irq_edge &BIT (d->hwirq)))ixp4xx_gpio_irq_ack (d); +gpiochip_enable_irq (gc, d->hwirq);irq_chip_unmask_parent (d); }
@@ -153,12 +162,14 @@ static int ixp4xx_gpio_irq_set_type(struct irq_data *d, unsigned int type)return irq_chip_set_type_parent (d,IRQ_TYPE_LEVEL_HIGH ); } -static struct irq_chip ixp4xx_gpio_irqchip = { +static const struct irq_chip ixp4xx_gpio_irqchip = { .name ="IXP4GPIO" , .irq_ack = ixp4xx_gpio_irq_ack, - .irq_mask = irq_chip_mask_parent, + .irq_mask = ixp4xx_gpio_mask_irq, .irq_unmask = ixp4xx_gpio_irq_unmask, .irq_set_type = ixp4xx_gpio_irq_set_type, + .flags =IRQCHIP_IMMUTABLE , +GPIOCHIP_IRQ_RESOURCE_HELPERS , }; static int ixp4xx_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
@@ -282,7 +293,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev) g->gc.owner =THIS_MODULE ; girq = &g->gc.irq; - girq->chip = &ixp4xx_gpio_irqchip; +gpio_irq_chip_set_chip (girq, &ixp4xx_gpio_irqchip); girq->fwnode = g->fwnode; girq->parent_domain = parent; girq->child_to_parent_hwirq = ixp4xx_gpio_child_to_parent_hwirq;
Signature · 7 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 1/5 Drivers: hv: Never allocate anything besides framebuffer from framebuffer memory region
From: Vitaly Kuznetsov <[email protected]>
[ Upstream commit f0880e2cb7e1f8039a048fdd01ce45ab77247221 ]
Passed through PCI device sometimes misbehave on Gen1 VMs when Hyper-V DRM driver is also loaded. Looking at IOMEM assignment, we can see e.g.
$ cat /proc/iomem
...
f8000000-fffbffff : PCI Bus 0000:00
f8000000-fbffffff : 0000:00:08.0
f8000000-f8001fff : bb8c4f33-2ba2-4808-9f7f-02f3b4da22fe
...
fe0000000-fffffffff : PCI Bus 0000:00
fe0000000-fe07fffff : bb8c4f33-2ba2-4808-9f7f-02f3b4da22fe
fe0000000-fe07fffff : 2ba2:00:02.0
fe0000000-fe07fffff : mlx4_corethe interesting part is the 'f8000000' region as it is actually the VM's framebuffer:
$ lspci -v ... 0000:00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA (prog-if 00 [VGA controller]) Flags: bus master, fast devsel, latency 0, IRQ 11 Memory at f8000000 (32-bit, non-prefetchable) [size=64M] ...
hv_vmbus: registering driver hyperv_drm
hyperv_drm 5620e0c7-8062-4dce-aeb7-520c7ef76171: [drm] Synthvid Version major 3, minor 5 hyperv_drm 0000:00:08.0: vgaarb: deactivate vga console
hyperv_drm 0000:00:08.0: BAR 0: can't reserve [mem 0xf8000000-0xfbffffff]
hyperv_drm 5620e0c7-8062-4dce-aeb7-520c7ef76171: [drm] Cannot request framebuffer, boot fb still active?
Note: "Cannot request framebuffer" is not a fatal error in hyperv_setup_gen1() as the code assumes there's some other framebuffer device there but we actually have some other PCI device (mlx4 in this case) config space there!
The problem appears to be that vmbus_allocate_mmio() can use dedicated framebuffer region to serve any MMIO request from any device. The semantics one might assume of a parameter named "fb_overlap_ok" aren't implemented because !fb_overlap_ok essentially has no effect. The existing semantics are really "prefer_fb_overlap". This patch implements the expected and needed semantics, which is to not allocate from the frame buffer space when !fb_overlap_ok.
Note, Gen2 VMs are usually unaffected by the issue because framebuffer region is already taken by EFI fb (in case kernel supports it) but Gen1 VMs may have this region unclaimed by the time Hyper-V PCI pass-through driver tries allocating MMIO space if Hyper-V DRM/FB drivers load after it. Devices can be brought up in any sequence so let's resolve the issue by always ignoring 'fb_mmio' region for non-FB requests, even if the region is unclaimed.
--- drivers/hv/vmbus_drv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +9 -1
@@ -2075,7 +2075,7 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, bool fb_overlap_ok) {struct resource *iter, *shadow; -resource_size_t range_min, range_max, start; +resource_size_t range_min, range_max, start, end;const char *dev_n =dev_name (&device_obj->device);int retval;
@@ -2110,6 +2110,14 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, range_max = iter->end; start = (range_min + align -1 ) & ~(align -1 );for (; start + size -1 <= range_max; start += align) { + end = start + size -1 ; + +/* Skip the whole fb_mmio region if not fb_overlap_ok */ +if (!fb_overlap_ok && fb_mmio && + (((start >= fb_mmio->start) && (start <= fb_mmio->end)) || + ((end >= fb_mmio->start) && (end <= fb_mmio->end)))) +continue ; + shadow =__request_region (iter, start, size,NULL ,IORESOURCE_BUSY );if (!shadow)
Signature · 1 line
2.35.1
Re: [PATCH AUTOSEL 5.4 2/5] gpio: ixp4xx: Make irqchip immutable
In reply to Sasha LevinQuoted 12 lines · Sasha Levin
From: Linus Walleij <[email protected]>
[ Upstream commit
94e9bc73d85aa6ecfe249e985ff57abe0ab35f34]This turns the IXP4xx GPIO irqchip into an immutable irqchip, a bit different from the standard template due to being hierarchical.
Tested on the IXP4xx which uses
drivers/ata/pata_ixp4xx_cf.cfor a rootfs on compact flash with IRQs from this GPIO block to the CF ATA controller.
Quoted 5 lines
Cc Marc Zyngier <[email protected]>Signed-off-by Linus Walleij <[email protected]>Acked-by Marc Zyngier <[email protected]>Signed-off-by Bartosz Golaszewski <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Why? The required dependencies are only in 5,19, and are definitely NOT a stable candidate...
This isn't a fix by any stretch of the imagination.
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Re: [PATCH AUTOSEL 5.4 2/5] gpio: ixp4xx: Make irqchip immutable
Quoted 20 lines · Marc Zyngier
Quoted 12 lines · Sasha Levin
From: Linus Walleij <[email protected]>
[ Upstream commit
94e9bc73d85aa6ecfe249e985ff57abe0ab35f34]This turns the IXP4xx GPIO irqchip into an immutable irqchip, a bit different from the standard template due to being hierarchical.
Tested on the IXP4xx which uses
drivers/ata/pata_ixp4xx_cf.cfor a rootfs on compact flash with IRQs from this GPIO block to the CF ATA controller.Quoted 5 lines
Cc Marc Zyngier <[email protected]>Signed-off-by Linus Walleij <[email protected]>Acked-by Marc Zyngier <[email protected]>Signed-off-by Bartosz Golaszewski <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Quoted 5 lines
Why? The required dependencies are only in 5,19, and are definitely NOT a stable candidate...
This isn't a fix by any stretch of the imagination.
Hi Marc,
While I didn't mark it for stable (and it shouldn't go into any branch earlier than 5.19.x), I did send the patches making the irqchips immutable to Linus Torvalds as fixes as they technically do *fix* the warning emitted by gpiolib and make the implementation correct.
I think these patches should still be part of the v5.19.x stable branch.
Bart
Re: [PATCH AUTOSEL 5.4 2/5] gpio: ixp4xx: Make irqchip immutable
Hi Bartosz,
Quoted 28 lines · Bartosz Golaszewski
Quoted 20 lines · Marc Zyngier
Quoted 12 lines · Sasha Levin
From: Linus Walleij <[email protected]>
[ Upstream commit
94e9bc73d85aa6ecfe249e985ff57abe0ab35f34]This turns the IXP4xx GPIO irqchip into an immutable irqchip, a bit different from the standard template due to being hierarchical.
Tested on the IXP4xx which uses
drivers/ata/pata_ixp4xx_cf.cfor a rootfs on compact flash with IRQs from this GPIO block to the CF ATA controller.Quoted 5 lines
Cc Marc Zyngier <[email protected]>Signed-off-by Linus Walleij <[email protected]>Acked-by Marc Zyngier <[email protected]>Signed-off-by Bartosz Golaszewski <[email protected]>Signed-off-by Sasha Levin <[email protected]>Quoted 5 lines
Why? The required dependencies are only in 5,19, and are definitely NOT a stable candidate...
This isn't a fix by any stretch of the imagination.
Quoted 8 lines
Hi Marc,
While I didn't mark it for stable (and it shouldn't go into any branch earlier than 5.19.x), I did send the patches making the irqchips immutable to Linus Torvalds as fixes as they technically do *fix* the warning emitted by gpiolib and make the implementation correct.
I think these patches should still be part of the v5.19.x stable branch.
5.19, sure. All the dependencies are there, and tightening the driver implementations is a valuable goal.
However, targeting all the other stable releases (5.4, 5.10, 5.15) makes little sense. It won't even compile! Do the dependencies need to be backported? I don't think it is worthwhile, as this is a long series containing multiple related changes spread all over the tree. This would defeat the very purpose of a stable tree.
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Re: [PATCH AUTOSEL 5.4 2/5] gpio: ixp4xx: Make irqchip immutable
Quoted 42 lines · Marc Zyngier
Hi Bartosz,
Quoted 28 lines · Bartosz Golaszewski
Quoted 20 lines · Marc Zyngier
Quoted 12 lines · Sasha Levin
From: Linus Walleij <[email protected]>
[ Upstream commit
94e9bc73d85aa6ecfe249e985ff57abe0ab35f34]This turns the IXP4xx GPIO irqchip into an immutable irqchip, a bit different from the standard template due to being hierarchical.
Tested on the IXP4xx which uses
drivers/ata/pata_ixp4xx_cf.cfor a rootfs on compact flash with IRQs from this GPIO block to the CF ATA controller.Quoted 5 lines
Cc Marc Zyngier <[email protected]>Signed-off-by Linus Walleij <[email protected]>Acked-by Marc Zyngier <[email protected]>Signed-off-by Bartosz Golaszewski <[email protected]>Signed-off-by Sasha Levin <[email protected]>Quoted 5 lines
Why? The required dependencies are only in 5,19, and are definitely NOT a stable candidate...
This isn't a fix by any stretch of the imagination.
Quoted 8 lines
Hi Marc,
While I didn't mark it for stable (and it shouldn't go into any branch earlier than 5.19.x), I did send the patches making the irqchips immutable to Linus Torvalds as fixes as they technically do *fix* the warning emitted by gpiolib and make the implementation correct.
I think these patches should still be part of the v5.19.x stable branch.
Quoted 9 lines
5.19, sure. All the dependencies are there, and tightening the driver implementations is a valuable goal.
However, targeting all the other stable releases (5.4, 5.10, 5.15) makes little sense. It won't even compile! Do the dependencies need to be backported? I don't think it is worthwhile, as this is a long series containing multiple related changes spread all over the tree. This would defeat the very purpose of a stable tree.
That's what I'm saying. All the conversions to immutable irqchips should go to v5.19 but nowhere else.
I thought that by saying "This isn't a fix by any stretch of the imagination." you meant it should go like regular feature patches into the next merge window only.
Sasha: can you drop this from all branches earlier than v5.19?
Thanks,
Bartosz
Re: [PATCH AUTOSEL 5.4 3/5] drm/amdgpu: use dirty framebuffer helper
In reply to Sasha LevinQuoted 29 lines · Sasha Levin
From: Hamza Mahfooz <[email protected]>
[ Upstream commit
66f99628eb24409cb8feb5061f78283c8b65f820]Currently, we aren't handling
DRM_IOCTL_MODE_DIRTYFB. So, usedrm_atomic_helper_dirtyfb()as the dirty callback in theamdgpu_fb_funcsstruct.Signed-off-by Hamza Mahfooz <[email protected]>Acked-by Alex Deucher <[email protected]>Signed-off-by Alex Deucher <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1
-0@@ -35,6 +35,7 @@#include <linux/pci.h> #include <linux/pm_runtime.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_damage_helper.h> #include <drm/drm_edid.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_helper.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector, · line 502
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1
-0@@ -495,6 +496,7 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,static const struct drm_framebuffer_funcs amdgpu_fb_funcs = { .destroy = drm_gem_fb_destroy, .create_handle = drm_gem_fb_create_handle, + .dirty = drm_atomic_helper_dirtyfb, }; uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,
This patch has issues, see https://patchwork.freedesktop.org/patch/503749/ .
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
Sasha Levin
maintainerRe: [PATCH AUTOSEL 5.4 2/5] gpio: ixp4xx: Make irqchip immutable
In reply to Bartosz GolaszewskiQuoted 27 lines · Bartosz Golaszewski
Quoted 20 lines · Marc Zyngier
Quoted 12 lines · Sasha Levin
From: Linus Walleij <[email protected]>
[ Upstream commit
94e9bc73d85aa6ecfe249e985ff57abe0ab35f34]This turns the IXP4xx GPIO irqchip into an immutable irqchip, a bit different from the standard template due to being hierarchical.
Tested on the IXP4xx which uses
drivers/ata/pata_ixp4xx_cf.cfor a rootfs on compact flash with IRQs from this GPIO block to the CF ATA controller.Quoted 5 lines
Cc Marc Zyngier <[email protected]>Signed-off-by Linus Walleij <[email protected]>Acked-by Marc Zyngier <[email protected]>Signed-off-by Bartosz Golaszewski <[email protected]>Signed-off-by Sasha Levin <[email protected]>Quoted 5 lines
Why? The required dependencies are only in 5,19, and are definitely NOT a stable candidate...
This isn't a fix by any stretch of the imagination.
Quoted 8 lines
Hi Marc,
While I didn't mark it for stable (and it shouldn't go into any branch earlier than 5.19.x), I did send the patches making the irqchips immutable to Linus Torvalds as fixes as they technically do *fix* the warning emitted by gpiolib and make the implementation correct.
I think these patches should still be part of the v5.19.x stable branch.
Yes, and as far as I see we are taking those fixes too.
Signature · 2 lines
Thanks, Sasha