Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3161939pxj; Mon, 7 Jun 2021 04:04:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTomrfBXd2HmLgS0mFlJfR2i8d7h/+oeq4wY2LAkvZSIKZGcZCm5YtQ0a3NWjUMp62Qtgm X-Received: by 2002:a17:906:1701:: with SMTP id c1mr17043279eje.425.1623063880291; Mon, 07 Jun 2021 04:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623063880; cv=none; d=google.com; s=arc-20160816; b=Zui+C/JuHmf/uuJRLZ3HMWkRJRgpcpvPBAxJnRPV7pmQqVpElQFCa3wVFVEFgSQGcx 5IVxKEaR5yN12ASXi/fUfmQtUX4Vi1Dr6vkQSw1EjtwFPOZFLKPGprnzsE4w9MV2YTFp 8+e3F1hy19s8hsFWt42FzYt8F7R71JPiTvkZdwemySjBTNmu8atd+gK4pyVxYZGToiYE +BBaA9/Nfa1UZ7RMDECNjH8A+AFF/11psJVYjJDJM49LfyvzDWdVbBz1U3UKkwDAE2Sk Iz8A2bHsdLAgBreuCkkzTN2+mVjrbn4DoNkEhQB5KiKV/RSkoE2sP+pslM3NGBI2iF6c oTvQ== 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=4PwEOhhSgqcDZBccS2qEUl6w+mHR3TrhOJ8GYWHqr8k=; b=PRde7ncllOswGHDhkZcdZrXkF368psa5POyexF0b94G7zH+LHKBRbbZ6xghwlEwA5/ pCQSPvJkozkyJKS+aRDyEuMGRoKYBV3KDvf3d+2plcUauSFNZc72UgqLl7x+OdA7DUAW QqEZ+GA9Prg0Itc/9+HTnVzqGwUa+diKpa0GtDSoJfzAjS4NFtHMqERFQdsS/eY6CY3k GiNyZz3EsBPM4Df7EfOU+bAFBXEpMKo3insVJrmFNnE6OVBoPQmjm3/0mQme8uoghIGZ KKnvCz+LpjNbVbUF1YKPgR33zo+yhZ2VP3NmlS+bVLDh96AOh6KMWcWIrxZ4LOHzxQqi T85g== 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 g21si12127404edu.34.2021.06.07.04.04.17; Mon, 07 Jun 2021 04:04:40 -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 S231140AbhFGLE4 (ORCPT + 99 others); Mon, 7 Jun 2021 07:04:56 -0400 Received: from mail-ot1-f42.google.com ([209.85.210.42]:45783 "EHLO mail-ot1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbhFGLEz (ORCPT ); Mon, 7 Jun 2021 07:04:55 -0400 Received: by mail-ot1-f42.google.com with SMTP id 6-20020a9d07860000b02903e83bf8f8fcso3252867oto.12; Mon, 07 Jun 2021 04:03:04 -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=4PwEOhhSgqcDZBccS2qEUl6w+mHR3TrhOJ8GYWHqr8k=; b=Vv72F61pOdy43bSOAo02JOdeatweILpN5RDVKHy7/ksKYe9Jq/aJPTFEVPFc7AqriL 9NN9UT57a0jh6kRQYal0O3aI75uDxnP63+bhjccMvGaXOJa+fByvuSAelIkflQvFkglA UDpUSwSDbvRTJxSrwnfQx9N4v8giZ802knd1+5FPy38jD+KsK0t9qw/qv2Mos1DVP3yu XZu3BIJHd5BC1pDuomf+rBcaprGyM6Yw/ru02clb9OOAnuKfzK1e99kq//Ts8AUF1v/l DypFulHpImlXinTjP57E7kAXLCvj4L38uhCXafqZMoNZhOKnmJ5koj7PEmAaEg5G94pz F2MA== X-Gm-Message-State: AOAM5330M0tkGqO2agunF26PZMy8DWACPfr/7undCHyH+D1pLRm04kv1 D4eBYIFqmlpigGCfgTzknNJNmmwHWbbZrj5CWY0= X-Received: by 2002:a9d:6c4d:: with SMTP id g13mr10038001otq.321.1623063784342; Mon, 07 Jun 2021 04:03:04 -0700 (PDT) MIME-Version: 1.0 References: <20210521221906.199436-1-kyle.meyer@hpe.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 7 Jun 2021 13:02:46 +0200 Message-ID: Subject: Re: [PATCH] acpi-cpufreq: Skip initialization if a cpufreq driver exists To: Viresh Kumar Cc: "Rafael J. Wysocki" , Takashi Iwai , Kyle Meyer , "Rafael J. Wysocki" , Linux Kernel Mailing List , Linux PM , linux-acpi@vegr.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 7, 2021 at 9:26 AM Viresh Kumar wrote: > > Hi Rafael, > > On Mon, May 24, 2021 at 7:47 PM Rafael J. Wysocki wrote: > > On Sat, May 22, 2021 at 12:19 AM Kyle Meyer wrote: > > > > diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c > > > index 7e7450453714..e79a945369d1 100644 > > > --- a/drivers/cpufreq/acpi-cpufreq.c > > > +++ b/drivers/cpufreq/acpi-cpufreq.c > > > @@ -1003,7 +1003,7 @@ static int __init acpi_cpufreq_init(void) > > > > > > /* don't keep reloading if cpufreq_driver exists */ > > > if (cpufreq_get_current_driver()) > > > - return -EEXIST; > > > + return 0; > > > > > > pr_debug("%s\n", __func__); > > > > > > -- > > > > Applied as 5.14 material with some edits in the subject and changelog, thanks! > > I am not sure how this is supposed to work. If we return 0 from > acpi_cpufreq_init(), > then the driver will never be used, since it's acpi_cpufreq_init() > will never get > called again later. Unless the module is unloaded and loaded again, that is. > cpufreq drivers don't follow the generic device/driver model where a driver gets > probed again if a device appears and so this is broken. It is broken anyway as per the changelog of this patch. On systems with several hundred logical CPUs this really can be troublesome. > Please revert this patch. Well, you can argue that the problem at hand is outside the kernel and so it's not a kernel's business to address it. After all, systemd-udevd could learn to avoid attempting to load the module again if it fails with -EEXIST, but I'm not sure how different that really would be from what this patch does, in practice.