All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: hci_bcm: Don't change runtime-status when not using runtime-pm
@ 2018-03-19 21:02 Hans de Goede
  2018-03-19 21:02 ` [PATCH 2/2] Bluetooth: hci_bcm: Add broken-irq dmi blacklist and add Meegopad T08 to it Hans de Goede
  2018-03-24  8:02 ` [PATCH 1/2] Bluetooth: hci_bcm: Don't change runtime-status when not using runtime-pm Lukas Wunner
  0 siblings, 2 replies; 8+ messages in thread
From: Hans de Goede @ 2018-03-19 21:02 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, Lukas Wunner, linux-bluetooth, linux-serial,
	linux-acpi

The pm_runtime_set_suspended() call in bcm_close() is intended as a
counterpart to the pm_runtime_set_active() call from bcm_request_irq()
(which gets called from bcm_setup()).

The pm_runtime_set_active() call only happens if our pre-requisites for
doing runtime-pm are met. This commit adds the same check to the
pm_runtime_set_suspended() call to avoid the runtime-pm state getting
stuck in suspended after after a bcm_close().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/hci_bcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index eee33b0e4d67..06e2434c9b3d 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -464,7 +464,7 @@ static int bcm_close(struct hci_uart *hu)
 		err = bcm_gpio_set_power(bdev, false);
 		if (err)
 			bt_dev_err(hu->hdev, "Failed to power down");
-		else
+		else if (IS_ENABLED(CONFIG_PM) && bdev->irq > 0)
 			pm_runtime_set_suspended(bdev->dev);
 	}
 	mutex_unlock(&bcm_device_lock);
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-03 14:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-19 21:02 [PATCH 1/2] Bluetooth: hci_bcm: Don't change runtime-status when not using runtime-pm Hans de Goede
2018-03-19 21:02 ` [PATCH 2/2] Bluetooth: hci_bcm: Add broken-irq dmi blacklist and add Meegopad T08 to it Hans de Goede
2018-03-24  8:02 ` [PATCH 1/2] Bluetooth: hci_bcm: Don't change runtime-status when not using runtime-pm Lukas Wunner
2018-03-24 11:07   ` Hans de Goede
2018-03-24 14:19     ` Lukas Wunner
2018-04-03 12:55       ` Hans de Goede
2018-04-03 14:16         ` Marcel Holtmann
2018-04-03 14:42           ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.