[PATCH 2/3] hw/pci-host/designware: Fix viewport configuration

Bernhard Beschow posted 3 patches 6 months, 2 weeks ago
Maintainers: Peter Maydell <peter.maydell@linaro.org>, Andrey Smirnov <andrew.smirnov@gmail.com>
[PATCH 2/3] hw/pci-host/designware: Fix viewport configuration
Posted by Bernhard Beschow 6 months, 2 weeks ago
Commit 6970f91ac781, "hw/pci-host/designware: Use deposit/extract API"
accidentally introduced a copy-and-paste error, causing Linux 6.14 to hang when
initializing the PCIe bridge on the imx8mp-evk machine. This fix corrects the
error.

Fixes: 6970f91ac781 ("hw/pci-host/designware: Use deposit/extract API")
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/pci-host/designware.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index b4bff14579..f6e49ce9b8 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -348,14 +348,14 @@ static void designware_pcie_root_config_write(PCIDevice *d, uint32_t address,
 
     case DESIGNWARE_PCIE_ATU_LOWER_BASE:
     case DESIGNWARE_PCIE_ATU_UPPER_BASE:
-        viewport->base = deposit64(root->msi.base,
+        viewport->base = deposit64(viewport->base,
                                    address == DESIGNWARE_PCIE_ATU_LOWER_BASE
                                    ? 0 : 32, 32, val);
         break;
 
     case DESIGNWARE_PCIE_ATU_LOWER_TARGET:
     case DESIGNWARE_PCIE_ATU_UPPER_TARGET:
-        viewport->target = deposit64(root->msi.base,
+        viewport->target = deposit64(viewport->target,
                                      address == DESIGNWARE_PCIE_ATU_LOWER_TARGET
                                      ? 0 : 32, 32, val);
         break;
-- 
2.49.0
Re: [PATCH 2/3] hw/pci-host/designware: Fix viewport configuration
Posted by Philippe Mathieu-Daudé 6 months, 2 weeks ago
On 1/5/25 20:34, Bernhard Beschow wrote:
> Commit 6970f91ac781, "hw/pci-host/designware: Use deposit/extract API"
> accidentally introduced a copy-and-paste error, causing Linux 6.14 to hang when
> initializing the PCIe bridge on the imx8mp-evk machine. This fix corrects the
> error.
> 
> Fixes: 6970f91ac781 ("hw/pci-host/designware: Use deposit/extract API")
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/pci-host/designware.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
> index b4bff14579..f6e49ce9b8 100644
> --- a/hw/pci-host/designware.c
> +++ b/hw/pci-host/designware.c
> @@ -348,14 +348,14 @@ static void designware_pcie_root_config_write(PCIDevice *d, uint32_t address,
>   
>       case DESIGNWARE_PCIE_ATU_LOWER_BASE:
>       case DESIGNWARE_PCIE_ATU_UPPER_BASE:
> -        viewport->base = deposit64(root->msi.base,
> +        viewport->base = deposit64(viewport->base,
>                                      address == DESIGNWARE_PCIE_ATU_LOWER_BASE
>                                      ? 0 : 32, 32, val);
>           break;
>   
>       case DESIGNWARE_PCIE_ATU_LOWER_TARGET:
>       case DESIGNWARE_PCIE_ATU_UPPER_TARGET:
> -        viewport->target = deposit64(root->msi.base,
> +        viewport->target = deposit64(viewport->target,
>                                        address == DESIGNWARE_PCIE_ATU_LOWER_TARGET
>                                        ? 0 : 32, 32, val);
>           break;

Oops sorry :/

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>