From: Ben Nizette <bn@niasdigital.com>
To: Paul Mundt <lethal@linux-sh.org>
Cc: gregkh@suse.de, linux-kernel <linux-kernel@vger.kernel.org>,
hjk@linutronix.de
Subject: Re: [PATCH] UIO: Implement a UIO interface for the SMX Cryptengine
Date: Wed, 12 Mar 2008 21:41:08 +1100 [thread overview]
Message-ID: <1205318468.4344.23.camel@moss.renham> (raw)
In-Reply-To: <20080312100831.GB21854@linux-sh.org>
On Wed, 2008-03-12 at 19:08 +0900, Paul Mundt wrote:
> On Tue, Mar 11, 2008 at 03:57:10PM +1100, Ben Nizette wrote:
> > +
> > + info->mem[0].size = regs->end - regs->start;
> > + info->mem[0].memtype = UIO_MEM_PHYS;
> > +
> You have an off-by-1 in the resource size. ioremap and struct resource
> are not equal in their expectations. You probably want to do something
> like:
>
> info->mem[0].size = regs->end - regs->start + 1;
> info->mem[0].internal_addr = ioremap(regs->start, info->mem[0].size);
> ...
>
You're right, thanks. I hadn't noticed since we don't actually access
all the way to the end of the region in normal use.
> and make sure that your resource end doesn't overlap with a start address
> of an unrelated resource in your definition. /proc/iomem tends to be
> useful for this.
Yup. In our case this is fairly easy as the engine just takes up a
whole Chip Select's worth of address space on an AVR32 AT32AP7000.
--Ben.
prev parent reply other threads:[~2008-03-12 10:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-11 4:57 [PATCH] UIO: Implement a UIO interface for the SMX Cryptengine Ben Nizette
2008-03-11 8:15 ` Hans-Jürgen Koch
2008-03-12 9:54 ` Ben Nizette
2008-03-12 10:08 ` Paul Mundt
2008-03-12 10:41 ` Ben Nizette [this message]
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=1205318468.4344.23.camel@moss.renham \
--to=bn@niasdigital.com \
--cc=gregkh@suse.de \
--cc=hjk@linutronix.de \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
/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