Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4381162ybf; Wed, 4 Mar 2020 02:53:25 -0800 (PST) X-Google-Smtp-Source: ADFU+vsp9b5dgXCu+VBqkwNbc5ptHvoYftpijBQ6TaKa76XiT7mmMq8g5lGe9CoaFftiBLJjBU56 X-Received: by 2002:aca:b06:: with SMTP id 6mr168618oil.71.1583319205238; Wed, 04 Mar 2020 02:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583319205; cv=none; d=google.com; s=arc-20160816; b=NvhwUz5Ab1I39TkS5f0GsK1EWMFASjMe5shg+/XKbSuTvTygQtQjQxgPzj5Swb0GCH /VPb6RahB7KykvEZA8PlNnF4HsQ2nLDAYK/5fhrSAGoKctt84UW43sOlf7D2OW8vR5m9 tuZz3PZMcvtAqCNU9PvSoct7A6WwozilfSusBdmG2WqtLGIgzteNwtpqrsTJKNGkXecw z4r4tTt/Y8IJ3H2Ei59h0h4uZcwXatNMYj8gFMAKPxPckqGBq6X4/CJ/dam+2PVbSRIu lOeeDHPQp9TK7OWovsJd4yEdBvkxkp2pul0f6jtZcSkaBzu53UPKIivZK0+4zxMl2S2N hrFA== 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=wleD/ROyxwonWdHKvG0zTxmD8FKPaYExESoY+01uGSQ=; b=G0dsUOEhNPFEYtvc92rbB3SdLcZdnPSMOb1wmMzRlhjY8kVfWfGIxvoAM3w7WbLNAn bLU+TzaHqruJkLZ/S2U5x7+v3GPOQZ4vOlABRCnhcupSRlz9Sr51zafO8kyVj2RKHoeE CL8/3Ud/iIz9LPmop+Tq/eeXrVoDiNyUqiM9B4J5AycIo3tukDFxYkoUm98sg4cw9Ls1 CMR+17JOc/e22O0vh1K1EboE0hQAM2RmycKdlUIMi8lk1Igbj+Bz7BqQfAFGk+ufJ8cW YQ9zC2TwMCM1jAAxtz1L+wzaESro0UsUoRiYWoZCLObNNPI8Ey7QDe68umk2D7XU/ZPg mgBQ== 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 z18si854737oid.82.2020.03.04.02.53.13; Wed, 04 Mar 2020 02:53:25 -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 S2387939AbgCDKxA (ORCPT + 99 others); Wed, 4 Mar 2020 05:53:00 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:61986 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387905AbgCDKw5 (ORCPT ); Wed, 4 Mar 2020 05:52:57 -0500 Received: from 79.184.237.41.ipv4.supernova.orange.pl (79.184.237.41) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id 8085f99e0095f875; Wed, 4 Mar 2020 11:52:56 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , "Rafael J. Wysocki" , Daniel Drake , Jian-Hong Pan Subject: [PATCH v2 1/6] ACPI: EC: Avoid printing confusing messages in acpi_ec_setup() Date: Wed, 04 Mar 2020 11:44:46 +0100 Message-ID: <2452684.omWlTi7MXd@kreacher> In-Reply-To: <2411774.6kdisLRoUK@kreacher> References: <2094703.CetWLLyMuz@kreacher> <2411774.6kdisLRoUK@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 --- -> v2: No changes. --- 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