All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option
@ 2018-03-16 20:28 Hans de Goede
  2018-03-16 20:28 ` [PATCH 2/5] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Hans de Goede
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Hans de Goede @ 2018-03-16 20:28 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, linux-bluetooth, linux-serial, linux-acpi, stable

Add irq_polarity module option for easier troubleshooting of irq-polarity
issues.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/hci_bcm.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 5e3aba3c3185..bb6cd1623132 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -126,6 +126,10 @@ struct bcm_data {
 static DEFINE_MUTEX(bcm_device_lock);
 static LIST_HEAD(bcm_device_list);
 
+static int irq_polarity = -1;
+module_param(irq_polarity, int, 0444);
+MODULE_PARM_DESC(irq_polarity, "IRQ polarity 0: active-high 1: active-low");
+
 static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
 {
 	if (hu->serdev)
@@ -988,11 +992,17 @@ static int bcm_acpi_probe(struct bcm_device *dev)
 	}
 	acpi_dev_free_resource_list(&resources);
 
-	dmi_id = dmi_first_match(bcm_active_low_irq_dmi_table);
-	if (dmi_id) {
-		dev_warn(dev->dev, "%s: Overwriting IRQ polarity to active low",
-			    dmi_id->ident);
-		dev->irq_active_low = true;
+	if (irq_polarity != -1) {
+		dev->irq_active_low = irq_polarity;
+		dev_warn(dev->dev, "Overwriting IRQ polarity to active %s by module-param\n",
+			 dev->irq_active_low ? "low" : "high");
+	} else {
+		dmi_id = dmi_first_match(bcm_active_low_irq_dmi_table);
+		if (dmi_id) {
+			dev_warn(dev->dev, "%s: Overwriting IRQ polarity to active low",
+				 dmi_id->ident);
+			dev->irq_active_low = true;
+		}
 	}
 
 	return 0;
-- 
2.14.3

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

* [PATCH 2/5] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low
  2018-03-16 20:28 [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
@ 2018-03-16 20:28 ` Hans de Goede
  2018-03-16 20:28 ` [PATCH 3/5] Bluetooth: hci_bcm: Add 6 new ACPI HIDs Hans de Goede
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2018-03-16 20:28 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, linux-bluetooth, linux-serial, linux-acpi, stable

Older devices with a serdev attached bcm bt hci, use an Interrupt ACPI
resource to describe the IRQ (rather then a GpioInt resource).

These device seem to all claim the IRQ is active-high and seem to all need
a DMI quirk to treat it as active-low. Instead simply always assume that
Interrupt resource specified IRQs are always active-low.

This fixes the bt device not being able to wake the host from runtime-
suspend on the: Asus T100TAM, Asus T200TA, Lenovo Yoga2 and the Toshiba
Encore, without the need to add 4 new DMI quirks for these models.

This also allows us to remove 2 DMI quirks for the Asus T100TA and Asus
T100CHI series. Likely the 2 remaining quirks can also be removed but I
could not find a DSDT of these devices to verify this.

Cc: stable@vger.kernel.org
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=198953
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1554835
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/hci_bcm.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index bb6cd1623132..7acd77a53b08 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -799,22 +799,6 @@ static const struct acpi_gpio_mapping acpi_bcm_int_first_gpios[] = {
 #ifdef CONFIG_ACPI
 /* IRQ polarity of some chipsets are not defined correctly in ACPI table. */
 static const struct dmi_system_id bcm_active_low_irq_dmi_table[] = {
-	{
-		.ident = "Asus T100TA",
-		.matches = {
-			DMI_EXACT_MATCH(DMI_SYS_VENDOR,
-					"ASUSTeK COMPUTER INC."),
-			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
-		},
-	},
-	{
-		.ident = "Asus T100CHI",
-		.matches = {
-			DMI_EXACT_MATCH(DMI_SYS_VENDOR,
-					"ASUSTeK COMPUTER INC."),
-			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100CHI"),
-		},
-	},
 	{	/* Handle ThinkPad 8 tablets with BCM2E55 chipset ACPI ID */
 		.ident = "Lenovo ThinkPad 8",
 		.matches = {
@@ -842,7 +826,9 @@ static int bcm_resource(struct acpi_resource *ares, void *data)
 	switch (ares->type) {
 	case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
 		irq = &ares->data.extended_irq;
-		dev->irq_active_low = irq->polarity == ACPI_ACTIVE_LOW;
+		if (irq->polarity != ACPI_ACTIVE_LOW)
+			dev_info(dev->dev, "ACPI Interrupt resource is active-high, this is usually wrong, treating the IRQ as active-low\n");
+		dev->irq_active_low = true;
 		break;
 
 	case ACPI_RESOURCE_TYPE_GPIO:
-- 
2.14.3

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

* [PATCH 3/5] Bluetooth: hci_bcm: Add 6 new ACPI HIDs
  2018-03-16 20:28 [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
  2018-03-16 20:28 ` [PATCH 2/5] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Hans de Goede
