* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
[not found] <AANLkTinqN4MjWz4y5D195f9J8vob42GsG9u39xX-RuJf@mail.gmail.com>
@ 2011-02-15 14:44 ` me
2011-02-15 14:49 ` Jiri Slaby
2011-02-15 22:05 ` [ath5k-devel] " Hugh Davenport
1 sibling, 1 reply; 15+ messages in thread
From: me @ 2011-02-15 14:44 UTC (permalink / raw)
To: Николай Ледовских
Cc: linville, ath5k-devel, linux-wireless, lrodriguez, mickflemm,
jirislaby
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 %% www.bobcopeland.com
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
2011-02-15 14:44 ` [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips me
@ 2011-02-15 14:49 ` Jiri Slaby
0 siblings, 0 replies; 15+ messages in thread
From: Jiri Slaby @ 2011-02-15 14:49 UTC (permalink / raw)
To: me
Cc: Николай Ледовских,
linville, ath5k-devel, linux-wireless, lrodriguez, mickflemm
On 02/15/2011 03:44 PM, me@bobcopeland.com 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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [ath5k-devel] [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
[not found] <AANLkTinqN4MjWz4y5D195f9J8vob42GsG9u39xX-RuJf@mail.gmail.com>
2011-02-15 14:44 ` [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips me
@ 2011-02-15 22:05 ` Hugh Davenport
1 sibling, 0 replies; 15+ messages in thread
From: Hugh Davenport @ 2011-02-15 22:05 UTC (permalink / raw)
To: Николай Ледовских
Cc: linville, jirislaby, linux-wireless, ath5k-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 16/02/11 03:29, Николай Ледовских wrote:
> This patch fixes seqfault on ar2316 and other AHB based chips.
>
This could fix the issues I have been having with my ubiquiti bullet 2.
It segfaults all the time :P
Cheers,
Hugh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJNWvi1AAoJEBwrtoQ2Ia06JfUIAIMAYYjFp5n1081UfEQ8BUhJ
3QZiwEleuND+OKGOyCUbA+Ua6Pq9FOZRwpKmPus1p94a3PI5e5hVBtYVgNE+ENJg
M4S7Rc7YPCIGie3OdjztdIR9rscWzV7Z8s1MUt/cFrUqlncIfRE5bpDe8qboXjX8
uSpelqP7EAE6QlS7bKRc40t2ysInPgjsHNURr1uoUkhprsYrxsIvVM9oZtWcqkFq
9GwW/+81cEUS8+d04xrEuF4Upu/9mcP3POFGaCmesdnRPl16ZrSNfK53Fc08v6rG
pT2oYknuUSzFBRl9NBsjwOaZkYVifGvRWpWBLvhMv4og3ylEOw2qtksVFFnRvgc=
=buhf
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
@ 2011-02-15 19:09 Nikolay Ledovskikh
2011-02-15 19:40 ` Jiri Slaby
0 siblings, 1 reply; 15+ messages in thread
From: Nikolay Ledovskikh @ 2011-02-15 19:09 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, lrodriguez, mickflemm, me, jirislaby
This patch fixes seqfault on ar2316 and other AHB based chips.
Signed-off-by: Nikolay Ledovskikh <nledovskikh@gmail.com>
---
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
index 707cde1..35d5273 100644
--- a/drivers/net/wireless/ath/ath5k/ahb.c
+++ b/drivers/net/wireless/ath/ath5k/ahb.c
@@ -34,7 +34,7 @@ static void ath5k_ahb_read_cachesize(struct ath_common *common, int *csz)
bool ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
{
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));
struct ar231x_board_config *bcfg = pdev->dev.platform_data;
u16 *eeprom, *eeprom_end;
@@ -55,7 +55,7 @@ bool ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
int ath5k_hw_read_srev(struct ath5k_hw *ah)
{
struct ath5k_softc *sc = ah->ah_sc;
- struct platform_device *pdev = to_platform_device(sc->dev);
+ struct platform_device *pdev = to_platform_device(wiphy_dev(sc->hw->wiphy));
struct ar231x_board_config *bcfg = pdev->dev.platform_data;
ah->ah_mac_srev = bcfg->devid;
return 0;
@@ -92,7 +92,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
goto err_out;
}
- mem = ioremap_nocache(res->start, res->end - res->start + 1);
+ mem = res->start;
if (mem == NULL) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
@@ -114,10 +114,11 @@ static int ath_ahb_probe(struct platform_device *pdev)
ret = -ENOMEM;
goto err_out;
}
+ SET_IEEE80211_DEV(hw, &pdev->dev);
sc = hw->priv;
sc->hw = hw;
- sc->dev = &pdev->dev;
+ sc->dev = NULL;
sc->iobase = mem;
sc->irq = irq;
sc->devid = bcfg->devid;
@@ -136,7 +137,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
/* Enable WMAC DMA access (assuming 5312 or 231x*/
/* TODO: check other platforms */
reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE);
- if (to_platform_device(sc->dev)->id == 0)
+ if (to_platform_device(wiphy_dev(sc->hw->wiphy))->id == 0)
reg |= AR5K_AR5312_ENABLE_WLAN0;
else
reg |= AR5K_AR5312_ENABLE_WLAN1;
@@ -181,7 +182,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
} else {
/*Stop DMA access */
reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE);
- if (to_platform_device(sc->dev)->id == 0)
+ if (to_platform_device(wiphy_dev(sc->hw->wiphy))->id == 0)
reg &= ~AR5K_AR5312_ENABLE_WLAN0;
else
reg &= ~AR5K_AR5312_ENABLE_WLAN1;
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 09ae4ef..8633762 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2343,7 +2343,6 @@ ath5k_init_softc(struct ath5k_softc *sc, const struct ath_bus_ops *bus_ops)
int csz;
/* Initialize driver private data */
- SET_IEEE80211_DEV(hw, sc->dev);
hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
IEEE80211_HW_SIGNAL_DBM |
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index 7f8c5b0..7fb1eaf 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -216,6 +216,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
ret = -ENOMEM;
goto err_map;
}
+ SET_IEEE80211_DEV(hw, &pdev->dev);
dev_info(&pdev->dev, "registered as '%s'\n", wiphy_name(hw->wiphy));
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
index 8420689..2430dfb 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -383,7 +383,7 @@ static int ath5k_hw_wisoc_reset(struct ath5k_hw *ah, u32 flags)
val |= AR5K_AR2315_RESET_BB_WARM;
} else {
reg = (u32 *) AR5K_AR5312_RESET;
- if (to_platform_device(ah->ah_sc->dev)->id == 0) {
+ if (to_platform_device(wiphy_dev(ah->ah_sc->hw->wiphy))->id == 0) {
if (mask & AR5K_RESET_CTL_PCU)
val |= AR5K_AR5312_RESET_WMAC0;
if (mask & AR5K_RESET_CTL_BASEBAND)
diff --git a/drivers/net/wireless/ath/ath5k/sysfs.c b/drivers/net/wireless/ath/ath5k/sysfs.c
index 929c68c..c93c685 100644
--- a/drivers/net/wireless/ath/ath5k/sysfs.c
+++ b/drivers/net/wireless/ath/ath5k/sysfs.c
@@ -95,7 +95,7 @@ static struct attribute_group ath5k_attribute_group_ani = {
int
ath5k_sysfs_register(struct ath5k_softc *sc)
{
- struct device *dev = sc->dev;
+ struct device *dev = wiphy_dev(sc->hw->wiphy);
int err;
err = sysfs_create_group(&dev->kobj, &ath5k_attribute_group_ani);
@@ -110,7 +110,7 @@ ath5k_sysfs_register(struct ath5k_softc *sc)
void
ath5k_sysfs_unregister(struct ath5k_softc *sc)
{
- struct device *dev = sc->dev;
+ struct device *dev = wiphy_dev(sc->hw->wiphy);
sysfs_remove_group(&dev->kobj, &ath5k_attribute_group_ani);
}
--
Best regards, Nikolay Ledovskikh.
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
2011-02-15 19:09 Nikolay Ledovskikh
@ 2011-02-15 19:40 ` Jiri Slaby
[not found] ` <AANLkTiks9rG2CzM2LabNerK3zgJ+R+weytQgvXxDbNe7@mail.gmail.com>
0 siblings, 1 reply; 15+ messages in thread
From: Jiri Slaby @ 2011-02-15 19:40 UTC (permalink / raw)
To: Nikolay Ledovskikh; +Cc: linville, linux-wireless, lrodriguez, mickflemm, me
On 02/15/2011 08:09 PM, Nikolay Ledovskikh wrote:
> This patch fixes seqfault on ar2316 and other AHB based chips.
You need to spare few more words on the changelog.
> Signed-off-by: Nikolay Ledovskikh <nledovskikh@gmail.com>
> ---
> diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
> index 707cde1..35d5273 100644
> --- a/drivers/net/wireless/ath/ath5k/ahb.c
> +++ b/drivers/net/wireless/ath/ath5k/ahb.c
...
> @@ -92,7 +92,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
> goto err_out;
> }
>
> - mem = ioremap_nocache(res->start, res->end - res->start + 1);
> + mem = res->start;
Looking into the code which fills this, I still don't get the change.
res->start is a physical address which should be remapped. Care to
elaborate?
> if (mem == NULL) {
> dev_err(&pdev->dev, "ioremap failed\n");
> ret = -ENOMEM;
> @@ -114,10 +114,11 @@ static int ath_ahb_probe(struct platform_device *pdev)
> ret = -ENOMEM;
> goto err_out;
> }
> + SET_IEEE80211_DEV(hw, &pdev->dev);
>
> sc = hw->priv;
> sc->hw = hw;
> - sc->dev = &pdev->dev;
> + sc->dev = NULL;
This I don't understand too. Maybe because of missing changelog...
regards,
--
js
^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <AANLkTi=6jVGZx0oQdMQmndCB9k_xPywfntsB1LS_4ekM@mail.gmail.com>]
* Re: [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips
[not found] <AANLkTi=6jVGZx0oQdMQmndCB9k_xPywfntsB1LS_4ekM@mail.gmail.com>
@ 2011-02-15 18:58 ` John W. Linville
0 siblings, 0 replies; 15+ messages in thread
From: John W. Linville @ 2011-02-15 18:58 UTC (permalink / raw)
To: Nikolay Ledovskikh; +Cc: linux-wireless, lrodriguez, mickflemm, me, Jiri Slaby
On Tue, Feb 15, 2011 at 09:49:24PM +0300, Nikolay Ledovskikh wrote:
> This patch fixes seqfault on ar2316 and other AHB based chips.
> (I don't know why it's not in archives)
>
> Signed-off-by: Nikolay Ledovskikh <nledovskikh@gmail.com>
> ---
> diff --git a/drivers/net/wireless/ath/
> ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
> index 707cde1..35d5273 100644
> --- a/drivers/net/wireless/ath/ath5k/ahb.c
> +++ b/drivers/net/wireless/ath/ath5k/ahb.c
> @@ -34,7 +34,7 @@ static void ath5k_ahb_read_cachesize(struct ath_common
> *common, int *csz)
> bool ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
> {
> 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));
> struct ar231x_board_config *bcfg = pdev->dev.platform_data;
> u16 *eeprom, *eeprom_end;
>
Please use a mailer that doesn't do whitespace damage to patches --
I'll never live long enough to make-up for the time I've already
spent fixing-up broken patches...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2011-02-23 10:18 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <AANLkTinqN4MjWz4y5D195f9J8vob42GsG9u39xX-RuJf@mail.gmail.com>
2011-02-15 14:44 ` [PATCH] ath5k: Use mips generic dma-mapping functions to avoid seqfault on AHB chips me
2011-02-15 14:49 ` Jiri Slaby
2011-02-15 22:05 ` [ath5k-devel] " Hugh Davenport
2011-02-15 19:09 Nikolay Ledovskikh
2011-02-15 19:40 ` Jiri Slaby
[not found] ` <AANLkTiks9rG2CzM2LabNerK3zgJ+R+weytQgvXxDbNe7@mail.gmail.com>
2011-02-15 20:42 ` Jiri Slaby
2011-02-15 20:57 ` Nikolay Ledovskikh
2011-02-15 21:03 ` Jiri Slaby
2011-02-15 21:18 ` Nikolay Ledovskikh
2011-02-15 21:39 ` Nikolay Ledovskikh
2011-02-15 22:16 ` Jiri Slaby
2011-02-15 22:18 ` Jiri Slaby
[not found] ` <20110216011203.GA5773@linux-mips.org>
2011-02-16 10:26 ` Nikolay Ledovskikh
2011-02-23 10:18 ` Wojciech Dubowik
[not found] <AANLkTi=6jVGZx0oQdMQmndCB9k_xPywfntsB1LS_4ekM@mail.gmail.com>
2011-02-15 18:58 ` John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).