mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	Michael Krufky <mkrufky@linuxtv.org>,
	Chuck Ebbert <cebbert@redhat.com>,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, fabbione@ubuntu.com, bunk@stusta.de,
	"David S. Miller" <davem@davemloft.net>
Subject: [patch 064/101] Fix interrupt probing on E450 sparc64 systems
Date: Wed, 07 Mar 2007 09:11:39 -0800	[thread overview]
Message-ID: <20070307171454.776245687@mini.kroah.org> (raw)
In-Reply-To: <20070307171035.150802805@mini.kroah.org>

[-- Attachment #1: fix-interrupt-probing-on-e450-sparc64-systems.patch --]
[-- Type: text/plain, Size: 2330 bytes --]

From: David Miller <davem@davemloft.net>

[SPARC64]: Fix PCI interrupts on E450 et al.

When the PCI controller OBP node lacks an interrupt-map
and interrupt-map-mask property, we need to form the
INO by hand.  The PCI swizzle logic was not doing that
properly.

This was a regression added by the of_device code.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/sparc64/kernel/of_device.c |   40 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

--- linux-2.6.20.1.orig/arch/sparc64/kernel/of_device.c
+++ linux-2.6.20.1/arch/sparc64/kernel/of_device.c
@@ -708,7 +708,7 @@ static unsigned int __init pci_irq_swizz
 					   unsigned int irq)
 {
 	struct linux_prom_pci_registers *regs;
-	unsigned int devfn, slot, ret;
+	unsigned int bus, devfn, slot, ret;
 
 	if (irq < 1 || irq > 4)
 		return irq;
@@ -717,10 +717,46 @@ static unsigned int __init pci_irq_swizz
 	if (!regs)
 		return irq;
 
+	bus = (regs->phys_hi >> 16) & 0xff;
 	devfn = (regs->phys_hi >> 8) & 0xff;
 	slot = (devfn >> 3) & 0x1f;
 
-	ret = ((irq - 1 + (slot & 3)) & 3) + 1;
+	if (pp->irq_trans) {
+		/* Derived from Table 8-3, U2P User's Manual.  This branch
+		 * is handling a PCI controller that lacks a proper set of
+		 * interrupt-map and interrupt-map-mask properties.  The
+		 * Ultra-E450 is one example.
+		 *
+		 * The bit layout is BSSLL, where:
+		 * B: 0 on bus A, 1 on bus B
+		 * D: 2-bit slot number, derived from PCI device number as
+		 *    (dev - 1) for bus A, or (dev - 2) for bus B
+		 * L: 2-bit line number
+		 *
+		 * Actually, more "portable" way to calculate the funky
+		 * slot number is to subtract pbm->pci_first_slot from the
+		 * device number, and that's exactly what the pre-OF
+		 * sparc64 code did, but we're building this stuff generically
+		 * using the OBP tree, not in the PCI controller layer.
+		 */
+		if (bus & 0x80) {
+			/* PBM-A */
+			bus  = 0x00;
+			slot = (slot - 1) << 2;
+		} else {
+			/* PBM-B */
+			bus  = 0x10;
+			slot = (slot - 2) << 2;
+		}
+		irq -= 1;
+
+		ret = (bus | slot | irq);
+	} else {
+		/* Going through a PCI-PCI bridge that lacks a set of
+		 * interrupt-map and interrupt-map-mask properties.
+		 */
+		ret = ((irq - 1 + (slot & 3)) & 3) + 1;
+	}
 
 	return ret;
 }

