Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3095235ybz; Mon, 27 Apr 2020 09:52:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKj6zOujVD5o3MzVUXzJ+z2G4VRe3U5nvOgLsNqrChEyVpuZohGiAgf6nza0BF6Vs2yzAye X-Received: by 2002:a17:906:130d:: with SMTP id w13mr20163290ejb.253.1588006356760; Mon, 27 Apr 2020 09:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588006356; cv=none; d=google.com; s=arc-20160816; b=ug+C/WEAnNDU5zXa0XmgQBGF4VIpMgu52CvdiIA0WJWxDdmeHiVieEIIFf90uVl2js eIsiurH8+wpreJqxFR1voH9dXnMOKKGFENjmxYMfmNZTHGX0lBFuaGG0FHjBP1bo8O4y V0dD6yg0LhnpUcUO2Pl7fJJP+HQIR0f/8nrZy295JTS7ZXeJUdXyrDH6PmvVjotkj3a+ KvcAUxpjmkLaGq1qB9d6N2hpcEotykNdxETwvbC7HBK8Wqf3FpNGxIKMijpH1pH0EyVm 2eSgfr8ZGJYkR1SnMu/GSETb05N5eZQw4tlxH9ZKljtW1CPvQSPa9+gam1Z0HqdA4Eyv SgEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=V2IKgBBGeWQaS3nKENTTI6oYzwqYmWY3/5vxajcyiRg=; b=M/yZXhdycXRcF40+UwJUvlXwASbktOdjR4l9LWoFB4Hc/h80skSqRPwbHOMaVvX5Pu 61gLofHpFmkJfiPmhGOD4BVt5Byo5mflrz8Xk8j1ryCXv0Q6rTcUOtnwHFpgPuREqz+Y qk14VK5STq/ImwWo0DQYYtltn6ATT9RYSx7dGcqxUYLJv6U/i9Lg9waJmQmmxtxGmnC2 JTWCrck5cylIuxmGu0EEGhZ4TW4vFXwEGFyHMZbj4AXUIWjxVotI/EE4nOs8QOtmcwKu mtzLjaSo6QEm9t/mXgYRbSdKTEqX5tXutzJaXEQodsrj5D4fUftBVcxOQE8QPlJ+11P4 vwiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PW927SF/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss24si92461ejb.392.2020.04.27.09.52.13; Mon, 27 Apr 2020 09:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PW927SF/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726410AbgD0QsU (ORCPT + 99 others); Mon, 27 Apr 2020 12:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726402AbgD0QsU (ORCPT ); Mon, 27 Apr 2020 12:48:20 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01C02C03C1A8 for ; Mon, 27 Apr 2020 09:48:20 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id u127so401261wmg.1 for ; Mon, 27 Apr 2020 09:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=V2IKgBBGeWQaS3nKENTTI6oYzwqYmWY3/5vxajcyiRg=; b=PW927SF/uC1q91VoVVYQ+1pXnGZTfNMH4wSEMOjVR2xohzu4yp9PaN8dJxdTffySOX Xg90snZYIfR+VLNbsD+aeBooFQY9hW3NEw/9WC8Ikg8Ua3CdX9GPiZdqolNYOZDjbOgW 8nMoVwWgXPDSdBzjyuD773mLMsMK2wxXf5mig/QQUsR9SZEmYcZxvhi1gOQNi/fBDetD M2sOiHVkryGE0+k9XDDGVVwPrq/CFRbfFGAFfPhRys7RrcFrr1jI8b4rEFcrFjBdPlG+ ClCJmIQPMDJNb+VxjUwfW0rLYaSZQtSlHUpG3wiJ9Of7PaDg2cLwtlVdadaEVGFXiIoU E5bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=V2IKgBBGeWQaS3nKENTTI6oYzwqYmWY3/5vxajcyiRg=; b=rQFBYYZk7++fL9UkJ7gF4SCO7oV3da5pCvu2To121i7SxPt64QqH6n/BdTs33nMq5S WyOBYS5w9NVi8JG5rjjTf6/AYBPmnjBabjJDXOfiUwj3HhvEdnp7IYB7jCxx6uTM+j6U Au6jCiOfAS6He/zPGf2hlwJgpCw87BWxbhWBwUhFgLoal87pWnQWngTHKGX/QZSN3A+B dgIqVxf9xc/KbQtvrx6B8WACRQRsT0LRP9PFB9ufY/MNZK4T/cmy5MAOiVD9NIkvWSv+ Ti2h+k2EVkRuJUqSH5Bucw2CBd/VtjBVbsyY7yGpx2NCae3XiLC12UXzvTFxPJH5rXwV cuHg== X-Gm-Message-State: AGi0Pub3smNj6gP+5yHOtb4FoXsiXpubvfcXRW03GkQhSDG4FPc4iFW5 eNHWBi5qlznnOdwHzAuNRvx5bg== X-Received: by 2002:a1c:ba09:: with SMTP id k9mr387758wmf.176.1588006098658; Mon, 27 Apr 2020 09:48:18 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id r20sm15553355wmh.26.2020.04.27.09.48.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 09:48:18 -0700 (PDT) Date: Mon, 27 Apr 2020 17:48:16 +0100 From: Daniel Thompson To: Douglas Anderson Cc: jason.wessel@windriver.com, gregkh@linuxfoundation.org, kgdb-bugreport@lists.sourceforge.net, mingo@redhat.com, hpa@zytor.com, bp@alien8.de, linux-serial@vger.kernel.org, agross@kernel.org, tglx@linutronix.de, frowand.list@gmail.com, bjorn.andersson@linaro.org, jslaby@suse.com, catalin.marinas@arm.com, corbet@lwn.net, will@kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 8/9] serial: qcom_geni_serial: Support earlycon_kgdboc Message-ID: <20200427164816.j4xqw3vvlgoqkmx7@holly.lan> References: <20200421211447.193860-1-dianders@chromium.org> <20200421141234.v2.8.If2deff9679a62c1ce1b8f2558a8635dc837adf8c@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200421141234.v2.8.If2deff9679a62c1ce1b8f2558a8635dc837adf8c@changeid> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 21, 2020 at 02:14:46PM -0700, Douglas Anderson wrote: > Implement the read() function in the early console driver. With > recent kgdb patches this allows you to use kgdb to debug fairly early > into the system boot. > > We only bother implementing this if polling is enabled since kgdb > can't be enabled without that. > > Signed-off-by: Douglas Anderson > --- > > Changes in v2: None > > drivers/tty/serial/qcom_geni_serial.c | 32 +++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c > index 6119090ce045..4563d152b39e 100644 > --- a/drivers/tty/serial/qcom_geni_serial.c > +++ b/drivers/tty/serial/qcom_geni_serial.c > @@ -1090,6 +1090,36 @@ static void qcom_geni_serial_earlycon_write(struct console *con, > __qcom_geni_serial_console_write(&dev->port, s, n); > } > > +#ifdef CONFIG_CONSOLE_POLL > +static int qcom_geni_serial_earlycon_read(struct console *con, > + char *s, unsigned int n) > +{ > + struct earlycon_device *dev = con->data; > + struct uart_port *uport = &dev->port; > + int num_read = 0; > + int ch; > + > + while (num_read < n) { > + ch = qcom_geni_serial_get_char(uport); > + if (ch == NO_POLL_CHAR) > + break; > + s[num_read++] = ch; > + } > + > + return num_read; > +} > + > +static void __init qcom_geni_serial_enable_early_read(struct geni_se *se, > + struct console *con) > +{ > + geni_se_setup_s_cmd(se, UART_START_READ, 0); > + con->read = qcom_geni_serial_earlycon_read; > +} > +#else > +static inline void qcom_geni_serial_enable_early_read(struct geni_se *se, > + struct console *con) { ; } This is pure nitpicking but since I was passing... why the ; ? Daniel.