diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index cfe09117fe6c..7c7ab2cb0ebf 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -3991,6 +3991,10 @@ static int bcmgenet_probe(struct platform_device *pdev) } priv->wol_irq = platform_get_irq_optional(pdev, 2); + dev_info(&pdev->dev, "IRQ0: %d (%u), IRQ1: %d (%u), Wol IRQ: %d (%u)\n", + priv->irq0, priv->irq1, priv->wol_irq, + priv->irq0, priv->irq1, priv->wol_irq); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) { err = PTR_ERR(priv->base); @@ -4021,10 +4025,13 @@ static int bcmgenet_probe(struct platform_device *pdev) /* Request the WOL interrupt and advertise suspend if available */ priv->wol_irq_disabled = true; if (priv->wol_irq > 0) { + dev_info(&pdev->dev, "Wol IRQ > 0 requesting WoL ISR\n"); err = devm_request_irq(&pdev->dev, priv->wol_irq, bcmgenet_wol_isr, 0, dev->name, priv); - if (!err) + if (!err) { + dev_info(&pdev->dev, "Marking device as wake-up capable\n"); device_set_wakeup_capable(&pdev->dev, 1); + } } /* Set the needed headroom to account for any possible diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c index e31a5a397f11..26efa4d175a7 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c @@ -57,11 +57,15 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) struct bcmgenet_priv *priv = netdev_priv(dev); struct device *kdev = &priv->pdev->dev; - if (!device_can_wakeup(kdev)) + if (!device_can_wakeup(kdev)) { + dev_err(kdev, "Device cannot wake-up\n"); return -ENOTSUPP; + } - if (wol->wolopts & ~(WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER)) + if (wol->wolopts & ~(WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER)) { + dev_err(kdev, "Invalid wolopts\n"); return -EINVAL; + } if (wol->wolopts & WAKE_MAGICSECURE) memcpy(priv->sopass, wol->sopass, sizeof(priv->sopass)); @@ -69,6 +73,7 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) /* Flag the device and relevant IRQ as wakeup capable */ if (wol->wolopts) { device_set_wakeup_enable(kdev, 1); + dev_info(kdev, "Enabling device for wake-up\n"); /* Avoid unbalanced enable_irq_wake calls */ if (priv->wol_irq_disabled) enable_irq_wake(priv->wol_irq); diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index f23ffd30385b..d1a436f29a3a 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -841,11 +841,15 @@ static int set_irq_wake_real(unsigned int irq, unsigned int on) struct irq_desc *desc = irq_to_desc(irq); int ret = -ENXIO; - if (irq_desc_get_chip(desc)->flags & IRQCHIP_SKIP_SET_WAKE) + if (irq_desc_get_chip(desc)->flags & IRQCHIP_SKIP_SET_WAKE) { + pr_info("%s: IRQ chip is marked with IRQCHIP_SKIP_SET_WAKE\n", __func__); return 0; + } - if (desc->irq_data.chip->irq_set_wake) + if (desc->irq_data.chip->irq_set_wake) { ret = desc->irq_data.chip->irq_set_wake(&desc->irq_data, on); + pr_info("%s: irq_set_wake returned: %d for IRQ: %d\n", __func__, irq); + } return ret; } @@ -875,8 +879,12 @@ int irq_set_irq_wake(unsigned int irq, unsigned int on) struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL); int ret = 0; - if (!desc) + pr_info("%s: called with IRQ: %d on: %d\n", __func__, irq, on); + + if (!desc) { + pr_err("%s: invalid descriptor\n", __func__); return -EINVAL; + } /* Don't use NMIs as wake up interrupts please */ if (desc->istate & IRQS_NMI) { @@ -909,6 +917,7 @@ int irq_set_irq_wake(unsigned int irq, unsigned int on) out_unlock: irq_put_desc_busunlock(desc, flags); + pr_info("%s: returning %d for IRQ: %d\n", __func__, ret, irq); return ret; } EXPORT_SYMBOL(irq_set_irq_wake);