Received: by 10.192.165.156 with SMTP id m28csp142928imm; Tue, 17 Apr 2018 07:51:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+qoww5aj+3FuiPMEiD1U45Z+5fgwOuvbkp40xiuMcG4okz+YQM6ULHNnx6Kf3yD/Y7sMLs X-Received: by 10.98.61.201 with SMTP id x70mr2220227pfj.85.1523976661329; Tue, 17 Apr 2018 07:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523976661; cv=none; d=google.com; s=arc-20160816; b=bmz/FVAaRYmEKvL63S2cKXSF49M8mDHQIEQPycfh13ZVS29yJohCVebfOTODjlthZy gjyRHQGThEpVfHSRvgKeUuWE4GAuG12wXbLX2SlDlRGzW2hD/7z14xJHJTJd7P6l2Tkj re9O/YJyIr3iO6xPZh1qonJk9OAhraRwx9FiefoaIA2wCQ1bmD52NKdG9Z/ngxnTiCTZ K1vON2h/pDH8/vo5xdhosvECblQzo63pX5BCp+hnagkij83FiQEpQgAmX6+O4tE1Ltqi z6YjMoK5kEso8Fx/3YDGnYglbnSdWCGBAtOO+vWfZ27WBNLTYDNnZXknXv15nyqIJ59/ U0Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dmarc-filter :arc-authentication-results; bh=N8sul/DhC+hzv4xi2OFIXvTIJXI1QwgruHIO44NlFpU=; b=gxiJu5djwN3zbYonZFyH0cuTD7Wl0TUsG8Upu2mDkYIWFauIq/0XVExRrT2Mcl77RC Ft1dXnUWX0g0+jgHyVa2RiHrJCRkiZtNcQhnJsN22jUAtOZqwKxnDqV5rWceE99yQtDQ t7QKCrls28cnx4uvMm8Owa3KgrhEQPMZobnCmFi3ekXaoiICGgkgDkTsvAC9eDXTe51A YA0/k08iDIXWN7Qr36lMSv7mbFWO3vhbfZ9IX4ODDyq5Gwdtqjyz1zxLqd60P2cM0D8T amYeO9rQDqMI3HUfuNCgVCkfxjGRPbv8Ygf+DO0+OAGgNNtywR2S7b8eWn5cB5B++uWI gGLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 135si13004601pfc.21.2018.04.17.07.50.47; Tue, 17 Apr 2018 07:51:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619AbeDQOch (ORCPT + 99 others); Tue, 17 Apr 2018 10:32:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:36298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751230AbeDQOcf (ORCPT ); Tue, 17 Apr 2018 10:32:35 -0400 Received: from localhost (unknown [69.71.5.252]) (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 6CB8A2170D; Tue, 17 Apr 2018 14:32:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CB8A2170D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Tue, 17 Apr 2018 09:32:32 -0500 From: Bjorn Helgaas To: Christoph Hellwig Cc: Frederick Lawler , bhelgaas@google.com, mike.marciniszyn@intel.com, dennis.dalessandro@intel.com, dledford@redhat.com, jgg@mellanox.com, linux-pci@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Bartlomiej Dudek Subject: Re: [PATCH v3 0/2] IB/hfi1: Cleanup PCIe link configuration Message-ID: <20180417143232.GH28657@bhelgaas-glaptop.roam.corp.google.com> References: <20180417002825.2737-1-fred@fredlawl.com> <20180417065343.GA29193@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180417065343.GA29193@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Bartlomiej, who recently changed do_pcie_gen3_transition(), LKML] On Mon, Apr 16, 2018 at 11:53:43PM -0700, Christoph Hellwig wrote: > On Mon, Apr 16, 2018 at 07:28:23PM -0500, Frederick Lawler wrote: > > The IB/hfi1 driver uses custom macros to configure the target link speed. Some > > macros were previously replaced, but not fully. This patch series addresses the > > configuration inconsistencies by adding PCI_EXP_LNKCTL2_TLS* macros to PCI, > > and then use them in the following IB/hfi1 patch. > > Btw, why is the driver configuring the PCIe link speed? Isn't this > something we should be handling in the PCI core? Good question. I think this sort of code definitely should not be in drivers unless it's to work around some kind of defect in the device. I think the intent of the spec is that neither the OS nor the driver has to deal with link training and the link should train to the highest speed supported by both ends. For example, PCIe r4.0, sec 1.2 says Initialization – During hardware initialization, each PCI Express Link is set up following a negotiation of Lane widths and frequency of operation by the two agents at each end of the Link. No firmware or operating system software is involved. Maybe the Intel guys can comment on why HFI needs this code. Presumably they didn't write it just for fun, so I assume there's some reason. Bjorn