From: Huang Shijie <shijie.huang@intel.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
Frank.Li@freescale.com, linux-mtd@lists.infradead.org,
han.xu@freescale.com, computersforpeace@gmail.com,
shijie8@gmail.com
Subject: Re: [PATCH RESEND] mtd: fsl-quadspi: Fix module unbound
Date: Wed, 14 Jan 2015 09:04:59 +0800 [thread overview]
Message-ID: <20150114010459.GB10784@hsj.sh.intel.com> (raw)
In-Reply-To: <1421187255-20618-1-git-send-email-festevam@gmail.com>
On Tue, Jan 13, 2015 at 08:14:15PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> When removing the fsl-quadspi module and running 'cat /proc/mtd' afterwards,
> we see garbage data like:
>
> $ rmmod fsl-quadspi
> $ cat /proc/mtd
> dev: size erasesize name
> mtd0: 00000000 00000000 "(null)"
> mtd0: 00000000 00000000 "(null)"
> mtd0: 00000000 00000000 "(null)"
> ...
> mtd0: a22296c6c756e28 00000000 "(null)"
> mtd0: a22296c6c756e28 3064746d "(null)"
>
> If we continue doing multiple module load/unload operations, then it will also
> lead to a kernel crash.
>
> The reason for this is due to the wrong mtd index used in
> mtd_device_unregister() in the remove function.
>
> We need to keep the mtd unregister index aligned with the one used in the probe
> function, which means we need to take into account the 'has_second_chip'
> property. By doing so we can guarantee that the mtd index is the same in the
> registration and unregistration functions.
>
> With this patch applied we can load/unload the fsl-quadspi driver several times
> and it will result in no crash.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
ok. Let this patch in.
Acked-by: Huang Shijie <shijie.huang@intel.com>
next prev parent reply other threads:[~2015-01-14 1:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 22:14 [PATCH RESEND] mtd: fsl-quadspi: Fix module unbound Fabio Estevam
2015-01-14 1:04 ` Huang Shijie [this message]
2015-01-14 20:50 ` Zhi Li
2015-01-15 15:41 ` Han Xu
2015-01-20 20:41 ` Brian Norris
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=20150114010459.GB10784@hsj.sh.intel.com \
--to=shijie.huang@intel.com \
--cc=Frank.Li@freescale.com \
--cc=computersforpeace@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=han.xu@freescale.com \
--cc=linux-mtd@lists.infradead.org \
--cc=shijie8@gmail.com \
/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