diff options
author | Haijun Liu <haijun.liu@mediatek.com> | 2022-08-16 09:53:53 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-08-17 11:53:53 +0100 |
commit | 140424d90165d83c75b23ead7c3573bb6dd74f50 (patch) | |
tree | f6999fc5ddee49287cc19a4d5c762ccf578a7fdf /drivers/net/wwan/t7xx/t7xx_pci_rescan.h | |
parent | 007f26f0d68e28509d369fe0e71845e095bdd955 (diff) |
net: wwan: t7xx: PCIe reset rescan
PCI rescan module implements "rescan work queue". In firmware flashing
or coredump collection procedure WWAN device is programmed to boot in
fastboot mode and a work item is scheduled for removal & detection.
The WWAN device is reset using APCI call as part driver removal flow.
Work queue rescans pci bus at fixed interval for device detection,
later when device is detect work queue exits.
Signed-off-by: Haijun Liu <haijun.liu@mediatek.com>
Co-developed-by: Madhusmita Sahu <madhusmita.sahu@intel.com>
Signed-off-by: Madhusmita Sahu <madhusmita.sahu@intel.com>
Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan/t7xx/t7xx_pci_rescan.h')
-rw-r--r-- | drivers/net/wwan/t7xx/t7xx_pci_rescan.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wwan/t7xx/t7xx_pci_rescan.h b/drivers/net/wwan/t7xx/t7xx_pci_rescan.h new file mode 100644 index 000000000000..de4ca1363bb0 --- /dev/null +++ b/drivers/net/wwan/t7xx/t7xx_pci_rescan.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-only + * + * Copyright (c) 2021, MediaTek Inc. + * Copyright (c) 2021-2022, Intel Corporation. + */ + +#ifndef __T7XX_PCI_RESCAN_H__ +#define __T7XX_PCI_RESCAN_H__ + +#define MTK_RESCAN_WQ "mtk_rescan_wq" + +#define DELAY_RESCAN_MTIME 1000 +#define RESCAN_RETRIES 35 + +struct remove_rescan_context { + struct work_struct service_task; + struct workqueue_struct *pcie_rescan_wq; + spinlock_t dev_lock; /* protects device */ + struct pci_dev *dev; + int rescan_done; +}; + +void t7xx_pci_dev_rescan(void); +void t7xx_rescan_queue_work(struct pci_dev *pdev); +int t7xx_rescan_init(void); +void t7xx_rescan_deinit(void); +void t7xx_rescan_done(void); + +#endif /* __T7XX_PCI_RESCAN_H__ */ |