All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: saeed bishara <saeed.bishara@gmail.com>
Cc: Saeed Bishara <saeed@marvell.com>,
	jeff@garzik.org, htejun@gmail.com, linux-ide@vger.kernel.org,
	nico@cam.org, byron.bbradley@gmail.com
Subject: Re: [PATCH 2/2] sata_mv: remove iounmap in mv_platform_remove
Date: Thu, 14 Feb 2008 14:40:40 -0500	[thread overview]
Message-ID: <47B49938.8090709@rtr.ca> (raw)
In-Reply-To: <c70ff3ad0802141033g712be583p3d4a0269568803c6@mail.gmail.com>

saeed bishara wrote:
>>  Mmm.. sounds like a bug to me.  Possibly two bugs:
>>
>>  1. the ioremap() should fail if the range is already mapped, and
>>  2. we should free the resources on module unload.
>>
>>  I suppose this would be mostly automatic if the code simply
>>  were to use devm_ioremap() instead of ioremap().
> my understanding for the /proc/iomem was totaly wrong..
> the ioremap() actually allocated different address each time,
..

Good.  That makes a lot more sense.

> I don't know if should fail if the range is already mapped,
> but maybe the name (remap) hints that it is shouldn't.
> anyway, I replaced ioremap with devm_ioremap and it looks fine. I'll
> send the new patch in different email.
..

I think that the code should first call devm_request_region()
to reserve the ioports -- this will then fail if the ports are in-use.
After success there, it should then call devm_ioremap(),
which gives a virtual address back (the "remap" part) for use within the kernel.

Cheers

  reply	other threads:[~2008-02-14 19:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13 21:09 [PATCH 1/2] sata_mv: use hpriv->base instead of the host->iomap Saeed Bishara
2008-02-13 21:09 ` [PATCH 2/2] sata_mv: remove iounmap in mv_platform_remove Saeed Bishara
2008-02-13 19:31   ` Mark Lord
2008-02-14 12:56     ` saeed bishara
2008-02-14 16:43       ` Mark Lord
2008-02-14 18:33         ` saeed bishara
2008-02-14 19:40           ` Mark Lord [this message]
2008-02-16 11:11     ` Martin Michlmayr
2008-02-16 14:05 ` [PATCH 1/2] sata_mv: use hpriv->base instead of the host->iomap Mark Lord
2008-02-20 17:09 ` Jeff Garzik

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=47B49938.8090709@rtr.ca \
    --to=liml@rtr.ca \
    --cc=byron.bbradley@gmail.com \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=nico@cam.org \
    --cc=saeed.bishara@gmail.com \
    --cc=saeed@marvell.com \
    /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.