Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp823882pxa; Wed, 5 Aug 2020 13:44:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdKez4an6TpK1VQ8KHJefbuu/jj7C8Ba2vhqozPjm6E2uABf4JczgbU0C5sG/bYf2dgygG X-Received: by 2002:a17:906:fb07:: with SMTP id lz7mr1120353ejb.49.1596660277206; Wed, 05 Aug 2020 13:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596660277; cv=none; d=google.com; s=arc-20160816; b=moDFSSMjiC0FowzbvPqxGv8pJ42hL9h5h9wR/m77+IqC0BlpnKVwoNsRg6mhgyg5D+ ecdZNYUAmddf+bSVuwV3o4wjvjE34ZV99fMaZsVXYm4za8qbzJNxyW7dykq9NWMPztAW BDTOztMVgtaBgAVuDyObJQa4vRkx4CbvgKzcXEhTaNwa9cOga4ryGwPNtbMtX8ihiuW4 pM+zfcqwPdA/GvNIfZVlvDklTCwjY1Yb+8pa2tYXklNvILC3D6/BC0zDu7htiveBFmFk oHNl8vrTqgKoGpM2cCPmzfHQbtG2TXVKUi4Ze9UDDMQpWUo+BC+8FvhUd+EdZ9JMsCAx N1Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=TX4uNWwdhVHJfLDkW9+7gKDTT+SOZzW2AXtBTTETT68=; b=isy2YmEFzJ5791CH0FDq8zeafqLv9CN8zgb5Tq9osnD2Tovl2glcBUt3er0L4XagHE jzrxyZrTTyQLM8OZRfOy1QCb5lBF8TSJAnY+/d7hLq274OScPwedz1781b2Om7OJATil l7hunpFRKxcdj+Z57kJ53L+b2bYSxl8QvpY8RtLRcd2JbzTbgsVE/MckviN57iOqZBvP t1auHkY3zmDj+zlmE7jtYIaZM9tSshXXgm30VGfw8ktzGaZ2LBzZjSjxHsCdL7kDzu3T 2NTdvcbJ/QF3LlCyRKfurdvKnfkTZkDxdrsR16wl9TtaOXqsGqn7eltHuwGVIQZm8wby HjRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ffYl8CBo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si2173095ejq.427.2020.08.05.13.44.13; Wed, 05 Aug 2020 13:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ffYl8CBo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbgHEUoA (ORCPT + 99 others); Wed, 5 Aug 2020 16:44:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:59622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbgHEUoA (ORCPT ); Wed, 5 Aug 2020 16:44:00 -0400 Received: from localhost (mobile-166-175-186-42.mycingular.net [166.175.186.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91D29206D4; Wed, 5 Aug 2020 20:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596660240; bh=cc3Lf4FlNVl371CkEGHgJiQ/kuJ+pE4NL0Yr8sg6rd4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ffYl8CBoOHateD8I23vIlkS5ZkG6SYIskbB4PPN6ABmomgS8J+M9py19VIj47Mbo0 Ux+lywAjHLF2wr8r1DMATjfYFdugdECBp4toHHPL29Jso2lwY7wCqpsv9tgXXJGVhc 8bFryKOLjiTvB6MBa9rQVpek4qdl0sVGsgQMwoa8= Date: Wed, 5 Aug 2020 15:43:58 -0500 From: Bjorn Helgaas To: Bharat Kumar Gogada Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, lorenzo.pieralisi@arm.com, robh@kernel.org, maz@kernel.org Subject: Re: [PATCH v9 2/2] PCI: xilinx-cpm: Add Versal CPM Root Port driver Message-ID: <20200805204358.GA535480@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1592312214-9347-3-git-send-email-bharat.kumar.gogada@xilinx.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 16, 2020 at 06:26:54PM +0530, Bharat Kumar Gogada wrote: > - Add support for Versal CPM as Root Port. > - The Versal ACAP devices include CCIX-PCIe Module (CPM). The integrated > block for CPM along with the integrated bridge can function > as PCIe Root Port. > - Bridge error and legacy interrupts in Versal CPM are handled using > Versal CPM specific interrupt line. > +static void xilinx_cpm_pcie_init_port(struct xilinx_cpm_pcie_port *port) > +{ > + if (cpm_pcie_link_up(port)) > + dev_info(port->dev, "PCIe Link is UP\n"); > + else > + dev_info(port->dev, "PCIe Link is DOWN\n"); > + > + /* Disable all interrupts */ > + pcie_write(port, ~XILINX_CPM_PCIE_IDR_ALL_MASK, > + XILINX_CPM_PCIE_REG_IMR); > + > + /* Clear pending interrupts */ > + pcie_write(port, pcie_read(port, XILINX_CPM_PCIE_REG_IDR) & > + XILINX_CPM_PCIE_IMR_ALL_MASK, > + XILINX_CPM_PCIE_REG_IDR); > + > + /* > + * XILINX_CPM_PCIE_MISC_IR_ENABLE register is mapped to > + * CPM SLCR block. > + */ > + writel(XILINX_CPM_PCIE_MISC_IR_LOCAL, > + port->cpm_base + XILINX_CPM_PCIE_MISC_IR_ENABLE); > + /* Enable the Bridge enable bit */ > + pcie_write(port, pcie_read(port, XILINX_CPM_PCIE_REG_RPSC) | > + XILINX_CPM_PCIE_REG_RPSC_BEN, > + XILINX_CPM_PCIE_REG_RPSC); > +} > + > +/** > + * xilinx_cpm_pcie_parse_dt - Parse Device tree > + * @port: PCIe port information > + * @bus_range: Bus resource > + * > + * Return: '0' on success and error value on failure > + */ > +static int xilinx_cpm_pcie_parse_dt(struct xilinx_cpm_pcie_port *port, > + struct resource *bus_range) > +{ > + struct device *dev = port->dev; > + struct platform_device *pdev = to_platform_device(dev); > + struct resource *res; > + > + port->cpm_base = devm_platform_ioremap_resource_byname(pdev, > + "cpm_slcr"); > + if (IS_ERR(port->cpm_base)) > + return PTR_ERR(port->cpm_base); > + > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg"); > + if (!res) > + return -ENXIO; > + > + port->cfg = pci_ecam_create(dev, res, bus_range, > + &pci_generic_ecam_ops); Aren't we passing an uninitialized pointer (bus_range) here? This looks broken to me. The kernelci build warns about it: https://kernelci.org/build/next/branch/master/kernel/next-20200805/ /scratch/linux/drivers/pci/controller/pcie-xilinx-cpm.c:557:39: warning: variable 'bus_range' is uninitialized when used here [-Wuninitialized] I'm dropping this for now. I can't believe this actually works. Bjorn