From: David Miller <davem@davemloft.net>
To: srinivas.kandagatla@st.com
Cc: netdev@vger.kernel.org, peppe.cavallaro@st.com
Subject: Re: [Stlinux-devel] [PATCH linux-stm 1/4] net:stmmac: Add check if mdiobus is registered in stmmac_mdio_unregister
Date: Fri, 31 Aug 2012 16:12:43 -0400 (EDT) [thread overview]
Message-ID: <20120831.161243.2158415044562484305.davem@davemloft.net> (raw)
In-Reply-To: <1346341798-19704-1-git-send-email-srinivas.kandagatla@st.com>
From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
Date: Thu, 30 Aug 2012 16:49:58 +0100
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
>
> This patch adds a basic check in stmmac_mdio_unregister to see if mdio
> bus registeration for this driver was actually sucessfull or not.
>
> Use case here is, if BSP considers using mdio-gpio bus along with stmmac
> driver by passing mdio_bus_data as NULL in platform data.
> Call to stmmac_mdio_register with mdio_bus_data as NULL returns 0, which
> is a considered sucessfull call form stmmac. Then again when we unload
> the driver we just call stmmac_mdio_unregister, this is were the actual
> problem is stmmac-mdio code dont really know at this instance of calling
> that stmmac_mdio_register was actually successful.
>
> So Adding a check in stmmac_mdio_unregister is always safe.
>
> Without this patch stmmac driver calls stmmac_mdio_register from
> stmmac_release which Segfaults as mii bus was never registered at the
> first point.
>
> Originally the this bug was found when unloading an stmmac driver
> instance which uses mdio-gpio for smi access.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Applied.
prev parent reply other threads:[~2012-08-31 20:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 15:49 [Stlinux-devel] [PATCH linux-stm 1/4] net:stmmac: Add check if mdiobus is registered in stmmac_mdio_unregister Srinivas KANDAGATLA
2012-08-31 20:12 ` David Miller [this message]
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=20120831.161243.2158415044562484305.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=srinivas.kandagatla@st.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;
as well as URLs for NNTP newsgroup(s).