Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3743505pxb; Tue, 7 Sep 2021 06:44:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMJZOYkodZ6oVQ7HWnPXUbBJaJ/HS+gOglu3mgybpF/a6Wq8HjMW1jbWVMRuOqpac3vyWd X-Received: by 2002:a05:6402:2210:: with SMTP id cq16mr18537446edb.348.1631022277367; Tue, 07 Sep 2021 06:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631022277; cv=none; d=google.com; s=arc-20160816; b=b18kl8Y/xyoad/HPSQ05MhxfyrDTg2359vcuwb45jXIy/hL9qEPYlpFe5tyIf7Qb07 GxEeASiiCzccdsDWSZJR46+psUjhdvhIDfCXLNfBFxd3yRXvc66RYUKX2lVzWz6cuzda gKPl78QECWAbhFN3N1tjlVt7qhFTrdmzzYvIxVlfbuxVIheLcdCrL4aLQdkC8KDVBiDV R5PX5Lfa9P6WsqIeqhjNrVtJKihT9KGCTHNEHDPOEZUPhyYbRYi5Wv5fuU49rvTQ3CO4 55oEEpz8MPeqUDkiB+nQLVEUjzhGvKTMKeFvbaV8xzy5KME9SeFTMn62dKqG87emu1k0 m/9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=vtwlrY+3E/w0K10z05i9TDnzVL9Tq5TYd9aqQbks3tY=; b=QSUgTzvB3AqlcMHxSDO6jE22SpeQuLmeQ8h3UXMQZlRtP5cre4nRQp39yDkhs/FZr0 O/M2uGN8O8QuYPzhvtcGweX7Jzz3ydUZ4PQMKOcGx8kGViBUmxUt3dN93HuAtHUbcqd5 5OdF8ClUgn7p/EgVlqd72Z8hlCjtBwxzivay28NQkxh/wpZyPICCsIw0VadMTi8nBGQ2 cdLLMFbWoVvK1dUqkY/rXqgTIeIT7dY/QiJkr2cylSPhTdaay1b8Jx8LiO195Yr5YTwj WQFu3HZQ6WyOu2J3E29222aNZTcKAfdR0oUO+SMxXZ9gArljY3HmW9XwcnwX+Qp1RzPq 2Z3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qf39si10632330ejc.644.2021.09.07.06.44.08; Tue, 07 Sep 2021 06:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344822AbhIGNmn (ORCPT + 99 others); Tue, 7 Sep 2021 09:42:43 -0400 Received: from mail-ot1-f47.google.com ([209.85.210.47]:43739 "EHLO mail-ot1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344760AbhIGNmm (ORCPT ); Tue, 7 Sep 2021 09:42:42 -0400 Received: by mail-ot1-f47.google.com with SMTP id x10-20020a056830408a00b004f26cead745so12773560ott.10; Tue, 07 Sep 2021 06:41:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vtwlrY+3E/w0K10z05i9TDnzVL9Tq5TYd9aqQbks3tY=; b=aREyV3FAqdslzbRNvOH3LLxMqyLQ6ytYScKw0Hwmxlig/32+AFFRLD65ndtbsNYHyE QUSdO96YGEu5CxQloIh0upUQKKn4eZWQ3DmSUI5jFFwiWmyuh2NvJNNtg3Tu7bwXq7qm GxI5OJMQByNvYeU7UXFbzYYFgY/diql1jkjoj74+LqqZFxD5p0FCz66j3YMMYL9IYhH9 Gs6g0/1EgpH9KxqtwFwN5hT8Eq4TwQ7jyHdyoSdUyrrc0zg80VXhA/dWCKIv5rnhg07G ecKmbQGWGsYztuXE2jIlADma68xp/Zk4TMAfn58oKyeWLTCkkBQ4+euMcdTAeC/e/WvE GAfg== X-Gm-Message-State: AOAM533k5t+Bne/8YPILR2hG7rFb3E9Ds0LKx0fElNQ/TszyfWZ1tnPR lPPXvs+jMK2osw5VIOjPSqmGgQzUkmcXPlpJ6+k= X-Received: by 2002:a9d:6945:: with SMTP id p5mr15455234oto.301.1631022094445; Tue, 07 Sep 2021 06:41:34 -0700 (PDT) MIME-Version: 1.0 References: <20210904053703.581297-1-srinivas.pandruvada@linux.intel.com> <926ac4b9-1bb5-e96e-ded3-6461f7a215b7@kernel.dk> <8dc57921f157b154e4af2dba26ce697dc4d4fcc2.camel@linux.intel.com> <584a4fad09048e3ea0dbc3515b2e909b745177dd.camel@linux.intel.com> <980bc41a8bedbd81c199a78ce9f2ab2ef7b9341f.camel@linux.intel.com> In-Reply-To: <980bc41a8bedbd81c199a78ce9f2ab2ef7b9341f.camel@linux.intel.com> From: "Rafael J. Wysocki" Date: Tue, 7 Sep 2021 15:41:23 +0200 Message-ID: Subject: Re: [PATCH] cpufreq: intel_pstate: Fix for HWP interrupt before driver is ready To: Srinivas Pandruvada Cc: "Rafael J. Wysocki" , Jens Axboe , "Rafael J. Wysocki" , Len Brown , Viresh Kumar , Linux PM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 6, 2021 at 9:57 PM Srinivas Pandruvada wrote: > > On Mon, 2021-09-06 at 20:25 +0200, Rafael J. Wysocki wrote: > > On Mon, Sep 6, 2021 at 8:14 PM Srinivas Pandruvada > > wrote: > > > > > > On Mon, 2021-09-06 at 19:54 +0200, Rafael J. Wysocki wrote: > > > > > [...] > > > > > > > > We are handling offline for other thermal interrupt sources from > > > same > > > interrupt in therm-throt.c, where we do similar in offline path (by > > > TGLX). If cpufreq offline can cause such issue of changing CPU, > > > > This is not cpufreq offline, but intel_pstate_update_status() which > > may be triggered via sysfs. And again, the theoretically problematic > > thing is dereferencing cpudata (which may be cleared by a remote CPU) > > from the interrupt handler without protection. > > This will be a problem. > > > > > > I can call intel_pstate_disable_hwp_interrupt() via override from > > > https://elixir.bootlin.com/linux/latest/C/ident/thermal_throttle_offline > > > after masking APIC interrupt. > > > > But why would using RCU be harder than this? > I think, this will require all_cpu_data and cpu_data to be rcu > protected. This needs to be well tested. > > I think better to revert the patch for the next release. Done, thanks!