Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6196488ybf; Thu, 5 Mar 2020 15:18:35 -0800 (PST) X-Google-Smtp-Source: ADFU+vvglAW8LnwW3LekRNWhkxaHZoAwM+Q3DSz6VfD1HmXNSVN8Sb5SbFSLlQgANop4RuLpgwqd X-Received: by 2002:aca:1a05:: with SMTP id a5mr625629oia.113.1583450315452; Thu, 05 Mar 2020 15:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583450315; cv=none; d=google.com; s=arc-20160816; b=F4X9uYRQLKsA++vV+ibicO/ieetYS0t2rjV6jDnMMu+p3KfCO3Raf3ST0rfvvuDejc Loyezz69NvtHS7f3/w+EP0Fui1aFMw1emabVno0uyhawdcOnGjEBA5r3R42/1OJDs8RP V9FmjqiI6OX33pVTReW1Wi20C55AYgA7F+gq8PYkc5tK0La+z9HGQuuuNmXQQ41k3ZNm uuVv0np5GOoRoANLON9reUrmdx5Q0Hhs4N889B2RINH78+oVXX/UZId8kvVofwohEmUc zOAjHuedUZbxg73i7UrjG1ThQk+UCt1dLnkpNZIg/INy433nE8u2xC3wCtxPHUcCHe1b zFUA== 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 :message-id:date:subject:cc:to:from; bh=Qjvsqap9CmEyIC8SrRSNo7yuDCLGNkNvN9wZ5xUmpA0=; b=L3d0cayHiHA8B/gh3tsYXeb6aHdi46l5315Ssd6zWQ1IsgunDftAgOESvbX4JLVWBV wYzeSYn/U6AilLdrKRxWd1wZkxRwruRDOL4Nby9wQqII4MCs1N8Uj3xSrlEWtdrIq5Jb mgW4tlh7ZaepFnWWwa6QPu1hJUsbrYwzaiNiVeirFj2E7P8nujPG9/5Wp2OtFabumdQy E1kIZ7YMdQAHjo34AZf0Rtv+kYtNWndmO/uZve+IddHY27OHS/x4jxwLwEPXSiERyNBB x+8A0/kJgoWZL6Li7SFOTIHs85B7fojoHkiU5Yzt0vYFhkNe+Eqkpcu1GhX76ZWvguOq SKEQ== 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 h8si228573otq.237.2020.03.05.15.18.22; Thu, 05 Mar 2020 15:18:35 -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 S1726436AbgCEXR6 (ORCPT + 99 others); Thu, 5 Mar 2020 18:17:58 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:63419 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbgCEXR5 (ORCPT ); Thu, 5 Mar 2020 18:17: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 4a20b7f991c383a4; Fri, 6 Mar 2020 00:17:55 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , "Rafael J. Wysocki" Subject: [PATCH] ACPI: EC: Eliminate EC_FLAGS_QUERY_HANDSHAKE Date: Fri, 06 Mar 2020 00:17:55 +0100 Message-ID: <4132402.vtZ0fvcVVT@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 The EC_FLAGS_QUERY_HANDSHAKE switch is never set in the current code (the only function setting it is defined under #if 0) and has no effect whatever, so eliminate it and drop the code depending on it. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/ec.c | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) Index: linux-pm/drivers/acpi/ec.c =================================================================== --- linux-pm.orig/drivers/acpi/ec.c +++ linux-pm/drivers/acpi/ec.c @@ -182,7 +182,6 @@ static bool boot_ec_is_ecdt = false; static struct workqueue_struct *ec_wq; static struct workqueue_struct *ec_query_wq; -static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */ static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */ static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */ static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */ @@ -690,21 +689,9 @@ static void advance_transaction(struct a wakeup = true; } goto out; - } else { - if (EC_FLAGS_QUERY_HANDSHAKE && - !(status & ACPI_EC_FLAG_SCI) && - (t->command == ACPI_EC_COMMAND_QUERY)) { - ec_transaction_transition(ec, ACPI_EC_COMMAND_POLL); - t->rdata[t->ri++] = 0x00; - ec_transaction_transition(ec, ACPI_EC_COMMAND_COMPLETE); - ec_dbg_evt("Command(%s) completed by software", - acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); - wakeup = true; - } else if ((status & ACPI_EC_FLAG_IBF) == 0) { - acpi_ec_write_cmd(ec, t->command); - ec_transaction_transition(ec, ACPI_EC_COMMAND_POLL); - } else - goto err; + } else if (!(status & ACPI_EC_FLAG_IBF)) { + acpi_ec_write_cmd(ec, t->command); + ec_transaction_transition(ec, ACPI_EC_COMMAND_POLL); goto out; } err: @@ -1805,22 +1792,6 @@ static void __init acpi_ec_ecdt_start(vo acpi_bus_register_early_device(ACPI_BUS_TYPE_ECDT_EC); } -#if 0 -/* - * Some EC firmware variations refuses to respond QR_EC when SCI_EVT is not - * set, for which case, we complete the QR_EC without issuing it to the - * firmware. - * https://bugzilla.kernel.org/show_bug.cgi?id=82611 - * https://bugzilla.kernel.org/show_bug.cgi?id=97381 - */ -static int ec_flag_query_handshake(const struct dmi_system_id *id) -{ - pr_debug("Detected the EC firmware requiring QR_EC issued when SCI_EVT set\n"); - EC_FLAGS_QUERY_HANDSHAKE = 1; - return 0; -} -#endif - /* * On some hardware it is necessary to clear events accumulated by the EC during * sleep. These ECs stop reporting GPEs until they are manually polled, if too