Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1494588ybh; Sun, 19 Jul 2020 22:41:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRabap9UMCg1LC2pRq/lwKo/ckZf5A0TrgVErFHpOI/HUwkCXeNfd7TL4Xok9+YPtgfV+h X-Received: by 2002:a17:906:f20d:: with SMTP id gt13mr19601046ejb.117.1595223678324; Sun, 19 Jul 2020 22:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595223678; cv=none; d=google.com; s=arc-20160816; b=rmiWfK37R1O2rYjpkCrrgd7q7J9M+CBVJe66esXQg2l6nBkEexHkSMA5Rn1KOA73tc qZIYUGrTE1IdR207PxE7WxpZsTWA05lqH5cSC6f1EWj9gv+q2alQsNNU6zztnV4zKrcQ P7p60+8SCavcoccRC0MGZ7xftU4H8GA34bpdZ3RRCBmBuC5dN76fz+VMg5t9hq1BKIvy TK9PfHy9D2hr2rbSnEeyMUGW1jsuf7jN1s9KIPPF5YiMfrLwBafxi3hGsd0yv9gFv5c0 vBUKSjJO0NikcDzmpGoEitIqBOxOY8wiyJG8dnBcgaQbd3m2ioxAuyBia3iD3YS1ZwiW MwPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Mra/ak9D1+r3t7wzeEyhfxM6IMDYdP7DqDfcxJZ5WCA=; b=t97Y0bAqq6NHq3R84q7AUpbGitjQDO88ijSv+4ItYllx/SOXegtM+Sh19b/AI1uEKb +vwdZwwqCLwEbhavqxO+UtKuGu9yhfOh152akZwROecpl1/jm4AwTOT40x+IOHk3CrMx /JUDI/bn9IpyyQ7qP34+BWjFV6axaZp2ZTbAUkkt1oL1DAeI0qR+rSnJJzh5LgdvyaDx KItKZA+2NMz8ccqmJS5J+MWq/7v22hf0kNUjRWoDCM4QxHbWcZLk4luUqezzMtqkDtQP 2rG8Ko/tZ0phRcTiKDITHh2+n9yGrkYYnJkv+WhFYOl0M0v0iVdVpOcPsL2f+RTodLJx y2kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q/BeaS6U"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt10si10752484ejb.196.2020.07.19.22.40.55; Sun, 19 Jul 2020 22:41:18 -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; dkim=pass header.i=@linaro.org header.s=google header.b="q/BeaS6U"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726520AbgGTFjk (ORCPT + 99 others); Mon, 20 Jul 2020 01:39:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726016AbgGTFjk (ORCPT ); Mon, 20 Jul 2020 01:39:40 -0400 Received: from mail-vk1-xa42.google.com (mail-vk1-xa42.google.com [IPv6:2607:f8b0:4864:20::a42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEE15C0619D2 for ; Sun, 19 Jul 2020 22:39:39 -0700 (PDT) Received: by mail-vk1-xa42.google.com with SMTP id q85so3415408vke.4 for ; Sun, 19 Jul 2020 22:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Mra/ak9D1+r3t7wzeEyhfxM6IMDYdP7DqDfcxJZ5WCA=; b=q/BeaS6UMn4+h7XAy10XUDWX0sTf0GOY6JjFrVVsyzaFn5scLjVx6NpXfZpbWZSW3I DhbYEXoJOV3WSsOZbdu44Z8teUBZNSupURzgAHu6Bo33JbJQxzj09w412BJ7xhhR5l4a cTk8QdN13dvQSeGgQjrHLmkCFaPls0hPoxsg7LvhjcuTLQob36unB9kWB6vcKnHm6o2j ibxieKxN6dl1NQopfoaCYTPmumk26LfNwtBAGWBAcQIXo9gTf9GFW1k1hkHsiRS9x649 lBi4ja7HhiihDwb/8nSneVhtWisEX6G3seVWAq3J+OupTWiEqh3XrsheQmgVWAugC86L GQwg== 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:content-transfer-encoding; bh=Mra/ak9D1+r3t7wzeEyhfxM6IMDYdP7DqDfcxJZ5WCA=; b=eFNzRLsnS5+cgi3E7ya/HwbeFAUwwqhxVI9QsgRBObcup40Z774baVagLk/fHqge/o i6VxDvMddzZtD3K1pQ62dhFZKXoqSngv/roRFKfH681+lZ9EgKlgw/gVtQn+qWLdo/8V 95/wRaYdasn3VPPlQGrGVb8ttVv8WViB+7iyBZg/SeSQbkGaTzvPkTBrAThY468O4F+m ErnsrhfMoOPg+2XjIc3ZdkjL3XJmpIM4ZZ4U4WLMEJAleZKazpxE9bCIBPZNp3carvGX 5MENcnS0A30VjntITsSgE7VYSUqhAQbfKa/HNJEp9Buh7EZK980cIUJ0pNbBxKHrfoPZ Cgiw== X-Gm-Message-State: AOAM530izbn0+oqRkbUN4S8cTzdTqndTHPBGxHp5TJCH/ZCiEhTWfFb8 g7U/Mk5cEB1G7MR3HzpLlk7e6m6cGuEr2xB87IBLEw== X-Received: by 2002:a1f:f848:: with SMTP id w69mr15006496vkh.86.1595223578965; Sun, 19 Jul 2020 22:39:38 -0700 (PDT) MIME-Version: 1.0 References: <20200717164217.18819-1-daniel.lezcano@linaro.org> <20200717164217.18819-2-daniel.lezcano@linaro.org> In-Reply-To: <20200717164217.18819-2-daniel.lezcano@linaro.org> From: Amit Kucheria Date: Mon, 20 Jul 2020 11:09:26 +0530 Message-ID: Subject: Re: [PATCH 2/2] thermal: core: Move initialization after core initcall To: Daniel Lezcano Cc: Zhang Rui , LKML , Linux PM list , Marek Szyprowski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 17, 2020 at 10:12 PM Daniel Lezcano wrote: > > The generic netlink is initialized at subsys_initcall, so far after > the thermal init routine and the thermal generic netlink family > initialization. > > On =C5=9Dome platforms, that leads to a memory corruption. > > The fix was sent to netdev@ to move the genetlink framework > initialization at core_initcall. > > Move the thermal core initialization to postcore level which is very > close to core level. > > Reported-by: Marek Szyprowski > Tested-by: Marek Szyprowski > Signed-off-by: Daniel Lezcano > --- > drivers/thermal/thermal_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_cor= e.c > index c2e7d7aaa354..79551bb6cd4c 100644 > --- a/drivers/thermal/thermal_core.c > +++ b/drivers/thermal/thermal_core.c > @@ -1617,4 +1617,4 @@ static int __init thermal_init(void) > mutex_destroy(&poweroff_lock); > return result; > } > -core_initcall(thermal_init); > +postcore_initcall(thermal_init); For posterity, we moved to core_initcall from fs_initcall since we had removed netlink support from the thermal framework and we wanted to initialise it as quickly as possible after cpufreq to allow early mitigation possibility. Given the addition of the new netlink-based API to thermal framework, I think moving to postcore_initcall is an acceptable compromise. Reviewed-by: Amit Kucheria > -- > 2.17.1 >