Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665Ab3IKIHL (ORCPT ); Wed, 11 Sep 2013 04:07:11 -0400 Received: from mail-ob0-f179.google.com ([209.85.214.179]:46576 "EHLO mail-ob0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752588Ab3IKIHA (ORCPT ); Wed, 11 Sep 2013 04:07:00 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 11 Sep 2013 13:36:58 +0530 Message-ID: Subject: Re: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too From: Viresh Kumar To: Guennadi Liakhovetski Cc: Greg KH , "Rafael J. Wysocki" , Linux Kernel Mailing List , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" , "cpufreq@vger.kernel.org" , SH-Linux , Magnus Damm Content-Type: multipart/mixed; boundary=089e01182678039c6604e6171b3b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10438 Lines: 157 --089e01182678039c6604e6171b3b Content-Type: text/plain; charset=ISO-8859-1 On 10 September 2013 22:37, Guennadi Liakhovetski wrote: > On Tue, 10 Sep 2013, Viresh Kumar wrote: >> Quite straight forward actually.. > > Apparently, not quite. I overlooked the situation where we return early from ->target() routines.. :( Please try attached patches, I will repost them later (once I am able to convince Rafael that these are really important :) ) -- viresh --089e01182678039c6604e6171b3b Content-Type: application/octet-stream; name="0001-cpufreq-distinguish-drivers-that-do-asynchronous-not.patch" Content-Disposition: attachment; filename="0001-cpufreq-distinguish-drivers-that-do-asynchronous-not.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hlg93iqy0 RnJvbSBhMTUzNzUyNzE5Nzc0NzYzZjllZGQ4ZjQ2MjkxZjFiYWI3MjJmN2Q2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpNZXNzYWdlLUlkOiA8YTE1Mzc1MjcxOTc3NDc2M2Y5ZWRkOGY0N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LS0gYS9pbmNsdWRlL2xpbnV4L2NwdWZyZXEuaAor KysgYi9pbmNsdWRlL2xpbnV4L2NwdWZyZXEuaApAQCAtMjE5LDYgKzIxOSwxMiBAQCBzdHJ1Y3Qg Y3B1ZnJlcV9kcml2ZXIgewogCQkJCQkgKiBmcmVxdWVuY3kgdHJhbnNpdGlvbnMgKi8KICNkZWZp bmUgQ1BVRlJFUV9QTV9OT19XQVJOCTB4MDQJLyogZG9uJ3Qgd2FybiBvbiBzdXNwZW5kL3Jlc3Vt ZSBzcGVlZAogCQkJCQkgKiBtaXNtYXRjaGVzICovCisvKgorICogRHJpdmVyIHdpbGwgZG8gUE9T VENIQU5HRSBub3RpZmljYXRpb25zIGZyb20gb3V0c2lkZSBvZiB0aGVpciAtPnRhcmdldCgpCisg KiByb3V0aW5lIGFuZCBzbyBtdXN0IHNldCBjcHVmcmVxX2RyaXZlci0+ZmxhZ3Mgd2l0aCB0aGlz IGZsYWcsIHNvIHRoYXQgY29yZQorICogY2FuIGhhbmRsZSB0aGVtIHNwZWNpYWxseS4KKyAqLwor I2RlZmluZSBDUFVGUkVRX0FTWU5DX05PVElGSUNBVElPTiAweDA4CiAKIGludCBjcHVmcmVxX3Jl Z2lzdGVyX2RyaXZlcihzdHJ1Y3QgY3B1ZnJlcV9kcml2ZXIgKmRyaXZlcl9kYXRhKTsKIGludCBj cHVmcmVxX3VucmVnaXN0ZXJfZHJpdmVyKHN0cnVjdCBjcHVmcmVxX2RyaXZlciAqZHJpdmVyX2Rh dGEpOwotLSAKMS43LjEyLnJjMi4xOC5nNjFiNDcyZQoK --089e01182678039c6604e6171b3b Content-Type: application/octet-stream; name="0002-cpufreq-fix-notification-serialization-issues.patch" Content-Disposition: attachment; filename="0002-cpufreq-fix-notification-serialization-issues.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hlg93izp1 RnJvbSA0Mjg1MWUzYzJmYzRhOGU3MDQ2ODNjMzA5YzAzZDVhZjQyYThmMzk4IE1vbiBTZXAg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Y0NAotLS0gYS9kcml2ZXJzL2NwdWZyZXEvZXh5bm9zNTQ0MC1j cHVmcmVxLmMKKysrIGIvZHJpdmVycy9jcHVmcmVxL2V4eW5vczU0NDAtY3B1ZnJlcS5jCkBAIC0y NTEsNiArMjUxLDkgQEAgc3RhdGljIGludCBleHlub3NfdGFyZ2V0KHN0cnVjdCBjcHVmcmVxX3Bv bGljeSAqcG9saWN5LAogCiAJCV9fcmF3X3dyaXRlbCh0bXAsIGR2ZnNfaW5mby0+YmFzZSArIFhN VV9DMF8zX1BTVEFURSArIGkgKiA0KTsKIAl9CisKKwkvKiBNYXJrIHRyYW5zaXRpb24gYXMgSW4t cHJvZ3Jlc3MgKi8KKwlyZXQgPSAtRUlOUFJPR1JFU1M7CiBvdXQ6CiAJbXV0ZXhfdW5sb2NrKCZj cHVmcmVxX2xvY2spOwogCXJldHVybiByZXQ7Ci0tIAoxLjcuMTIucmMyLjE4Lmc2MWI0NzJlCgo= --089e01182678039c6604e6171b3b-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/