--

  parent reply	other threads:[~2007-03-07 17:36 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07 17:10 [patch 000/101] 2.6.20-stable review Greg KH
2007-03-07 17:10 ` [patch 001/101] ocfs2: ocfs2_link() journal credits update Greg KH
2007-03-07 17:10 ` [patch 002/101] x86_64: fix 2.6.18 regression - PTRACE_OLDSETOPTIONS should be accepted Greg KH
2007-03-07 17:10 ` [patch 003/101] rtc-pcf8563: detect polarity of century bit automatically Greg KH
2007-03-07 17:10 ` [patch 004/101] prism54: correct assignment of DOT1XENABLE in WE-19 codepaths Greg KH
2007-03-07 17:10 ` [patch 005/101] pata_amd: fix an obvious bug in cable detection Greg KH
2007-03-07 17:10 ` [patch 006/101] knfsd: Fix a race in closing NFSd connections Greg KH
2007-03-07 17:10 ` [patch 007/101] Keys: Fix key serial number collision handling Greg KH
2007-03-07 17:10 ` [patch 008/101] ide: fix drive side 80c cable check Greg KH
2007-03-07 17:10 ` [patch 009/101] bcm43xx: Fix for oops on resume Greg KH
2007-03-07 17:10 ` [patch 010/101] bcm43xx: Fix for oops on ampdu status Greg KH
2007-03-07 17:10 ` [patch 011/101] AGP: intel-agp bugfix Greg KH
2007-03-07 17:10 ` [patch 012/101] Missing critical phys_to_virt in lib/swiotlb.c Greg KH
2007-03-07 17:10 ` [patch 013/101] USB: fix concurrent buffer access in the hub driver Greg KH
2007-03-07 17:10 ` [patch 014/101] USB audio fixes 1 Greg KH
2007-03-07 17:10 ` [patch 015/101] USB audio fixes 2 Greg KH
2007-03-07 17:10 ` [patch 016/101] hda-intel - Dont try to probe invalid codecs Greg KH
2007-03-07 17:10 ` [patch 017/101] Fix various bugs with aligned reads in RAID5 Greg KH
2007-03-07 17:10 ` [patch 018/101] Fix ATM initcall ordering Greg KH
2007-03-07 17:10 ` [patch 019/101] Fix TCP FIN handling Greg KH
2007-03-07 17:10 ` [patch 020/101] Fix allocation failure handling in multicast Greg KH
2007-03-07 17:10 ` [patch 021/101] md: Avoid possible BUG_ON in md bitmap handling Greg KH
2007-03-07 17:10 ` [patch 022/101] Fix compile error for e500 core based processors Greg KH
2007-03-07 17:10 ` [patch 023/101] ieee1394: video1394: DMA fix Greg KH
2007-03-07 17:10 ` [patch 024/101] ieee1394: fix host device registering when nodemgr disabled Greg KH
2007-03-07 17:11 ` [patch 025/101] Fix null pointer dereference in appledisplay driver Greg KH
2007-03-07 17:11 ` [patch 026/101] USB HID: Fix USB vendor and product IDs endianness for USB HID devices Greg KH
2007-03-07 17:11 ` [patch 027/101] Kconfig: FAULT_INJECTION can be selected only if LOCKDEP is enabled Greg KH
2007-03-08 12:17   ` Blaisorblade
2007-03-07 17:11 ` [patch 028/101] MTD: Fatal regression in drivers/mtd/redboot.c in 2.6.20 Greg KH
2007-03-07 17:11 ` [patch 029/101] IPV6: HASHTABLES: Use appropriate seed for caluculating ehash index Greg KH
2007-03-07 17:11 ` [patch 030/101] EHCI: turn off remote wakeup during shutdown Greg KH
2007-03-07 17:11 ` [patch 031/101] Avoid using nfsd process pools on SMP machines Greg KH
2007-03-07 17:11 ` [patch 032/101] Fix recently introduced problem with shutting down a busy NFS server Greg KH
2007-03-07 17:11 ` [patch 033/101] UHCI: fix port resume problem Greg KH
2007-03-07 17:11 ` [patch 034/101] Fix atmarp.h for userspace Greg KH
2007-03-07 17:11 ` [patch 035/101] Clear TCP segmentation offload state in ipt_REJECT Greg KH
2007-03-07 17:11 ` [patch 036/101] Fix IPX module unload Greg KH
2007-03-07 17:11 ` [patch 037/101] : Prevent pseudo garbage in SYNs advertized window Greg KH
2007-03-07 17:11 ` [patch 038/101] Fix oops in xfrm_audit_log() Greg KH
2007-03-07 17:11 ` [patch 039/101] sky2: dont flush good pause frames Greg KH
2007-03-07 17:11 ` [patch 040/101] sky2: transmit timeout deadlock Greg KH
2007-03-07 17:11 ` [patch 041/101] x86_64: Fix wrong gcc check in bitops.h Greg KH
2007-03-07 17:11 ` [patch 042/101] x86: Dont require the vDSO for handling a.out signals Greg KH
2007-03-07 17:11 ` [patch 043/101] i386: Fix broken CONFIG_COMPAT_VDSO on i386 Greg KH
2007-03-07 17:11 ` [patch 044/101] bcm43xx: fix for 4309 Greg KH
2007-03-07 17:11 ` [patch 045/101] md: Fix raid10 recovery problem Greg KH
2007-03-07 17:11 ` [patch 046/101] dvbdev: fix illegal re-usage of fileoperations struct Greg KH
2007-03-07 17:11 ` [patch 047/101] V4L: pvrusb2: Fix video corruption on stream start Greg KH
2007-03-07 17:11 ` [patch 048/101] V4L: pvrusb2: Handle larger cx2341x firmware images Greg KH
2007-03-07 17:11 ` [patch 049/101] DVB: cxusb: fix firmware patch for big endian systems Greg KH
2007-03-07 17:11 ` [patch 050/101] DVB: digitv: open nxt6000 i2c_gate for TDED4 tuner handling Greg KH
2007-03-07 17:11 ` [patch 051/101] V4L: fix cx25840 firmware loading Greg KH
2007-03-07 17:11 ` [patch 052/101] V4L: cx88-blackbird: allow usage of 376836 and 262144 sized firmware images Greg KH
2007-03-07 17:11 ` [patch 053/101] Fix posix-cpu-timer breakage caused by stale p->last_ran value Greg KH
2007-03-07 17:11 ` [patch 054/101] swsusp: Fix possible oops in userland interface Greg KH
2007-03-07 17:11 ` [patch 055/101] sata_sil: ignore and clear spurious IRQs while executing commands by polling Greg KH
2007-03-07 17:11 ` [patch 056/101] fix umask when noACL kernel meets extN tuned for ACLs Greg KH
2007-03-07 17:11 ` [patch 057/101] UML - Fix 2.6.20 hang Greg KH
2007-03-07 17:11 ` [patch 058/101] mmc: Power quirk for ENE controllers Greg KH
2007-03-07 17:11 ` [patch 059/101] bcm43xx: Fix assertion failures in interrupt handler Greg KH
2007-03-07 17:11 ` [patch 060/101] libata: add missing PM callbacks Greg KH
2007-03-07 17:11 ` [patch 061/101] libata: add missing CONFIG_PM in LLDs Greg KH
2007-03-07 17:11 ` [patch 062/101] POWERPC: Fix performance monitor exception Greg KH
2007-03-07 17:11 ` [patch 063/101] HID: fix possible double-free on error path in hid parser Greg KH
2007-03-07 17:11 ` Greg KH [this message]
2007-03-07 17:11 ` [patch 065/101] Fix xfrm_add_sa_expire() return value Greg KH
2007-03-07 17:11 ` [patch 066/101] Fix skb data reallocation handling in IPSEC Greg KH
2007-03-07 17:11 ` [patch 067/101] Fix %100 cpu spinning on sparc64 Greg KH
2007-03-07 17:11 ` [patch 068/101] Fix TCP MD5 locking Greg KH
2007-03-07 17:11 ` [patch 069/101] Dont add anycast reference to device multiple times Greg KH
2007-03-07 17:11 ` [patch 070/101] Fix anycast procfs device leak Greg KH
2007-03-07 17:11 ` [patch 071/101] Fix reference counting (memory leak) problem in __nfulnl_send() and callers related to packet queueing Greg KH
2007-03-07 17:11 ` [patch 072/101] export blk_recount_segments Greg KH
2007-03-07 17:11 ` [patch 073/101] forcedeth: disable msix Greg KH
2007-03-07 17:11 ` [patch 074/101] tty_io: fix race in master pty close/slave pty close path Greg KH
2007-03-07 17:11 ` [patch 075/101] sched: fix SMT scheduler bug Greg KH
2007-03-07 17:11 ` [patch 076/101] USB: usbnet driver bugfix Greg KH
2007-03-07 17:11 ` [patch 077/101] Backport of psmouse suspend/shutdown cleanups Greg KH
2007-03-07 17:11 ` [patch 078/101] Revert "LOG2: Alter get_order() so that it can make use of ilog2() on a constant" Greg KH
2007-03-07 17:11 ` [patch 079/101] RPM: fix double free in portmapper code Greg KH
2007-03-07 17:11 ` [patch 080/101] NLM: Fix double free in __nlm_async_call Greg KH
2007-03-07 17:11 ` [patch 081/101] kexec: Fix CONFIG_SMP=n compilation V2 (ia64) Greg KH
2007-03-07 17:11 ` [patch 082/101] Fix MTRR compat ioctl Greg KH
2007-03-07 17:11 ` [patch 083/101] ufs: restore back support of openstep Greg KH
2007-03-07 17:11 ` [patch 084/101] v9fs_vfs_mkdir(): fix a double free Greg KH
2007-03-07 17:12 ` [patch 085/101] enable mouse button 2+3 emulation for x86 macs Greg KH
2007-03-07 17:12 ` [patch 086/101] hugetlb: preserve hugetlb pte dirty state Greg KH
2007-03-07 17:12 ` [patch 087/101] m32r: build fix for processors without ISA_DSP_LEVEL2 Greg KH
2007-03-07 17:12 ` [patch 088/101] kernel/time/clocksource.c needs struct task_struct on m68k Greg KH
2007-03-07 17:12 ` [patch 089/101] buffer: memorder fix Greg KH
2007-03-07 17:12 ` [patch 090/101] Char: specialix, isr have 2 params Greg KH
2007-03-07 17:12 ` [patch 091/101] lockdep: forward declare struct task_struct Greg KH
2007-03-07 17:12 ` [patch 092/101] kvm: Fix asm constraint for lldt instruction Greg KH
2007-03-07 17:12 ` [patch 093/101] ueagle-atm.c needs sched.h Greg KH
2007-03-07 17:12 ` [patch 094/101] fix section mismatch warning in lockdep Greg KH
2007-03-07 17:12 ` [patch 095/101] throttle_vm_writeout(): dont loop on GFP_NOFS and GFP_NOIO allocations Greg KH
2007-03-07 17:12 ` [patch 096/101] bug in gdth.c crashing machine Greg KH
2007-03-07 17:12 ` [patch 097/101] revert "drivers/net/tulip/dmfe: support basic carrier detection" Greg KH
2007-03-07 18:14   ` Stephen Hemminger
2007-03-08  2:41     ` Dan Williams
2007-03-08  3:06       ` Linus Torvalds
2007-03-07 17:12 ` [patch 098/101] video/aty/mach64_ct.c: fix bogus delay loop Greg KH
2007-03-07 17:12 ` [patch 099/101] pktcdvd: Correctly set cmd_len field in pkt_generic_packet Greg KH
2007-03-07 17:12 ` [patch 100/101] ATA: convert GSI to irq on ia64 Greg KH
2007-03-07 17:12 ` [patch 101/101] gfs2: fix locking mistake Greg KH
2007-03-07 17:34 ` [stable] [patch 000/101] 2.6.20-stable review Greg KH
2007-03-07 23:12   ` [patch 102/101] TCP: Fix minisock tcp_create_openreq_child() typo Chris Wright
2007-03-07 23:12   ` [patch 103/101] Fix buffer overflow in Omnikey CardMan 4040 driver (CVE-2007-0005) Chris Wright
2007-03-07 23:13   ` [patch 104/101] x86-64: survive having no irq mapping for a vector Chris Wright
2007-03-07 18:41 ` [patch 000/101] 2.6.20-stable review Chuck Ebbert
2007-03-07 21:05   ` [stable] " Chris Wright

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=20070307171454.776245687@mini.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bunk@stusta.de \
    --cc=cebbert@redhat.com \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=fabbione@ubuntu.com \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkrufky@linuxtv.org \
    --cc=rdunlap@xenotime.net \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=zwane@arm.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®