Re: [PATCH 10/19] usb: host: ehci-orion: fix the probe without DT

From: Alan Stern

Date: Thu Nov 05 2026 - 16:34:28 EST


On Tue, Oct 27, 2026 at 03:57:50PM +0100, Greg Kroah-Hartman wrote:
> From: Josef Bacik <josef@xxxxxxxxxxxxxx>
>
> The Orion5x, MV78xx0 and Dove board files register the controllers as
> platform devices called "orion-ehci" (arch/arm/plat-orion/common.c),
> which are bound by name. of_device_get_match_data() returns NULL for
> them, and ehci_orion_drv_probe() dereferences it to get the DMA mask.
>
> Use the 32 bit mask, as before, if there is no match data.
>
> Fixes: c63fe1cc7093 ("usb: host: Add ac5 to EHCI Orion")
> Cc: Elad Nachman <enachman@xxxxxxxxxxx>
> Cc: stable <stable@xxxxxxxxxx>
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

> drivers/usb/host/ehci-orion.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
> index eaaa49712a8c..2071c3d6e582 100644
> --- a/drivers/usb/host/ehci-orion.c
> +++ b/drivers/usb/host/ehci-orion.c
> @@ -218,7 +218,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
> int irq, err;
> enum orion_ehci_phy_ver phy_version;
> struct orion_ehci_hcd *priv;
> - u64 *dma_mask_ptr;
> + const u64 *dma_mask_ptr;
>
> if (usb_disabled())
> return -ENODEV;
> @@ -236,7 +236,9 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
> * set. Since shared usb code relies on it, set it here for
> * now. Once we have dma capability bindings this can go away.
> */
> - dma_mask_ptr = (u64 *)of_device_get_match_data(&pdev->dev);
> + dma_mask_ptr = of_device_get_match_data(&pdev->dev);
> + if (!dma_mask_ptr)
> + dma_mask_ptr = &dma_mask_orion;
> err = dma_coerce_mask_and_coherent(&pdev->dev, *dma_mask_ptr);
> if (err)
> goto err;
>
> --
> 2.56.0
>