Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+23 -19
+3 -1
Documentation/devicetree/bindings/net/can/rcar_canfd.txt
··· 5 5 - compatible: Must contain one or more of the following: 6 6 - "renesas,rcar-gen3-canfd" for R-Car Gen3 compatible controller. 7 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 12 When compatible with the generic version, nodes must list the 11 13 SoC-specific version corresponding to the platform first, followed by the
+2 -2
arch/arm/boot/dts/imx35.dtsi
··· 303 303 }; 304 304 305 305 can1: can@53fe4000 { 306 - compatible = "fsl,imx35-flexcan"; 306 + compatible = "fsl,imx35-flexcan", "fsl,imx25-flexcan"; 307 307 reg = <0x53fe4000 0x1000>; 308 308 clocks = <&clks 33>, <&clks 33>; 309 309 clock-names = "ipg", "per"; ··· 312 312 }; 313 313 314 314 can2: can@53fe8000 { 315 - compatible = "fsl,imx35-flexcan"; 315 + compatible = "fsl,imx35-flexcan", "fsl,imx25-flexcan"; 316 316 reg = <0x53fe8000 0x1000>; 317 317 clocks = <&clks 34>, <&clks 34>; 318 318 clock-names = "ipg", "per";
+2 -2
arch/arm/boot/dts/imx53.dtsi
··· 551 551 }; 552 552 553 553 can1: can@53fc8000 { 554 - compatible = "fsl,imx53-flexcan"; 554 + compatible = "fsl,imx53-flexcan", "fsl,imx25-flexcan"; 555 555 reg = <0x53fc8000 0x4000>; 556 556 interrupts = <82>; 557 557 clocks = <&clks IMX5_CLK_CAN1_IPG_GATE>, ··· 561 561 }; 562 562 563 563 can2: can@53fcc000 { 564 - compatible = "fsl,imx53-flexcan"; 564 + compatible = "fsl,imx53-flexcan", "fsl,imx25-flexcan"; 565 565 reg = <0x53fcc000 0x4000>; 566 566 interrupts = <83>; 567 567 clocks = <&clks IMX5_CLK_CAN2_IPG_GATE>,
+1 -1
drivers/net/can/dev.c
··· 605 605 { 606 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 610 netif_carrier_off(dev); 611 611
+14 -12
drivers/net/can/flexcan.c
··· 200 200 #define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disable Memory error detection */ 201 201 #define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5) /* Use timestamp based offloading */ 202 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 205 /* Structure of the message buffer */ 205 206 struct flexcan_mb { ··· 288 287 }; 289 288 290 289 static const struct flexcan_devtype_data fsl_p1010_devtype_data = { 290 + .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | 291 + FLEXCAN_QUIRK_BROKEN_PERR_STATE | 292 + FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN, 293 + }; 294 + 295 + static const struct flexcan_devtype_data fsl_imx25_devtype_data = { 291 296 .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | 292 297 FLEXCAN_QUIRK_BROKEN_PERR_STATE, 293 298 }; ··· 1258 1251 static const struct of_device_id flexcan_of_match[] = { 1259 1252 { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, 1260 1253 { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, 1261 - { .compatible = "fsl,imx53-flexcan", .data = &fsl_p1010_devtype_data, }, 1262 - { .compatible = "fsl,imx35-flexcan", .data = &fsl_p1010_devtype_data, }, 1263 - { .compatible = "fsl,imx25-flexcan", .data = &fsl_p1010_devtype_data, }, 1254 + { .compatible = "fsl,imx53-flexcan", .data = &fsl_imx25_devtype_data, }, 1255 + { .compatible = "fsl,imx35-flexcan", .data = &fsl_imx25_devtype_data, }, 1256 + { .compatible = "fsl,imx25-flexcan", .data = &fsl_imx25_devtype_data, }, 1264 1257 { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, 1265 1258 { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, 1266 1259 { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, ··· 1344 1337 1345 1338 priv = netdev_priv(dev); 1346 1339 1347 - if (of_property_read_bool(pdev->dev.of_node, "big-endian")) { 1340 + if (of_property_read_bool(pdev->dev.of_node, "big-endian") || 1341 + devtype_data->quirks & FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN) { 1348 1342 priv->read = flexcan_read_be; 1349 1343 priv->write = flexcan_write_be; 1350 1344 } else { 1351 - if (of_device_is_compatible(pdev->dev.of_node, 1352 - "fsl,p1010-flexcan")) { 1353 - priv->read = flexcan_read_be; 1354 - priv->write = flexcan_write_be; 1355 - } else { 1356 - priv->read = flexcan_read_le; 1357 - priv->write = flexcan_write_le; 1358 - } 1345 + priv->read = flexcan_read_le; 1346 + priv->write = flexcan_write_le; 1359 1347 } 1360 1348 1361 1349 priv->can.clock.freq = clock_freq;
+1 -1
drivers/net/can/usb/kvaser_usb.c
··· 1179 1179 1180 1180 skb = alloc_can_skb(priv->netdev, &cf); 1181 1181 if (!skb) { 1182 - stats->tx_dropped++; 1182 + stats->rx_dropped++; 1183 1183 return; 1184 1184 } 1185 1185