From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomasz Wroblewski Subject: Re: [PATCH] V2 pci uart - better cope with UART being temporarily unavailable Date: Tue, 27 Aug 2013 16:02:43 +0200 Message-ID: <521CB183.8030307@citrix.com> References: <1377598539-21973-1-git-send-email-tomasz.wroblewski@citrix.com> <521CB72B02000078000EEBE7@nat28.tlf.novell.com> <521CAD51.8060106@citrix.com> <521CCCF402000078000EECD0@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VEJso-0005vp-UA for xen-devel@lists.xenproject.org; Tue, 27 Aug 2013 14:04:35 +0000 In-Reply-To: <521CCCF402000078000EECD0@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , keir@xen.org List-Id: xen-devel@lists.xenproject.org On 08/27/2013 03:59 PM, Jan Beulich wrote: >>>> On 27.08.13 at 15:44, Tomasz Wroblewski wrote: >> On 08/27/2013 02:26 PM, Jan Beulich wrote: >>>>>> On 27.08.13 at 12:15, Tomasz Wroblewski wrote: >>>> @@ -102,12 +107,17 @@ static void __ns16550_poll(struct cpu_user_regs *regs) >>>> if ( uart->intr_works ) >>>> return; /* Interrupts work - no more polling */ >>>> >>>> - while ( ns_read_reg(uart, UART_LSR)& UART_LSR_DR ) >>>> - serial_rx_interrupt(port, regs); >>>> + while ( ns_read_reg(uart, UART_LSR)& UART_LSR_DR ) >>>> + { >>>> + serial_rx_interrupt(port, regs); >>>> + if ( ns16550_ioport_invalid(uart) ) >>>> + goto out; >>>> + } >>>> >>>> if ( ns_read_reg(uart, UART_LSR)& UART_LSR_THRE ) >>>> serial_tx_interrupt(port, regs); >>>> >>>> +out: >>> So serial_rx_interrupt() gets run once in that case, but >>> serial_tx_interrupt() not at all? That not only inconsistent, I also >>> can't see why anything would need to be done here at all in this >>> case. Plus doing the check before the loop would shrink patch >>> size. >> So I presume it is impossible for dom0 code to run on another cpu whilst >> xen is executing the poll routine, I was not sure at all about this? >> Would like to avoid the possibility of dom0 disabling device whilst this >> loop is running. > Of course can a Dom0 vCPU run on another pCPU. > > And yes, I hence appreciate reducing the risk window. But then > please do the check before calling serial_rx_interrupt(). > Ah sure, will repost v4 soon then