On 30/06/17 18:59, Loic Poulain wrote: > Yes, but there is no IRQ assigned to your bcm_device. > Actually seems you find an other "issue", the bcm_request_irq() returns > an error only on request_irq failure. However in your case, you never > assigned the bcm->irq, so bcm_request_irq does not even try to request > the irq and returns success. Yes, thats what I was getting at. I solved it by setting err to -EINVAL to begin with, rather than 0, as a temporary hack, as I wasn't sure of the original functions intent. Your solution is cleaner, so I've tested it, it works. > You should try the following: > > diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c > index be53238..586f3d0 100644 > --- a/drivers/bluetooth/hci_bcm.c > +++ b/drivers/bluetooth/hci_bcm.c > @@ -185,22 +185,24 @@ static int bcm_request_irq(struct bcm_data *bcm) > goto unlock; > } > > - if (bdev->irq > 0) { > - err = devm_request_irq(&bdev->pdev->dev, bdev->irq, > - bcm_host_wake, IRQF_TRIGGER_RISING, > - "host_wake", bdev); > - if (err) > - goto unlock; > - > - device_init_wakeup(&bdev->pdev->dev, true); > - > - pm_runtime_set_autosuspend_delay(&bdev->pdev->dev, > - BCM_AUTOSUSPEND_DELAY); > - pm_runtime_use_autosuspend(&bdev->pdev->dev); > - pm_runtime_set_active(&bdev->pdev->dev); > - pm_runtime_enable(&bdev->pdev->dev); > + if (bdev->irq <= 0) { > + err = -EOPNOTSUPP; > + goto unlock; > } > > + err = devm_request_irq(&bdev->pdev->dev, bdev->irq, bcm_host_wake, > + IRQF_TRIGGER_RISING, "host_wake", bdev); > + if (err) > + goto unlock; > + > + device_init_wakeup(&bdev->pdev->dev, true); > + > + pm_runtime_set_autosuspend_delay(&bdev->pdev->dev, > + BCM_AUTOSUSPEND_DELAY); > + pm_runtime_use_autosuspend(&bdev->pdev->dev); > + pm_runtime_set_active(&bdev->pdev->dev); > + pm_runtime_enable(&bdev->pdev->dev); > + > unlock: > mutex_unlock(&bcm_device_lock); > -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html