From: David Miller <davem@davemloft.net>
To: olteanv@gmail.com
Cc: richardcochran@gmail.com, andrew@lunn.ch, f.fainelli@gmail.com,
vivien.didelot@gmail.com, claudiu.manoil@nxp.com,
alexandru.marginean@nxp.com, xiaoliang.yang_1@nxp.com,
yangbo.lu@nxp.com, netdev@vger.kernel.org,
alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com,
vladimir.oltean@nxp.com, antoine.tenart@bootlin.com
Subject: Re: [PATCH v3 net] net: mscc: ocelot: unregister the PTP clock on deinit
Date: Tue, 03 Dec 2019 11:28:03 -0800 (PST) [thread overview]
Message-ID: <20191203.112803.2177074793533497746.davem@davemloft.net> (raw)
In-Reply-To: <20191203154535.21183-1-olteanv@gmail.com>
From: Vladimir Oltean <olteanv@gmail.com>
Date: Tue, 3 Dec 2019 17:45:35 +0200
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> Currently a switch driver deinit frees the regmaps, but the PTP clock is
> still out there, available to user space via /dev/ptpN. Any PTP
> operation is a ticking time bomb, since it will attempt to use the freed
> regmaps and thus trigger kernel panics:
...
> And now that ocelot->ptp_clock is checked at exit, prevent a potential
> error where ptp_clock_register returned a pointer-encoded error, which
> we are keeping in the ocelot private data structure. So now,
> ocelot->ptp_clock is now either NULL or a valid pointer.
>
> Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support")
> Cc: Antoine Tenart <antoine.tenart@bootlin.com>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Applied and queued up for v5.4 -stable, thanks.
prev parent reply other threads:[~2019-12-03 19:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-03 15:45 [PATCH v3 net] net: mscc: ocelot: unregister the PTP clock on deinit Vladimir Oltean
2019-12-03 19:28 ` 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=20191203.112803.2177074793533497746.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandru.marginean@nxp.com \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@bootlin.com \
--cc=claudiu.manoil@nxp.com \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=richardcochran@gmail.com \
--cc=vivien.didelot@gmail.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiaoliang.yang_1@nxp.com \
--cc=yangbo.lu@nxp.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).