Skip to content

Commit 50d94ac

Browse files
l1kgregkh
authored andcommitted
can: hi311x: Use level-triggered interrupt
commit f164d02 upstream. If the hi3110 shares the SPI bus with another traffic-intensive device and packets are received in high volume (by a separate machine sending with "cangen -g 0 -i -x"), reception stops after a few minutes and the counter in /proc/interrupts stops incrementing. Bus state is "active". Bringing the interface down and back up reconvenes the reception. The issue is not observed when the hi3110 is the sole device on the SPI bus. Using a level-triggered interrupt makes the issue go away and lets the hi3110 successfully receive 2 GByte over the course of 5 days while a ks8851 Ethernet chip on the same SPI bus handles 6 GByte of traffic. Unfortunately the hi3110 datasheet is mum on the trigger type. The pin description on page 3 only specifies the polarity (active high): http://www.holtic.com/documents/371-hi-3110_v-rev-kpdf.do Cc: Mathias Duckeck <m.duckeck@kunbus.de> Cc: Akshay Bhat <akshay.bhat@timesys.com> Cc: Casey Fitzpatrick <casey.fitzpatrick@timesys.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bf8295f commit 50d94ac

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎Documentation/devicetree/bindings/net/can/holt_hi311x.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Example:
1717
reg = <1>;
1818
clocks = <&clk32m>;
1919
interrupt-parent = <&gpio4>;
20-
interrupts = <13 IRQ_TYPE_EDGE_RISING>;
20+
interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
2121
vdd-supply = <&reg5v0>;
2222
xceiver-supply = <&reg5v0>;
2323
};

‎drivers/net/can/spi/hi311x.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ static int hi3110_open(struct net_device *net)
760760
{
761761
struct hi3110_priv *priv = netdev_priv(net);
762762
struct spi_device *spi = priv->spi;
763-
unsigned long flags = IRQF_ONESHOT | IRQF_TRIGGER_RISING;
763+
unsigned long flags = IRQF_ONESHOT | IRQF_TRIGGER_HIGH;
764764
int ret;
765765

766766
ret = open_candev(net);

0 commit comments

Comments
 (0)