From: Amit Shah Subject: Re: PATCH: virtio_console: Fix poll blocking even though there is data to read (version 2) Date: Thu, 16 Sep 2010 10:46:26 +0530 Message-ID: <20100916051626.GA2429@amit-laptop.redhat.com> References: <4C90E3BF.4000408@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: spice-devel@lists.freedesktop.org, rusty@rustcorp.com.au, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: Hans de Goede Return-path: Content-Disposition: inline In-Reply-To: <4C90E3BF.4000408@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: spice-devel-bounces+gcesd-spice-space-devel=m.gmane.org@lists.freedesktop.org Errors-To: spice-devel-bounces+gcesd-spice-space-devel=m.gmane.org@lists.freedesktop.org List-Id: kvm.vger.kernel.org On (Wed) Sep 15 2010 [17:18:23], Hans de Goede wrote: > diff -up linux-2.6.35.x86_64/drivers/char/virtio_console.c~ linux-2.6.35.x86_64/drivers/char/virtio_console.c > --- linux-2.6.35.x86_64/drivers/char/virtio_console.c~ 2010-08-02 00:11:14.000000000 +0200 > +++ linux-2.6.35.x86_64/drivers/char/virtio_console.c 2010-09-15 13:39:29.043505000 +0200 > @@ -642,7 +642,7 @@ static unsigned int port_fops_poll(struc > poll_wait(filp, &port->waitqueue, wait); > > ret = 0; > - if (port->inbuf) > + if (port_has_data(port)) > ret |= POLLIN | POLLRDNORM; > if (!will_write_block(port)) > ret |= POLLOUT; Thanks, this works. I'll send a git-formatted patch to Rusty. Amit