@ 2018-03-16 20:28 ` Hans de Goede
  2018-03-16 20:28 ` [PATCH 4/5] Bluetooth: hci_bcm: Remove duplication in gpio-mappings declaration Hans de Goede
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2018-03-16 20:28 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, linux-bluetooth, linux-serial, linux-acpi, stable

Add 6 new ACPI HIDs to enable bluetooth on devices using these HIDs,
I've tested the following HIDs / devices:

BCM2E74: Jumper ezPad mini 3
BCM2E83: Acer Iconia Tab8 w1-810
BCM2E90: Meegopad T08
BCM2EAA: Chuwi Vi8 plus (CWI519)

The reporter of Red Hat bugzilla 1554835 has tested:
BCM2E84: Lenovo Yoga2

The reporter of kernel bugzilla 274481 has tested:
BCM2E38: Toshiba Encore

Note the Lenovo Yoga2 and Toshiba Encore also needs the earlier patch to
treat all Interrupt ACPI resources as active low.

Cc: stable@vger.kernel.org
Buglink: https://bugzilla.kernel.org/attachment.cgi?id=274481
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1554835
Reported-and-tested-by: Robert R. Howell <rhowell@uwyo.edu>
Reported-and-tested-by: Christian Herzog <daduke@daduke.org>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/hci_bcm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 7acd77a53b08..18416c435b20 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -1075,6 +1075,7 @@ static const struct hci_uart_proto bcm_proto = {
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id bcm_acpi_match[] = {
 	{ "BCM2E1A", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
+	{ "BCM2E38", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E39", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E3A", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E3D", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
@@ -1087,12 +1088,17 @@ static const struct acpi_device_id bcm_acpi_match[] = {
 	{ "BCM2E67", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E71", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E72", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
+	{ "BCM2E74", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E7B", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E7C", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E7E", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
+	{ "BCM2E83", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
+	{ "BCM2E84", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
+	{ "BCM2E90", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
 	{ "BCM2E95", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
 	{ "BCM2E96", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
 	{ "BCM2EA4", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
+	{ "BCM2EAA", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, bcm_acpi_match);
-- 
2.14.3

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

* [PATCH 4/5] Bluetooth: hci_bcm: Remove duplication in gpio-mappings declaration
  2018-03-16 20:28 [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
  2018-03-16 20:28 ` [PATCH 2/5] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Hans de Goede
  2018-03-16 20:28 ` [PATCH 3/5] Bluetooth: hci_bcm: Add 6 new ACPI HIDs Hans de Goede
@ 2018-03-16 20:28 ` Hans de Goede
  2018-03-16 20:28 ` [PATCH 5/5] Bluetooth: hci_bcm: Do not tie GPIO pin order to a specific ACPI HID Hans de Goede
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2018-03-16 20:28 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, linux-bluetooth, linux-serial, linux-acpi

We declare the same set of const acpi_gpio_params twice with different
names, besides the needless duplication this naming leads to a sortof
double indirection which also makes it harder to see how the mapping is
actually setup.

This commit renames the first set to have generic names, which better
describe the contents of the mapping and drops the second set.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/hci_bcm.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 18416c435b20..3c7fc5d6ef9f 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -774,25 +774,21 @@ static int bcm_resume(struct device *dev)
 }
 #endif
 
-static const struct acpi_gpio_params int_last_device_wakeup_gpios = { 0, 0, false };
-static const struct acpi_gpio_params int_last_shutdown_gpios = { 1, 0, false };
-static const struct acpi_gpio_params int_last_host_wakeup_gpios = { 2, 0, false };
+static const struct acpi_gpio_params first_gpio = { 0, 0, false };
+static const struct acpi_gpio_params second_gpio = { 1, 0, false };
+static const struct acpi_gpio_params third_gpio = { 2, 0, false };
 
 static const struct acpi_gpio_mapping acpi_bcm_int_last_gpios[] = {
-	{ "device-wakeup-gpios", &int_last_device_wakeup_gpios, 1 },
-	{ "shutdown-gpios", &int_last_shutdown_gpios, 1 },
-	{ "host-wakeup-gpios", &int_last_host_wakeup_gpios, 1 },
+	{ "device-wakeup-gpios", &first_gpio, 1 },
+	{ "shutdown-gpios", &second_gpio, 1 },
+	{ "host-wakeup-gpios", &third_gpio, 1 },
 	{ },
 };
 
-static const struct acpi_gpio_params int_first_host_wakeup_gpios = { 0, 0, false };
-static const struct acpi_gpio_params int_first_device_wakeup_gpios = { 1, 0, false };
-static const struct acpi_gpio_params int_first_shutdown_gpios = { 2, 0, false };
-
 static const struct acpi_gpio_mapping acpi_bcm_int_first_gpios[] = {
-	{ "device-wakeup-gpios", &int_first_device_wakeup_gpios, 1 },
-	{ "shutdown-gpios", &int_first_shutdown_gpios, 1 },
-	{ "host-wakeup-gpios", &int_first_host_wakeup_gpios, 1 },
+	{ "host-wakeup-gpios", &first_gpio, 1 },
+	{ "device-wakeup-gpios", &second_gpio, 1 },
+	{ "shutdown-gpios", &third_gpio, 1 },
 	{ },
 };
 
-- 
2.14.3

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

* [PATCH 5/5] Bluetooth: hci_bcm: Do not tie GPIO pin order to a specific ACPI HID
  2018-03-16 20:28 [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
                   ` (2 preceding siblings ...)
  2018-03-16 20:28 ` [PATCH 4/5] Bluetooth: hci_bcm: Remove duplication in gpio-mappings declaration Hans de Goede
@ 2018-03-16 20:28 ` Hans de Goede
  2018-03-23 10:56 ` [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
  2018-03-23 20:51 ` Marcel Holtmann
  5 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2018-03-16 20:28 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, linux-bluetooth, linux-serial, linux-acpi

Since I've been doing a lot of work on Linux Bay Trail / Cherry Trail
support, I've gathered a collection of ACPI DSDTs from about 50 such
machines.

Looking at these DSTDs many have an ACPI device entry describing a bcm
bluetooth device (often disabled in the DSDT), quite a few of these ACPI
device entries have a resource-table where the order does not match with
the order currently associated with the HID of that entry in the
bcm_acpi_match table.

Looking at the Windows .inf files, there is nothing indicating a specific
order there, so I believe that there is no 1:1 mapping between the ACPI
HID and the order in which the resources are listed.

Therefor this commit replaces the hardcoded mapping based on ACPI HID,
with code which actually checks in which order the resources are listed
and bases the gpio-mapping on that.

This should ensure that we always pick the right mapping and this will
make adding new ACPI HIDs to the driver easier.

This has been tested on the following devices:
-Asus T100CHI           BCM2E39 / brcmfmac43241b4-sdio / BCM4324B3-37.4M.hcd
-Asus T100TA            BCM2E39 / brcmfmac43241b4-sdio / BCM4324B3-37.4M.hcd
-Asus T200TA            BCM2E65 / brcmfmac43340-sdio   / BCM43341B0-37.4M.hcd
-Jumper ezPad mini 3    BCM2E74 / brcmfmac43430a0-sdio / BCM4343A0-26M.hcd
-Acer Iconia Tab8 w1-8  BCM2E83 / brcmfmac4330-sdio    / BCM4330B1-26M.hcd
-Chuwi Vi8 plus(CWI519) BCM2EAA / brcmfmac43430-sdio   / BCM43430A1-26M.hcd

Which together cover all 3 combinations of using an Interrupt resource /
GpioInt resource as first resource / GpioInt resource as last resource.

Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/hci_bcm.c | 91 +++++++++++++++++++++++++++------------------
 1 file changed, 55 insertions(+), 36 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 3c7fc5d6ef9f..13f8dda11715 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -98,6 +98,8 @@ struct bcm_device {
 	int			(*set_shutdown)(struct bcm_device *, bool);
 #ifdef CONFIG_ACPI
 	acpi_handle		btlp, btpu, btpd;
+	int			gpio_count;
+	int			gpio_int_idx;
 #endif
 
 	struct clk		*clk;
@@ -829,8 +831,11 @@ static int bcm_resource(struct acpi_resource *ares, void *data)
 
 	case ACPI_RESOURCE_TYPE_GPIO:
 		gpio = &ares->data.gpio;
-		if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT)
+		if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT) {
+			dev->gpio_int_idx = dev->gpio_count;
 			dev->irq_active_low = gpio->polarity == ACPI_ACTIVE_LOW;
+		}
+		dev->gpio_count++;
 		break;
 
 	case ACPI_RESOURCE_TYPE_SERIAL_BUS:
@@ -947,20 +952,11 @@ static int bcm_acpi_probe(struct bcm_device *dev)
 	LIST_HEAD(resources);
 	const struct dmi_system_id *dmi_id;
 	const struct acpi_gpio_mapping *gpio_mapping = acpi_bcm_int_last_gpios;
-	const struct acpi_device_id *id;
 	struct resource_entry *entry;
 	int ret;
 
-	/* Retrieve GPIO data */
-	id = acpi_match_device(dev->dev->driver->acpi_match_table, dev->dev);
-	if (id)
-		gpio_mapping = (const struct acpi_gpio_mapping *) id->driver_data;
-
-	ret = devm_acpi_dev_add_driver_gpios(dev->dev, gpio_mapping);
-	if (ret)
-		return ret;
-
 	/* Retrieve UART ACPI info */
+	dev->gpio_int_idx = -1;
 	ret = acpi_dev_get_resources(ACPI_COMPANION(dev->dev),
 				     &resources, bcm_resource, dev);
 	if (ret < 0)
@@ -974,6 +970,29 @@ static int bcm_acpi_probe(struct bcm_device *dev)
 	}
 	acpi_dev_free_resource_list(&resources);
 
+	/* If the DSDT uses an Interrupt resource for the IRQ, then there are
+	 * only 2 GPIO resources, we use the irq-last mapping for this, since
+	 * we already have an irq the 3th / last mapping will not be used.
+	 */
+	if (dev->irq)
+		gpio_mapping = acpi_bcm_int_last_gpios;
+	else if (dev->gpio_int_idx == 0)
+		gpio_mapping = acpi_bcm_int_first_gpios;
+	else if (dev->gpio_int_idx == 2)
+		gpio_mapping = acpi_bcm_int_last_gpios;
+	else
+		dev_warn(dev->dev, "Unexpected ACPI gpio_int_idx: %d\n",
+			 dev->gpio_int_idx);
+
+	/* Warn if our expectations are not met. */
+	if (dev->gpio_count != (dev->irq ? 2 : 3))
+		dev_warn(dev->dev, "Unexpected number of ACPI GPIOs: %d\n",
+			 dev->gpio_count);
+
+	ret = devm_acpi_dev_add_driver_gpios(dev->dev, gpio_mapping);
+	if (ret)
+		return ret;
+
 	if (irq_polarity != -1) {
 		dev->irq_active_low = irq_polarity;
 		dev_warn(dev->dev, "Overwriting IRQ polarity to active %s by module-param\n",
@@ -1070,31 +1089,31 @@ static const struct hci_uart_proto bcm_proto = {
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id bcm_acpi_match[] = {
-	{ "BCM2E1A", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E38", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E39", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E3A", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E3D", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E3F", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E40", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E54", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E55", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E64", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E65", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E67", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E71", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E72", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E74", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E7B", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E7C", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E7E", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
-	{ "BCM2E83", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
-	{ "BCM2E84", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E90", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
-	{ "BCM2E95", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
-	{ "BCM2E96", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
-	{ "BCM2EA4", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
-	{ "BCM2EAA", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
+	{ "BCM2E1A" },
+	{ "BCM2E38" },
+	{ "BCM2E39" },
+	{ "BCM2E3A" },
+	{ "BCM2E3D" },
+	{ "BCM2E3F" },
+	{ "BCM2E40" },
+	{ "BCM2E54" },
+	{ "BCM2E55" },
+	{ "BCM2E64" },
+	{ "BCM2E65" },
+	{ "BCM2E67" },
+	{ "BCM2E71" },
+	{ "BCM2E72" },
+	{ "BCM2E74" },
+	{ "BCM2E7B" },
+	{ "BCM2E7C" },
+	{ "BCM2E7E" },
+	{ "BCM2E83" },
+	{ "BCM2E84" },
+	{ "BCM2E90" },
+	{ "BCM2E95" },
+	{ "BCM2E96" },
+	{ "BCM2EA4" },
+	{ "BCM2EAA" },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, bcm_acpi_match);
-- 
2.14.3

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

* Re: [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option
  2018-03-16 20:28 [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
                   ` (3 preceding siblings ...)
  2018-03-16 20:28 ` [PATCH 5/5] Bluetooth: hci_bcm: Do not tie GPIO pin order to a specific ACPI HID Hans de Goede
@ 2018-03-23 10:56 ` Hans de Goede
  2018-03-23 11:16   ` Marcel Holtmann
  2018-03-23 20:51 ` Marcel Holtmann
  5 siblings, 1 reply; 11+ messages in thread
From: Hans de Goede @ 2018-03-23 10:56 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: linux-bluetooth, linux-serial, linux-acpi, stable

Hi Marcel, et al.,

On 16-03-18 21:28, Hans de Goede wrote:
> Add irq_polarity module option for easier troubleshooting of irq-polarity
> issues.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Marcel, is there any reason why this (bug-fix) series is not merged
yet? Any review remarks I missed?

Regards,

Hans



> ---
>   drivers/bluetooth/hci_bcm.c | 20 +++++++++++++++-----
>   1 file changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
> index 5e3aba3c3185..bb6cd1623132 100644
> --- a/drivers/bluetooth/hci_bcm.c
> +++ b/drivers/bluetooth/hci_bcm.c
> @@ -126,6 +126,10 @@ struct bcm_data {
>   static DEFINE_MUTEX(bcm_device_lock);
>   static LIST_HEAD(bcm_device_list);
>   
> +static int irq_polarity = -1;
> +module_param(irq_polarity, int, 0444);
> +MODULE_PARM_DESC(irq_polarity, "IRQ polarity 0: active-high 1: active-low");
> +
>   static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
>   {
>   	if (hu->serdev)
> @@ -988,11 +992,17 @@ static int bcm_acpi_probe(struct bcm_device *dev)
>   	}
>   	acpi_dev_free_resource_list(&resources);
>   
> -	dmi_id = dmi_first_match(bcm_active_low_irq_dmi_table);
> -	if (dmi_id) {
> -		dev_warn(dev->dev, "%s: Overwriting IRQ polarity to active low",
> -			    dmi_id->ident);
> -		dev->irq_active_low = true;
> +	if (irq_polarity != -1) {
> +		dev->irq_active_low = irq_polarity;
> +		dev_warn(dev->dev, "Overwriting IRQ polarity to active %s by module-param\n",
> +			 dev->irq_active_low ? "low" : "high");
> +	} else {
> +		dmi_id = dmi_first_match(bcm_active_low_irq_dmi_table);
> +		if (dmi_id) {
> +			dev_warn(dev->dev, "%s: Overwriting IRQ polarity to active low",
> +				 dmi_id->ident);
> +			dev->irq_active_low = true;
> +		}
>   	}
>   
>   	return 0;
> 

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

* Re: [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option
  2018-03-23 10:56 ` [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
@ 2018-03-23 11:16   ` Marcel Holtmann
  2018-03-23 11:17     ` Hans de Goede
  0 siblings, 1 reply; 11+ messages in thread
From: Marcel Holtmann @ 2018-03-23 11:16 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, linux-serial,
	linux-acpi, stable

Hi Hans,

>> Add irq_polarity module option for easier troubleshooting of irq-polarity
>> issues.
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> Marcel, is there any reason why this (bug-fix) series is not merged
> yet? Any review remarks I missed?

I was waiting for net to be merged back into net-next so that I don’t have to deal with conflicts.

Regards

Marcel

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

* Re: [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option
  2018-03-23 11:16   ` Marcel Holtmann
@ 2018-03-23 11:17     ` Hans de Goede
  2018-03-23 11:23       ` Marcel Holtmann
  0 siblings, 1 reply; 11+ messages in thread
From: Hans de Goede @ 2018-03-23 11:17 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, linux-serial,
	linux-acpi, stable

Hi,

On 23-03-18 12:16, Marcel Holtmann wrote:
> Hi Hans,
> 
>>> Add irq_polarity module option for easier troubleshooting of irq-polarity
>>> issues.
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>
>> Marcel, is there any reason why this (bug-fix) series is not merged
>> yet? Any review remarks I missed?
> 
> I was waiting for net to be merged back into net-next so that I don’t have to deal with conflicts.

Ah ok, no problem. I was just wondering if there was anything
I needed to do.

Regards,

Hans

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

* Re: [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option
  2018-03-23 11:17     ` Hans de Goede
@ 2018-03-23 11:23       ` Marcel Holtmann
  2018-03-23 11:30         ` Hans de Goede
  0 siblings, 1 reply; 11+ messages in thread
From: Marcel Holtmann @ 2018-03-23 11:23 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, linux-serial,
	linux-acpi, stable

Hi Hans,

>>>> Add irq_polarity module option for easier troubleshooting of irq-polarity
>>>> issues.
>>>> Cc: stable@vger.kernel.org
>>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>> 
>>> Marcel, is there any reason why this (bug-fix) series is not merged
>>> yet? Any review remarks I missed?
>> I was waiting for net to be merged back into net-next so that I don’t have to deal with conflicts.
> 
> Ah ok, no problem. I was just wondering if there was anything
> I needed to do.

I would really like to move over to using btuart.c that I posted a few days ago, but that will be obviously more work and maybe it is good to stabilize and simplify this inside hci_bcm.c first.

Regards

Marcel

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

* Re: [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option
  2018-03-23 11:23       ` Marcel Holtmann
@ 2018-03-23 11:30         ` Hans de Goede
  0 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2018-03-23 11:30 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, linux-serial,
	linux-acpi, stable

Hi Marcel,

On 23-03-18 12:23, Marcel Holtmann wrote:
> Hi Hans,
> 
>>>>> Add irq_polarity module option for easier troubleshooting of irq-polarity
>>>>> issues.
>>>>> Cc: stable@vger.kernel.org
>>>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>>>
>>>> Marcel, is there any reason why this (bug-fix) series is not merged
>>>> yet? Any review remarks I missed?
>>> I was waiting for net to be merged back into net-next so that I don’t have to deal with conflicts.
>>
>> Ah ok, no problem. I was just wondering if there was anything
>> I needed to do.
> 
> I would really like to move over to using btuart.c that I posted a few days ago, but that will be obviously more work and maybe it is good to stabilize and simplify this inside hci_bcm.c first.

Yes I already saw your remark about this a few days ago. I do think that
moving to btuart.c eventually is a good idea, but your RFC seemed somewhat
feature incomplete. Mainly lacking the runtime-pm stuff, which is not
only needed for powersaving, but on some machines the shutdown gpio
defaults to "off", so the bluetooth won't work until we at a minimum
have added gpio support to btuart.c.

So for now I would like to get things fixed in hci_bcm.c first, as
you suggest. This will also allow easily getting the IRQ polarity and
missing IDs (at least those IDs which are confirmed to be actually
used) fixed in current stable kernels.

I'm afraid I don't have time to help much with btuart.c my hci_bcm.c
work is a small part of a project I'm working on to better support
Bay and Cherry Trail devices and that project itself is a personal
side-project. But when btuart.c is more feature complete I would be
happy to test it on various devices I own which have an uart attach
broadcom bt device.

Regards,

Hans

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

* Re: [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option
  2018-03-16 20:28 [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
                   ` (4 preceding siblings ...)
  2018-03-23 10:56 ` [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
@ 2018-03-23 20:51 ` Marcel Holtmann
  5 siblings, 0 replies; 11+ messages in thread
From: Marcel Holtmann @ 2018-03-23 20:51 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, linux-serial,
	linux-acpi, stable

Hi Hans,

> Add irq_polarity module option for easier troubleshooting of irq-polarity
> issues.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/bluetooth/hci_bcm.c | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)

all 5 patches have been applied to bluetooth-next tree.

Regards

Marcel

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

end of thread, other threads:[~2018-03-23 20:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16 20:28 [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
2018-03-16 20:28 ` [PATCH 2/5] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Hans de Goede
2018-03-16 20:28 ` [PATCH 3/5] Bluetooth: hci_bcm: Add 6 new ACPI HIDs Hans de Goede
2018-03-16 20:28 ` [PATCH 4/5] Bluetooth: hci_bcm: Remove duplication in gpio-mappings declaration Hans de Goede
2018-03-16 20:28 ` [PATCH 5/5] Bluetooth: hci_bcm: Do not tie GPIO pin order to a specific ACPI HID Hans de Goede
2018-03-23 10:56 ` [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
2018-03-23 11:16   ` Marcel Holtmann
2018-03-23 11:17     ` Hans de Goede
2018-03-23 11:23       ` Marcel Holtmann
2018-03-23 11:30         ` Hans de Goede
2018-03-23 20:51 ` Marcel Holtmann

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.