From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1D1BC18E5B for ; Mon, 16 Mar 2020 15:47:52 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E3B920679 for ; Mon, 16 Mar 2020 15:47:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=axtens.net header.i=@axtens.net header.b="HC5iw9ns" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E3B920679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48h10Q2B4QzDqTZ for ; Tue, 17 Mar 2020 02:47:50 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=axtens.net (client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=dja@axtens.net; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.a=rsa-sha256 header.s=google header.b=HC5iw9ns; dkim-atps=neutral Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48gxPN3bNHzDqLR for ; Tue, 17 Mar 2020 00:05:43 +1100 (AEDT) Received: by mail-pf1-x442.google.com with SMTP id u68so9903078pfb.2 for ; Mon, 16 Mar 2020 06:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=S3ylSoSVkSVtheK/F1qvWvf0XZ/cN1+4cUsuDfSQPrg=; b=HC5iw9nsPFCCHJIQ4FigojhiQRRfcdyb6Qpgcbl9eWbw97vM6ByH1GNo0POUcLpnq8 W2526eX+MuNa5a/YiPRQpKhHy989nZbvMYd0iQ068YzwHi/XfEMOAHswjNqJkdwQO/xa W0/LGixqd91m0pYY9vhfsXQG0Fssoiruwz8xI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=S3ylSoSVkSVtheK/F1qvWvf0XZ/cN1+4cUsuDfSQPrg=; b=MtYvpnAO6nPjm3jvRWx/2HI68h8GTfLRMQmUMCEvbU35BiieVHUaXW4G+41Z2QjNha zpy/MgD/1ELVq9r+e64ze3RjpomOYJBhQ5sqCMf5gROBiTHsavbj77JFth/4yUDGDNO+ kTmb5L8Ux7z4CnsOsZpRS33vlrVjlzvEhkdEgQ42JQrIjR6j5Ji7anONVNSwnJ6so9BD nVE8WcNAPB20yqfo+0oyuFDMnJ/7Pppx8vkuz3ueQNxiif0KybGfoIxcM4sSraeBOXYw 8qkg6a1SQfldH67EP1HsY5Qv2its+upyIIw/q/haioeHt8SzxB77s5LPfIDCmYZzC+sF 82gw== X-Gm-Message-State: ANhLgQ1dcnayiTcLDHy1yc4Wpdvybe77xr+M22dNzg4pw5yt/zoTYX+l tCY97+UcW6bfx/KDidlPFPRthg== X-Google-Smtp-Source: ADFU+vte8YprRXpiosPh6oK8UzgBCXexYDX8dInWwsIZfEzpUDJTBrqtjf9QP5Ukzx4PTdYLK6yJpw== X-Received: by 2002:a63:5506:: with SMTP id j6mr26894163pgb.43.1584363939827; Mon, 16 Mar 2020 06:05:39 -0700 (PDT) Received: from localhost (2001-44b8-1113-6700-789d-cd2c-42e1-23af.static.ipv6.internode.on.net. [2001:44b8:1113:6700:789d:cd2c:42e1:23af]) by smtp.gmail.com with ESMTPSA id z15sm32281786pfg.152.2020.03.16.06.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 06:05:38 -0700 (PDT) From: Daniel Axtens To: Pratik Rajesh Sampat , linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, psampat@linux.ibm.com, pratik.r.sampat@gmail.com, ego@linux.vnet.ibm.com Subject: Re: [PATCH] Fixes: 227942809b52 ("cpufreq: powernv: Restore cpu frequency to policy->cur on unthrottling") In-Reply-To: <20200306110549.25517-1-psampat@linux.ibm.com> References: <20200306110549.25517-1-psampat@linux.ibm.com> Date: Tue, 17 Mar 2020 00:05:35 +1100 Message-ID: <87v9n4o3fk.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Pratik, Please could you resend this with a more meaningful subject line and move the Fixes: line to immediately above your signed-off-by? Thanks! Regards, Daniel > The patch avoids allocating cpufreq_policy on stack hence fixing frame > size overflow in 'powernv_cpufreq_work_fn' > > Signed-off-by: Pratik Rajesh Sampat > --- > drivers/cpufreq/powernv-cpufreq.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c > index 56f4bc0d209e..20ee0661555a 100644 > --- a/drivers/cpufreq/powernv-cpufreq.c > +++ b/drivers/cpufreq/powernv-cpufreq.c > @@ -902,6 +902,7 @@ static struct notifier_block powernv_cpufreq_reboot_nb = { > void powernv_cpufreq_work_fn(struct work_struct *work) > { > struct chip *chip = container_of(work, struct chip, throttle); > + struct cpufreq_policy *policy; > unsigned int cpu; > cpumask_t mask; > > @@ -916,12 +917,14 @@ void powernv_cpufreq_work_fn(struct work_struct *work) > chip->restore = false; > for_each_cpu(cpu, &mask) { > int index; > - struct cpufreq_policy policy; > > - cpufreq_get_policy(&policy, cpu); > - index = cpufreq_table_find_index_c(&policy, policy.cur); > - powernv_cpufreq_target_index(&policy, index); > - cpumask_andnot(&mask, &mask, policy.cpus); > + policy = cpufreq_cpu_get(cpu); > + if (!policy) > + continue; > + index = cpufreq_table_find_index_c(policy, policy->cur); > + powernv_cpufreq_target_index(policy, index); > + cpumask_andnot(&mask, &mask, policy->cpus); > + cpufreq_cpu_put(policy); > } > out: > put_online_cpus(); > -- > 2.17.1