Message ID | 20250225053955.3781831-5-xu.yang_2@nxp.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | add USB2.0 support for i.MX95-19x19 EVK board | expand |
Hi Xu, kernel test robot noticed the following build errors: [auto build test ERROR on shawnguo/for-next] [also build test ERROR on tty/tty-testing tty/tty-next tty/tty-linus linus/master v6.14-rc4 next-20250225] [cannot apply to usb/usb-testing usb/usb-next usb/usb-linus] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Xu-Yang/dt-bindings-usb-chipidea-Add-i-MX95-compatible-string-fsl-imx95-usb/20250225-134215 base: https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git for-next patch link: https://lore.kernel.org/r/20250225053955.3781831-5-xu.yang_2%40nxp.com patch subject: [PATCH v2 4/6] usb: chipidea: imx: add wakeup interrupt handling config: x86_64-buildonly-randconfig-003-20250226 (https://download.01.org/0day-ci/archive/20250226/202502261559.XexYUCXi-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250226/202502261559.XexYUCXi-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202502261559.XexYUCXi-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/usb/chipidea/ci_hdrc_imx.c: In function 'imx_controller_resume': >> drivers/usb/chipidea/ci_hdrc_imx.c:633:14: error: implicit declaration of function 'irqd_irq_disabled'; did you mean 'arch_irqs_disabled'? [-Werror=implicit-function-declaration] 633 | if (!irqd_irq_disabled(irq_get_irq_data(data->wakeup_irq))) | ^~~~~~~~~~~~~~~~~ | arch_irqs_disabled >> drivers/usb/chipidea/ci_hdrc_imx.c:633:32: error: implicit declaration of function 'irq_get_irq_data'; did you mean 'irq_set_irq_wake'? [-Werror=implicit-function-declaration] 633 | if (!irqd_irq_disabled(irq_get_irq_data(data->wakeup_irq))) | ^~~~~~~~~~~~~~~~ | irq_set_irq_wake cc1: some warnings being treated as errors vim +633 drivers/usb/chipidea/ci_hdrc_imx.c 616 617 static int imx_controller_resume(struct device *dev, 618 pm_message_t msg) 619 { 620 struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); 621 int ret = 0; 622 623 dev_dbg(dev, "at %s\n", __func__); 624 625 if (!data->in_lpm) { 626 WARN_ON(1); 627 return 0; 628 } 629 630 if (data->plat_data->flags & CI_HDRC_PMQOS) 631 cpu_latency_qos_add_request(&data->pm_qos_req, 0); 632 > 633 if (!irqd_irq_disabled(irq_get_irq_data(data->wakeup_irq))) 634 disable_irq_nosync(data->wakeup_irq); 635 636 ret = imx_prepare_enable_clks(dev); 637 if (ret) 638 return ret; 639 640 data->in_lpm = false; 641 642 ret = imx_usbmisc_resume(data->usbmisc_data, 643 PMSG_IS_AUTO(msg) || device_may_wakeup(dev)); 644 if (ret) { 645 dev_err(dev, "usbmisc resume failed, ret=%d\n", ret); 646 goto clk_disable; 647 } 648 649 return 0; 650 651 clk_disable: 652 imx_disable_unprepare_clks(dev); 653 return ret; 654 } 655
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 1a7fc638213e..b36fc8c19748 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -98,6 +98,7 @@ struct ci_hdrc_imx_data { struct clk *clk; struct clk *clk_wakeup; struct imx_usbmisc_data *usbmisc_data; + int wakeup_irq; bool supports_runtime_pm; bool override_phy_control; bool in_lpm; @@ -336,6 +337,16 @@ static int ci_hdrc_imx_notify_event(struct ci_hdrc *ci, unsigned int event) return ret; } +static irqreturn_t ci_wakeup_irq_handler(int irq, void *data) +{ + struct ci_hdrc_imx_data *imx_data = data; + + disable_irq_nosync(irq); + pm_runtime_resume(&imx_data->ci_pdev->dev); + + return IRQ_HANDLED; +} + static int ci_hdrc_imx_probe(struct platform_device *pdev) { struct ci_hdrc_imx_data *data; @@ -476,6 +487,16 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) if (pdata.flags & CI_HDRC_SUPPORTS_RUNTIME_PM) data->supports_runtime_pm = true; + data->wakeup_irq = platform_get_irq_optional(pdev, 1); + if (data->wakeup_irq > 0) { + ret = devm_request_threaded_irq(dev, data->wakeup_irq, + NULL, ci_wakeup_irq_handler, + IRQF_ONESHOT | IRQF_NO_AUTOEN, + pdata.name, data); + if (ret) + goto err_clk; + } + ret = imx_usbmisc_init(data->usbmisc_data); if (ret) { dev_err(dev, "usbmisc init failed, ret=%d\n", ret); @@ -584,6 +605,7 @@ static int imx_controller_suspend(struct device *dev, } imx_disable_unprepare_clks(dev); + enable_irq(data->wakeup_irq); if (data->plat_data->flags & CI_HDRC_PMQOS) cpu_latency_qos_remove_request(&data->pm_qos_req); @@ -608,6 +630,9 @@ static int imx_controller_resume(struct device *dev, if (data->plat_data->flags & CI_HDRC_PMQOS) cpu_latency_qos_add_request(&data->pm_qos_req, 0); + if (!irqd_irq_disabled(irq_get_irq_data(data->wakeup_irq))) + disable_irq_nosync(data->wakeup_irq); + ret = imx_prepare_enable_clks(dev); if (ret) return ret; @@ -643,6 +668,10 @@ static int ci_hdrc_imx_suspend(struct device *dev) return ret; pinctrl_pm_select_sleep_state(dev); + + if (device_may_wakeup(dev)) + enable_irq_wake(data->wakeup_irq); + return ret; } @@ -651,6 +680,9 @@ static int ci_hdrc_imx_resume(struct device *dev) struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); int ret; + if (device_may_wakeup(dev)) + disable_irq_wake(data->wakeup_irq); + pinctrl_pm_select_default_state(dev); ret = imx_controller_resume(dev, PMSG_RESUME); if (!ret && data->supports_runtime_pm) {
In previous imx platform, normal USB controller interrupt and wakeup interrupt are bound to one irq line. However, it changes on latest i.MX95 platform since it has a dedicated irq line for wakeup interrupt. This will add wakeup interrupt handling for i.MX95 to support various wakeup events. Signed-off-by: Xu Yang <xu.yang_2@nxp.com> --- Changes in v2: - rename irq to wakeup_irq - disable irq by default - enable irq when suspend, disable irq when resume --- drivers/usb/chipidea/ci_hdrc_imx.c | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)