Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2284305ybl; Thu, 19 Dec 2019 11:00:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzl0vv4k1P08Xluuq1fj+hCRvrz4omM8AnE1P2cC16kcBj9junta2JpeKpG4kaQDlxd2NVq X-Received: by 2002:a05:6830:1e7c:: with SMTP id m28mr10593507otr.131.1576782039067; Thu, 19 Dec 2019 11:00:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782039; cv=none; d=google.com; s=arc-20160816; b=rrjcWckUtXBP5RWhBtyEMQ/yJCg87cMMKtGSR1skUOhsLvvc7C399qGLv3mtVIPJNc EAZ0foRnEjqDkJXoXErFCiN0l/lmiQ089Gpb2WfsQnfLwyRifGzjJ8ZA2vnyljYScWqj pEnR+4Lgxh9a1QQp1zOSAApsIe/lQoX5qDfs/B506DGQuOcBYFfN34U8fmeHYLuDUVcz 32p5FxY5COZL/02cSgqfPYhSQClBm/g6KylHVzSj57794N+xxvKZ0M3jj35uL+YfvVX4 ktuopGOX7tCTe+zbM8hozxVtgYhaImbG8GMPFAksjmQcq+S/4XN6IhpS1lqZEVb/jsaP xouA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y+fAfwjjwNhJ2JJ1CMSdPkYAwEU3t4rmaEqCtBfsikE=; b=dEa0vu844Hu1NrF5GuNC46VWv0wxfcfdsgszbt/sN9cugQT1jSCjx0k9wCGJGlE/gb 4/MJ5+7NQ2ZHryTp+q3VxUCthcOz66bYFDD3AywZZFa6co27TrXwXmMdZ4cheY18RXUj /6oi09lhtJG/RintKG/STutZWzfiEcBdxIhMm5feeaLEwx05rF5KQv1r+T6fMQY1/XTA 8bNlRr11rJcIM+yWKvF7Yt8Km4cgf7oKw5/G1T22phIDalvBHZ5x/54gE5+8YskBpjA1 pG77Rrz6iTYe3ylnPOXwUXaG2eCZ/7yxCuAfNcUlW8WAFyiYqmKzRVjHqwMBJlv/K6Yk OewA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G4fTqlml; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i26si3737467otl.29.2019.12.19.11.00.26; Thu, 19 Dec 2019 11:00:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G4fTqlml; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730359AbfLSS7O (ORCPT + 99 others); Thu, 19 Dec 2019 13:59:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:48972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730408AbfLSSxp (ORCPT ); Thu, 19 Dec 2019 13:53:45 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 443EA20674; Thu, 19 Dec 2019 18:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781624; bh=J5/14ErjQFX/vUZvANlmfZEZ14nE/YRklZ5JEAAXeqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G4fTqlmljGM47x95GjNMy659zFC5Ocrd91E/3nsQPq/vSE8C+8cFjdRMvPzm3AXwG yqRUSW6U0RSIOgZZ7rCWmLT03rFvORVj2GMlFilaf1dAI5zQsJmtTAZYp0GxmbfiiO ErRUqjGM6CqMflVYzNtu92kkXZ8LxZQahV+m2p28= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leonard Crestez , Matthias Kaehlcke , "Rafael J. Wysocki" Subject: [PATCH 5.4 14/80] PM / QoS: Redefine FREQ_QOS_MAX_DEFAULT_VALUE to S32_MAX Date: Thu, 19 Dec 2019 19:34:06 +0100 Message-Id: <20191219183050.779066263@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183031.278083125@linuxfoundation.org> References: <20191219183031.278083125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leonard Crestez commit c6a3aea93571a5393602256d8f74772bd64c8225 upstream. QOS requests for DEFAULT_VALUE are supposed to be ignored but this is not the case for FREQ_QOS_MAX. Adding one request for MAX_DEFAULT_VALUE and one for a real value will cause freq_qos_read_value to unexpectedly return MAX_DEFAULT_VALUE (-1). This happens because freq_qos max value is aggregated with PM_QOS_MIN but FREQ_QOS_MAX_DEFAULT_VALUE is (-1) so it's smaller than other values. Fix this by redefining FREQ_QOS_MAX_DEFAULT_VALUE to S32_MAX. Looking at current users for freq_qos it seems that none of them create requests for FREQ_QOS_MAX_DEFAULT_VALUE. Fixes: 77751a466ebd ("PM: QoS: Introduce frequency QoS") Signed-off-by: Leonard Crestez Reported-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Cc: 5.4+ # 5.4+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- include/linux/pm_qos.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -256,7 +256,7 @@ static inline s32 dev_pm_qos_raw_resume_ #endif #define FREQ_QOS_MIN_DEFAULT_VALUE 0 -#define FREQ_QOS_MAX_DEFAULT_VALUE (-1) +#define FREQ_QOS_MAX_DEFAULT_VALUE S32_MAX enum freq_qos_req_type { FREQ_QOS_MIN = 1,