From patchwork Mon Aug 12 23:04:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 2843318 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F27749F294 for ; Mon, 12 Aug 2013 23:04:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23B60204AF for ; Mon, 12 Aug 2013 23:04:42 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11D822035A for ; Mon, 12 Aug 2013 23:04:41 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V91AC-0006BK-Nx; Mon, 12 Aug 2013 23:04:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V91AA-0000C4-CS; Mon, 12 Aug 2013 23:04:34 +0000 Received: from mail-pd0-x230.google.com ([2607:f8b0:400e:c02::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V91A7-0000BZ-Jq for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2013 23:04:32 +0000 Received: by mail-pd0-f176.google.com with SMTP id q10so4049231pdj.21 for ; Mon, 12 Aug 2013 16:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=VICCDp2rXEKnhjrpSS9Ni4JSTk7S5yEqqj7ElMilx8o=; b=zGH/wpXKAE6sC1W5iynCDFfjHY5zWsZaRSA+HYGsWaLvV+eWtkxhgmB360g8L0kw3d 8EPpFwC8zXVZJ+8JBK66HmFOr1lxCzHxqrxbyKdgFzZynXoKx3Hx69Xp9eNi+YkIOMZH yCtnED6Zbu2VkfWFPhmNDv2KIRqVeJbk4ZipheOuDEPPtQ8cXyMk7MMTi2MS4qQoj/yc BfQsovEYFdmWl2t970cSHxV8tzefFCJJPKK2WpLowJ7300hYVAHv0Vne45QnlIBBSWCt pn0F3r5EUsYrZNQOtn1jkA4fwWPG+RH3p0enWtIZaAXtinRBpMya5EyBxzoyvkqAWyGg A9cQ== X-Received: by 10.66.150.97 with SMTP id uh1mr1344838pab.118.1376348650230; Mon, 12 Aug 2013 16:04:10 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id eq5sm39758184pbc.15.2013.08.12.16.04.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 16:04:09 -0700 (PDT) Date: Mon, 12 Aug 2013 16:04:08 -0700 From: Guenter Roeck To: Russell King - ARM Linux Subject: Re: [Qemu-devel] SCSI bus failures with qemu-arm in kernel 3.8+ Message-ID: <20130812230408.GA4420@roeck-us.net> References: <20130811220450.GY23006@n2100.arm.linux.org.uk> <52082EF8.10005@roeck-us.net> <20130812164548.GE23006@n2100.arm.linux.org.uk> <20130812200628.GG23006@n2100.arm.linux.org.uk> <20130812212149.GH23006@n2100.arm.linux.org.uk> <20130812221250.GI23006@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130812221250.GI23006@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130812_190431_929427_15CB41F5 X-CRM114-Status: GOOD ( 21.23 ) X-Spam-Score: -1.6 (-) Cc: Peter Maydell , qemu-devel@nongnu.org, "linux-kernel@vger.kernel.org" , Paul Gortmaker , Arnd Bergmann , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Aug 12, 2013 at 11:12:50PM +0100, Russell King - ARM Linux wrote: > On Mon, Aug 12, 2013 at 10:36:17PM +0100, Peter Maydell wrote: > > On this point, yes. Equivalent bit from the PB926 TRM: > > http://infocenter.arm.com/help/topic/com.arm.doc.dui0224i/Cacdijji.html > > > > (There are differences between the PCI controllers on > > the different boards. Differences I know of are: > > * size of the three memory mapped regions > > * whether the top bits of the PCI address come from the top > > or bottom of the IMAP* registers > > I believe (based on some experimentation and an educated guess) > > that these both changed at the same point, but some of the board > > TRMs claim to be part one way part the other, presumably due to > > copy and paste error. In particular PB1176's TRM has a mangled > > description of the IMAP* registers which didn't match what the > > h/w actually did in my testing.) > > Bah, updated TRMs since my version. > > Right, so if I've traced everything correctly, this should work: > > /* > * Slot INTA INTB INTC INTD > * 31 PCI1 PCI2 PCI3 PCI0 > * 30 PCI0 PCI1 PCI2 PCI3 > * 29 PCI3 PCI0 PCI1 PCI2 > */ > return IRQ_SIC_PCI0 + ((slot + 2 + pin - 1) & 3); > I tried the above with qemu 1.5.2. Success! Hacked diff is below. Can I write that up as clean patch and submit it, or do we need a test on real hardware ? Thanks, Guenter diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c index e92e5e0..53b4208 100644 --- a/arch/arm/mach-versatile/pci.c +++ b/arch/arm/mach-versatile/pci.c @@ -333,7 +333,11 @@ static int __init versatile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) * 26 1 IRQ_SIC_PCI2 * 27 1 IRQ_SIC_PCI3 */ +#if 0 irq = IRQ_SIC_PCI0 + ((slot - 24 + pin - 1) & 3); +#else + irq = IRQ_SIC_PCI0 + ((slot + 2 + pin - 1) & 3); +#endif return irq; }