From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: Re: [PATCH] i2c: i2c-qcom-geni: Fix suspend clock handling Date: Fri, 13 Jul 2018 00:03:25 +0200 Message-ID: <20180712220325.y42t5pheifzub6m7@ninjato> References: <20180709234937.176154-1-evgreen@chromium.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="idfaxadab3uz5vqy" Return-path: Content-Disposition: inline In-Reply-To: <20180709234937.176154-1-evgreen@chromium.org> Sender: linux-kernel-owner@vger.kernel.org To: Evan Green Cc: andy.gross@linaro.org, david.brown@linaro.org, Karthikeyan Ramasubramanian , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, swboyd@chromium.org, dianders@chromium.org, Girish Mahadevan , linux-i2c@vger.kernel.org List-Id: linux-i2c@vger.kernel.org --idfaxadab3uz5vqy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 09, 2018 at 04:49:37PM -0700, Evan Green wrote: > pm_runtime_suspended can return 0 even if the last runtime power > management function called in the device was a suspend call. This > trips up the i2c-qcom-geni's suspend_noirq accounting, which was > trying to use the function to determine if it should disable clocks > or if that had already been done. >=20 > The fix is to track whether or not clocks have been enabled explicitly > in the driver with a new member. While in there, also honor the return > value of geni_se_resources_off, which can technically fail. >=20 > An example of the warning generated during suspend: > [ 68.314733] WARNING: CPU: 0 PID: 1990 at drivers/clk/clk.c:595 clk_cor= e_disable+0x28/0x200 > [ 68.464576] Call trace: > [ 68.554410] [] clk_core_disable+0x28/0x200 > [ 68.560244] [] clk_disable+0x38/0x4c > [ 68.565541] [] geni_se_resources_off+0x40/0x74 > [ 68.571731] [] geni_i2c_runtime_suspend+0x2c/0x3c > [ 68.578185] [] geni_i2c_suspend_noirq+0x38/0x68 > [ 68.584475] [] dpm_run_callback+0x104/0x210 > [ 68.590404] [] __device_suspend_noirq+0x158/0x1a8 > [ 68.596859] [] dpm_noirq_suspend_devices+0x180/0x38c > [ 68.603594] [] suspend_devices_and_enter+0x49c/0x964 > [ 68.610321] [] pm_suspend+0x690/0x6e0 > [ 68.615712] [] state_store+0xd4/0xf8 > [ 68.621014] [] kobj_attr_store+0x18/0x28 > [ 68.626672] [] sysfs_kf_write+0x5c/0x68 > [ 68.632240] [] kernfs_fop_write+0x174/0x1b8 > [ 68.638177] [] __vfs_write+0x58/0x160 > [ 68.643567] [] vfs_write+0xcc/0x184 > [ 68.648780] [] SyS_write+0x64/0xb4 >=20 > Signed-off-by: Evan Green > --- > This change applies atop Karthik's patch [1], which as far as I can tell > technically hasn't landed yet, but also hasn't had feedback in awhile > either. I opted to submit this as a separate patch, but if the maintainers > prefer it's fine with me if this get folded in to another spin of the > base series. >=20 > [1] https://patchwork.kernel.org/patch/10460819/ Yeah, since the FSI driver seems to be mostly done now, this will be the next new driver I will have a look at. If the maintainers of the driver ack or rev this patch, I would then just fold it into the driver itself when I apply it? D'accord everyone? --idfaxadab3uz5vqy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAltH0CkACgkQFA3kzBSg KbaVCQ/+OsfMSLp8VGeuD+yB7FloWiAo08IeXuPfri/Hc5yCNmFRGbLYMKfy1Ssj 7XKLnJUU59A4E1vtBGuurch5i/HlOlN3XwVLaTV1abwB574xX6sRbULnHhkA83AW VkT81yVZPXZ+KPdMyY6j7NFmWaWCfjVe3Sz47pHDbvVgMUVJbRHb0QKa7BGIxN6d hEBl7f/74yCYMbXWlzkE1BRnfFxqewYc/HyO9uxF3oLNoslWcxbsSKGjuKo+xata s42hyr7YTohOuoBzR2zNkiEnXoNHtEz3Y2DWT+CgaRpmzBKgkvoS6zwGDdX2t/JO A4BDG3VYtU8/opOWFwfIGAdbhnxk6kduWNV9xKu07unq7BQVq0IvjgOoZ2F2CoHI 3ZTh2Z0XRJJR9cxOKsjz8mNbkc9g9yTwiZORVQ1SezVIxCAtdcvQZhWewi9ZUbSd sNx4hp/9Qp5JxDRz8hH/PQ/GdGFlRHLyNM2khXmqOGF7GjK92+/etuc5iekpjiWW xLMKAEtH2cP5IwXW2jeDNWcenfX6VQcoD8egykAnQE9wrirsu76mErUEqZyQbK7V JWZ4pGAbr16CRL+enQVxWsml+2Xtpf5/YWOl7pN47dQIBMtdTXrBdLQtYO35TIFY BewjSgBAaZkwv4T+WbkoU+swC4FhIBx6LRzP0x5pfVxhay8H2fk= =Hvt8 -----END PGP SIGNATURE----- --idfaxadab3uz5vqy--