Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1229582ybg; Fri, 18 Oct 2019 14:12:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4X5xfAaAWEkx4EXemjCnTGr421UWEsd7+NAaGSaIj8IcJnsDRTPFUplenrO/tzNCUZ0Te X-Received: by 2002:a17:906:6858:: with SMTP id a24mr11097547ejs.27.1571433161244; Fri, 18 Oct 2019 14:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571433161; cv=none; d=google.com; s=arc-20160816; b=jcdOFS0C1dm9xpeLZ9oBRUezZ8DPb5GRxVCz7ydxcRBf38fmUBYlCWZECmxeU/gskf UHvLG1Fo+dsPNJNOgN9hRLfoaoFATSy9Dd1AyL4OvQpCV2WlTgURWQF9j2obt1dy7MwU UKAi8uKWTkK+PM9jpJ5hSMFer6+QmBvVxmGriDVdCmhDjZc07sM26QgpQjBjiZQju/CA BY3+UpOztG4c4gEDNSXv0t6hoLARLCM/Aeua7t4UkZk3F2PM1OGzpU1uxxAzBnMLe5gg t8SMFhLSjxKGaflOM7GCe9M8eGCj0O9X0vXg7eYUbb1nl3gzU5KiWrGo85vmoKx3RepW hevw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=11YJE2aA7RuRF6qiR5+1ahOif5CeVAWWDeEU9WRsL7k=; b=ZDQhH5+mvk70UTkSbn7669ITT3sl/Oy1vmfi9BCaihrllSuOBg6UpS33M7+4ZuWUMT /qX1Mw/slrhCE5Fli2O7G9fbxPYrFMc6UjyTM5GWfZci6jtvLPomIln878qJ7jn37WR0 rRh/F6FYyxdsAyIT6OeTppp/Wcx/z6EKdP2KDGjuW/5sricwVcKB3CC9Xoeo+vaWDvdL 9qPhq7Pmamovtv/dAkdmR6Nea7gYw8ZaIKpjAK4ZIkn9Tz8XlNlcbPVZDXqjSYX71GCJ OaCQlu/efG1rrWeez5ibtJ6dp6qVMqyMiOBErj0hs1KvT2mhaF5cRBGuQlucfadjUkrA edzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si4114080ejq.372.2019.10.18.14.12.18; Fri, 18 Oct 2019 14:12:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409209AbfJQQmn (ORCPT + 99 others); Thu, 17 Oct 2019 12:42:43 -0400 Received: from [217.140.110.172] ([217.140.110.172]:41286 "EHLO foss.arm.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1729529AbfJQQmm (ORCPT ); Thu, 17 Oct 2019 12:42:42 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 15D4A328; Thu, 17 Oct 2019 09:42:22 -0700 (PDT) Received: from bogus (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 127E23F6C4; Thu, 17 Oct 2019 09:42:20 -0700 (PDT) Date: Thu, 17 Oct 2019 17:42:15 +0100 From: Sudeep Holla To: "Rafael J. Wysocki" Cc: Viresh Kumar , "Rafael J. Wysocki" , Linux PM , Linux ACPI , LKML , Sudeep Holla , Dmitry Osipenko Subject: Re: [RFT][PATCH 0/3] cpufreq / PM: QoS: Introduce frequency QoS and use it in cpufreq Message-ID: <20191017164215.GA32531@bogus> References: <2811202.iOFZ6YHztY@kreacher> <20191016142343.GB5330@bogus> <20191017095725.izchzl7enfylvpf3@vireshk-i7> <20191017095942.GF8978@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 17, 2019 at 06:34:28PM +0200, Rafael J. Wysocki wrote: > On Thu, Oct 17, 2019 at 12:00 PM Sudeep Holla wrote: > > > > On Thu, Oct 17, 2019 at 03:27:25PM +0530, Viresh Kumar wrote: > > > On 16-10-19, 15:23, Sudeep Holla wrote: > > > > Thanks for the spinning these patches so quickly. > > > > > > > > I did give it a spin, but unfortunately it doesn't fix the bug I reported. > > > > So I looked at my bug report in detail and looks like the cpufreq_driver > > > > variable is set to NULL at that point and it fails to dereference it > > > > while trying to execute: > > > > ret = cpufreq_driver->verify(new_policy); > > > > (Hint verify is at offset 0x1c/28) > > > > > > > > So I suspect some race as this platform with bL switcher tries to > > > > unregister and re-register the cpufreq driver during the boot. > > > > > > > > I need to spend more time on this as reverting the initial PM QoS patch > > > > to cpufreq.c makes the issue disappear. > > I guess you mean commit 67d874c3b2c6 ("cpufreq: Register notifiers > with the PM QoS framework")? > Correct. > That would make sense, because it added the cpufreq_notifier_min() and > cpufreq_notifier_max() that trigger handle_update() via > schedule_work(). > Yes, it was not clear as I didn't trace to handle_update earlier. After looking at depth today afternoon, I arrived at the same conclusion. > [BTW, Viresh, it looks like cpufreq_set_policy() should still ensure > that the new min is less than the new max, because the QoS doesn't do > that.] > > > > Is this easily reproducible ? cpufreq_driver == NULL shouldn't be the case, it > > > get updated only once while registering/unregistering cpufreq drivers. That is > > > the last thing which can go wrong from my point of view :) > > > > > > > Yes, if I boot my TC2 with bL switcher enabled, it always crashes on boot. > > It does look like handle_update() races with > cpufreq_unregister_driver() and cpufreq_remove_dev (called from there > indirectly) does look racy. Indeed, we just crossed the mails. I just found that and posted a patch. -- Regards, Sudeep