From: ajneu <ajneu1@gmail.com>
To: linux-can@vger.kernel.org
Subject: Re: Kernel Oops with: ip link set can0 type can
Date: Tue, 21 Jun 2016 12:25:56 +0000 (UTC) [thread overview]
Message-ID: <loom.20160621T142101-867@post.gmane.org> (raw)
In-Reply-To: d9d3c57a-1c47-2220-7b09-40b46966c80a@hartkopp.net
Oliver Hartkopp <socketcan <at> hartkopp.net> writes:
>
>
> On 06/21/2016 11:17 AM, Oliver Hartkopp wrote:
> > On 06/21/2016 10:55 AM, ajneu wrote:
> >> ajneu <ajneu1 <at> gmail.com> writes:
> >>
> >>>
> >>> Hi,
> >>>
> >>> issuing the command
> >>> sudo ip link set can0 type can
> >>> I get Kernel Oops (NULL pointer dereference)
>
> > But the OOPS should no occur due to your ip usage anyway
> > This has to be fixed ...
>
> Can you please check whether my posted patch fixes your problem?
>
> http://marc.info/?l=linux-can&m=146650412017263&w=2
>
> I tested it myself with success.
>
> Thanks for catching this issue!
>
> Regards,
> Oliver
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo <at> vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
Hi Oliver,
thanks for the patch.
I unloaded the old driver, and loaded yours with the patch as follows:
lsmod | grep can
sudo rmmod peak_usb # I had to remove this first, since issuing
# sudo rmmod vcan
# showed
# ERROR: Module can_dev is in use by: peak_usb
sudo rmmod can_dev
lsmod | grep can
sudo insmod drivers/net/can/can-dev.ko
sudo insmod drivers/net/can/usb/peak_usb/peak_usb.ko
Then I tested the command:
sudo ip link set can0 type can ## working!
sudo ip link add can0 type can ## working!
=> RTNETLINK answers: File exists
~~>So far so good. Good till here.
Then I tested SOME MORE:
sudo ip link delete can0 ## also removes /sys/class/net/can0
sudo ip link add can0 type can ## hmmmm?
=> RTNETLINK answers: Operation not supported
~~>Is this still ok?
Directly after this I managed to provoke a bug:
I pulled out the Peak USB Adapter, and the computer computer HANGS!!!!
~~>NOTHINGS WORKS. Absolutely nothing. No mouse. No keyboard.
This bug is therefore:
Calling
sudo ip link delete can0
while the Peak USB Adapter is still plugged in,
and THEN disconnecting the Peak USB Adapter.
Regards,
ajneu
PS:
Note to self -- how to apply Oliver's patch and unload load can kernel modules
## 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 modules
## perform patch and then recompile with:
make SUBDIRS=drivers/net/can modules
## Then unload old and insert new driver
## (as already shown at beginning of this message)
lsmod | grep can
sudo rmmod peak_usb # I had to remove this first, since issuing
# sudo rmmod vcan
# showed
# ERROR: Module can_dev is in use by: peak_usb
sudo rmmod can_dev
lsmod | grep can
sudo insmod drivers/net/can/can-dev.ko
sudo insmod drivers/net/can/usb/peak_usb/peak_usb.ko
next prev parent reply other threads:[~2016-06-21 12:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 7:57 Kernel Oops with: ip link set can0 type can ajneu
2016-06-21 8:55 ` ajneu
2016-06-21 9:17 ` Oliver Hartkopp
2016-06-21 10:19 ` Oliver Hartkopp
2016-06-21 12:25 ` ajneu [this message]
2016-06-21 12:31 ` ajneu
2016-06-21 13:28 ` Oliver Hartkopp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20160621T142101-867@post.gmane.org \
--to=ajneu1@gmail.com \
--cc=linux-can@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox