From owner-freebsd-hackers@freebsd.org Thu Jan 2 00:29:28 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FC6F1E4E9F for ; Thu, 2 Jan 2020 00:29:28 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47p86v3mrJz4YHR for ; Thu, 2 Jan 2020 00:29:27 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qk1-x741.google.com with SMTP id z76so30735054qka.2 for ; Wed, 01 Jan 2020 16:29:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=J2F3ffPcFIjcdc6QpuyTnwMlRLYYS2SLGufrwMlzOq0=; b=EFITa/fWaNWHfZXIonmtOlyQgNhDUGHMYbegby5SBgK9fByKTHeVvq9x4Vko7/yry3 b0n2EUAKP2Jws8+h33D6Jy2Wokf1FQCzXOIsh4YkBCKNHRTBalzJKdu6jr0NZiA1sMCp D3Ho6PFmTsCQzV3fvyDC4xJYbYa1xGU3j5VINhaELgldKuahPzrY5JLWpx6CWuyH3Br3 gIpcOXHIgSmf4wjKFbXTOtUwSnX6I+Aupa6Pmo/xhejYoyhzWwXCq12otoNxIDZXMlU9 jcV7q1quPZE/znOHf0SfpadGvS0HvNCq82N6t2rwFrT8L3bdPydxmfTDNsItuKwhI3p+ WaWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=J2F3ffPcFIjcdc6QpuyTnwMlRLYYS2SLGufrwMlzOq0=; b=IiCAazVN2SfIZuLgkfQ1PDZTFLz5W9AC2B8Vg1KLtSnj82uNshLCkxyV1MpIyON5TF ZEzxBu9Bkd5hJAZsiQ2avxfs4/Zm8zsotNLWo/KPU7J+Woloq8goc3t8mMyYk9FM8hBt HAs6bktN5K3JuLdGd6BNWm6WlS8Uv0iLG7AJwD+kvB1QPQYbpa4TK7WvEHU6gk5JJ7Jb wkmsNUQIlHogKD2RKhnC3Joo4fKOc6kkDRvLoOvorp7Ap0rYJctp9c2l4QRq97ZfF/5q szM3SSfI8+DdJXDrnxKRaCOJiJywuagBfkPJBDEehCqYek4imokdeUlbdUdkgTHCQtax /TQA== X-Gm-Message-State: APjAAAVpGJNA/YoN9E8X9BjPQNXcqYAPBGMpA6MH1sZSlxhb5E68GcSo qkKNERHuK+Ep3Xe2gRjrRILvkPTCgHyfDm28CmMiIQ== X-Google-Smtp-Source: APXvYqzAe0t3bHMTaPShPthh3uTQxvXNbTzaw+LoUKfgtwzPEnB3Lvex4MNiFk8IElYnjVKKAQnO68G87G9afVdifuU= X-Received: by 2002:a37:308:: with SMTP id 8mr1916427qkd.98.1577924965583; Wed, 01 Jan 2020 16:29:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ryan Stone Date: Wed, 1 Jan 2020 19:29:14 -0500 Message-ID: Subject: Re: How do I completely disable suspend? To: Warner Losh Cc: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 47p86v3mrJz4YHR X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=EFITa/fW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rysto32@gmail.com designates 2607:f8b0:4864:20::741 as permitted sender) smtp.mailfrom=rysto32@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[1.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; IP_SCORE(0.00)[ip: (2.29), ipnet: 2607:f8b0::/32(-2.14), asn: 15169(-1.87), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jan 2020 00:29:28 -0000 On Wed, Jan 1, 2020 at 5:01 PM Warner Losh wrote: > > > > On Wed, Jan 1, 2020, 1:46 PM Ryan Stone wrote: >> >> I have a laptop on which suspend/resume doesn't work. I don't need >> suspend/resume and don't want to spend the time debugging it. >> However, there are some really annoying cases that can trigger a >> suspend, and I find up having to power off the laptop to get it to >> boot properly again. How can I completely disable suspend? Playing >> with the sysctls under hw.acpi doesn't seem to actually do anything. > > > You want to make the switch action do nothing. I do this so that I have = a custom devd action that sleeps for 60 seconds and then suspends if the li= d is still closed. I often close my lid and then go 'oh, crap I forgot to..= .' and I want some time to recover from that mistake that doesn't force a s= uspend/resume. > > hw.acpi.lid_switch_state: NONE > > and > > notify 10 { > match "system" "ACPI"; > match "subsystem" "Lid"; > action "/usr/local/bin/imp-lid $notify"; > }; > > in devd.conf for me. > > And while Ryan won't need it, here's imp-lid: > > #!/bin/sh > lid-wait() { > logger "Waiting a minute to suspend" > sleep 60 > case $(sysctl -n dev.acpi_lid.0.state) in > 0) logger "suspending"; zzz ;; > *) logger "never mind";; > esac > } > > case $1 in > 0x00) # lid closed > lid-wait & > ;; > 0x01) ;; # Ignore opening > esac > exit 0 > > > Warner Thanks, but in my case, the biggest issue isn't closing the lid but some magic extra function button on the keyboard that something has decided should trigger a suspend.