Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755232AbdDEQLr (ORCPT ); Wed, 5 Apr 2017 12:11:47 -0400 Received: from linode.aoot.com ([69.164.194.13]:51006 "EHLO linode.aoot.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754167AbdDEQLB (ORCPT ); Wed, 5 Apr 2017 12:11:01 -0400 X-Greylist: delayed 1754 seconds by postgrey-1.27 at vger.kernel.org; Wed, 05 Apr 2017 12:11:01 EDT From: "Steve Wise" To: "'Sagi Grimberg'" , "'Logan Gunthorpe'" , "'Christoph Hellwig'" , "'James E.J. Bottomley'" , "'Martin K. Petersen'" , "'Jens Axboe'" , "'Stephen Bates'" , "'Max Gurtovoy'" , "'Dan Williams'" , "'Keith Busch'" , "'Jason Gunthorpe'" Cc: , , , , , References: <1490911959-5146-1-git-send-email-logang@deltatee.com> <1490911959-5146-3-git-send-email-logang@deltatee.com> In-Reply-To: Subject: RE: [RFC 2/8] cxgb4: setup pcie memory window 4 and create p2pmem region Date: Wed, 5 Apr 2017 10:41:45 -0500 Message-ID: <003001d2ae23$21e8f7d0$65bae770$@opengridcomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGDrzFnHJRLFLPPZsE1XDlAT9YfwAJLsBMBAnWfAUeiLt02kA== Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 703 Lines: 32 > > > > +static void setup_memwin_p2pmem(struct adapter *adap) > > +{ > > + unsigned int mem_base = t4_read_reg(adap, > CIM_EXTMEM2_BASE_ADDR_A); > > + unsigned int mem_size = t4_read_reg(adap, > CIM_EXTMEM2_ADDR_SIZE_A); > > + > > + if (!use_p2pmem) > > + return; > > This is weird, why even call this if !use_p2pmem? > The use_p2pmem was added after the original change. I'll update as you suggest. > > +static int init_p2pmem(struct adapter *adapter) > > +{ > > + unsigned int mem_size = t4_read_reg(adapter, > CIM_EXTMEM2_ADDR_SIZE_A); > > + struct p2pmem_dev *p; > > + int rc; > > + struct resource res; > > + > > + if (!mem_size || !use_p2pmem) > > + return 0; > > Again, weird... Yup.