linux-can-next-for-3.20-20150204
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCAAGBQJU0hl9AAoJECte4hHFiupU7KwP/ittz4fuxerf4h0gfnKwSKyF Sfl6vdtpuJzikpEgzEAaXrlgY3teWphg+UuObA5XasbesK3ms+SS4KYSSEqp33/3 1vTpyx3qn0tUBMdmtflnl4x8exXaIZaYqWTS/URyBO8MLjCtScURgSm7atQgik6o FGGAT5S7/x7qUDH8jbcyNCnu1AyrCcTLHkhxJlBHG4mQS8bXn/Skbzvk5xkIPsFj Nz5RJ1nu2wdmVfotMNWHDAQFi/rDQtDJ9FWqWU2SZm+e3UQ7ArY8eIOQw7NIo1jY uOvPDzEkTDGIZ79cpjPxw3bXKUxCsGlnVb6pCIvZo8CkikiA/fygortzZlhoOoUr 2pWsT0KubZ1itmpoEHO97zMgM+2fL15ncDjEYrqR0iCQg437ejQChQcX/nlEpqvR 6TM+N6HSjsXd8ZrS0oFZ0FNiGG9g/DusrPzPS1HCExDAYQKMlMRCVBypOOOnLjeF e0VmANy9IpMTn3UanjmKshy1RfqN/2176k861gwChA0r7fsUEOypd8gnZlWFYmjP JXQiAYBoex6xJaO3TTxrb9JqGkP0psNzBqag+8sPln0+FyLpnLSTzR5/mt0UWM/2 w9ro55ocQnCbXOkzO0wjk23SRmroZERCpD8fn2SXTMgJjrCcnP+CoTYiyaFPOm6q T0C6cLih54eK6ybjp7b6 =rHuc -----END PGP SIGNATURE----- Merge tag 'linux-can-next-for-3.20-20150204' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2015-02-04 this is a pull request of 2 patches for net-next/master. Nicholas Mc Guire contributes a patch for the janz-ican3 driver to fix a mismatch in an assignment. Ahmed S. Darwish contributes a patch for the kvaser_usb driver, to make the driver more robust during the bus-off handling. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
adfde05166
|
@ -1679,8 +1679,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = wait_for_completion_timeout(&mod->buserror_comp, HZ);
|
||||
if (ret == 0) {
|
||||
if (!wait_for_completion_timeout(&mod->buserror_comp, HZ)) {
|
||||
netdev_info(mod->ndev, "%s timed out\n", __func__);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
@ -1705,8 +1704,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = wait_for_completion_timeout(&mod->termination_comp, HZ);
|
||||
if (ret == 0) {
|
||||
if (!wait_for_completion_timeout(&mod->termination_comp, HZ)) {
|
||||
netdev_info(mod->ndev, "%s timed out\n", __func__);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* Copyright (C) 2002-2006 KVASER AB, Sweden. All rights reserved.
|
||||
* Copyright (C) 2010 Matthias Fuchs <matthias.fuchs@esd.eu>, esd gmbh
|
||||
* Copyright (C) 2012 Olivier Sobrie <olivier@sobrie.be>
|
||||
* Copyright (C) 2015 Valeo A.S.
|
||||
* Copyright (C) 2015 Valeo S.A.
|
||||
*/
|
||||
|
||||
#include <linux/completion.h>
|
||||
|
@ -824,15 +824,16 @@ static void kvaser_usb_rx_error_update_can_state(struct kvaser_usb_net_priv *pri
|
|||
else if (es->status & M16C_STATE_BUS_PASSIVE)
|
||||
new_state = CAN_STATE_ERROR_PASSIVE;
|
||||
else if (es->status & M16C_STATE_BUS_ERROR) {
|
||||
if ((es->txerr >= 256) || (es->rxerr >= 256))
|
||||
new_state = CAN_STATE_BUS_OFF;
|
||||
else if ((es->txerr >= 128) || (es->rxerr >= 128))
|
||||
/* Guard against spurious error events after a busoff */
|
||||
if (cur_state < CAN_STATE_BUS_OFF) {
|
||||
if ((es->txerr >= 128) || (es->rxerr >= 128))
|
||||
new_state = CAN_STATE_ERROR_PASSIVE;
|
||||
else if ((es->txerr >= 96) || (es->rxerr >= 96))
|
||||
new_state = CAN_STATE_ERROR_WARNING;
|
||||
else if (cur_state > CAN_STATE_ERROR_ACTIVE)
|
||||
new_state = CAN_STATE_ERROR_ACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!es->status)
|
||||
new_state = CAN_STATE_ERROR_ACTIVE;
|
||||
|
|
Loading…
Reference in New Issue