All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Andy Whitcroft <apw@shadowen.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [BUG] linux-next: Tree for April 10 - kernel panic while loading ata driver on powermac
Date: Thu, 10 Apr 2008 21:16:28 +0200	[thread overview]
Message-ID: <200804102116.28637.bzolnier@gmail.com> (raw)
In-Reply-To: <47FE5B96.9090207@linux.vnet.ibm.com>

On Thursday 10 April 2008, Kamalesh Babulal wrote:
> Bartlomiej Zolnierkiewicz wrote:
> > On Thursday 10 April 2008, Bartlomiej Zolnierkiewicz wrote:
> >> Hi,
> >>
> >> On Thu, Apr 10, 2008 at 12:24 PM, Kamalesh Babulal
> >> <kamalesh@linux.vnet.ibm.com> wrote:
> >>> Hi Stephen,
> >>>
> >>>  The next-20080410 kernel panics while bootup over the PowerMac G5 box, while
> >>>  loading the ATA driver.
> >>>
> >>>  [    3.704000] Faulting instruction address: 0xc0000000000222a8
> >>>  [    3.704000] Oops: Kernel access of bad area, sig: 11 [#1]
> >>>  [    3.704000] SMP NR_CPUS=32 NUMA PowerMac
> >>>  [    3.704000] Modules linked in:
> >>>  [    3.704000] NIP: c0000000000222a8 LR: c00000000021cd10 CTR: 0000000000000100
> >>>  [    3.704000] REGS: c0000002760db070 TRAP: 0300   Not tainted  (2.6.25-rc8-next-20080410-autokern1)
> >>>  [    3.704000] MSR: 9000000000009032 <EE,ME,IR,DR>  CR: 44000042  XER: 20000000
> >>>  [    3.704000] DAR: a0001000822fa000, DSISR: 0000000040000000
> >>>  [    3.704000] TASK = c0000002760d7100[1] 'swapper' THREAD: c0000002760d8000 CPU: 0
> >>>  [    3.704000] GPR00: 0000000000000100 c0000002760db2f0 c000000000498310 a0001000822fa000
> >>>  [    3.704000] GPR04: c000000274806a00 0000000000000100 0000000000000201 c00000000000fed4
> >>>  [    3.704000] GPR08: c0000002760daf20 c0000000003ee0d8 c0000000004f1428 0000000000000000
> >>>  [    3.704000] GPR12: 0000000000000000 c0000000003fa700 0000000000000000 0000000000000000
> >>>  [    3.704000] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> >>>  [    3.704000] GPR20: 0000000000000001 0000000000000027 0000000000000027 0000000000000000
> >>>  [    3.704000] GPR24: c0000000004f1400 0000000000000000 0000000000000201 c0000000004f1490
> >>>  [    3.704000] GPR28: a0001000822fa000 0000000000000200 c00000000044cf50 c000000274806a00
> >>>  [    3.704000] NIP [c0000000000222a8] ._insw_ns+0x10/0x30
> >>>  [    3.704000] LR [c00000000021cd10] .ata_input_data+0x1f4/0x264
> >> Could you please add printk() for 'hwif->host_flags', 'mmio' and 'io_32bit'
> >> to ide-iops.c::ata_input_data() so we know more on what is going on?
> > 
> > No longer needed - please test the hot-fix below instead:
> > 
> > ---
> > thanks to Andrew for noticing me about the gcc warning
> > 
> >  drivers/ide/ppc/pmac.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Index: b/drivers/ide/ppc/pmac.c
> > ===================================================================
> > --- a/drivers/ide/ppc/pmac.c
> > +++ b/drivers/ide/ppc/pmac.c
> > @@ -941,7 +941,7 @@ static const struct ide_port_info pmac_p
> >  	.port_ops		= &pmac_ide_port_ops,
> >  	.host_flags		= IDE_HFLAG_SET_PIO_MODE_KEEP_DMA |
> >  				  IDE_HFLAG_POST_SET_MODE |
> > -				  IDE_HFLAG_UNMASK_IRQS,
> > +				  IDE_HFLAG_UNMASK_IRQS |
> >  				  IDE_HFLAG_MMIO,
> >  	.pio_mask		= ATA_PIO4,
> >  	.mwdma_mask		= ATA_MWDMA2,
> > 
> > --
> Thanks, the kernel panic is solved after applying the patch.
> 
> Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>

Thanks.

I integrated the fix with the guilty patch and pushed it to IDE tree
(Andrew, you may drop the revert-patch now).

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: add IDE_HFLAG_MMIO host flag (take 2)

* Add IDE_HFLAG_MMIO host flag and set it for hosts which use
  default_hwif_mmiops().

v2:
* Fix kernel panic in pmac host driver (',' should be '|').

  Thanks to Kamalesh for reporting it + testing the fix
  and to Andrew for hinting me about the source of the issue.

Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/arm/icside.c          |    2 +-
 drivers/ide/arm/palm_bk3710.c     |    1 +
 drivers/ide/arm/rapide.c          |    1 +
 drivers/ide/legacy/ide_platform.c |    4 +++-
 drivers/ide/mips/swarm.c          |    1 +
 drivers/ide/pci/sgiioc4.c         |    1 +
 drivers/ide/pci/siimage.c         |    1 +
 drivers/ide/ppc/pmac.c            |    1 +
 include/linux/ide.h               |    2 ++
 9 files changed, 12 insertions(+), 2 deletions(-)

Index: b/drivers/ide/arm/icside.c
===================================================================
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -481,7 +481,7 @@ static const struct ide_port_info icside
 	.init_dma		= icside_dma_off_init,
 	.port_ops		= &icside_v6_no_dma_port_ops,
 	.dma_ops		= &icside_v6_dma_ops,
-	.host_flags		= IDE_HFLAG_SERIALIZE,
+	.host_flags		= IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
 	.mwdma_mask		= ATA_MWDMA2,
 	.swdma_mask		= ATA_SWDMA2,
 };
