From patchwork Tue May 3 05:04:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9000301 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2B1BABF29F for ; Tue, 3 May 2016 05:04:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4310A202A1 for ; Tue, 3 May 2016 05:04:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A0E320173 for ; Tue, 3 May 2016 05:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750878AbcECFEu (ORCPT ); Tue, 3 May 2016 01:04:50 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:36433 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbcECFEt (ORCPT ); Tue, 3 May 2016 01:04:49 -0400 Received: by mail-pa0-f45.google.com with SMTP id bt5so4534710pac.3; Mon, 02 May 2016 22:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=oxFLCrH6uwPeGAaqOjTXxiC18ume/+IuXa0RUKGmcZE=; b=0BrNWxaPFU7BDwSR/DPHNKIvytsRVHh0taHoIsUpeYRhel65lVIOLVv+z/VC4ttcb4 FcIkqvZ0Yslgj45bR/kRj2DGpfLBzNcK3nVnbQu8HKM9Hkh8UU1h1e2/KHC3qnyrfQl+ ZOkiezSUKhbPIv72n/jtUq4K2Em0eke+tCVQ0b2Nwz3mamQC38ospp4LNLpSTPjsN4hO c/zsR7LanLmUerCYi8Jr2ibkI3Kbts5KaG2z66fnV0Oz1uRUstX7lyvwDON3VfHAERP4 XSruk/6PkFPKHliLx8kw9U55xjHsmLoCYhd7K/HXuZW8QmBrBgJPttyQDvZ41orb+mM5 ZzLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oxFLCrH6uwPeGAaqOjTXxiC18ume/+IuXa0RUKGmcZE=; b=bkgiU2+8EW0XjrpjqXqHQbv2I2lpHyI5ny90mMo7Ueq99u1pwsJJRYCEDylXkpIFgc nILGzIoRPviSjHmvAMcYgo2iwmu2k8O5WJDnWUM7CIGEH3n3a7Prw1Xl+ZoxC9UP43lV DUKDOlSQnpxlMAalFDPb0uhftugNP0nFlC+AhK2rfH4eB02/39Wl5FFpOtLaltTpWvta oxkshJ9VdFMwrlbM18zoeojP+AYse3DW61Z+PfV/8Q1xNwD4G9czmiBlSIJNXYMxYOku plFJE+FV1soiVVjH9BbmUu1mcpBJsQQJVy6wdXqiGnyZBm4Kd9IkOM79kP085qWs6Wzv sRaQ== X-Gm-Message-State: AOPr4FUw3kgvlLaN8cncTq9xTzsVrdreAojOocn8JA5xBUCF0kPMg9Anp/AnabSyII5o6A== X-Received: by 10.67.6.3 with SMTP id cq3mr533788pad.115.1462251888285; Mon, 02 May 2016 22:04:48 -0700 (PDT) Received: from localhost ([2601:647:4203:c8e0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id hk7sm1876558pad.25.2016.05.02.22.04.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 May 2016 22:04:47 -0700 (PDT) From: Eduardo Valentin To: rjw@rjwysocki.net, Rui Zhang Cc: Linux PM , Eduardo Valentin , Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] drivers: acpi: add CPU id to cooling device type of processor driver Date: Mon, 2 May 2016 22:04:39 -0700 Message-Id: <1462251879-7224-1-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, in an ACPI based system, the processor driver registers one cooling device per processor. However, the cooling device type is the same for each processor. For example, on a system with four processors, the sysfs reading of each cooling device would look like: ebv@besouro ~ $ cat /sys/class/thermal/cooling_device*/type Processor Processor Processor Processor which turns out to fine. But, some parts of the thermal code may use type to identify participating devices in a thermal zone. Besides, adding notifications to user space may cause the production of messages that may confuse the listener. For this reason, this patch adds the processor ID cooling device type. After this change, the cooling device listing in the same previous example would look like this: ebv@besouro ~ $ cat /sys/class/thermal/cooling_device*/type Processor.0 Processor.1 Processor.2 Processor.3 allowing an easier identification of cooling device target. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin --- drivers/acpi/processor_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index d2fa8cb..6e982c1 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -163,6 +163,7 @@ static struct notifier_block acpi_cpu_notifier = { static int acpi_pss_perf_init(struct acpi_processor *pr, struct acpi_device *device) { + char cdev_name[THERMAL_NAME_LENGTH]; int result = 0; acpi_processor_ppc_has_changed(pr, 0); @@ -172,7 +173,8 @@ static int acpi_pss_perf_init(struct acpi_processor *pr, if (pr->flags.throttling) pr->flags.limit = 1; - pr->cdev = thermal_cooling_device_register("Processor", device, + snprintf(cdev_name, sizeof(cdev_name), "Processor.%d", pr->id); + pr->cdev = thermal_cooling_device_register(cdev_name, device, &processor_cooling_ops); if (IS_ERR(pr->cdev)) { result = PTR_ERR(pr->cdev);