From: Larry Finger <larry.finger@lwfinger.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] bcm43xx-mac80211: Fix machine checks on PPC with rev 1 PHYs
Date: Tue, 17 Apr 2007 12:08:28 -0500 [thread overview]
Message-ID: <4624FF0C.5000105@lwfinger.net> (raw)
In-Reply-To: <461EDB39.6080806@lwfinger.net>
John,
In case you cannot find it, here is a copy of David's patch.
Larry
From David Woodhouse.
It's very simple... if we use inw instead of readw for the faulting I/O
access, then the machine check gets trapped. We can do this because on
PPC, PCI I/O is actually memory-mapped. The CPU doesn't have a separate
I/O space and instructions. So we just compensate for the address at
which PCI I/O is mapped, and abuse inw().
Then we make bcm43xx_phy_read() print the register it tried to access
whenever it gets 0xFFFF, and stick a WARN_ON(1) in the machine check
handler when it detects a machine check caused by an I/O access...
--- ../linux-2.6.20.ppc64/./drivers/net/wireless/mac80211/bcm43xx/bcm43xx_phy.c 2007-04-14
21:51:02.000000000 +0100
+++ ./drivers/net/wireless/mac80211/bcm43xx/bcm43xx_phy.c 2007-04-16 01:39:44.000000000 +0100
@@ -269,10 +270,13 @@ static inline u16 adjust_phyreg_for_phyt
u16 bcm43xx_phy_read(struct bcm43xx_wldev *dev, u16 offset)
{
struct bcm43xx_phy *phy = &dev->phy;
-
+ uint16_t foo;
offset = adjust_phyreg_for_phytype(phy, offset);
bcm43xx_write16(dev, BCM43xx_MMIO_PHY_CONTROL, offset);
- return bcm43xx_read16(dev, BCM43xx_MMIO_PHY_DATA);
+ foo = bcm43xx_read16(dev, BCM43xx_MMIO_PHY_DATA);
+ if (foo == 0xffff)
+ printk(KERN_DEBUG "Read phy reg %x; got 0xFFFF.\n", offset);
+ return foo;
}
void bcm43xx_phy_write(struct bcm43xx_wldev *dev, u16 offset, u16 val)
--- ../linux-2.6.20.ppc64/./drivers/ssb/pci.c 2007-04-14 21:51:02.000000000 +0100
+++ ./drivers/ssb/pci.c 2007-04-15 23:44:27.000000000 +0100
@@ -475,6 +475,7 @@ static u16 ssb_pci_read16(struct ssb_dev
if (unlikely(ssb_pci_switch_core(bus, dev)))
return 0xFFFF;
}
+ return inw(bus->mmio + offset - isa_io_base);
return readw(bus->mmio + offset);
}
--- ../linux-2.6.20.ppc64/./arch/powerpc/kernel/traps.c 2007-04-14 21:50:40.000000000 +0100
+++ ./arch/powerpc/kernel/traps.c 2007-04-15 23:45:48.000000000 +0100
@@ -343,8 +343,10 @@ void machine_check_exception(struct pt_r
return;
}
- if (check_io_access(regs))
+ if (check_io_access(regs)) {
+ WARN_ON(1);
return;
+ }
#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
if (reason & ESR_IMCP) {
--
dwmw2
_______________________________________________
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
next prev parent reply other threads:[~2007-04-17 17:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 16:08 [PATCH] bcm43xx-mac80211: Fix machine checks on PPC with rev 1 PHYs Larry Finger
2007-04-11 17:22 ` Michael Buesch
2007-04-13 0:09 ` John W. Linville
2007-04-13 0:57 ` Pavel Roskin
2007-04-13 1:22 ` Larry Finger
2007-04-16 1:04 ` David Woodhouse
2007-04-17 17:08 ` Larry Finger [this message]
2007-04-13 9:36 ` Stefano Brivio
2007-04-13 15:06 ` Larry Finger
2007-04-13 15:17 ` Johannes Berg
2007-04-16 0:06 ` David Woodhouse
2007-04-16 0:53 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4624FF0C.5000105@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.