2011-02-15 14:44:51

by Bob Copeland

[permalink] [raw]
Subject: Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips

On Tue, Feb 15, 2011 at 02:29:13PM +0000, Николай Ледовских wrote:
> This patch fixes seqfault on ar2316 and other AHB based chips.

Ok, but I'm guessing it also breaks PCI functionality?

> struct ath5k_softc *sc = common->priv;
> - struct platform_device *pdev = to_platform_device(sc->dev);
> + struct platform_device *pdev =
> to_platform_device(wiphy_dev(sc->hw->wiphy));

Your patch got wrapped strangely here...

> - mem = ioremap_nocache(res->start, res->end - res->start + 1);
> + mem = res->start;

Won't this break iommu platforms?

> + SET_IEEE80211_DEV(hw, &pdev->dev);
>
> - sc->dev = &pdev->dev;
> + sc->dev = NULL;

> /* Initialize driver private data */
> - SET_IEEE80211_DEV(hw, sc->dev);

> @@ -216,6 +216,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
> ret = -ENOMEM;
> goto err_map;
> }
> + SET_IEEE80211_DEV(hw, &pdev->dev);

This set of changes needs some rationale... in other words, what is
the real problem the patch fixes?

--
Bob Copeland %% http://www.bobcopeland.com



2011-02-15 14:49:35

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips

On 02/15/2011 03:44 PM, [email protected] wrote:
> On Tue, Feb 15, 2011 at 02:29:13PM +0000, Николай Ледовских wrote:
>> - mem = ioremap_nocache(res->start, res->end - res->start + 1);
>> + mem = res->start;
>
> Won't this break iommu platforms?

And not only those. This is incorrect on _all_ platforms. You try to
dereference a physical address.

regards,
--
js