aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-01-26 18:42:01 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-26 18:42:01 -0500
commit707d79e5cdcf7833d31fea9712f11b185ce25822 (patch)
tree6bcdc972de744e7c7129a599dba5bd12403d46b5
parent4141d93fc55a33bbe74c9de48f1f99dd85bf0441 (diff)
parentef186f25fdf00d92c6bd5d3301fc0ee44f17ca33 (diff)
Merge tag 'linux-can-next-for-3.20-20150121' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
Marc Kleine-Budde says: ==================== pull-request: can-next 2015-21-01 this is a pull request of 4 patches for net-next/master. Andri Yngvason contributes one patch to further consolidate the CAN state change handling. The next patch is by kbuild test robot/Fengguang Wu which fixes a coccinelle warning in the CAN infrastructure. The two last patches are by me, they remove a unused variable from the flexcan and at91_can driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/can/at91_can.c2
-rw-r--r--drivers/net/can/bfin_can.c1
-rw-r--r--drivers/net/can/c_can/c_can.c2
-rw-r--r--drivers/net/can/cc770/cc770.c1
-rw-r--r--drivers/net/can/dev.c5
-rw-r--r--drivers/net/can/flexcan.c2
-rw-r--r--drivers/net/can/janz-ican3.c1
-rw-r--r--drivers/net/can/m_can/m_can.c1
-rw-r--r--drivers/net/can/pch_can.c1
-rw-r--r--drivers/net/can/rcar_can.c1
-rw-r--r--drivers/net/can/softing/softing_main.c1
-rw-r--r--drivers/net/can/spi/mcp251x.c1
-rw-r--r--drivers/net/can/ti_hecc.c1
-rw-r--r--drivers/net/can/usb/ems_usb.c1
-rw-r--r--drivers/net/can/usb/esd_usb2.c1
-rw-r--r--drivers/net/can/usb/peak_usb/pcan_usb.c1
-rw-r--r--drivers/net/can/usb/peak_usb/pcan_usb_pro.c1
-rw-r--r--drivers/net/can/usb/usb_8dev.c1
18 files changed, 18 insertions, 7 deletions
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index d0c2463b573f..eeb4b8b6b335 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -138,7 +138,6 @@ struct at91_devtype_data {
138 138
139struct at91_priv { 139struct at91_priv {
140 struct can_priv can; /* must be the first member! */ 140 struct can_priv can; /* must be the first member! */
141 struct net_device *dev;
142 struct napi_struct napi; 141 struct napi_struct napi;
143 142
144 void __iomem *reg_base; 143 void __iomem *reg_base;
@@ -1350,7 +1349,6 @@ static int at91_can_probe(struct platform_device *pdev)
1350 priv->can.do_get_berr_counter = at91_get_berr_counter; 1349 priv->can.do_get_berr_counter = at91_get_berr_counter;
1351 priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | 1350 priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
1352 CAN_CTRLMODE_LISTENONLY; 1351 CAN_CTRLMODE_LISTENONLY;
1353 priv->dev = dev;
1354 priv->reg_base = addr; 1352 priv->reg_base = addr;
1355 priv->devtype_data = *devtype_data; 1353 priv->devtype_data = *devtype_data;
1356 priv->clk = clk; 1354 priv->clk = clk;
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index 417d50998e31..e7a6363e736b 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -352,6 +352,7 @@ static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status)
352 netdev_dbg(dev, "bus-off mode interrupt\n"); 352 netdev_dbg(dev, "bus-off mode interrupt\n");
353 state = CAN_STATE_BUS_OFF; 353 state = CAN_STATE_BUS_OFF;
354 cf->can_id |= CAN_ERR_BUSOFF; 354 cf->can_id |= CAN_ERR_BUSOFF;
355 priv->can.can_stats.bus_off++;
355 can_bus_off(dev); 356 can_bus_off(dev);
356 } 357 }
357 358
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index f94a9fa60488..70f77e96d409 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -866,7 +866,7 @@ static int c_can_handle_state_change(struct net_device *dev,
866 case C_CAN_BUS_OFF: 866 case C_CAN_BUS_OFF:
867 /* bus-off state */ 867 /* bus-off state */
868 priv->can.state = CAN_STATE_BUS_OFF; 868 priv->can.state = CAN_STATE_BUS_OFF;
869 can_bus_off(dev); 869 priv->can.can_stats.bus_off++;
870 break; 870 break;
871 default: 871 default:
872 break; 872 break;
diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c
index c486fe510f37..c11d44984036 100644
--- a/drivers/net/can/cc770/cc770.c
+++ b/drivers/net/can/cc770/cc770.c
@@ -535,6 +535,7 @@ static int cc770_err(struct net_device *dev, u8 status)
535 cc770_write_reg(priv, control, CTRL_INI); 535 cc770_write_reg(priv, control, CTRL_INI);
536 cf->can_id |= CAN_ERR_BUSOFF; 536 cf->can_id |= CAN_ERR_BUSOFF;
537 priv->can.state = CAN_STATE_BUS_OFF; 537 priv->can.state = CAN_STATE_BUS_OFF;
538 priv->can.can_stats.bus_off++;
538 can_bus_off(dev); 539 can_bus_off(dev);
539 } else if (status & STAT_WARN) { 540 } else if (status & STAT_WARN) {
540 cf->can_id |= CAN_ERR_CRTL; 541 cf->can_id |= CAN_ERR_CRTL;
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 3ec8f6f25e5f..6ac02c8d747e 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -289,9 +289,11 @@ static void can_update_state_error_stats(struct net_device *dev,
289 priv->can_stats.error_passive++; 289 priv->can_stats.error_passive++;
290 break; 290 break;
291 case CAN_STATE_BUS_OFF: 291 case CAN_STATE_BUS_OFF:
292 priv->can_stats.bus_off++;
293 break;
292 default: 294 default:
293 break; 295 break;
294 }; 296 }
295} 297}
296 298
297static int can_tx_state_to_frame(struct net_device *dev, enum can_state state) 299static int can_tx_state_to_frame(struct net_device *dev, enum can_state state)
@@ -544,7 +546,6 @@ void can_bus_off(struct net_device *dev)
544 netdev_dbg(dev, "bus-off\n"); 546 netdev_dbg(dev, "bus-off\n");
545 547
546 netif_carrier_off(dev); 548 netif_carrier_off(dev);
547 priv->can_stats.bus_off++;
548 549
549 if (priv->restart_ms) 550 if (priv->restart_ms)
550 mod_timer(&priv->restart_timer, 551 mod_timer(&priv->restart_timer,
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index b1d583ba9674..80c46ad4cee4 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -247,7 +247,6 @@ struct flexcan_devtype_data {
247 247
248struct flexcan_priv { 248struct flexcan_priv {
249 struct can_priv can; 249 struct can_priv can;
250 struct net_device *dev;
251 struct napi_struct napi; 250 struct napi_struct napi;
252 251
253 void __iomem *base; 252 void __iomem *base;
@@ -1220,7 +1219,6 @@ static int flexcan_probe(struct platform_device *pdev)
1220 CAN_CTRLMODE_LISTENONLY | CAN_CTRLMODE_3_SAMPLES | 1219 CAN_CTRLMODE_LISTENONLY | CAN_CTRLMODE_3_SAMPLES |
1221 CAN_CTRLMODE_BERR_REPORTING; 1220 CAN_CTRLMODE_BERR_REPORTING;
1222 priv->base = base; 1221 priv->base = base;
1223 priv->dev = dev;
1224 priv->clk_ipg = clk_ipg; 1222 priv->clk_ipg = clk_ipg;
1225 priv->clk_per = clk_per; 1223 priv->clk_per = clk_per;
1226 priv->pdata = dev_get_platdata(&pdev->dev); 1224 priv->pdata = dev_get_platdata(&pdev->dev);
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 1b118394907f..0eb4d181ae4d 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1008,6 +1008,7 @@ static int ican3_handle_cevtind(struct ican3_dev *mod, struct ican3_msg *msg)
1008 if (status & SR_BS) { 1008 if (status & SR_BS) {
1009 state = CAN_STATE_BUS_OFF; 1009 state = CAN_STATE_BUS_OFF;
1010 cf->can_id |= CAN_ERR_BUSOFF; 1010 cf->can_id |= CAN_ERR_BUSOFF;
1011 mod->can.can_stats.bus_off++;
1011 can_bus_off(dev); 1012 can_bus_off(dev);
1012 } else if (status & SR_ES) { 1013 } else if (status & SR_ES) {
1013 if (rxerr >= 128 || txerr >= 128) 1014 if (rxerr >= 128 || txerr >= 128)
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index d7bc462aafdc..b2ecb6c5e94b 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -589,6 +589,7 @@ static int m_can_handle_state_change(struct net_device *dev,
589 /* bus-off state */ 589 /* bus-off state */
590 priv->can.state = CAN_STATE_BUS_OFF; 590 priv->can.state = CAN_STATE_BUS_OFF;
591 m_can_disable_all_interrupts(priv); 591 m_can_disable_all_interrupts(priv);
592 priv->can.can_stats.bus_off++;
592 can_bus_off(dev); 593 can_bus_off(dev);
593 break; 594 break;
594 default: 595 default:
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index a67eb01f3028..e187ca783da0 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -505,6 +505,7 @@ static void pch_can_error(struct net_device *ndev, u32 status)
505 pch_can_set_rx_all(priv, 0); 505 pch_can_set_rx_all(priv, 0);
506 state = CAN_STATE_BUS_OFF; 506 state = CAN_STATE_BUS_OFF;
507 cf->can_id |= CAN_ERR_BUSOFF; 507 cf->can_id |= CAN_ERR_BUSOFF;
508 priv->can.can_stats.bus_off++;
508 can_bus_off(ndev); 509 can_bus_off(ndev);
509 } 510 }
510 511
diff --git a/drivers/net/can/rcar_can.c b/drivers/net/can/rcar_can.c
index 91cd48ca0efc..7deb80dcbe8c 100644
--- a/drivers/net/can/rcar_can.c
+++ b/drivers/net/can/rcar_can.c
@@ -331,6 +331,7 @@ static void rcar_can_error(struct net_device *ndev)
331 priv->can.state = CAN_STATE_BUS_OFF; 331 priv->can.state = CAN_STATE_BUS_OFF;
332 /* Clear interrupt condition */ 332 /* Clear interrupt condition */
333 writeb(~RCAR_CAN_EIFR_BOEIF, &priv->regs->eifr); 333 writeb(~RCAR_CAN_EIFR_BOEIF, &priv->regs->eifr);
334 priv->can.can_stats.bus_off++;
334 can_bus_off(ndev); 335 can_bus_off(ndev);
335 if (skb) 336 if (skb)
336 cf->can_id |= CAN_ERR_BUSOFF; 337 cf->can_id |= CAN_ERR_BUSOFF;
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 2bf98d862302..7621f91a8a20 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -261,6 +261,7 @@ static int softing_handle_1(struct softing *card)
261 ++priv->can.can_stats.error_passive; 261 ++priv->can.can_stats.error_passive;
262 else if (can_state == CAN_STATE_BUS_OFF) { 262 else if (can_state == CAN_STATE_BUS_OFF) {
263 /* this calls can_close_cleanup() */ 263 /* this calls can_close_cleanup() */
264 ++priv->can.can_stats.bus_off;
264 can_bus_off(netdev); 265 can_bus_off(netdev);
265 netif_stop_queue(netdev); 266 netif_stop_queue(netdev);
266 } 267 }
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index c66d699640a9..bf63fee4e743 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -905,6 +905,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
905 if (priv->can.state == CAN_STATE_BUS_OFF) { 905 if (priv->can.state == CAN_STATE_BUS_OFF) {
906 if (priv->can.restart_ms == 0) { 906 if (priv->can.restart_ms == 0) {
907 priv->force_quit = 1; 907 priv->force_quit = 1;
908 priv->can.can_stats.bus_off++;
908 can_bus_off(net); 909 can_bus_off(net);
909 mcp251x_hw_sleep(spi); 910 mcp251x_hw_sleep(spi);
910 break; 911 break;
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 9a07eafe554b..e95a9e1a889f 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -715,6 +715,7 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
715 hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_CCR); 715 hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_CCR);
716 /* Disable all interrupts in bus-off to avoid int hog */ 716 /* Disable all interrupts in bus-off to avoid int hog */
717 hecc_write(priv, HECC_CANGIM, 0); 717 hecc_write(priv, HECC_CANGIM, 0);
718 ++priv->can.can_stats.bus_off;
718 can_bus_off(ndev); 719 can_bus_off(ndev);
719 } 720 }
720 721
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 29d3f0938eb8..9376f5e5b94e 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -347,6 +347,7 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
347 dev->can.state = CAN_STATE_BUS_OFF; 347 dev->can.state = CAN_STATE_BUS_OFF;
348 cf->can_id |= CAN_ERR_BUSOFF; 348 cf->can_id |= CAN_ERR_BUSOFF;
349 349
350 dev->can.can_stats.bus_off++;
350 can_bus_off(dev->netdev); 351 can_bus_off(dev->netdev);
351 } else if (state & SJA1000_SR_ES) { 352 } else if (state & SJA1000_SR_ES) {
352 dev->can.state = CAN_STATE_ERROR_WARNING; 353 dev->can.state = CAN_STATE_ERROR_WARNING;
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index c063a54ab8dd..bacca0bd89c1 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -250,6 +250,7 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
250 case ESD_BUSSTATE_BUSOFF: 250 case ESD_BUSSTATE_BUSOFF:
251 priv->can.state = CAN_STATE_BUS_OFF; 251 priv->can.state = CAN_STATE_BUS_OFF;
252 cf->can_id |= CAN_ERR_BUSOFF; 252 cf->can_id |= CAN_ERR_BUSOFF;
253 priv->can.can_stats.bus_off++;
253 can_bus_off(priv->netdev); 254 can_bus_off(priv->netdev);
254 break; 255 break;
255 case ESD_BUSSTATE_WARN: 256 case ESD_BUSSTATE_WARN:
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index 4e1659d07979..2a1c9ce53fae 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -488,6 +488,7 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,
488 switch (new_state) { 488 switch (new_state) {
489 case CAN_STATE_BUS_OFF: 489 case CAN_STATE_BUS_OFF:
490 cf->can_id |= CAN_ERR_BUSOFF; 490 cf->can_id |= CAN_ERR_BUSOFF;
491 mc->pdev->dev.can.can_stats.bus_off++;
491 can_bus_off(mc->netdev); 492 can_bus_off(mc->netdev);
492 break; 493 break;
493 494
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
index 4cfa3b8605b1..145fa87c31b9 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
@@ -634,6 +634,7 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if,
634 switch (new_state) { 634 switch (new_state) {
635 case CAN_STATE_BUS_OFF: 635 case CAN_STATE_BUS_OFF:
636 can_frame->can_id |= CAN_ERR_BUSOFF; 636 can_frame->can_id |= CAN_ERR_BUSOFF;
637 dev->can.can_stats.bus_off++;
637 can_bus_off(netdev); 638 can_bus_off(netdev);
638 break; 639 break;
639 640
diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c
index ef674ecb82f8..dd52c7a4c80d 100644
--- a/drivers/net/can/usb/usb_8dev.c
+++ b/drivers/net/can/usb/usb_8dev.c
@@ -377,6 +377,7 @@ static void usb_8dev_rx_err_msg(struct usb_8dev_priv *priv,
377 case USB_8DEV_STATUSMSG_BUSOFF: 377 case USB_8DEV_STATUSMSG_BUSOFF:
378 priv->can.state = CAN_STATE_BUS_OFF; 378 priv->can.state = CAN_STATE_BUS_OFF;
379 cf->can_id |= CAN_ERR_BUSOFF; 379 cf->can_id |= CAN_ERR_BUSOFF;
380 priv->can.can_stats.bus_off++;
380 can_bus_off(priv->netdev); 381 can_bus_off(priv->netdev);
381 break; 382 break;
382 case USB_8DEV_STATUSMSG_OVERRUN: 383 case USB_8DEV_STATUSMSG_OVERRUN: