Received: by 10.213.65.68 with SMTP id h4csp3586328imn; Tue, 10 Apr 2018 01:05:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx48btAw+l6IdRWkxg0YZ7MCvwX6JJqh9kyu9UufNW96IFsbxutMdJGF+r14mDG4QKNwaIhUc X-Received: by 10.98.165.8 with SMTP id v8mr1866623pfm.225.1523347518126; Tue, 10 Apr 2018 01:05:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523347518; cv=none; d=google.com; s=arc-20160816; b=CYZfspPJopha/mXv1YfkucJEMtKjp0TVAY9OnZSR27ihGDDcIN7+EXgPyBbXX1FPIk pYz6G3vARKHat1wfmpajnbhoMRIVAosb7CEXL2dCPabKXgvt787uS22cTBwc5bQO7iZx +BIXXWSfWxFS1C+Vm/GRocOAyOtciUTdlKdyx6Mc5Em2ZT5IJeUHLUz5IUMz3c6z6ghP zT/p1XZZueWUcGACptJXqX6v6qxrVrKHkXztL3aZvvQowAfHM9hiMfDI3e9h7deOz6xi MT44z1OCmYxDZrOu+ILBiJg+U5d4glnRO4PTGvfECW+B+VgrWOJssviyC2EcaWXdhXDo ALfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=//N7o/nqknagruUUfxA82Q9HEVMMhy57hUzG8yNvTZ0=; b=dTy0R+V4+MexyEPuLnIyXtn8uVxu9SjRWpOjJ5gopKhJGaPpC9NYeh1Pkq2QzOCvXh kcnXTaG4L2sLySwbv6Bzmt3D4WZggrwQtKvArZk0STRBZhaEhp5BZ6kJPCtMZWGoywGL v03IK0qWo0xfqEu1w7/bjxJoAZm8EqVmQTxkWr40UfIJYb3WVk5iwk1hXPVfmgUehNpy trpa/r3/pUF5J5WrYe+8fN3dwfz2C4b4+egHQq7xGD6GCxA1jMBW5xxsYQaEAIKvknnE 9yEpdtvp5394pK5TsleqYzxOnzXbhiP291fVRjAtxBVfnwyAtPYojzkjFpxXfgxY1e4V rJdw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si1435365pgt.130.2018.04.10.01.04.41; Tue, 10 Apr 2018 01:05:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752472AbeDJIA3 (ORCPT + 99 others); Tue, 10 Apr 2018 04:00:29 -0400 Received: from smtprelay.synopsys.com ([198.182.60.111]:49379 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbeDJIA2 (ORCPT ); Tue, 10 Apr 2018 04:00:28 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 1DA8110C1130; Tue, 10 Apr 2018 01:00:28 -0700 (PDT) Received: from pt02.synopsys.com (pt02.internal.synopsys.com [10.107.23.240]) by mailhost.synopsys.com (Postfix) with ESMTP id AA8A45BC0; Tue, 10 Apr 2018 01:00:27 -0700 (PDT) Received: from [127.0.0.1] (gustavo-e7480.internal.synopsys.com [10.107.25.102]) by pt02.synopsys.com (Postfix) with ESMTP id D90313EF44; Tue, 10 Apr 2018 09:00:26 +0100 (WEST) Subject: Re: [PATCH v2 6/9] PCI: dwc: Define maximum number of vectors To: Lorenzo Pieralisi Cc: "bhelgaas@google.com" , "Joao.Pinto@synopsys.com" , "jingoohan1@gmail.com" , "kishon@ti.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" References: <20180409160356.GA14533@e107981-ln.cambridge.arm.com> From: Gustavo Pimentel Message-ID: Date: Tue, 10 Apr 2018 08:59:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180409160356.GA14533@e107981-ln.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lorenzo, On 09/04/2018 17:03, Lorenzo Pieralisi wrote: > On Mon, Apr 09, 2018 at 10:41:15AM +0100, Gustavo Pimentel wrote: >> Adds a callback that defines the maximum number of vectors that can be use >> by the Root Complex. >> >> Since this is a parameter associated to each SoC IP setting, makes sense to >> be configurable and easily visible to future modifications. >> >> The designware IP supports a maximum of 256 vectors. > > I think that a DT property instead of a callback would have made more > sense - I struggle to see the point in defining a callback to initialize > a variable, this can be done in the generic dwc code (and a DT binding). The addition of this callback was done in MSI-X patch series before I take over the PCIe Designware driver responsibility. However I remember a thread in which this subject was discussed (see [1]), maybe this could bring some light about the motive why is was done like this. If you don't agree I can do patch after this series only focusing on this topic in order to do like to suggested. [1] -> https://www.spinics.net/lists/linux-pci/msg61835.html > > Lorenzo > >> Signed-off-by: Gustavo Pimentel >> --- >> Change v1->v2: >> - Nothing changed, just to follow the patch set version. >> >> drivers/pci/dwc/pcie-designware-plat.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/drivers/pci/dwc/pcie-designware-plat.c b/drivers/pci/dwc/pcie-designware-plat.c >> index 5382a7a..94da252 100644 >> --- a/drivers/pci/dwc/pcie-designware-plat.c >> +++ b/drivers/pci/dwc/pcie-designware-plat.c >> @@ -48,8 +48,14 @@ static int dw_plat_pcie_host_init(struct pcie_port *pp) >> return 0; >> } >> >> +static void dw_plat_set_num_vectors(struct pcie_port *pp) >> +{ >> + pp->num_vectors = MAX_MSI_IRQS; >> +} >> + >> static const struct dw_pcie_host_ops dw_plat_pcie_host_ops = { >> .host_init = dw_plat_pcie_host_init, >> + .set_num_vectors = dw_plat_set_num_vectors, >> }; >> >> static int dw_plat_pcie_establish_link(struct dw_pcie *pci) >> -- >> 2.7.4 >> >> Regards, Gustavo