diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-02-27 03:58:30 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-02-27 12:42:44 -0500 |
commit | c91799c50a14137ecee6d60d2f1d9ab8bc895e52 (patch) | |
tree | 8d7482f4a8b309ae8df77f1bfe41999491927cb0 | |
parent | 702d211c45d95e6788cec42f7f3c4a538e8853ef (diff) |
at86rf230: add warning if edge-triggered irq
While testing I experience a deadlock while using the at86rf233 on a
raspberry pi. The reason was an edge triggered gpio irq because the irq
triggered while irq was disabled. This issue doesn't happend on a level
triggered irq because the irq will hit after calling enable_irq.
This patch adds a warning that it's not recommended to use a edge-triggered
irq type. Also change the examples to high-level irqtype.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | Documentation/devicetree/bindings/net/ieee802154/at86rf230.txt | 5 | ||||
-rw-r--r-- | drivers/net/ieee802154/at86rf230.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/net/ieee802154/at86rf230.txt b/Documentation/devicetree/bindings/net/ieee802154/at86rf230.txt index 1ae5100fea14..168f1be50912 100644 --- a/Documentation/devicetree/bindings/net/ieee802154/at86rf230.txt +++ b/Documentation/devicetree/bindings/net/ieee802154/at86rf230.txt | |||
@@ -6,7 +6,8 @@ Required properties: | |||
6 | - spi-max-frequency: maximal bus speed, should be set to 7500000 depends | 6 | - spi-max-frequency: maximal bus speed, should be set to 7500000 depends |
7 | sync or async operation mode | 7 | sync or async operation mode |
8 | - reg: the chipselect index | 8 | - reg: the chipselect index |
9 | - interrupts: the interrupt generated by the device | 9 | - interrupts: the interrupt generated by the device. Non high-level |
10 | can occur deadlocks while handling isr. | ||
10 | 11 | ||
11 | Optional properties: | 12 | Optional properties: |
12 | - reset-gpio: GPIO spec for the rstn pin | 13 | - reset-gpio: GPIO spec for the rstn pin |
@@ -20,7 +21,7 @@ Example: | |||
20 | compatible = "atmel,at86rf231"; | 21 | compatible = "atmel,at86rf231"; |
21 | spi-max-frequency = <7500000>; | 22 | spi-max-frequency = <7500000>; |
22 | reg = <0>; | 23 | reg = <0>; |
23 | interrupts = <19 1>; | 24 | interrupts = <19 4>; |
24 | interrupt-parent = <&gpio3>; | 25 | interrupt-parent = <&gpio3>; |
25 | xtal-trim = /bits/ 8 <0x06>; | 26 | xtal-trim = /bits/ 8 <0x06>; |
26 | }; | 27 | }; |
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index c7a30ce71dcf..1d438bc54189 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c | |||
@@ -1321,6 +1321,10 @@ static int at86rf230_hw_init(struct at86rf230_local *lp, u8 xtal_trim) | |||
1321 | return rc; | 1321 | return rc; |
1322 | 1322 | ||
1323 | irq_type = irq_get_trigger_type(lp->spi->irq); | 1323 | irq_type = irq_get_trigger_type(lp->spi->irq); |
1324 | if (irq_type == IRQ_TYPE_EDGE_RISING || | ||
1325 | irq_type == IRQ_TYPE_EDGE_FALLING) | ||
1326 | dev_warn(&lp->spi->dev, | ||
1327 | "Using edge triggered irq's are not recommended!\n"); | ||
1324 | if (irq_type == IRQ_TYPE_EDGE_FALLING || | 1328 | if (irq_type == IRQ_TYPE_EDGE_FALLING || |
1325 | irq_type == IRQ_TYPE_LEVEL_LOW) | 1329 | irq_type == IRQ_TYPE_LEVEL_LOW) |
1326 | irq_pol = IRQ_ACTIVE_LOW; | 1330 | irq_pol = IRQ_ACTIVE_LOW; |