From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aravind Gopalakrishnan Subject: Re: [PATCH V6] ns16550: Add support for UART present in Broadcom TruManage capable NetXtreme chips Date: Tue, 3 Dec 2013 10:37:16 -0600 Message-ID: <529E08BC.20508@amd.com> References: <1386009120-2454-1-git-send-email-Aravind.Gopalakrishnan@amd.com> <529DBE8A0200007800109420@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.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VnsyT-0004VG-Mh for xen-devel@lists.xenproject.org; Tue, 03 Dec 2013 16:37:25 +0000 In-Reply-To: <529DBE8A0200007800109420@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: Thomas Lendacky , andrew.cooper3@citrix.com, Suravee Suthikulpanit , sherry.hurwitz@amd.com, xen-devel , shurd@broadcom.com List-Id: xen-devel@lists.xenproject.org On 12/3/2013 4:20 AM, Jan Beulich wrote: >>>> On 02.12.13 at 19:32, Aravind Gopalakrishnan wrote: >> @@ -434,7 +477,21 @@ static void __init ns16550_endboot(struct serial_port *port) >> struct ns16550 *uart = port->uart; >> >> if ( uart->remapped_io_base ) >> + { >> + if ( uart->enable_ro ) { >> + if ( rangeset_add_range(mmio_ro_ranges, >> + uart->io_base, >> + uart->io_base + uart->io_size - 1) ) >> + WARN(); >> + >> + if ( pci_ro_device(0, uart->ps_bdf[0], >> + PCI_DEVFN(uart->ps_bdf[1], uart->ps_bdf[2])) ) >> + WARN(); >> + > Stray blank line. > > Also, for neither of the two WARN()s above the resulting stack trace > is really meaningful. A simple printk() would therefore suffice. > But, more importantly, did you overlook the use of pci_hide_device() > in ns16550_init_postirq(): The hiding should be done in one place. > And with pci_ro_device() implicitly hiding the device, you should > probably make sure you call just one of the two. Yes, fixed this... >> + /* >> + * Set enable_ro flag to 1 to >> + * make device and MMIO region read only >> + */ >> + uart->enable_ro = 1; >> + break; > So in the comment with the field declaration you say this is > optional, as if the user had a choice. Since the selection is made > internally, I don't think you should comment it that way. Ok, I have reworded this in V7. > Furthermore, with the way you use it the field should clearly be > bool_t. Fixed this. Sending out V7. Thanks, -Aravind.