From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH 2/2] kvm tools: Modify ioport to use interval rbtree Date: Sat, 21 May 2011 16:08:19 +0400 Message-ID: <4DD7AB33.5080102@gmail.com> References: <1305967911-30045-1-git-send-email-levinsasha928@gmail.com> <1305967911-30045-2-git-send-email-levinsasha928@gmail.com> <4DD79478.6040602@gmail.com> <1305975338.3205.23.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: penberg@kernel.org, mingo@elte.hu, asias.hejun@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org To: Sasha Levin Return-path: Received: from mail-ey0-f174.google.com ([209.85.215.174]:54956 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755507Ab1EUMIW (ORCPT ); Sat, 21 May 2011 08:08:22 -0400 Received: by eyx24 with SMTP id 24so1391683eyx.19 for ; Sat, 21 May 2011 05:08:21 -0700 (PDT) In-Reply-To: <1305975338.3205.23.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: On 05/21/2011 02:55 PM, Sasha Levin wrote: ... >>> 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. > Yup, my bad, drop my complain, thanks ;) -- Cyrill