All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: penberg@kernel.org, mingo@elte.hu, asias.hejun@gmail.com,
	prasadjoshi124@gmail.com, kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] kvm tools: Modify ioport to use interval rbtree
Date: Sat, 21 May 2011 13:55:38 +0300	[thread overview]
Message-ID: <1305975338.3205.23.camel@lappy> (raw)
In-Reply-To: <4DD79478.6040602@gmail.com>

On Sat, 2011-05-21 at 14:31 +0400, Cyrill Gorcunov wrote:
> On 05/21/2011 12:51 PM, Sasha Levin wrote:
> > Currently the ioport implementation is based on a USHRT_MAX length
> > array of ptrs to ioport_operations.
> > 
> > Instead, use an interval rbtree to map the ioports to
> > ioport_operations.
> > 
> > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> > ---
> ...
> > -static struct ioport_operations *ioport_ops[USHRT_MAX];
> > -
> >  void ioport__register(u16 port, struct ioport_operations *ops, int count)
> >  {
> > -	int i;
> > +	struct ioport_entry *entry;
> >  
> > -	for (i = 0; i < count; i++)
> > -		ioport_ops[port + i]	= ops;
> > +	entry = ioport_search(&ioport_tree, port);
> > +	if (entry)
> > +		rb_int_erase(&ioport_tree, &entry->node);
> > +
> 
>   Hi Sasha, if I understand this correct we're simply drop old registartion, right? I think
> it should not be like that, if one port get used for several drivers/purposes we need a
> ref-counting, but at moment I think we simply should not allow to re-register port without
> previously unregister it. Or I miss something?

Currently we register some ports as dummy ports in the ioport
initialization, and re-register them once they get someone who can use
them (for example, serial device).

Not allowing ports to re-register would mean we can't reassign ports to
serial console when the serial console module gets loaded.

-- 

Sasha.


  reply	other threads:[~2011-05-21 10:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-21  8:51 [PATCH 1/2] kvm tools: Fix rbtree-interval balancing Sasha Levin
2011-05-21  8:51 ` [PATCH 2/2] kvm tools: Modify ioport to use interval rbtree Sasha Levin
2011-05-21 10:31   ` Cyrill Gorcunov
2011-05-21 10:55     ` Sasha Levin [this message]
2011-05-21 12:08       ` Cyrill Gorcunov
2011-05-21 12:16         ` Cyrill Gorcunov

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=1305975338.3205.23.camel@lappy \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.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.