Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1607968ybf; Thu, 27 Feb 2020 14:25:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwkY+gFeyEMFilg75nWR/y0mPQ13ZMP0SZkVEQxUkG9BuGnwlnM/XMF8Bkvwd2kPOimYPc0 X-Received: by 2002:aca:2b0a:: with SMTP id i10mr932406oik.137.1582842346946; Thu, 27 Feb 2020 14:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582842346; cv=none; d=google.com; s=arc-20160816; b=pGPZEA43OvQEx5rd/cEFrET2iYSdfk9wvzmdw/fm3LkdZWlcFbvMW5810ssK5TFReA 6cBdc/GPPItuj+pZctdouEz5SMSa5SWxQ5sZufNAVz/mTW3Eo3OgNwt0Qi+VjLgsJwXN y6a9+ZiB5QFkKU1oiIBlgF2e7CD9gBdbrDVlTblGaMLCI7XNjUt/nNW+reg/HAXVUOEQ 65EIhLWSlWnbotuM1+ASQLEX3BtfhhEa5GCWZk61EGbwL0L8UeXpY/UEXW64lT/7NRMg EY0+ErwmUymT7AKJgri3MlZyeRmQPRakObKIr2a/UorcNURD6BDByoEYMPiXy8qEdNIn aJgA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8odlehmNMAaHJLBdmd/HsUIEFbW2QU33Th+fnStJ3HM=; b=SAcK9stlBONi0mrA2tyoEuV/NRo/+vxxC3ydsHGwnKdtX9pT8m8nymGV67uxsbt8pK OKYEe5CBY8SX22zNypPy4gnFQM6hrGSQ9aQ7ifAYAzYchAT8V9Ehi3kZA0LITB9OD1w+ WQIOILVbyUFb3s6bPgUysI9Q2RGDBXW3qZ17wX6ty1qZKzyeouVfZPogmCzrHwfNZZ1m 3Sw6nantyZ/3g9RAD9hSu55PUJTK6bQP6aKlnq4ErmFfSdwX3MQO5fkSrFA02+6XjMNG 7VdZsebqunuqe6FebGteivY2pJDyTy+AJS2fohTXRO8rkkzQ5m75MltUkaDDzWyEgOoO E67w== ARC-Authentication-Results: i=1; mx.google.com; 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 a124si634767oii.138.2020.02.27.14.25.35; Thu, 27 Feb 2020 14:25:46 -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; 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 S1730256AbgB0WZZ (ORCPT + 99 others); Thu, 27 Feb 2020 17:25:25 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:44163 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729735AbgB0WZW (ORCPT ); Thu, 27 Feb 2020 17:25:22 -0500 Received: from 79.184.237.30.ipv4.supernova.orange.pl (79.184.237.30) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id c5af9dd566d2263a; Thu, 27 Feb 2020 23:25:20 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , "Rafael J. Wysocki" , Daniel Drake Subject: [PATCH 1/6] ACPI: EC: Avoid printing confusing messages in acpi_ec_setup() Date: Thu, 27 Feb 2020 23:21:18 +0100 Message-ID: <2905294.VeAyQmVl7x@kreacher> In-Reply-To: <2094703.CetWLLyMuz@kreacher> References: <2094703.CetWLLyMuz@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Rafael J. Wysocki" It doesn't really make sense to pass ec->handle of the ECDT EC to acpi_handle_info(), because it is set to ACPI_ROOT_OBJECT in acpi_ec_ecdt_probe(), so rework acpi_ec_setup() to avoid using acpi_handle_info() for printing messages. First, notice that the "Used as first EC" message is not really useful, because it is immediately followed by a more meaningful one from either acpi_ec_ecdt_probe() or acpi_ec_dsdt_probe() (the latter also includes the EC object path), so drop it altogether. Second, use pr_info() for printing the EC configuration information. While at it, make the code in question avoid printing invalid GPE or IRQ numbers and make it print the GPE/IRQ information only when the driver is ready to handle events. Fixes: 72c77b7ea9ce ("ACPI / EC: Cleanup first_ec/boot_ec code") Fixes: 406857f773b0 ("ACPI: EC: add support for hardware-reduced systems") Cc: 5.5+ # 5.5+ Signed-off-by: Rafael J. Wysocki --- drivers/acpi/ec.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index d1f1cf5d4bf0..2dc7cf2aeb21 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1584,14 +1584,19 @@ static int acpi_ec_setup(struct acpi_ec *ec, struct acpi_device *device, return ret; /* First EC capable of handling transactions */ - if (!first_ec) { + if (!first_ec) first_ec = ec; - acpi_handle_info(first_ec->handle, "Used as first EC\n"); + + pr_info("EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n", ec->command_addr, + ec->data_addr); + + if (test_bit(EC_FLAGS_EVENT_HANDLER_INSTALLED, &ec->flags)) { + if (ec->gpe >= 0) + pr_info("GPE=0x%x\n", ec->gpe); + else + pr_info("IRQ=%d\n", ec->irq); } - acpi_handle_info(ec->handle, - "GPE=0x%x, IRQ=%d, EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n", - ec->gpe, ec->irq, ec->command_addr, ec->data_addr); return ret; } -- 2.16.4