linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Mattias Boström" <mattias.bostroem@gmail.com>
To: linuxppc-dev@ozlabs.org
Subject: Patch fixing rmmod -> kernel panic for Peak CAN driver for MPC5200B
Date: Tue, 19 Feb 2008 16:18:01 +0100	[thread overview]
Message-ID: <10d674cb0802190718r13af85a6w89557e4ca052432f@mail.gmail.com> (raw)

Here is a patch that solves the problem with kernel panic when
removing the peak-linux-driver-3.17 on a MPC5200B. If someone else
apart from us have experienced that.
The patches to peak-linux-driver-3.17 needed to run on MPC5200B are:
peak-linux-driver-3.17-mpc5200.patch (DENX)
peak-linux-driver-3.17-mpc5200-platform_driver.patch (Sylvain Munaut &
MontaVista)

Mattias

diff --exclude CVS -uNr
peak-linux-driver-3.17/driver/src/pcan_mpc5200.c
peak-linux-driver-3.17.modified/driver/src/pcan_mpc5200.c
--- peak-linux-driver-3.17/driver/src/pcan_mpc5200.c    2008-02-19
16:06:54.000000000 +0100
+++ peak-linux-driver-3.17.modified/driver/src/pcan_mpc5200.c
2008-02-19 16:06:46.000000000 +0100
@@ -752,7 +752,16 @@
 {
        DPRINTK(KERN_DEBUG "%s: mgt_mscan_cleanup()\n", DEVICE_NAME);

-       platform_driver_unregister(&mscan_driver);
+       /* In mgt_mscan_init platform_driver_register is called only once
+        * for module 1.
+        * We should only call platform_driver_unregister once and we do it
+        * for module 1 since it is the last module to cleanup.
+        */
+       if (!(dev->port.mscan.module_num-1)) {
+          DPRINTK(KERN_DEBUG "platform_driver_unregister(&mscan_driver)\n");
+          (void) platform_driver_unregister(&mscan_driver);
+       }
+

 #if 0  /* seems like it's been freed already */
        mgt_mscan_free_irq(dev);

                 reply	other threads:[~2008-02-19 15:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=10d674cb0802190718r13af85a6w89557e4ca052432f@mail.gmail.com \
    --to=mattias.bostroem@gmail.com \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).