From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FDE4C282CE for ; Fri, 12 Apr 2019 14:05:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 103D82171F for ; Fri, 12 Apr 2019 14:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555077905; bh=JReIut2kwPScl3gx4eZCcxUjgr4kBMUxzKxp6nHksqw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=dSSK1EU8HolzjrjzIaepEsp5m3g6bry6EiMDYFTKmCeskFfsD8nbmwu2hWzmrjOYy 3NAd9BbTh7vJnAlM0kkLrFht56uZ/nOF3w5XZQkGCRlIQjiHDZlEkyfo8Fi91xsGkV Z9iscZ61lydBGhOcurneQjJXpB20EiMo+xjq5LUk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726981AbfDLOFD (ORCPT ); Fri, 12 Apr 2019 10:05:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:50946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbfDLOFD (ORCPT ); Fri, 12 Apr 2019 10:05:03 -0400 Received: from localhost (173-25-63-173.client.mchsi.com [173.25.63.173]) (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 9DF992083E; Fri, 12 Apr 2019 14:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555077901; bh=JReIut2kwPScl3gx4eZCcxUjgr4kBMUxzKxp6nHksqw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LR3oC2/ubJS+bVXXJ33Tkw8zbq0bdWARbNOCH0BE/PoKhUAa7u83EKBdWOPGaEuS3 SvsaPusOGvJtHpOFQxWAdWa1Rp6iuS4iop3Xv1QVtP0n0n9atqJAXxVCdhANXJIwMb IA/Yv1H8q6jp1SKz/7MKtQfAmMmet7RKd1qLgh5o= Date: Fri, 12 Apr 2019 09:05:00 -0500 From: Bjorn Helgaas To: Kishon Vijay Abraham I Cc: Gustavo Pimentel , Rob Herring , Lorenzo Pieralisi , Arnd Bergmann , Murali Karicheri , Jingoo Han , Greg Kroah-Hartman , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-kernel@axis.com, Minghuan Lian , Mingkai Hu , Roy Zang , Jesper Nilsson , Sekhar Nori Subject: Re: [PATCH v3 16/26] PCI: OF: Allow of_pci_get_max_link_speed() to be used by PCI Endpoint drivers Message-ID: <20190412140500.GB141472@google.com> References: <20190325093947.32633-1-kishon@ti.com> <20190325093947.32633-17-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190325093947.32633-17-kishon@ti.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 25, 2019 at 03:09:37PM +0530, Kishon Vijay Abraham I wrote: > of_pci_get_max_link_speed() is built only if CONFIG_PCI is enabled. > Make of_pci_get_max_link_speed() to be also used by PCI Endpoint > controllers with just CONFIG_PCI_ENDPOINT enabled. > > Signed-off-by: Kishon Vijay Abraham I > Signed-off-by: Sekhar Nori Acked-by: Bjorn Helgaas > --- > drivers/pci/Makefile | 2 +- > drivers/pci/of.c | 44 +++++++++++++++++++++++--------------------- > 2 files changed, 24 insertions(+), 22 deletions(-) > > diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile > index 657d642fcc67..28cdd8c0213a 100644 > --- a/drivers/pci/Makefile > +++ b/drivers/pci/Makefile > @@ -10,10 +10,10 @@ obj-$(CONFIG_PCI) += access.o bus.o probe.o host-bridge.o \ > ifdef CONFIG_PCI > obj-$(CONFIG_PROC_FS) += proc.o > obj-$(CONFIG_SYSFS) += slot.o > -obj-$(CONFIG_OF) += of.o > obj-$(CONFIG_ACPI) += pci-acpi.o > endif > > +obj-$(CONFIG_OF) += of.o > obj-$(CONFIG_PCI_QUIRKS) += quirks.o > obj-$(CONFIG_PCIEPORTBUS) += pcie/ > obj-$(CONFIG_HOTPLUG_PCI) += hotplug/ > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > index 3d32da15c215..8095933f8452 100644 > --- a/drivers/pci/of.c > +++ b/drivers/pci/of.c > @@ -15,6 +15,7 @@ > #include > #include "pci.h" > > +#ifdef CONFIG_PCI > void pci_set_of_node(struct pci_dev *dev) > { > if (!dev->bus->dev.of_node) > @@ -196,27 +197,6 @@ int of_get_pci_domain_nr(struct device_node *node) > } > EXPORT_SYMBOL_GPL(of_get_pci_domain_nr); > > -/** > - * This function will try to find the limitation of link speed by finding > - * a property called "max-link-speed" of the given device node. > - * > - * @node: device tree node with the max link speed information > - * > - * Returns the associated max link speed from DT, or a negative value if the > - * required property is not found or is invalid. > - */ > -int of_pci_get_max_link_speed(struct device_node *node) > -{ > - u32 max_link_speed; > - > - if (of_property_read_u32(node, "max-link-speed", &max_link_speed) || > - max_link_speed > 4) > - return -EINVAL; > - > - return max_link_speed; > -} > -EXPORT_SYMBOL_GPL(of_pci_get_max_link_speed); > - > /** > * of_pci_check_probe_only - Setup probe only mode if linux,pci-probe-only > * is present and valid > @@ -537,3 +517,25 @@ int pci_parse_request_of_pci_ranges(struct device *dev, > return err; > } > > +#endif /* CONFIG_PCI */ > + > +/** > + * This function will try to find the limitation of link speed by finding > + * a property called "max-link-speed" of the given device node. > + * > + * @node: device tree node with the max link speed information > + * > + * Returns the associated max link speed from DT, or a negative value if the > + * required property is not found or is invalid. > + */ > +int of_pci_get_max_link_speed(struct device_node *node) > +{ > + u32 max_link_speed; > + > + if (of_property_read_u32(node, "max-link-speed", &max_link_speed) || > + max_link_speed > 4) > + return -EINVAL; > + > + return max_link_speed; > +} > +EXPORT_SYMBOL_GPL(of_pci_get_max_link_speed); > -- > 2.17.1 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F78AC10F0E for ; Fri, 12 Apr 2019 14:05:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F29472171F for ; Fri, 12 Apr 2019 14:05:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E52IAX1A"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="LR3oC2/u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F29472171F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZFW+chilbxaUuumWpZKuOGqK349+UYXWWEz07f8WXZ4=; b=E52IAX1Am8OHC8 nRwAa3byAtSpTa0KXSDSJwr6T/DiK4Q6Y5/jn80aFQdNqgW0tO4qWwk18UUfcRUrpnX8DV+NVuEcQ sqsWrvaPbXjnWzMnI5EZ4Dy/dNDdQsYASjmpCR8cgdg/6lO0z/JBFGjkkg6h551DILd3rZgGiw/WI 51gz62FwCJxTj/7tgNcFfEozstBiVYkYuXIxU/y86VCBrN1qCfsFPa00Wp2GWmlGsmqgf/b2D/0SN k3tWoqTG+/x6NzmQUJCnqErPVsHdL+9WgiF3p9Aa/Hl4DGXyMtcya1KGIf63kV3yhEGrbf473L2uw EqMDNdE0GKFMVvQeLtZQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEwnh-0002iF-Je; Fri, 12 Apr 2019 14:05:05 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEwne-0002Mi-73 for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2019 14:05:03 +0000 Received: from localhost (173-25-63-173.client.mchsi.com [173.25.63.173]) (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 9DF992083E; Fri, 12 Apr 2019 14:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555077901; bh=JReIut2kwPScl3gx4eZCcxUjgr4kBMUxzKxp6nHksqw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LR3oC2/ubJS+bVXXJ33Tkw8zbq0bdWARbNOCH0BE/PoKhUAa7u83EKBdWOPGaEuS3 SvsaPusOGvJtHpOFQxWAdWa1Rp6iuS4iop3Xv1QVtP0n0n9atqJAXxVCdhANXJIwMb IA/Yv1H8q6jp1SKz/7MKtQfAmMmet7RKd1qLgh5o= Date: Fri, 12 Apr 2019 09:05:00 -0500 From: Bjorn Helgaas To: Kishon Vijay Abraham I Subject: Re: [PATCH v3 16/26] PCI: OF: Allow of_pci_get_max_link_speed() to be used by PCI Endpoint drivers Message-ID: <20190412140500.GB141472@google.com> References: <20190325093947.32633-1-kishon@ti.com> <20190325093947.32633-17-kishon@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190325093947.32633-17-kishon@ti.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_070502_320886_66DD8F97 X-CRM114-Status: GOOD ( 19.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Jesper Nilsson , Lorenzo Pieralisi , Arnd Bergmann , Greg Kroah-Hartman , Gustavo Pimentel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Minghuan Lian , Murali Karicheri , linux-arm-kernel@axis.com, Sekhar Nori , Jingoo Han , Mingkai Hu , linux-omap@vger.kernel.org, Roy Zang , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 25, 2019 at 03:09:37PM +0530, Kishon Vijay Abraham I wrote: > of_pci_get_max_link_speed() is built only if CONFIG_PCI is enabled. > Make of_pci_get_max_link_speed() to be also used by PCI Endpoint > controllers with just CONFIG_PCI_ENDPOINT enabled. > > Signed-off-by: Kishon Vijay Abraham I > Signed-off-by: Sekhar Nori Acked-by: Bjorn Helgaas > --- > drivers/pci/Makefile | 2 +- > drivers/pci/of.c | 44 +++++++++++++++++++++++--------------------- > 2 files changed, 24 insertions(+), 22 deletions(-) > > diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile > index 657d642fcc67..28cdd8c0213a 100644 > --- a/drivers/pci/Makefile > +++ b/drivers/pci/Makefile > @@ -10,10 +10,10 @@ obj-$(CONFIG_PCI) += access.o bus.o probe.o host-bridge.o \ > ifdef CONFIG_PCI > obj-$(CONFIG_PROC_FS) += proc.o > obj-$(CONFIG_SYSFS) += slot.o > -obj-$(CONFIG_OF) += of.o > obj-$(CONFIG_ACPI) += pci-acpi.o > endif > > +obj-$(CONFIG_OF) += of.o > obj-$(CONFIG_PCI_QUIRKS) += quirks.o > obj-$(CONFIG_PCIEPORTBUS) += pcie/ > obj-$(CONFIG_HOTPLUG_PCI) += hotplug/ > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > index 3d32da15c215..8095933f8452 100644 > --- a/drivers/pci/of.c > +++ b/drivers/pci/of.c > @@ -15,6 +15,7 @@ > #include > #include "pci.h" > > +#ifdef CONFIG_PCI > void pci_set_of_node(struct pci_dev *dev) > { > if (!dev->bus->dev.of_node) > @@ -196,27 +197,6 @@ int of_get_pci_domain_nr(struct device_node *node) > } > EXPORT_SYMBOL_GPL(of_get_pci_domain_nr); > > -/** > - * This function will try to find the limitation of link speed by finding > - * a property called "max-link-speed" of the given device node. > - * > - * @node: device tree node with the max link speed information > - * > - * Returns the associated max link speed from DT, or a negative value if the > - * required property is not found or is invalid. > - */ > -int of_pci_get_max_link_speed(struct device_node *node) > -{ > - u32 max_link_speed; > - > - if (of_property_read_u32(node, "max-link-speed", &max_link_speed) || > - max_link_speed > 4) > - return -EINVAL; > - > - return max_link_speed; > -} > -EXPORT_SYMBOL_GPL(of_pci_get_max_link_speed); > - > /** > * of_pci_check_probe_only - Setup probe only mode if linux,pci-probe-only > * is present and valid > @@ -537,3 +517,25 @@ int pci_parse_request_of_pci_ranges(struct device *dev, > return err; > } > > +#endif /* CONFIG_PCI */ > + > +/** > + * This function will try to find the limitation of link speed by finding > + * a property called "max-link-speed" of the given device node. > + * > + * @node: device tree node with the max link speed information > + * > + * Returns the associated max link speed from DT, or a negative value if the > + * required property is not found or is invalid. > + */ > +int of_pci_get_max_link_speed(struct device_node *node) > +{ > + u32 max_link_speed; > + > + if (of_property_read_u32(node, "max-link-speed", &max_link_speed) || > + max_link_speed > 4) > + return -EINVAL; > + > + return max_link_speed; > +} > +EXPORT_SYMBOL_GPL(of_pci_get_max_link_speed); > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel