Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4dc3ac7 authored by Jinesh K. Jayakumar's avatar Jinesh K. Jayakumar Committed by Gerrit - the friendly Code Review server
Browse files

net: aquantia: Detach SMMU during PCI device removal



Enable support for performing SMMU detach during PCI device removal
that is required for converting the driver to a loadable module.

Change-Id: Id5361db7607fa647308ba1eaaa5159cbc0add272
Signed-off-by: default avatarJinesh K. Jayakumar <jineshk@codeaurora.org>
parent cdfc6e8e
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -29,20 +29,4 @@ config AQFWD

source "drivers/net/ethernet/aquantia/atlantic-fwd/Kconfig"

config AQFWD_QCOM
	bool "QTI MSM/MDM target support"
	depends on AQFWD
	depends on ARCH_QCOM
	help
	  Enable support for integration with Qualcomm Technologies, Inc. chipsets.

config AQFWD_QCOM_IPA
	bool "QTI IPA offload support"
	depends on IPA_ETH
	select AQFWD_QCOM
	select ATLFWD_FWD
	help
	  Enable support for Qualcomm Technologies, Inc. IPA (Internet Protocol Accelerator).
	  If unsure, say N.

endif # NET_VENDOR_AQUANTIA
+21 −0
Original line number Diff line number Diff line
@@ -42,3 +42,24 @@ config ATLFWD_FWD_TXBUF
	 API enabled, 0 otherwise.

endif

config AQFWD_QCOM
	bool "QTI MSM/MDM target support"
	depends on AQFWD
	depends on ARCH_QCOM
	help
	  Some older targets using Qualcomm Technologies, Inc. chipsets
	  require peripheral drivers to explicitly set IOMMU attributes
	  and perform IOMMU attach. Enable this option if your platform
	  is affected. Using this feature will also require the user to
	  provide SMMU configuration via PCI device tree.
	  If unsure, say N.

config AQFWD_QCOM_IPA
	bool "QTI IPA offload support"
	depends on IPA_ETH
	select AQFWD_QCOM
	select ATLFWD_FWD
	help
	  Enable support for Qualcomm Technologies, Inc. IPA (Internet Protocol Accelerator).
	  If unsure, say N.
+0 −2
Original line number Diff line number Diff line
@@ -40,8 +40,6 @@ atlantic-fwd-objs := atl_fw.o \

atlantic-fwd-$(CONFIG_ATLFWD_FWD) += atl_fwd.o

atlantic-fwd-$(CONFIG_OF) += atl_of.o

atlantic-fwd-$(CONFIG_AQFWD_QCOM) += atl_qcom.o
atlantic-fwd-$(CONFIG_AQFWD_QCOM_IPA) += atl_qcom_ipa.o

+5 −11
Original line number Diff line number Diff line
@@ -13,9 +13,7 @@
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>

#include "atl_qcom_ipa.h"

#include "atl_of.h"
#include "atl_qcom.h"

const char atl_driver_name[] = "atlantic-fwd";

@@ -358,10 +356,6 @@ static int atl_probe(struct pci_dev *pdev, const struct pci_device_id *id)
	struct atl_hw *hw;
	int disable_needed;

	ret = atl_parse_dt(&pdev->dev);
	if (ret)
		return ret;

	ret = pci_enable_device_mem(pdev);
	if (ret)
		return ret;
@@ -704,9 +698,9 @@ static int __init atl_module_init(void)
		return -ENOMEM;
	}

	ret = atl_qcom_ipa_register(&atl_pci_ops);
	ret = atl_qcom_register(&atl_pci_ops);
	if (ret) {
		pr_err("%s: Failed to register driver with IPA\n",
		pr_err("%s: Failed to register driver with platform\n",
		       atl_driver_name);
		destroy_workqueue(atl_wq);
		return ret;
@@ -714,7 +708,7 @@ static int __init atl_module_init(void)

	ret = pci_register_driver(&atl_pci_ops);
	if (ret) {
		atl_qcom_ipa_unregister(&atl_pci_ops);
		atl_qcom_unregister(&atl_pci_ops);
		destroy_workqueue(atl_wq);
		return ret;
	}
@@ -727,7 +721,7 @@ static void __exit atl_module_exit(void)
{
	pci_unregister_driver(&atl_pci_ops);

	atl_qcom_ipa_unregister(&atl_pci_ops);
	atl_qcom_unregister(&atl_pci_ops);

	if (atl_wq) {
		destroy_workqueue(atl_wq);
+0 −41
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <linux/of.h>

#include "atl_qcom.h"
#include "atl_of.h"

static const struct of_device_id aqc_matches[] = {
	{ .compatible = "aquantia,aqc-107" },
	{ .compatible = "aquantia,aqc-108" },
	{ .compatible = "aquantia,aqc-109" },
};

int atl_parse_dt(struct device *dev)
{
	if (!dev->of_node) {
		dev_dbg(dev, "device tree node is not present\n");
		return 0;
	}

	if (!of_match_node(aqc_matches, dev->of_node)) {
		dev_notice(dev, "device tree node is not compatible\n");
		return 0;
	}

	/* Aquantia properties go here */

	/* OEM properties go here */

	return atl_qcom_parse_dt(dev);
}
Loading