linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: Xie Shaohui-B21989 <B21989@freescale.com>
Cc: David Laight <David.Laight@ACULAB.COM>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] powerpc/usb: use ioremap instead of base plus offset to access regs
Date: Thu, 24 Nov 2011 01:57:48 -0600	[thread overview]
Message-ID: <95089726-C330-474E-A24C-EECF7D17682B@kernel.crashing.org> (raw)
In-Reply-To: <267A3B246C22C34A8E574051858E077017FA88@039-SN1MPN1-005.039d.mgd.msft.net>


On Nov 2, 2011, at 4:39 AM, Xie Shaohui-B21989 wrote:

>> -----Original Message-----
>> From: David Laight [mailto:David.Laight@ACULAB.COM]
>> Sent: Wednesday, November 02, 2011 5:07 PM
>> To: Xie Shaohui-B21989; linuxppc-dev@lists.ozlabs.org
>> Cc: linux-usb@vger.kernel.org
>> Subject: RE: [PATCH] powerpc/usb: use ioremap instead of base plus =
offset
>> to access regs
>>=20
>>=20
>>> #ifndef CONFIG_ARCH_MXC
>>> 	if (pdata->have_sysif_regs)
>>> -		usb_sys_regs =3D (struct usb_sys_interface *)
>>> -				((u32)dr_regs + USB_DR_SYS_OFFSET);
>>> +		usb_sys_regs =3D ioremap(res->start + USB_DR_SYS_OFFSET,
>>> +				sizeof(struct
>> usb_sys_interface)/sizeof(int));
>>> #endif
>>=20
>> That ioremap() doesn't look right.
>> Isn't the 'size' in bytes??
> [Xie Shaohui] Yes, should not use sizeof(int).
>=20
>> (Although it will only matter if it crosses a page boundary.) Mind =
you,
>> I'd have though the original ioremap() should have covered the entire
>> structure??
> [Xie Shaohui] The original ioremap() did cover the entire structure, =
but the sysif_regs are not defined in dr_regs,
> So regs of sysif_regs cannot be accessed as a member of a structure, =
current driver handle this by type casting, this did work in 32-bit, but =
in 64-bit, this is not safe. So I use ioremap() to cover it again.

What's status on a new version of this patch.

Also, make sure to CC: Greg (gregkh@suse.de) on usb patches

- k=

      reply	other threads:[~2011-11-24  7:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02  7:08 [PATCH] powerpc/usb: use ioremap instead of base plus offset to access regs Shaohui Xie
2011-11-02  9:06 ` David Laight
2011-11-02  9:39   ` Xie Shaohui-B21989
2011-11-24  7:57     ` Kumar Gala [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=95089726-C330-474E-A24C-EECF7D17682B@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --cc=B21989@freescale.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).