Commit 4dfa5f05 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge tag 'linux-can-next-for-6.1-20220923' of...

Merge tag 'linux-can-next-for-6.1-20220923' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2022-09-23

The first 2 patches are by Ziyang Xuan and optimize registration and
the sending in the CAN BCM protocol a bit.

The next 8 patches target the gs_usb driver. 7 are by me and first fix
the time hardware stamping support (added during this net-next cycle),
rename a variable, convert the usb_control_msg + manual
kmalloc()/kfree() to usb_control_msg_{send,rev}(), clean up the error
handling and add switchable termination support. The patch by Rhett
Aultman and Vasanth Sadhasivan convert the driver from
usb_alloc_coherent()/usb_free_coherent() to kmalloc()/URB_FREE_BUFFER.

The last patch is by Shang XiaoJing and removes an unneeded call to
dev_err() from the ctucanfd driver.

* tag 'linux-can-next-for-6.1-20220923' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next:
  can: ctucanfd: Remove redundant dev_err call
  can: gs_usb: remove dma allocations
  can: gs_usb: add switchable termination support
  can: gs_usb: gs_make_candev(): clean up error handling
  can: gs_usb: convert from usb_control_msg() to usb_control_msg_{send,recv}()
  can: gs_usb: gs_cmd_reset(): rename variable holding struct gs_can pointer to dev
  can: gs_usb: gs_can_open(): initialize time counter before starting device
  can: gs_usb: add missing lock to protect struct timecounter::cycle_last
  can: gs_usb: gs_usb_get_timestamp(): fix endpoint parameter for usb_control_msg_recv()
  can: bcm: check the result of can_send() in bcm_can_tx()
  can: bcm: registration process optimization in bcm_module_init()
====================

Link: https://lore.kernel.org/r/20220923120859.740577-1-mkl@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents f416bdfb 6eed7564
...@@ -58,7 +58,6 @@ static int ctucan_platform_probe(struct platform_device *pdev) ...@@ -58,7 +58,6 @@ static int ctucan_platform_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
addr = devm_ioremap_resource(dev, res); addr = devm_ioremap_resource(dev, res);
if (IS_ERR(addr)) { if (IS_ERR(addr)) {
dev_err(dev, "Cannot remap address.\n");
ret = PTR_ERR(addr); ret = PTR_ERR(addr);
goto err; goto err;
} }
......
This diff is collapsed.
...@@ -274,6 +274,7 @@ static void bcm_can_tx(struct bcm_op *op) ...@@ -274,6 +274,7 @@ static void bcm_can_tx(struct bcm_op *op)
struct sk_buff *skb; struct sk_buff *skb;
struct net_device *dev; struct net_device *dev;
struct canfd_frame *cf = op->frames + op->cfsiz * op->currframe; struct canfd_frame *cf = op->frames + op->cfsiz * op->currframe;
int err;
/* no target device? => exit */ /* no target device? => exit */
if (!op->ifindex) if (!op->ifindex)
...@@ -298,11 +299,11 @@ static void bcm_can_tx(struct bcm_op *op) ...@@ -298,11 +299,11 @@ static void bcm_can_tx(struct bcm_op *op)
/* send with loopback */ /* send with loopback */
skb->dev = dev; skb->dev = dev;
can_skb_set_owner(skb, op->sk); can_skb_set_owner(skb, op->sk);
can_send(skb, 1); err = can_send(skb, 1);
if (!err)
op->frames_abs++;
/* update statistics */
op->currframe++; op->currframe++;
op->frames_abs++;
/* reached last frame? */ /* reached last frame? */
if (op->currframe >= op->nframes) if (op->currframe >= op->nframes)
...@@ -1749,15 +1750,27 @@ static int __init bcm_module_init(void) ...@@ -1749,15 +1750,27 @@ static int __init bcm_module_init(void)
pr_info("can: broadcast manager protocol\n"); pr_info("can: broadcast manager protocol\n");
err = register_pernet_subsys(&canbcm_pernet_ops);
if (err)
return err;
err = register_netdevice_notifier(&canbcm_notifier);
if (err)
goto register_notifier_failed;
err = can_proto_register(&bcm_can_proto); err = can_proto_register(&bcm_can_proto);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "can: registration of bcm protocol failed\n"); printk(KERN_ERR "can: registration of bcm protocol failed\n");
return err; goto register_proto_failed;
} }
register_pernet_subsys(&canbcm_pernet_ops);
register_netdevice_notifier(&canbcm_notifier);
return 0; return 0;
register_proto_failed:
unregister_netdevice_notifier(&canbcm_notifier);
register_notifier_failed:
unregister_pernet_subsys(&canbcm_pernet_ops);
return err;
} }
static void __exit bcm_module_exit(void) static void __exit bcm_module_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment