From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E60E719DF62 for ; Sun, 10 May 2026 12:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778417428; cv=none; b=jDfLXKvJj639FAvLb3PHEebnmLBPBVJJEG0KR1T3RCIcvwS1oMUbUZZ7AKgbaQD35vhWuqespU1LCh6eUirLix/wpBzvi/bpMoSFz6hmuem2V6+xDBxjQYR2UvL+I6jVZxUMKAH65ofSASPyIvVHfjjAdq1nNat/ikpy+Sytu4I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778417428; c=relaxed/simple; bh=UafUibLCTmG3CSFzMCAr9BFMG6tkTktSEXnpR5iA2SY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=diAlvwietTKaqlxlYuSu+nzTCivWu/JPcd5WWWzCAXbSwWUNxsc0L7WZ/WrTftbPryMRCDyFUt3mk86F9ikWdwnv05cR7HGbytXEopk9kvn9rQ8JnK1w+C2mMlu4LQWZKX+i1MRZ7DW/6aZNfyweSDPliz2rgvJyXGKr8IhYf4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qqvxSMa1; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qqvxSMa1" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-366be8040a9so808917a91.3 for ; Sun, 10 May 2026 05:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778417426; x=1779022226; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6S1mD+xx8x/tCfEbDPDZAW2paOh+aCEmBzds2w+qTLA=; b=qqvxSMa1BEowzMuO2H+92WOJaYVoPVcIi7DAphMsmULztjlgV+EbgLELRS1VL/cMtz 0lJU0okjlxezwx1W0BtePG1NWiSVP4/xWbz4ccDmeyDNEYnbGtQCaHKW7eqvvL8MYPC0 oWgJJyIHyTFWd0vS94ospANSFoM61/OHaclBWbPL/RsCj7PealUSakkuQtXnluiQX1xu 97S4jn61cg4zPGDXWrK2jOuK/DAAnauHNY9A0lAkosQ/nBfCId06s6zbhAbeGpmaFSM/ u8iXsaI3FDTS5x+cxRWq30ioI8sKpGAVJs6Y6CvmVWQnzgGAL22KXt2/mg6ARDK0Xmeg PFZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778417426; x=1779022226; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6S1mD+xx8x/tCfEbDPDZAW2paOh+aCEmBzds2w+qTLA=; b=d89Jpie8oO9jlA1xWe5Gn+iRpKyTJEvZQezdvMDbHghpjpPOGOExkrTm18k0eqCoHM 2Qy50ClYtpGjnF+wJOEKEpxKw/9o1EPHVM7DKVSyj76daRZh1CsxB5dxQBrmC+rbtyHR 2lEQy3U7Cv81E0rFBde2v/cn0vSxq/Jwy3AtvbudfevVoVxuwrbIP6rBQwHhdd5l8RSo R8hklS0Pl9mGt4NtaeilW3uYGHzHob/jKrKfYApisZsEifmRZMODEqs35MkSVLH/m11Q 4sAy8OSReGvoQ2/cWOtdG50Io1M0nZKyso4Z4OJeI6mXqNRjK5NAYoxf147DJ3xwj4GW zFwQ== X-Forwarded-Encrypted: i=1; AFNElJ+XPyGycPuYGazPK/x2VtBZimDvF6HWXOzrf7mNiQ4x2C32g/cqoqVQn9+dfPt7+qp3aQlMtKUT6DZdflc=@vger.kernel.org X-Gm-Message-State: AOJu0YzSyn0I0ha6s3NcAFm1FSYM+fIfyZJJk3hspm55tEhvEXS6RLVd UUQPZRVx+HEnwyXirCG39OOonS0E1IHhaIAHfLrqxL1aDoYpDpEN9kGN X-Gm-Gg: Acq92OGIpILqYNuvgUHcSqCIkIsJ8FxavmsF/rSg+7NesfooLekjHfr9ey+tU11wvni TLZkseekh1AMKBN2S4d7NCEnuqqH/keCTeT2Excm+ydNXW7Wolcj8qkLvYWfG/vKisOz8R1SaTC Ld5pbsjhN3twumg5+fZsvp4Ty86SG/v/dyxvPxSGCvFGoQrd4cMDr/ujep3BFFSHt/4t/9coc1C 3Smemi3OHTndtkPVcUX9l3AkcyNqzQTftPcaNHrbVyucOTP/+75FFpL/OQld3V2znvFze56Eu39 pJv00N8Z0spHrBniqBrneoW0OsIfLMDnRBwtIQHl39jN3KhwuCikpqBHcE1yjw5QCVa0KuUFiBW onQFwOyP8YaFcK0//r+dd7NR6Kq7gE6NrEXnhT9+UYjlfVbQQAzcTWo2fGW7sI3JTRWVyY3tVe5 YjZN9++D+Us3EIDOLaCAObsoB49Bj4j6IldzjwQF8= X-Received: by 2002:a17:90b:3f90:b0:368:119b:be07 with SMTP id 98e67ed59e1d1-368119bc130mr3007006a91.18.1778417426229; Sun, 10 May 2026 05:50:26 -0700 (PDT) Received: from [172.30.1.54] ([222.106.243.217]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c8267688fe2sm8403087a12.9.2026.05.10.05.50.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 May 2026 05:50:25 -0700 (PDT) Message-ID: Date: Sun, 10 May 2026 21:50:22 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/4] PM / devfreq: Fix governor_store() failing when device has no current governor Content-Language: ko To: Yaxiong Tian Cc: cw00.choi@samsung.com, kyungmin.park@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, myungjoo.ham@samsung.com, nm@ti.com, zhanjie9@hisilicon.com References: <20260401033119.67821-1-tianyaxiong@kylinos.cn> <20260430032035.75496-1-tianyaxiong@kylinos.cn> From: Choi Chanwoo In-Reply-To: <20260430032035.75496-1-tianyaxiong@kylinos.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2026-04-30 PM 12:20에 Yaxiong Tian 이(가) 쓴 글: > Since devfreq_remove_governor() may clear the device's current governor > in certain situations, while governors actually exist independently > of the device, directly returning EINVAL in this case is inaccurate. > > To fix this issue, remove this check and add relevant logic for when > df->governor is NULL. > > Fixes: 483d557ee9a3 ("PM / devfreq: Clean up the devfreq instance name in sysfs attr") > Co-developed-by: Choi Chanwoo > Signed-off-by: Yaxiong Tian > --- > drivers/devfreq/devfreq.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c > index 2977b07be939..76e3700577ca 100644 > --- a/drivers/devfreq/devfreq.c > +++ b/drivers/devfreq/devfreq.c > @@ -1390,9 +1390,6 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, > char str_governor[DEVFREQ_NAME_LEN + 1]; > const struct devfreq_governor *governor, *prev_governor; > > - if (!df->governor) > - return -EINVAL; > - > ret = sscanf(buf, "%" __stringify(DEVFREQ_NAME_LEN) "s", str_governor); > if (ret != 1) > return -EINVAL; > @@ -1403,6 +1400,9 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, > ret = PTR_ERR(governor); > goto out; > } > + if (!df->governor) > + goto start_new_governor; > + > if (df->governor == governor) { > ret = 0; > goto out; > @@ -1423,6 +1423,7 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, > goto out; > } > > +start_new_governor: > /* > * Start the new governor and create the specific sysfs files > * which depend on the new governor. > @@ -1436,6 +1437,9 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, > > /* Restore previous governor */ > df->governor = prev_governor; > + if (!df->governor) > + goto out; > + > ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL); > if (ret) { > dev_err(dev, I'm sorr for late reply. I applied it. Thanks, Chanwoo Choi