From owner-freebsd-acpi@FreeBSD.ORG Sun Dec 7 09:05:54 2014 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77A36AA5 for ; Sun, 7 Dec 2014 09:05:54 +0000 (UTC) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C52B7E3 for ; Sun, 7 Dec 2014 09:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=LpyLqXmeZ7hCcXw0H7+uGmn+N00=; b=GpZykBU+lDVn2U5G0J 8MbI9ZZmq1/spq78yPBKdWzEiPvLfnmNy+tlviSfxSQtUskSAXBKsNhFu28tGguU 1EFFpeoRWApcQITYt4eivOLCu+vfsyBS0TGfzYOjbdMMpXvQN/YsY+GigoRiStLE 3nnCy4BhIeOTYL1wZC63+8wfY= Received: by filter0166p1mdw1.sendgrid.net with SMTP id filter0166p1mdw1.29081.5484186F8 2014-12-07 09:05:51.656549879 +0000 UTC Received: from mail.tarsnap.com (unknown [10.100.60.97]) by ismtpd-032 (SG) with ESMTP id 14a23ff73ee.7d85.3a7b91 for ; Sun, 07 Dec 2014 09:05:51 +0000 (UTC) Received: (qmail 57736 invoked from network); 7 Dec 2014 09:05:51 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 7 Dec 2014 09:05:51 -0000 Received: (qmail 62276 invoked from network); 7 Dec 2014 09:04:04 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 7 Dec 2014 09:04:04 -0000 Message-ID: <54841804.5050700@freebsd.org> Date: Sun, 07 Dec 2014 01:04:04 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: freebsd-acpi@freebsd.org Subject: Re: ENXIOing non-present battery References: <54840781.70603@freebsd.org> <54840FBA.5050409@obluda.cz> In-Reply-To: <54840FBA.5050409@obluda.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SG-EID: t2fXfoZHCw6vGsGKHqKxJ9qWwHSlQfPdDS+3+p6rOCszDK4X43Mgfq7AVricQeSCfyItGgR82jIZ04 5RpB66vkO8s5o8B4cQeU1ST0G0zCc7Xk/wd9t0AkoE/UqUPB1oILsqYNiPmCDvEJIVpzcx/2HOLX5+ QvoW1xouccFe5zXzB9DE8PMuShFELs3SNYdT X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2014 09:05:54 -0000 On 12/07/14 00:28, Dan Lukes wrote: > Colin Percival wrote: >> it seems like not attaching a non-present battery would be a good idea. This shouldn't be the default behaviour, since >> there are plenty of systems where a non-present battery might be inserted at >> a later time; but I see nothing wrong with adding an option. >> >> The attached patch adds a acpi.cmbat.hide_not_present loader tunable which, >> as the name suggests, hides non-present batteries; this is done in the probe >> code by returning ENXIO >> >> Any objections to me committing this? > > No, but it may be more useful to create more generalized interface. I agree in theory, but do you have any idea how to do this? > A remember broken ACPI with issues related to ghost floppy drive when no > real floppy drive has been present. > > Not only battery, but any device should be considered non-attachable > upon administrator request. In the case of my laptop, the only way I can see to distinguish between the real battery and the "ghost" battery is that the latter returns zero from acpi_BatteryIsPresent; and that won't work for non-battery devices. There is, of course, the option of using debug.apci.disabled to disable complete subsystems, but I only want to hide the ghost battery, not the real one. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid