Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4150473imb; Wed, 6 Mar 2019 06:35:00 -0800 (PST) X-Google-Smtp-Source: APXvYqx7wIyLu9nn2FeF3xQiKdB0BH+pBgixBrm5Dx3jM9zORXI93cyPCdQ5kq6iuyNph/gfSksg X-Received: by 2002:a62:4553:: with SMTP id s80mr7431230pfa.141.1551882900602; Wed, 06 Mar 2019 06:35:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551882900; cv=none; d=google.com; s=arc-20160816; b=rIazSryh90Gz2w8OY15FjPziIjQuv8hhC5eY8POW247nNkn2bxuTrq0goavnmInjzV xk4S2aCNcJPCaHjmzsTOfBZlN1akSD4p7noBhUSc83m4gSvfNr6fgMhg8vUHWNYPt63F 2vxYgLx2MEmXjemdznSAuh5mxfGc/uxZOJSoyV5cfhgANigYySJSmN3X/ZQbVyZinEKR 50KSZWIUHtWDh9lOFA53IkW0NU0uFgXmDtqasVjjdng7KXeVYffbexq+u1jM25CQCYca TRlAP8HeqE9wuDsNW9JuIFBACxrRNse16eaADHokmsOUltf7GThVsSAQj+ySSOy4uIkR n/4A== 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 :dkim-signature; bh=bCyIxrKLRGGQdge9IQQGeaYMLr81+HyIqCN2r7zDc+E=; b=mzvXyK2XF4hv3NF++jYzQOyWlZYzkK7q1XGO8SECK6Tgb6tBxW3VeHf4qz3tTSdb/T C6PvDBCUK7GfCUZyEkSFXQgQVn9tbX9R+KyfRYYsaVTC+HR9jjZ/MKyi3R3DHrRiOm3A sCQfJjn98NmaE+eROeog8B2bdxlCWlYjMKM6TNnw+yv+MuX3Ci35wPLXj7ipalW1XsXv 8RmWHsA8f2J7iZRp5mNfzakDgSXUo3F15wwSbzsJmYnWH0XWj0DqDCIiukxbIA97uUtL +7zOUYN0lh/BVZt/flxQNVYMlPv+HSvbxJ15hY+uOcqJBuF1x/COXW3UoGs0/Wt5VOC0 UwwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tomli.me header.s=1490979754 header.b=MyjgEF8x; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tomli.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si1591314pla.226.2019.03.06.06.34.45; Wed, 06 Mar 2019 06:35:00 -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=@tomli.me header.s=1490979754 header.b=MyjgEF8x; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tomli.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729599AbfCFMCG (ORCPT + 99 others); Wed, 6 Mar 2019 07:02:06 -0500 Received: from tomli.me ([153.92.126.73]:46566 "EHLO tomli.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729498AbfCFMCE (ORCPT ); Wed, 6 Mar 2019 07:02:04 -0500 Received: from tomli.me (localhost [127.0.0.1]) by tomli.me (OpenSMTPD) with ESMTP id 8ef2bf1e; Wed, 6 Mar 2019 12:02:02 +0000 (UTC) X-HELO: localhost.lan Authentication-Results: tomli.me; auth=pass (login) smtp.auth=tomli Received: from Unknown (HELO localhost.lan) (2402:f000:1:1501:200:5efe:72f4:b31) by tomli.me (qpsmtpd/0.95) with ESMTPSA (DHE-RSA-CHACHA20-POLY1305 encrypted); Wed, 06 Mar 2019 12:02:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tomli.me; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=1490979754; bh=17tJ+LRyo7NePFlBvhmpIAFh7/EROGjz26SLZpRTBYk=; b=MyjgEF8xFMA4gUUzK0fMkGKS7cEmhocL1cEJz+3xWQkWF1oIc6Ivgk5cXKWosfXFFnEQmk3b01E+gihpu7217/mIF9njqRnnLg4GWpWonTy3Hai06iAPuPP7r0qI+zJ8YpUUj/TZK7cOJwdKjdMA5Ohbut0Q5vYdmvwywJw7aCEspC6QET7fu185s+6dSNsHuBHS4lxaB9K0lR84yCuNWlQTFX/YdbgIdpxd6OAjws/X1vgKVBoXRrxWze4l6RsuZVNWNYXubdauiWriL+CbS/yuSpO9ZMXu3dtZMGWQNoLP959fomkpaA9fUbI7NV8MJmL9cQTWQ2gO+XJj+324Sw== From: Yifeng Li To: Lee Jones , linux-mips@vger.kernel.org, Paul Burton Cc: Yifeng Li , Jiaxun Yang , Huacai Chen , Ralf Baechle , James Hogan , linux-kernel@vger.kernel.org Subject: [PATCH v3 4/7] mips: loongson64: remove yeeloong_report_lid_status from pm.c Date: Wed, 6 Mar 2019 20:01:10 +0800 Message-Id: <20190306120113.648-5-tomli@tomli.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190306120113.648-1-tomli@tomli.me> References: <20190306120113.648-1-tomli@tomli.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is some complicated logic in lemote-2f/pm.c. During wakeup, it creates a delayed_work to execute a callback to the function yeeloong_report_lid_status(). It's only purpose is to report the current status of the laptop lid switch, and this callback function was not implemented in the mainline kernel. This level of overenginnering hardly makes sense. All we need is to report the laptop lid switch unconditionally upon wakeup in the future PM code, which is being worked on. Signed-off-by: Yifeng Li --- arch/mips/loongson64/lemote-2f/pm.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/arch/mips/loongson64/lemote-2f/pm.c b/arch/mips/loongson64/lemote-2f/pm.c index 4ee7e9864700..ebe4b57535f0 100644 --- a/arch/mips/loongson64/lemote-2f/pm.c +++ b/arch/mips/loongson64/lemote-2f/pm.c @@ -80,17 +80,6 @@ void setup_wakeup_events(void) } } -static struct delayed_work lid_task; -static int initialized; -/* yeeloong_report_lid_status will be implemented in yeeloong_laptop.c */ -sci_handler yeeloong_report_lid_status; -EXPORT_SYMBOL(yeeloong_report_lid_status); -static void yeeloong_lid_update_task(struct work_struct *work) -{ - if (yeeloong_report_lid_status) - yeeloong_report_lid_status(KB3310B_BIT_LID_DETECT_ON); -} - int wakeup_loongson(void) { int irq; @@ -119,17 +108,6 @@ int wakeup_loongson(void) lid_status = kb3310b_read(KB3310B_REG_LID_DETECT); /* wakeup cpu when people open the LID */ if (lid_status == KB3310B_BIT_LID_DETECT_ON) { - /* If we call it directly here, the WARNING - * will be sent out by getnstimeofday - * via "WARN_ON(timekeeping_suspended);" - * because we can not schedule in suspend mode. - */ - if (initialized == 0) { - INIT_DELAYED_WORK(&lid_task, - yeeloong_lid_update_task); - initialized = 1; - } - schedule_delayed_work(&lid_task, 1); return 1; } } -- 2.20.1