diff options
author | David S. Miller <davem@davemloft.net> | 2018-05-08 10:19:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-08 10:19:53 -0400 |
commit | 42f02130f980ac81efddb7968f50fd9ed06df26b (patch) | |
tree | c7e7cd33915e2e5edf35a30df1c798b6da39da22 | |
parent | 2dabf9f281bc42ce1836c02b6588585d6c52b67d (diff) | |
parent | 7a25ac2f71a409e77dd5c85cf3cbe1cbf2ae77f3 (diff) |
Merge tag 'linux-can-fixes-for-4.17-20180508' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says:
====================
pull-request: can 2018-05-08
this is a pull request for 7 patches for net/master.
The first patch is by Jakob Unterwurzacher and increases the severity of
bus-off messages in the generic CAN device infrastructure. The next two patches
are by Uwe Kleine-König and fix the endianess detection in the flexcan driver.
Jimmy Assarsson's patch for the kvaser driver corrects the stats counter for
dropped tx-messages. Geert Uytterhoeven provides one patch and Sergei Shtylyov
two patches for the rcan_canfd device tree binding description.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/devicetree/bindings/net/can/rcar_canfd.txt | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/imx35.dtsi | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/imx53.dtsi | 4 | ||||
-rw-r--r-- | drivers/net/can/dev.c | 2 | ||||
-rw-r--r-- | drivers/net/can/flexcan.c | 26 | ||||
-rw-r--r-- | drivers/net/can/usb/kvaser_usb.c | 2 |
6 files changed, 23 insertions, 19 deletions
diff --git a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt index 93c3a6ae32f9..ac71daa46195 100644 --- a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt +++ b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt | |||
@@ -5,7 +5,9 @@ Required properties: | |||
5 | - compatible: Must contain one or more of the following: | 5 | - compatible: Must contain one or more of the following: |
6 | - "renesas,rcar-gen3-canfd" for R-Car Gen3 compatible controller. | 6 | - "renesas,rcar-gen3-canfd" for R-Car Gen3 compatible controller. |
7 | - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller. | 7 | - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller. |
8 | - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3) compatible controller. | 8 | - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3-W) compatible controller. |
9 | - "renesas,r8a77970-canfd" for R8A77970 (R-Car V3M) compatible controller. | ||
10 | - "renesas,r8a77980-canfd" for R8A77980 (R-Car V3H) compatible controller. | ||
9 | 11 | ||
10 | When compatible with the generic version, nodes must list the | 12 | When compatible with the generic version, nodes must list the |
11 | SoC-specific version corresponding to the platform first, followed by the | 13 | SoC-specific version corresponding to the platform first, followed by the |
diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi index bf343195697e..54111ed218b1 100644 --- a/arch/arm/boot/dts/imx35.dtsi +++ b/arch/arm/boot/dts/imx35.dtsi | |||
@@ -303,7 +303,7 @@ | |||
303 | }; | 303 | }; |
304 | 304 | ||
305 | can1: can@53fe4000 { | 305 | can1: can@53fe4000 { |
306 | compatible = "fsl,imx35-flexcan"; | 306 | compatible = "fsl,imx35-flexcan", "fsl,imx25-flexcan"; |
307 | reg = <0x53fe4000 0x1000>; | 307 | reg = <0x53fe4000 0x1000>; |
308 | clocks = <&clks 33>, <&clks 33>; | 308 | clocks = <&clks 33>, <&clks 33>; |
309 | clock-names = "ipg", "per"; | 309 | clock-names = "ipg", "per"; |
@@ -312,7 +312,7 @@ | |||
312 | }; | 312 | }; |
313 | 313 | ||
314 | can2: can@53fe8000 { | 314 | can2: can@53fe8000 { |
315 | compatible = "fsl,imx35-flexcan"; | 315 | compatible = "fsl,imx35-flexcan", "fsl,imx25-flexcan"; |
316 | reg = <0x53fe8000 0x1000>; | 316 | reg = <0x53fe8000 0x1000>; |
317 | clocks = <&clks 34>, <&clks 34>; | 317 | clocks = <&clks 34>, <&clks 34>; |
318 | clock-names = "ipg", "per"; | 318 | clock-names = "ipg", "per"; |
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi index 7d647d043f52..3d65c0192f69 100644 --- a/arch/arm/boot/dts/imx53.dtsi +++ b/arch/arm/boot/dts/imx53.dtsi | |||
@@ -551,7 +551,7 @@ | |||
551 | }; | 551 | }; |
552 | 552 | ||
553 | can1: can@53fc8000 { | 553 | can1: can@53fc8000 { |
554 | compatible = "fsl,imx53-flexcan"; | 554 | compatible = "fsl,imx53-flexcan", "fsl,imx25-flexcan"; |
555 | reg = <0x53fc8000 0x4000>; | 555 | reg = <0x53fc8000 0x4000>; |
556 | interrupts = <82>; | 556 | interrupts = <82>; |
557 | clocks = <&clks IMX5_CLK_CAN1_IPG_GATE>, | 557 | clocks = <&clks IMX5_CLK_CAN1_IPG_GATE>, |
@@ -561,7 +561,7 @@ | |||
561 | }; | 561 | }; |
562 | 562 | ||
563 | can2: can@53fcc000 { | 563 | can2: can@53fcc000 { |
564 | compatible = "fsl,imx53-flexcan"; | 564 | compatible = "fsl,imx53-flexcan", "fsl,imx25-flexcan"; |
565 | reg = <0x53fcc000 0x4000>; | 565 | reg = <0x53fcc000 0x4000>; |
566 | interrupts = <83>; | 566 | interrupts = <83>; |
567 | clocks = <&clks IMX5_CLK_CAN2_IPG_GATE>, | 567 | clocks = <&clks IMX5_CLK_CAN2_IPG_GATE>, |
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index b1779566c5bb..3c71f1cb205f 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -605,7 +605,7 @@ void can_bus_off(struct net_device *dev) | |||
605 | { | 605 | { |
606 | struct can_priv *priv = netdev_priv(dev); | 606 | struct can_priv *priv = netdev_priv(dev); |
607 | 607 | ||
608 | netdev_dbg(dev, "bus-off\n"); | 608 | netdev_info(dev, "bus-off\n"); |
609 | 609 | ||
610 | netif_carrier_off(dev); | 610 | netif_carrier_off(dev); |
611 | 611 | ||
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 634c51e6b8ae..d53a45bf2a72 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -200,6 +200,7 @@ | |||
200 | #define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disable Memory error detection */ | 200 | #define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disable Memory error detection */ |
201 | #define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5) /* Use timestamp based offloading */ | 201 | #define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5) /* Use timestamp based offloading */ |
202 | #define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6) /* No interrupt for error passive */ | 202 | #define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6) /* No interrupt for error passive */ |
203 | #define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7) /* default to BE register access */ | ||
203 | 204 | ||
204 | /* Structure of the message buffer */ | 205 | /* Structure of the message buffer */ |
205 | struct flexcan_mb { | 206 | struct flexcan_mb { |
@@ -288,6 +289,12 @@ struct flexcan_priv { | |||
288 | 289 | ||
289 | static const struct flexcan_devtype_data fsl_p1010_devtype_data = { | 290 | static const struct flexcan_devtype_data fsl_p1010_devtype_data = { |
290 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | | 291 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | |
292 | FLEXCAN_QUIRK_BROKEN_PERR_STATE | | ||
293 | FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN, | ||
294 | }; | ||
295 | |||
296 | static const struct flexcan_devtype_data fsl_imx25_devtype_data = { | ||
297 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | | ||
291 | FLEXCAN_QUIRK_BROKEN_PERR_STATE, | 298 | FLEXCAN_QUIRK_BROKEN_PERR_STATE, |
292 | }; | 299 | }; |
293 | 300 | ||
@@ -1251,9 +1258,9 @@ static void unregister_flexcandev(struct net_device *dev) | |||
1251 | static const struct of_device_id flexcan_of_match[] = { | 1258 | static const struct of_device_id flexcan_of_match[] = { |
1252 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, | 1259 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, |
1253 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, | 1260 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, |
1254 | { .compatible = "fsl,imx53-flexcan", .data = &fsl_p1010_devtype_data, }, | 1261 | { .compatible = "fsl,imx53-flexcan", .data = &fsl_imx25_devtype_data, }, |
1255 | { .compatible = "fsl,imx35-flexcan", .data = &fsl_p1010_devtype_data, }, | 1262 | { .compatible = "fsl,imx35-flexcan", .data = &fsl_imx25_devtype_data, }, |
1256 | { .compatible = "fsl,imx25-flexcan", .data = &fsl_p1010_devtype_data, }, | 1263 | { .compatible = "fsl,imx25-flexcan", .data = &fsl_imx25_devtype_data, }, |
1257 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, | 1264 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, |
1258 | { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, | 1265 | { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, |
1259 | { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, | 1266 | { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, |
@@ -1337,18 +1344,13 @@ static int flexcan_probe(struct platform_device *pdev) | |||
1337 | 1344 | ||
1338 | priv = netdev_priv(dev); | 1345 | priv = netdev_priv(dev); |
1339 | 1346 | ||
1340 | if (of_property_read_bool(pdev->dev.of_node, "big-endian")) { | 1347 | if (of_property_read_bool(pdev->dev.of_node, "big-endian") || |
1348 | devtype_data->quirks & FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN) { | ||
1341 | priv->read = flexcan_read_be; | 1349 | priv->read = flexcan_read_be; |
1342 | priv->write = flexcan_write_be; | 1350 | priv->write = flexcan_write_be; |
1343 | } else { | 1351 | } else { |
1344 | if (of_device_is_compatible(pdev->dev.of_node, | 1352 | priv->read = flexcan_read_le; |
1345 | "fsl,p1010-flexcan")) { | 1353 | priv->write = flexcan_write_le; |
1346 | priv->read = flexcan_read_be; | ||
1347 | priv->write = flexcan_write_be; | ||
1348 | } else { | ||
1349 | priv->read = flexcan_read_le; | ||
1350 | priv->write = flexcan_write_le; | ||
1351 | } | ||
1352 | } | 1354 | } |
1353 | 1355 | ||
1354 | priv->can.clock.freq = clock_freq; | 1356 | priv->can.clock.freq = clock_freq; |
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index 63587b8e6825..daed57d3d209 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c | |||
@@ -1179,7 +1179,7 @@ static void kvaser_usb_rx_can_msg(const struct kvaser_usb *dev, | |||
1179 | 1179 | ||
1180 | skb = alloc_can_skb(priv->netdev, &cf); | 1180 | skb = alloc_can_skb(priv->netdev, &cf); |
1181 | if (!skb) { | 1181 | if (!skb) { |
1182 | stats->tx_dropped++; | 1182 | stats->rx_dropped++; |
1183 | return; | 1183 | return; |
1184 | } | 1184 | } |
1185 | 1185 | ||