LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: FUJITA Tomonori <tomof@acm.org>
Cc: rct@frus.com, mingo@elte.hu, linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org, fujita.tomonori@lab.ntt.co.jp,
	akpm@linux-foundation.org
Subject: Re: [regression]2.6.25-rc4: boot panic on alpha
Date: Fri, 7 Mar 2008 19:21:16 +0300	[thread overview]
Message-ID: <20080307162116.GA18563@jurassic.park.msu.ru> (raw)
In-Reply-To: <20080307235616T.tomof@acm.org>

On Fri, Mar 07, 2008 at 11:56:40PM +0900, FUJITA Tomonori wrote:
> Very sorry, I probably broke the IOMMU. I don't have the hardware so
> I've not tested the patches.

Unfortunately, I was not able to test these patches either, as my
alpha with iommmu and scsi is disassembled at the moment, thanks to
dead CPU fan...

> -	BUG_ON(arena->dma_base & ~PAGE_MASK);
> +	if (arena->dma_base & ~PAGE_MASK)
> +		printk("%s %d: %lx\n", __FUNCTION__, __LINE__, arena->dma_base);

arena->dma_base is always properly aligned - it's pretty fundamental thing.

>  	base = arena->dma_base >> PAGE_SHIFT;
>  	if (dev)
>  		boundary_size = ALIGN(dma_get_max_seg_size(dev) + 1, PAGE_SIZE)
				      ^^^^^^^^^^^^^^^^^^^^^^^^^
Must be dma_get_seg_boundary(dev). Hopefully it's the only typo ;-)

> @@ -152,7 +155,8 @@ iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena,
>  	else
>  		boundary_size = ALIGN(1UL << 32, PAGE_SIZE) >> PAGE_SHIFT;

A bit of abuse of ALIGN() macro, to my taste ;-)

> -	BUG_ON(!is_power_of_2(boundary_size));
> +	if (!is_power_of_2(boundary_size))
> +		printk("%s %d: %lx\n", __FUNCTION__, __LINE__, boundary_size);

Perhaps it was that, if the scsi driver set max_seg_size to something
other than default 65536 (and not a power of two)...

Bob, can you give it a try?

Ivan.

diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index be6fa10..e07a23f 100644
--- a/arch/alpha/kernel/pci_iommu.c
+++ b/arch/alpha/kernel/pci_iommu.c
@@ -144,15 +144,14 @@ iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena,
 	unsigned long base;
 	unsigned long boundary_size;
 
-	BUG_ON(arena->dma_base & ~PAGE_MASK);
 	base = arena->dma_base >> PAGE_SHIFT;
-	if (dev)
-		boundary_size = ALIGN(dma_get_max_seg_size(dev) + 1, PAGE_SIZE)
-			>> PAGE_SHIFT;
-	else
-		boundary_size = ALIGN(1UL << 32, PAGE_SIZE) >> PAGE_SHIFT;
-
-	BUG_ON(!is_power_of_2(boundary_size));
+	if (dev) {
+		boundary_size = dma_get_seg_boundary(dev) + 1;
+		BUG_ON(!is_power_of_2(boundary_size));
+		boundary_size >>= PAGE_SHIFT;
+	} else {
+		boundary_size = 1UL << (32 - PAGE_SHIFT);
+	}
 
 	/* Search forward for the first mask-aligned sequence of N free ptes */
 	ptes = arena->ptes;

  reply	other threads:[~2008-03-07 16:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07  3:41 Bob Tracy
2008-03-07  7:23 ` Ingo Molnar
2008-03-07 12:36   ` Bob Tracy
2008-03-07 14:14     ` Ingo Molnar
2008-03-07 14:56       ` FUJITA Tomonori
2008-03-07 16:21         ` Ivan Kokshaysky [this message]
2008-03-07 16:45           ` FUJITA Tomonori
2008-03-07 19:06           ` Bob Tracy
2008-03-08  1:24           ` Bob Tracy
2008-03-09 10:20             ` FUJITA Tomonori
2008-03-09 13:22               ` Ivan Kokshaysky
2008-03-09 13:29                 ` FUJITA Tomonori
2008-03-09 15:38                   ` Ivan Kokshaysky
2008-03-10 14:34                     ` FUJITA Tomonori
2008-03-09 18:47                   ` Andrew Morton

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=20080307162116.GA18563@jurassic.park.msu.ru \
    --to=ink@jurassic.park.msu.ru \
    --cc=akpm@linux-foundation.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rct@frus.com \
    --cc=tomof@acm.org \
    --subject='Re: [regression]2.6.25-rc4: boot panic on alpha' \
    /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

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).