- 21 Sep, 2020 40 commits
-
-
Tim Harvey authored
Some SPI host controllers do not support full-duplex SPI and are marked as such via the SPI_CONTROLLER_HALF_DUPLEX controller flag. For such controllers use half duplex transactions but retain full duplex transactions for the controllers that can handle those. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Link: https://lore.kernel.org/r/1595516275-1179-1-git-send-email-tharvey@gateworks.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Andy Shevchenko authored
We may use special helper macro to poll IO till condition or timeout occurs. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200217161038.25009-1-andriy.shevchenko@linux.intel.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Timo Schlüßler authored
The mcp251x variants feature 3 general purpose digital inputs and 2 outputs. With this patch they are accessible through the gpio framework. Signed-off-by: Timo Schlüßler <schluessler@krause.de> Tested-by: Timo Schlüßler <schluessler@krause.de> Link: https://lore.kernel.org/r/20200915223527.1417033-28-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch sorts the include files alphabetically. Link: https://lore.kernel.org/r/20200915223527.1417033-27-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
The next patch adds gpio controller support to the mcp251x driver. This patch updates the binding accordingly. Cc: Timo Schlüßler <schluessler@krause.de> Link: https://lore.kernel.org/r/20200915223527.1417033-26-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
The MCP2515 datasheet clearly describes a level-triggered interrupt pin. Change example bindings accordingly. Link: https://lore.kernel.org/r/20200915223527.1417033-25-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
Since commits 653ee35c ("can: hi311x: remove custom DMA mapped buffer") Fixes: df58525d ("can: mcp251x: remove custom DMA mapped buffer") both the hi3111x and the mcp251x driver don't make use of the DMA API any more. So we can safely remove the HAS_DMA dependency. While we're here, remove the unneeded CAN_DEV and SPI dependencies from the CAN_HI311X symbol, as the parent menus already have these dependencies. Link: https://lore.kernel.org/r/20200915223527.1417033-24-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Stephane Grosjean authored
This patch adds the support of the rx/tx errors CAN counters to the driver of the PCAN-USB PC-CAN interface from PEAK-System GmbH. The PCAN-USB is capable of giving back the values of the rx/tx errors counters, to provide more details and statistics to the linux-can layer. Getting these values allows the driver to better tune CAN_ERR_CRTL_TX_xxx and CAN_ERR_CRTL_RX_xxx bits in case of the interface enters any CAN_STATE_ERROR_xxx state. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Link: https://lore.kernel.org/r/20191206153803.17725-3-s.grosjean@peak-system.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Stephane Grosjean authored
This patch documents the functions and numbers of the commands sent by the driver to the PCAN-USB CAN device from PEAK-System GmbH. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Link: https://lore.kernel.org/r/20191206153803.17725-2-s.grosjean@peak-system.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Vaibhav Gupta authored
Drivers using legacy power management .suspen()/.resume() callbacks have to manage PCI states and device's PM states themselves. They also need to take care of standard configuration registers. Switch to generic power management framework using a single "struct dev_pm_ops" variable to take the unnecessary load from the driver. This also avoids the need for the driver to directly call most of the PCI helper functions and device power state control functions, as through the generic framework PCI Core takes care of the necessary operations, and drivers are required to do only device-specific jobs. Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Link: https://lore.kernel.org/r/20200728085757.888620-1-vaibhavgupta40@gmail.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Wang Hai authored
CANFD_CLK_SEL_DIV_MASK and CANFD_OPTIONS_SET are never used after they were introduced. Remove them. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Link: https://lore.kernel.org/r/20200904131247.23021-1-wanghai38@huawei.com [mkl: keep CANFD_CLK_SEL_DIV_MASK for documentation purpose] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Liu Shixin authored
Convert cpu_to_le32(le32_to_cpu(E1) + E2) to use le32_add_cpu(). Signed-off-by: Liu Shixin <liushixin2@huawei.com> Link: https://lore.kernel.org/r/20200914041744.3701840-1-liushixin2@huawei.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Dejin Zheng authored
Use the function devm_platform_ioremap_resource_byname() to simplify source code which calls the functions platform_get_resource_byname() and devm_ioremap_resource(). Remove also a few error messages which became unnecessary with this software refactoring. Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Link: https://lore.kernel.org/r/20200420132207.8536-1-zhengdejin5@gmail.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
As -Wimplicit-fallthrough is now enabled the mscan driver shows this warning, which is fixed by this patch: drivers/net/can/mscan/mscan.c: In function ‘mscan_start_xmit’: drivers/net/can/mscan/mscan.c:211:3: warning: this statement may fall through [-Wimplicit-fallthrough=] 211 | netif_stop_queue(dev); | ^~~~~~~~~~~~~~~~~~~~~ drivers/net/can/mscan/mscan.c:212:2: note: here 212 | case 2: | ^~~~ Link: https://lore.kernel.org/r/20200915223527.1417033-17-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Colin Ian King authored
The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20200706164240.518623-1-colin.king@canonical.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
YueHaibing authored
commit 524369e2 ("can: c_can: remove obsolete STRICT_FRAME_ORDERING Kconfig option") left behind this, remove it. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20200505084149.23848-1-yuehaibing@huawei.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
If a CAN device goes into bus-off and has automatic restart enabled, inform user that a automatic restart is scheduled after the configured delay. Link: https://lore.kernel.org/r/20200915223527.1417033-14-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
In order to ease debugging let can_change_state() print the human readable state change messages. Also print the old and new state. Link: https://lore.kernel.org/r/20200915223527.1417033-13-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
The function can_put_echo_skb() can fail for several reasons. It may fail due to OOM, but when it fails it's usually due to locking problems in the driver. In order to help developing and debugging of new drivers propagate error value in case of errors. Link: https://lore.kernel.org/r/20200915223527.1417033-12-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch prints the number of the occupied echo_skb, to ease implementing and debugging of new drivers. Link: https://lore.kernel.org/r/20200915223527.1417033-11-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Masahiro Yamada authored
The "WITH Linux-syscall-note" exception is intended for UAPI headers. See LICENSES/exceptions/Linux-syscall-note Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20200403073741.18352-1-masahiroy@kernel.orgAcked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Diego Elio Pettenò authored
BerliOS has not been operating for more than five years. linux-can moved to GitHub. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.com> Link: https://lore.kernel.org/r/20200413170241.13207-1-flameeyes@flameeyes.com [mkl: split into two patches - handle softing part here] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Diego Elio Pettenò authored
BerliOS has not been operating for more than five years. linux-can moved to GitHub. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.com> Link: https://lore.kernel.org/r/20200413170241.13207-1-flameeyes@flameeyes.com [mkl: split into two patches - handle slcan part here] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch fixes the indention to follow kernel coding style. Link: https://lore.kernel.org/r/20200915223527.1417033-7-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch fixes spelling erros found by "codespell" in the drivers/net/can subtree. Link: https://lore.kernel.org/r/20200915223527.1417033-6-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch fixes spelling erros found by "codespell" in the net/can subtree. Link: https://lore.kernel.org/r/20200915223527.1417033-5-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch fixes spelling erros found by "codespell" in the include/linux/can subtree. Link: https://lore.kernel.org/r/20200915223527.1417033-4-mkl@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Alexandre Belloni authored
Fix a mistake in a register layout description. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20200214141751.21168-1-alexandre.belloni@bootlin.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Colin Ian King authored
There is a spelling mistake in a netdev_err error message. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20200806105616.46790-1-colin.king@canonical.comSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
Julia Lawall authored
sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(*x),flags) ... sg_init_table(x,n) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
-
Julia Lawall authored
sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(struct scatterlist),flags) ... sg_init_table(x,n) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
-
David S. Miller authored
Vladimir Oltean says: ==================== DSA with VLAN filtering and offloading masters This series attempts to make DSA VLANs work in the presence of a master interface that is: - filtering, so it drops VLANs that aren't explicitly added to its filter list - offloading, so the old assumptions in the tagging code about there being a VLAN tag in the skb are not necessarily true anymore. For more context: https://lore.kernel.org/netdev/20200910150738.mwhh2i6j2qgacqev@skbuf/ This probably marks the beginning of a series of patches in which DSA starts paying much more attention to its upper interfaces, not only for VLAN purposes but also for address filtering and for management of the CPU flooding domain. There was a comment from Florian on whether we could factor some of the mlxsw logic into some common functionality, but it doesn't look so. This seems bound to be open-coded, but frankly there isn't a lot to it. Changes in v2: Applied Florian's cosmetic suggestion in patch 4/9. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-
Vladimir Oltean authored
Check whether there is any hwaccel VLAN tag on RX, and if there is, treat it as the tag_8021q header. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-
Vladimir Oltean authored
The whole purpose of tag_8021q is to send VLAN-tagged traffic to the CPU, from which the driver can decode the source port and switch id. Currently this only works if the VLAN filtering on the master is disabled. Change that by explicitly adding code to tag_8021q.c to add the VLANs corresponding to the tags to the filter of the master interface. Because we now need to call vlan_vid_add, then we also need to hold the RTNL mutex. Propagate that requirement to the callers of dsa_8021q_setup and modify the existing call sites as appropriate. Note that one call path, sja1105_best_effort_vlan_filtering_set -> sja1105_vlan_filtering -> sja1105_setup_8021q_tagging, was already holding this lock. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-
Vladimir Oltean authored
Most DSA switch tags shift the EtherType to the right, causing the master to not parse the VLAN as VLAN. However, not all switches do that (example: tail tags, tag_8021q etc), and if the DSA master has "rx-vlan-filter: on" in ethtool -k, then we have a problem. Therefore, we could populate the VLAN table of the master, just in case (for some switches it will not make a difference), so that network I/O can work even with a VLAN filtering master. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-
Vladimir Oltean authored
When the bridge has VLAN awareness disabled there isn't any duplication of functionality, since the bridge does not process VLAN. Don't deny adding 8021q uppers to DSA switch ports in that case. The switch is supposed to simply pass traffic leaving the VLAN tag as-is, and the stack will happily strip the VLAN tag for all 8021q uppers that exist. We need to ensure that there are no 8021q uppers when the user attempts to enable bridge vlan_filtering. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-
Vladimir Oltean authored
The current logic beats me a little bit. The comment that "bridge skips -EOPNOTSUPP, so skip the prepare phase" was introduced in commit fb2dabad ("net: dsa: support VLAN filtering switchdev attr"). I'm not sure: (a) ok, the bridge skips -EOPNOTSUPP, but, so what, where are we returning -EOPNOTSUPP? (b) even if we are, and I'm just not seeing it, what is the causality relationship between the bridge skipping -EOPNOTSUPP and DSA skipping the prepare phase, and just returning zero? One thing is certain beyond doubt though, and that is that DSA currently refuses VLAN filtering from the "commit" phase instead of "prepare", and that this is not a good thing: ip link add br0 type bridge ip link add br1 type bridge vlan_filtering 1 ip link set swp2 master br0 ip link set swp3 master br1 [ 3790.379389] 001: sja1105 spi0.1: VLAN filtering is a global setting [ 3790.379399] 001: ------------[ cut here ]------------ [ 3790.379403] 001: WARNING: CPU: 1 PID: 515 at net/switchdev/switchdev.c:157 switchdev_port_attr_set_now+0x9c/0xa4 [ 3790.379420] 001: swp3: Commit of attribute (id=6) failed. [ 3790.379533] 001: [<c11ff588>] (switchdev_port_attr_set_now) from [<c11b62e4>] (nbp_vlan_init+0x84/0x148) [ 3790.379544] 001: [<c11b62e4>] (nbp_vlan_init) from [<c11a2ff0>] (br_add_if+0x514/0x670) [ 3790.379554] 001: [<c11a2ff0>] (br_add_if) from [<c1031b5c>] (do_setlink+0x38c/0xab0) [ 3790.379565] 001: [<c1031b5c>] (do_setlink) from [<c1036fe8>] (__rtnl_newlink+0x44c/0x748) [ 3790.379573] 001: [<c1036fe8>] (__rtnl_newlink) from [<c1037328>] (rtnl_newlink+0x44/0x60) [ 3790.379580] 001: [<c1037328>] (rtnl_newlink) from [<c10315fc>] (rtnetlink_rcv_msg+0x124/0x2f8) [ 3790.379590] 001: [<c10315fc>] (rtnetlink_rcv_msg) from [<c10926b8>] (netlink_rcv_skb+0xb8/0x110) [ 3790.379806] 001: ---[ end trace 0000000000000002 ]--- [ 3790.379819] 001: sja1105 spi0.1 swp3: failed to initialize vlan filtering on this port So move the current logic that may fail (except ds->ops->port_vlan_filtering, that is way harder) into the prepare stage of the switchdev transaction. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-
Vladimir Oltean authored
This is checking for the following order of operations, and makes sure to deny that configuration: ip link add link swp2 name swp2.100 type vlan id 100 ip link add br0 type bridge vlan_filtering 1 ip link set swp2 master br0 bridge vlan add dev swp2 vid 100 Instead of using vlan_for_each(), which looks at the VLAN filters installed with vlan_vid_add(), just track the 8021q uppers. This has the advantage of freeing up the vlan_vid_add() call for actual VLAN filtering. There is another change in this patch. The check is moved in slave.c, from switch.c. I don't think it makes sense to have this 8021q upper check for each switch port that gets notified of that VLAN addition (these include DSA links and CPU ports, we know those can't have 8021q uppers because they don't have a net_device registered for them), so just do it in slave.c, for that one slave interface. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-
Vladimir Oltean authored
DSA tries to prevent having a VLAN added by a bridge and by an 802.1Q upper at the same time. It does that by checking the VID in .ndo_vlan_rx_add_vid(), since that's something that the 8021q module calls, via vlan_vid_add(). When a VLAN matches in both subsystems, this check returns -EBUSY. However the vlan_vid_add() function isn't specific to the 8021q module in any way at all. It is simply the kernel's way to tell an interface to add a VLAN to its RX filter and not drop that VLAN. So there's no reason to return -EBUSY when somebody tries to call vlan_vid_add() for a VLAN that was installed by the bridge. The proper behavior is to accept that configuration. So what's wrong is how DSA checks that it has an 8021q upper. It should look at the actual uppers for that, not just assume that the 8021q module was somewhere in the call stack of .ndo_vlan_rx_add_vid(). Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-
Vladimir Oltean authored
We'll be adding a new check in the PRECHANGEUPPER notifier, where we'll need to check some VLAN uppers. It is hard to do that when there is already a function named dsa_slave_upper_vlan_check. So rename this one. Not to mention that this function probably shouldn't have started with "dsa_slave_" in the first place, since the struct net_device argument isn't a DSA slave, but an 8021q upper of one. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-