From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751781AbdJXX4k (ORCPT ); Tue, 24 Oct 2017 19:56:40 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:37626 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751576AbdJXX4i (ORCPT ); Tue, 24 Oct 2017 19:56:38 -0400 Date: Wed, 25 Oct 2017 00:56:35 +0100 From: Alan Cox To: Waldemar Rymarkiewicz Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: How to power gate a specific single device from outside? Message-ID: <20171025005635.57f1b926@alans-desktop> In-Reply-To: References: Organization: Intel Corporation X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I could not find anything standard that let me power gate single > device from userland. Perhaps it's considered as a too risky operation > to expose to the user. I don't want to touch drivers too much as well > not to make them dependant on extra system feature. Better to have a > separate module that handles this system mode and forces some drivers > to unload/power gate their HW. > > Are there already some proven solutions/ideas around the kernel that > can be used straight away? For a lot of devices if you close it then it will try and put the device into a low power state. If a driver isn't doing that then (unless there are hardware constraints preventing it) it would make sense to fix it. There are some things entirely in your control - big ones. In particular the brightness of laptop panels, pulling everything off one CPU socket, disabling the nmi watchdog, hard disk power settings, stopping processes that wake up a lot. Many of those you can set anyway for best power behaviour (see powertop). Alan