From mboxrd@z Thu Jan 1 00:00:00 1970 From: ajneu Subject: Re: Bug? -- NEVER getting =?utf-8?b?Y29udHJvbGxlci1wcm9ibGVte2JhY2stdG8tZXJyb3ItYWN0aXZlfQ==?= Date: Mon, 20 Jun 2016 12:41:09 +0000 (UTC) Message-ID: References: <5767C65D.2010303@grandegger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from plane.gmane.org ([80.91.229.3]:58770 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754021AbcFTNNZ (ORCPT ); Mon, 20 Jun 2016 09:13:25 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bEyVz-00069F-Br for linux-can@vger.kernel.org; Mon, 20 Jun 2016 14:41:19 +0200 Received: from 195.50.142.51 ([195.50.142.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Jun 2016 14:41:19 +0200 Received: from ajneu1 by 195.50.142.51 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Jun 2016 14:41:19 +0200 Sender: linux-can-owner@vger.kernel.org List-ID: To: linux-can@vger.kernel.org Wolfgang Grandegger grandegger.com> writes: > > Does the following patch fix both issues? > > diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c > index ce44a03..ca17ac2 100644 > --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c > +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c > -529,7 +529,7 static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if, > struct peak_usb_device *dev = usb_if->dev[pucan_stmsg_get_channel(sm)]; > struct pcan_usb_fd_device *pdev = > container_of(dev, struct pcan_usb_fd_device, dev); > - enum can_state new_state = CAN_STATE_ERROR_ACTIVE; > + enum can_state new_state; > enum can_state rx_state, tx_state; > struct net_device *netdev = dev->netdev; > struct can_frame *cf; > -547,10 +547,7 static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if, > new_state = CAN_STATE_ERROR_WARNING; > } else { > /* no error bit (so, no error skb, back to active state) */ > - dev->can.state = CAN_STATE_ERROR_ACTIVE; > - pdev->bec.txerr = 0; > - pdev->bec.rxerr = 0; > - return 0; > + new_state = CAN_STATE_ERROR_ACTIVE; > } > > /* state hasn't changed */ > > Wolfgang. > -- > To unsubscribe from this list: send the line "unsubscribe linux-can" in > the body of a message to majordomo vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > Hi Wolfgang, yes wonderful: both issues are fixed with your patch! Will that be going into the mainline linux kernel?? Thanks. Regards, ajneu PS: Note to self -- compiling kernel with Wolfgang's change: ## this is under Debian (stretch) ## (I'm currently using Kernel 4.6) sudo aptitude install build-essential sudo aptitude install linux-source mkdir ~/kernel cd ~/kernel tar xf /usr/src/linux-source-4.6.tar.xz cd ~/kernel/linux-source* cp /boot/config-4.6.0-1-amd64 .config cp /usr/src/linux-headers-4.6.0-1-amd64/Module.symvers . make prepare make modules_prepare make SUBDIRS=scripts/mod make SUBDIRS=drivers/net/can/usb/peak_usb modules ## perform patch and then recompile with: make SUBDIRS=drivers/net/can/usb/peak_usb modules lsmod | grep can ## see if previous peak_usb ## is still loaded. If this is the case then: sudo rmmod peak_usb ## load newly compiled driver sudo insmod drivers/net/can/usb/peak_usb/peak_usb.ko