From owner-freebsd-hackers@freebsd.org Thu May 17 14:59:29 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F0DCEAAFC0 for ; Thu, 17 May 2018 14:59:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94EC38396B for ; Thu, 17 May 2018 14:59:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id 70-v6so9247455ity.2 for ; Thu, 17 May 2018 07:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=SWA8guDu/EEAqWB6dQPgZ5VBMKLP4AxtihbKV7/947M=; b=DVRszpDE3tBqnGcG6dzmsiwhqsfMlWiXm3lTnHHtKSgGQMMB8Z6CyfyKDNBVdB8/AX m+qrsK5kugojgE65U15E50x2IcINWYwv5S6vY8DX2/BQZEpC3RS3lDB2soQMfsUDDbN4 xaLoHfP0tBfwhaXOvUHx5E9CNbCpC2a/IogtAioah8XbPIWKQTrwHF/zp2Q8uzr8c+F+ 6LTKDHKHL7T8jW8PRyEz+pTfbXhc39nH5dHyml1MSwOqv2NvVT+m+haXO1786l2uUF+K O9QAn75oaz2uPq32Bk5isQ7yubYxbvFgZLhLtuVI5sXYjBShdC5b0u5JjOsfIzTbdANV EMtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=SWA8guDu/EEAqWB6dQPgZ5VBMKLP4AxtihbKV7/947M=; b=k8Uh/9NzwzjddHCitVO28OJ/5t+auqmMyP0ZXZqeWiyOqZRFyHsGw7d1BmXJDeo9oY NRtzYGy+aGLziOxoxgFFX4C0K1jVc99I5BstLM9aqRTJcE8zJ71u8aj+DaYvwBgDZPXK YKFVqJzk/G1WRlhuFs5MLgkPoOo31+5TYC78EW8h9t9pwmlqThIny4uwbuV5ysJEkCnC 6pLg2ZSR4y4k5pvEw/OHW/MtplY3f6KtVDqwZ5kIDAu6M1kmBHfUU5Hz6/qExwa24wND cvfgGJ4a8TFovW4GOjgYgUze1ttIlW5Ghq32Byp5wgT9ywfC4Ui/shIztUML7NdlH4Qt M35A== X-Gm-Message-State: ALKqPwfkBF84nxa3T6z5juMBC2VA0EUmCJ5PJy5dvAkZVQWYy3ujuukE dA7B3UfwDy/gV7M75pQuTcliy2FS0k0+xq47XLIK2w== X-Google-Smtp-Source: AB8JxZpE5rUA/S59ZANxtyX8/ZIVD6PvrLbOStbyKj+tEn+Z6UqGMth5Qz5XNCCPEBG8v+xLJ41zdk0a1Bd8/qc49fg= X-Received: by 2002:a24:4c55:: with SMTP id a82-v6mr2926477itb.1.1526569168004; Thu, 17 May 2018 07:59:28 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a649:0:0:0:0:0 with HTTP; Thu, 17 May 2018 07:59:27 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <0e1d5601-f792-0708-3bcf-7153bea8f679@FreeBSD.org> <1526563552.32688.47.camel@freebsd.org> From: Warner Losh Date: Thu, 17 May 2018 08:59:27 -0600 X-Google-Sender-Auth: MbM5vind_VP0OzOtzw_oxqu9Vhk Message-ID: Subject: Re: serial console vs suspend To: Andriy Gapon Cc: Ian Lepore , freebsd-hackers , FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 14:59:29 -0000 On Thu, May 17, 2018 at 7:28 AM, Andriy Gapon wrote: > On 17/05/2018 16:25, Ian Lepore wrote: > > Why should it go through the console layer? If the uart hardware needs > > some re-init on resume, won't that be true whether the uart is serving > > as a console, a dial-in terminal, or the interface to wifi or bluetooth > > chip? > > I think that for those things a normal device resume should do. > console gets used very early, so it may require a special resume. > We should re-init both places (maybe with a flag to prevent double if that's harmful). The console is needed very early after the resume, often earlier than the accidental location in the device tree the console device_t node lives. That way we don't lose output. The console layer gives us a convenient hook early in resume to cope. It's yet another reason, though, it should be restricted to true console devices, but that's another conversation. Warner