From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752481AbdLFPUJ (ORCPT ); Wed, 6 Dec 2017 10:20:09 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:60898 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183AbdLFPUH (ORCPT ); Wed, 6 Dec 2017 10:20:07 -0500 Date: Wed, 6 Dec 2017 16:20:05 +0100 From: Maxime Ripard To: Takuo Koguchi Cc: lkml@vger.kernel.org, khoroshilov@ispras.ru, takuo.koguchi.sw@gmail.com, Takuo Koguchi , Mark Brown , Chen-Yu Tsai , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] spi: sun4i: disable clocks in the remove function Message-ID: <20171206152005.yfbyylu6tbe5gnnv@flea.lan> References: <1512573752-13091-1-git-send-email-takuo.koguchi.sw@hitachi.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2mew5oj6s7agwvco" Content-Disposition: inline In-Reply-To: <1512573752-13091-1-git-send-email-takuo.koguchi.sw@hitachi.com> User-Agent: NeoMutt/20171027 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --2mew5oj6s7agwvco Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Thu, Dec 07, 2017 at 12:22:13AM +0900, Takuo Koguchi wrote: > mclk and hclk need to be disabled explicitly since pm_runtime_disable does > not disable the clocks. >=20 > Found by Linux Driver Verification project (linuxtesting.org). >=20 > Signed-off-by: Takuo Koguchi > --- > drivers/spi/spi-sun4i.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c > index c5cd635..9011c09 100644 > --- a/drivers/spi/spi-sun4i.c > +++ b/drivers/spi/spi-sun4i.c > @@ -525,6 +525,11 @@ static int sun4i_spi_probe(struct platform_device *p= dev) > =20 > static int sun4i_spi_remove(struct platform_device *pdev) > { > + struct spi_master *master =3D dev_get_drvdata(&pdev->dev); > + struct sun4i_spi *sspi =3D spi_master_get_devdata(master); > + > + clk_disable_unprepare(sspi->mclk); > + clk_disable_unprepare(sspi->hclk); And that will in turn create an unbalanced disable call if suspend was called before the remove, which is very likely. Why are you not calling pm_runtime_force_suspend? How did you test that patch? Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --2mew5oj6s7agwvco Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlooCqEACgkQ0rTAlCFN r3RZXg/+Oo/FkxttUws0+cpdLqc0PfnpADYFzwtpeYrsZ8bhfhOjKv9MRI+XRyYp srVb52glmMZIPFHckuUe7aSav8xDbxpQ/zFgGmW7aYovJ3mcX5FX9D2AqxvSGde4 7weBb0PjXBVlVBChy0jRgxsES5udi1iPELBd+2AekNPAgv5OGbGr18bJ4lc1PThq 8oLCXUI4mkeM2m+0Aw6ye5EestIseCAHFxLkfqaRfIjl9o6QA7APo+67PZCkXYCX 08xmXkXhL3UjBBvpSWqjqhrn92nJOMNiNW7TfNdJfCHFTZq7gTVrSQ92QaWHKOiU SbaBX8GqpeQQTbuKyd5GqnnqRPXgiaPXrsCMtM5Ay9O1tSLtpVVwETLn5xpTikSL mhzEbyK/Yj46dIP/eaQSe6gEqkzctOh2afW2nx8q+1qscX2oK441fKpRwuJA5h0i ZyT+5/MfhM5fMhxDiYKwetfyYzaB8y5vgEepitDwYAcI9JEXYl5AK5BItWyKEgua VE1INuW6/132pYMpPmtmzu+Ox7hTksOwMuxHSEoORG4g1P58ESyic/5jtUdtlGer vUtjeOnWxlbthzZKlmLhTSl/Yd9jOVwk58dLNBpIhPGKtp6TyxWXMRfyFGIlCRIo RnGaXphlF6lCvh70wM6XhRUDFjn14qLXFx2sRrjAcwA4wdi1WuE= =8OV9 -----END PGP SIGNATURE----- --2mew5oj6s7agwvco--