lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKmqyKND0ruL+cTLoMzV2oG5BOdHDzAzWkKrW5eqLAP2Q6smvQ@mail.gmail.com>
Date:   Thu, 28 Feb 2019 14:41:53 -0800
From:   Alistair Francis <alistair23@...il.com>
To:     Paul Walmsley <paul.walmsley@...ive.com>
Cc:     Alistair Francis <Alistair.Francis@....com>,
        "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
        "robh@...nel.org" <robh@...nel.org>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Revert "of/device: Really only set bus DMA mask when appropriate"

On Thu, Feb 28, 2019 at 2:39 PM Paul Walmsley <paul.walmsley@...ive.com> wrote:
>
> Hello Alistair,
>
> On Thu, 28 Feb 2019, Alistair Francis wrote:
>
> > This reverts commit 6778be4e520959659b27a441c06a84c9cb009085.
> >
> > Reverting the commit fixes these error messages and an non-functioning
> > USB bus when attaching a USB to PCIe card to a RISC-V board:
> >     xhci_hcd 0000:03:00.0: Host took too long to start, waited 16000 microseconds.
> >     xhci_hcd 0000:03:00.0: startup error -19
> >     xhci_hcd 0000:03:00.0: USB bus 2 deregistered
> >     xhci_hcd 0000:03:00.0: WARNING: Host System Error
> >     xhci_hcd 0000:03:00.0: remove, state 1
> >
> > Signed-off-by: Alistair Francis <alistair.francis@....com>
> > ---
> > I'm not sure if this is the correct fix, it's possible something else is
> > wrong, but I wanted to get some feedback.
> >
> > drivers/of/device.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/of/device.c b/drivers/of/device.c
> > index 3717f2a20d0d..8299f8055da7 100644
> > --- a/drivers/of/device.c
> > +++ b/drivers/of/device.c
> > @@ -149,11 +149,9 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
> >        * set by the driver.
> >        */
> >       mask = DMA_BIT_MASK(ilog2(dma_addr + size - 1) + 1);
> > +     dev->bus_dma_mask = mask;
> >       dev->coherent_dma_mask &= mask;
> >       *dev->dma_mask &= mask;
> > -     /* ...but only set bus mask if we found valid dma-ranges earlier */
>
> Does the DT data for the PCIe controller that you're using contain a
> dma-ranges node?

Ah, no it does not. It only has ranges and bus-range [1].

Any idea what the dma-ranges should be?

1: https://github.com/riscv/opensbi/blob/master/platform/sifive/fu540/HiFiveUnleashed-MicroSemi-Expansion.dts#L407

Alistair

>
> > -     if (!ret)
> > -             dev->bus_dma_mask = mask;
> >
> >       coherent = of_dma_is_coherent(np);
> >       dev_dbg(dev, "device is%sdma coherent\n",
>
>
> - Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