From patchwork Tue Jun 14 23:09:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 581866 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 526D5C43334 for ; Wed, 15 Jun 2022 00:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234248AbiFOAEF (ORCPT ); Tue, 14 Jun 2022 20:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233809AbiFOAD7 (ORCPT ); Tue, 14 Jun 2022 20:03:59 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17803186CD; Tue, 14 Jun 2022 17:03:57 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id n185so5460377wmn.4; Tue, 14 Jun 2022 17:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DMTuvNRz1WP/wtYWEwAgZhtGlOYc4vZGQjh27l1KtGI=; b=j0v8Hc4uhX8Rwje+TwFKDBkE0s+n+7EeYfgd0FHCVN6K+uq/sZIIN+faP0pb9U2QrF 10ASdlgVGj9Yi5I0Lm1ApHXISvVw9ISMvzLYXD4gOmlHfx8VtayiT7ca0uCUESqwDYUD jXXi+U1vnG8zy7k0LZ/IVK9wkL9fj5a1a00rhjON7ByojAhSG9YTNzxb3eWNIJENsBoC UBMrHWPeFepk6DeuM5uXTLuCd4MevPHQoFFK3NPqfxM0NavPwV1y5QDMXMgWZC83Vs3K FdFllAYjezWk/HrgFGBn2piPfFgwZnjlWf87c4P1+ZEBOGb8dHG21qjBiVs4YFUgqrNt LQhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DMTuvNRz1WP/wtYWEwAgZhtGlOYc4vZGQjh27l1KtGI=; b=bXBk+SHgUNfGanHBss4RgfaYBiiWVVO97VnyhlnVOT+PmgrUhwvrmu1FSS823J7tGM tqYa4kagh7FrdyD9oiSmrUvkOMwQ8ZddfWOr1HsWV9WI7jlVeiOJZWNCb5MHi6GKxARP PnPFLhtbhS7LN6GgFBfsSMaaT2QmSfzNYLBGly1WJr6URZb/RnIhaTgW9ib+CDzbjOu1 LkxJB952bkO+GGamlTGshP+iIk/uaVqs9hMkmq9mrgIVTAJ1EFmHAjdcx9YWCnzSNswj y1b6gb+lhLG6nr+gEDi/5K6RwA3CitpCoPjLMHpfXollt3+iiHQjKhhfFPrcVr7cdHJu z57w== X-Gm-Message-State: AOAM530QXCr2Hl0eSHrMit5kpuDM1CISAGjHwG458QSfFNbm1/3eobfb xcAfLS8k7S6OWTMXve39xJ0Dhtt1U1M= X-Google-Smtp-Source: ABdhPJzEwGYR3qR4dRsdnfq3T1H7/7WZfH25RqJBOXAGOWcgPN2pp1IVgsZv2WzTGijrhIWpZI4Ihg== X-Received: by 2002:a05:600c:378d:b0:39c:4950:aef8 with SMTP id o13-20020a05600c378d00b0039c4950aef8mr6701943wmr.96.1655251435470; Tue, 14 Jun 2022 17:03:55 -0700 (PDT) Received: from localhost.localdomain (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.googlemail.com with ESMTPSA id l7-20020a05600c4f0700b00397342e3830sm5546821wmq.0.2022.06.14.17.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 17:03:54 -0700 (PDT) From: Christian 'Ansuel' Marangi To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Sibi Sankar , Saravana Kannan , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian 'Ansuel' Marangi Subject: [PATCH v4 2/4] PM / devfreq: Fix kernel warning with cpufreq passive register fail Date: Wed, 15 Jun 2022 01:09:48 +0200 Message-Id: <20220614230950.426-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220614230950.426-1-ansuelsmth@gmail.com> References: <20220614230950.426-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org When the cpufreq passive register path from the passive governor fails, the cpufreq_passive_unregister is called and a kernel WARNING is always reported. This is caused by the fact that the devfreq driver already call the governor unregister with the GOV_STOP, for this reason the second cpufreq_passive_unregister always return error and a WARN is printed from the WARN_ON function. Remove the unregister call from the error handling of the cpufreq register notifier as it's fundamentally wrong and already handled by the devfreq core code. Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor") Signed-off-by: Christian 'Ansuel' Marangi --- drivers/devfreq/governor_passive.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c index 95de336f20d5..dcc9dd518197 100644 --- a/drivers/devfreq/governor_passive.c +++ b/drivers/devfreq/governor_passive.c @@ -331,7 +331,6 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq) err_put_policy: cpufreq_cpu_put(policy); err: - WARN_ON(cpufreq_passive_unregister_notifier(devfreq)); return ret; } From patchwork Tue Jun 14 23:09:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 581865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4CD7C43334 for ; Wed, 15 Jun 2022 00:04:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235492AbiFOAEL (ORCPT ); Tue, 14 Jun 2022 20:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234912AbiFOAEF (ORCPT ); Tue, 14 Jun 2022 20:04:05 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B20AB289A9; Tue, 14 Jun 2022 17:04:00 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id x17so13199110wrg.6; Tue, 14 Jun 2022 17:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c2/QDJKQUYJdg67+qXw7NrZ4cn1DkdhNkxlezX0Iqcg=; b=f9VtERyCX3duWDopI90LJQYHVvSnJljwRZL6y/m2d6HzkM+7yuQIrmgQAuvVvXClCZ ZOs4McY4Jo15yzZN7T2b2TuxT9tHcepi/YAvt8LGbHLYMv+6cwB8OMON1yPtzDfFLCB2 4WALceBcPodYt5QkyOUu16WU2hSaOZ+48qQMFppAOFwFbSRKRNfU8gLP9Ouq2gCX1DtF 2ALbFUAhdmfqkpmlWyvigeUsWa2dfati4eQ/KMw849pm5N1F881OKrAvESBb2QsFicuZ 26yVTgOdYcJv/i+BFQJPYz0+13PyBVLUB4GH7chYjrATZrAvuvgqzDm0k7APR4P1Lg+l 4nVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c2/QDJKQUYJdg67+qXw7NrZ4cn1DkdhNkxlezX0Iqcg=; b=x3umG8N7F26J07QmoKMo90ZncVd22aCAZgir3LRafYimLYUrexMMUSEvbyeWxl6sYF n2jSWiwjRg+UaA8hfWae9Dcv98hlegNnzD/IWKKuVCEGiF8yhcPcd9y25P85h3AAbjxw yOKg/GkeUOjI0/ynscUe5KXqbHotArenV+Insjo0ylOZ/veWvyUH2cPj6L5bmyv235Pm aehqhXp7LoDME1bKepciHFvyDzuBpEjz3pNCAi88x2gzSqijlzDF3vbLGDqIk167kQ0t 69gFacyIqtg1kr3/882LK2mawlR3TksYBiiBMfNeEgj4mloUdEtOLYaa3QmJ9/uNynJ8 voVA== X-Gm-Message-State: AJIora+8ypAFVYpDp431lxUyD/115ZqnawZjq0slefAWSMVF0iK35ZrI ry64v/Bxe/O6LUVDRc8OkEM= X-Google-Smtp-Source: AGRyM1tpYj1qhLCK+1qDQJI/vr8WVmMz2VhWVGj/7ePdBMHIu9jmtZlxhsBhCTcyRFK31WealWrz4w== X-Received: by 2002:a05:6000:11:b0:210:302d:e787 with SMTP id h17-20020a056000001100b00210302de787mr7084509wrx.535.1655251439110; Tue, 14 Jun 2022 17:03:59 -0700 (PDT) Received: from localhost.localdomain (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.googlemail.com with ESMTPSA id l7-20020a05600c4f0700b00397342e3830sm5546821wmq.0.2022.06.14.17.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 17:03:58 -0700 (PDT) From: Christian 'Ansuel' Marangi To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Sibi Sankar , Saravana Kannan , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian 'Ansuel' Marangi Subject: [PATCH v4 4/4] PM / devfreq: Mute warning on governor PROBE_DEFER Date: Wed, 15 Jun 2022 01:09:50 +0200 Message-Id: <20220614230950.426-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220614230950.426-1-ansuelsmth@gmail.com> References: <20220614230950.426-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Don't print warning when a governor PROBE_DEFER as it's not a real GOV_START fail. Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor") Signed-off-by: Christian 'Ansuel' Marangi --- drivers/devfreq/devfreq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 2e2b3b414d67..6a39638ed064 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -931,8 +931,9 @@ struct devfreq *devfreq_add_device(struct device *dev, err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START, NULL); if (err) { - dev_err(dev, "%s: Unable to start governor for the device\n", - __func__); + dev_err_probe(dev, err, + "%s: Unable to start governor for the device\n", + __func__); goto err_init; } create_sysfs_files(devfreq, devfreq->governor);