linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH v2] driver core: platform: don't oops in platform_shutdown() on unbound devices
Date: Sat, 12 Dec 2020 23:58:14 +0100	[thread overview]
Message-ID: <20201212225814.pg73imvdm2eevw3w@pengutronix.de> (raw)
In-Reply-To: <20201212213832.237027-1-dmitry.baryshkov@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

Hello Dmitry,

On Sun, Dec 13, 2020 at 12:38:32AM +0300, Dmitry Baryshkov wrote:
> Platform code stopped checking if the device is bound to the actual
> platform driver, thus calling non-existing drv->shutdown(). Verify that
> _dev->driver is not NULL before calling shutdown callback.

I'd write:

	On shutdown the driver core calls the bus' shutdown callback also for
	unbound devices. A driver's shutdown callback however is only called for
	devices bound to this driver. Commit 9c30921fe799 ("driver core:
	platform: use bus_type functions") changed the platform bus from driver
	callbacks to bus callbacks, so the shutdown function must be prepared to
	be called without a driver. Add the corresponding check in the
	shutdown function.

With that adding the backtrace isn't necessary (and the patch is fine).

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2020-12-12 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12 21:38 [PATCH v2] driver core: platform: don't oops in platform_shutdown() on unbound devices Dmitry Baryshkov
2020-12-12 22:58 ` Uwe Kleine-König [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=20201212225814.pg73imvdm2eevw3w@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=rafael@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;
as well as URLs for NNTP newsgroup(s).