Index: b/drivers/ide/arm/palm_bk3710.c
===================================================================
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -342,6 +342,7 @@ static const struct ide_port_ops palm_bk
 static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
 	.init_dma		= palm_bk3710_init_dma,
 	.port_ops		= &palm_bk3710_ports_ops,
+	.host_flags		= IDE_HFLAG_MMIO,
 	.pio_mask		= ATA_PIO4,
 	.udma_mask		= ATA_UDMA4,	/* (input clk 99MHz) */
 	.mwdma_mask		= ATA_MWDMA2,
Index: b/drivers/ide/arm/rapide.c
===================================================================
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -53,6 +53,7 @@ rapide_probe(struct expansion_card *ec, 
 
 		ide_init_port_hw(hwif, &hw);
 
+		hwif->host_flags = IDE_HFLAG_MMIO;
 		default_hwif_mmiops(hwif);
 
 		idx[0] = hwif->index;
Index: b/drivers/ide/legacy/ide_platform.c
===================================================================
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -101,8 +101,10 @@ static int __devinit plat_ide_probe(stru
 
 	ide_init_port_hw(hwif, &hw);
 
-	if (mmio)
+	if (mmio) {
+		hwif->host_flags = IDE_HFLAG_MMIO;
 		default_hwif_mmiops(hwif);
+	}
 
 	idx[0] = hwif->index;
 
Index: b/drivers/ide/mips/swarm.c
===================================================================
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -109,6 +109,7 @@ static int __devinit swarm_ide_probe(str
 	base = ioremap(offset, size);
 
 	/* Setup MMIO ops.  */
+	hwif->host_flags = IDE_HFLAG_MMIO;
 	default_hwif_mmiops(hwif);
 
 	hwif->chipset = ide_generic;
Index: b/drivers/ide/pci/sgiioc4.c
===================================================================
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -573,6 +573,7 @@ static const struct ide_port_info sgiioc
 	.init_dma		= ide_dma_sgiioc4,
 	.port_ops		= &sgiioc4_port_ops,
 	.dma_ops		= &sgiioc4_dma_ops,
+	.host_flags		= IDE_HFLAG_MMIO,
 	.mwdma_mask		= ATA_MWDMA2_ONLY,
 };
 
Index: b/drivers/ide/pci/siimage.c
===================================================================
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -630,6 +630,7 @@ static void __devinit init_mmio_iops_sii
 	 *	Fill in the basic HWIF bits
 	 */
 
+	hwif->host_flags |= IDE_HFLAG_MMIO;
 	default_hwif_mmiops(hwif);
 	hwif->hwif_data			= addr;
 
Index: b/drivers/ide/ppc/pmac.c
===================================================================
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -941,6 +941,7 @@ static const struct ide_port_info pmac_p
 	.port_ops		= &pmac_ide_port_ops,
 	.host_flags		= IDE_HFLAG_SET_PIO_MODE_KEEP_DMA |
 				  IDE_HFLAG_POST_SET_MODE |
+				  IDE_HFLAG_MMIO |
 				  IDE_HFLAG_UNMASK_IRQS,
 	.pio_mask		= ATA_PIO4,
 	.mwdma_mask		= ATA_MWDMA2,
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1056,6 +1056,8 @@ enum {
 	IDE_HFLAG_NO_DMA		= (1 << 14),
 	/* check if host is PCI IDE device before allowing DMA */
 	IDE_HFLAG_NO_AUTODMA		= (1 << 15),
+	/* host uses MMIO */
+	IDE_HFLAG_MMIO			= (1 << 16),
 	/* host is CS5510/CS5520 */
 	IDE_HFLAG_CS5520		= IDE_HFLAG_VDMA,
 	/* no LBA48 */

  reply	other threads:[~2008-04-10 19:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10  8:14 linux-next: Tree for April 10 Stephen Rothwell
2008-04-10 10:24 ` [BUG] linux-next: Tree for April 10 - kernel panic while loading ata driver on powermac Kamalesh Babulal
2008-04-10 10:45   ` Jeff Garzik
2008-04-10 11:02     ` Kamalesh Babulal
2008-04-10 11:32     ` Alan Cox
2008-04-10 12:14       ` Jeff Garzik
2008-04-10 12:03   ` Bartlomiej Zolnierkiewicz
2008-04-10 17:14     ` Bartlomiej Zolnierkiewicz
2008-04-10 18:25       ` Kamalesh Babulal
2008-04-10 19:16         ` Bartlomiej Zolnierkiewicz [this message]
2008-04-10 17:42 ` linux-next: Tree for April 10 Greg KH
2008-04-10 18:07 ` [BUG] linux-next: April 10 - kernel oops at kmem_cache_alloc () regression from April 9 kernel Kamalesh Babulal
2008-04-11 17:56   ` Suresh Siddha
2008-04-14 13:14     ` Kamalesh Babulal
2008-04-10 19:34 ` linux-next: Tree for April 10: generic pci_enable_resources() strikes again Mariusz Kozlowski
2008-04-14  1:48   ` Stephen Rothwell
2008-04-14  4:28     ` Greg KH
2008-04-14  4:49       ` Stephen Rothwell
2008-04-10 22:07 ` linux-next: Tree for April 10 (ftrace) Randy Dunlap
2008-04-10 22:09 ` linux-next: Tree for April 10 (arch/x86) Randy Dunlap
2008-04-11  7:46   ` Ingo Molnar
2008-04-11 15:19     ` Randy Dunlap
2008-04-11 15:26       ` Al Viro
2008-04-14  8:12         ` Ingo Molnar
2008-04-14  8:22           ` Al Viro
2008-04-14  8:34             ` Ingo Molnar
2008-04-14  8:43               ` Jakub Jelinek
2008-04-14  9:30                 ` Al Viro
2008-04-14  9:37                   ` David Miller
2008-04-14  8:40       ` Jakub Jelinek
2008-04-14 22:28         ` Randy Dunlap

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=200804102116.28637.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=kamalesh@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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.