From patchwork Tue Mar 7 15:32:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 65636 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:570d:b0:a1:2e52:cf23 with SMTP id h13csp1968745dyk; Tue, 7 Mar 2023 07:38:49 -0800 (PST) X-Google-Smtp-Source: AK7set+e0PqM2dBOv5lKrPF9HSmoLDIMrYlkCEyU53X9IqwbEHCGqgqSrOE65TNQQt/y8MRim1Lb X-Received: by 2002:a05:6a20:144c:b0:cd:272:fd3f with SMTP id a12-20020a056a20144c00b000cd0272fd3fmr17368737pzi.25.1678203529308; Tue, 07 Mar 2023 07:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678203529; cv=none; d=google.com; s=arc-20160816; b=IMLJ5fCAj1xEj0npxUG6imoTmSLvClEvFS14SVuucyg3+30FKa/mkVcGx+w/gXPEBV 2jpEXvZ3Skl4v9VxAnucVBAYJG95MMzUBYvW/Y5HlhH6UZ7OR08o91xG4rbQyc1o/Jmi IgCSZc4YkkTFU5z4dAwl9QUk4YahtfOwlpm/VFUC03jynbD+Snn9PjfG34LnqhkDUWMg y29/ovmd585tuMg+apabHGMuOk2MT40dtBw60HJ7mQS+dPXoanzotiW9tL2YumdgKnFA 4F1J1Js21PXZWernrGUoDmJKJF6DyuAByD2lo63QHH2lVm7dfJZfF2w/uhXz6m/c/zsM OjSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=c3oD+VWh6vfXWKl1YinwYukVpyEX7O+ZCt88fiLI0g4=; b=natrN9yJwI2nC3q9XtcU5by/pcEz055efz3DJrwYP+HR/XzQdegVUAfOkS9wnBnD/n Ewpey+8U/UmV6ieueNf366OsaRnsBQw3ErQzSZOTg0aQt9YwlnRHX5FOXCxoG9jAa47Q MHmrozS/YTOVJba4etGJ72ykb7adMiapObJY+pAYRE4zfvbx1ldIKvroaExwjDiWhu/X YNz3dwwILucYDBFoBUpc3bohUj0VH/3o5A8RQRVddg2VTt2uKPpALcU8YNNPpdfDmc6m S7K8KALCxcHu30tOUcSE38dCtloFuIiGP/t6C3X+AL7LSz8gdY5jorYZmmWmH2oGbxJP jVCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RKiWq7kI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i14-20020a63220e000000b004e30cc4a2f5si11312313pgi.507.2023.03.07.07.38.34; Tue, 07 Mar 2023 07:38:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RKiWq7kI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231322AbjCGPdJ (ORCPT + 99 others); Tue, 7 Mar 2023 10:33:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230405AbjCGPc7 (ORCPT ); Tue, 7 Mar 2023 10:32:59 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AD887BA25 for ; Tue, 7 Mar 2023 07:32:48 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id x11so9955348pln.12 for ; Tue, 07 Mar 2023 07:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678203168; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=c3oD+VWh6vfXWKl1YinwYukVpyEX7O+ZCt88fiLI0g4=; b=RKiWq7kI7n6XmLArIWP1AnEyouczbA5z2QjZxwSdk9/YWDVGfDjQfkhiJtdsvXIhHZ 31v5iScnAoLMLvPeOkkr7apGnVHUR3f/0qXKPKEJr1wFwS3r/nEQ0mv/BloFixdhp1XV z+ULops+ColVZDGxpN+z2x9m6T0yFpAE42FHA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678203168; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=c3oD+VWh6vfXWKl1YinwYukVpyEX7O+ZCt88fiLI0g4=; b=VXCOnRWRe8Lb82pSN/zMVpFhS0dkZRP8QInLOK0bktjhLOZcAGmRxwJhmMb/u7L/T7 Pdrj1cJCTD4I7+V/ZyvEXbUpxzskL7r8TmdvoNfb74Huh3CKbL1CsYtc1YzmecXBVmUy WfNyvBZxcCRmMhBkT+JdxXuce/zITN06sfKYwqSXBsEqK3Nbs513QMdpyMKGEoA5F7r5 3snJuCfmfdlVLiSdmcjV5mY7Sju8gAoNpoL9cqPaL8K0MsqVafcicVPJp/+U36BrSSD1 CoY3PYuQ5OyVEVqncl7VPo0SqPT0N9HPlkmFS7SIJY2X61Ojke94MKHN3HDsL63qsv4m RG8Q== X-Gm-Message-State: AO0yUKVAcL2kSErShbowhNALwnSfuHkZ9qL6yu6FPy7delpVzt3hXBDJ s0diaudDxJ6R0aST6qU2wGPgSA== X-Received: by 2002:a17:902:e748:b0:19e:82d5:634c with SMTP id p8-20020a170902e74800b0019e82d5634cmr16558648plf.53.1678203167946; Tue, 07 Mar 2023 07:32:47 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2023:7dda:98bb:96dd]) by smtp.gmail.com with ESMTPSA id jy16-20020a17090342d000b0019719f752c5sm8586843plb.59.2023.03.07.07.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 07:32:47 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Greg Kroah-Hartman Cc: Jiri Slaby , Bartosz Golaszewski , Daniel Thompson , linux-serial@vger.kernel.org, linux-arm-msm@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Konrad Dybcio , Douglas Anderson , Andy Gross , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] tty: serial: qcom-geni-serial: Fix kdb/kgdb after port shutdown (again) Date: Tue, 7 Mar 2023 07:32:11 -0800 Message-Id: <20230307073155.1.Iaab0159b8d268060a0e131ebb27125af4750ef99@changeid> X-Mailer: git-send-email 2.40.0.rc0.216.gc4246ad0f0-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759723943868513569?= X-GMAIL-MSGID: =?utf-8?q?1759723943868513569?= Commit d8aca2f96813 ("tty: serial: qcom-geni-serial: stop operations in progress at shutdown") was basically a straight revert of the commit it claims to fix without any explanation of why the problems talked about in the original patch were no longer relevant. Indeed, commit d8aca2f96813 ("tty: serial: qcom-geni-serial: stop operations in progress at shutdown") re-introduces the same problem that commit e83766334f96 ("tty: serial: qcom_geni_serial: No need to stop tx/rx on UART shutdown") fixed. The problems are very easy to see by simply doing this on a sc7180-based Chromebook: 1. Boot in developer mode with serial console enabled and kdb setup on the serial console. 2. via ssh: stop console-ttyMSM0; echo g > /proc/sysrq-trigger When you do the above you'll see the "kdb" prompt printed on the serial console but be unable to interact with it. Let's fix the problem again by noting that the console port is never configured in DMA mode and thus we don't need to stop things for the console. Fixes: d8aca2f96813 ("tty: serial: qcom-geni-serial: stop operations in progress at shutdown") Signed-off-by: Douglas Anderson Reviewed-by: Bartosz Golaszewski Tested-by: Bartosz Golaszewski Reviewed-by: Johan Hovold --- drivers/tty/serial/qcom_geni_serial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index d69592e5e2ec..74a0e074c2de 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1070,8 +1070,10 @@ static int setup_fifos(struct qcom_geni_serial_port *port) static void qcom_geni_serial_shutdown(struct uart_port *uport) { disable_irq(uport->irq); - qcom_geni_serial_stop_tx(uport); - qcom_geni_serial_stop_rx(uport); + if (!uart_console(uport)) { + qcom_geni_serial_stop_tx(uport); + qcom_geni_serial_stop_rx(uport); + } } static int qcom_geni_serial_port_setup(struct uart_port *uport) From patchwork Tue Mar 7 15:32:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 65652 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:570d:b0:a1:2e52:cf23 with SMTP id h13csp1977416dyk; Tue, 7 Mar 2023 07:53:22 -0800 (PST) X-Google-Smtp-Source: AK7set/+4Jtrn77h4I7jPhGSw6MaQclCrlLQoNyOcyd4BXlI587GGOwjIU31CGCK5e8kPrOWSdR0 X-Received: by 2002:a17:907:3e07:b0:8b1:2867:380 with SMTP id hp7-20020a1709073e0700b008b128670380mr20485268ejc.22.1678204402049; Tue, 07 Mar 2023 07:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678204402; cv=none; d=google.com; s=arc-20160816; b=slOz2qJHfITpUqApxzGIc/3Ak1plf+TydIZHBRL80feGW0A1YIb5NagulhIdLAKt9i pfpqWSa6UVVv1abb9+kCieEhZhfXRgaZnBcN+XLStQquABpP5ESCflWnaKUpQp38328B NFLEUUhCvy4pYK+tVDAp81m96dpQx3WllyMHXqBTDJjs1PodxGGkGnQs3NbXcOHFCqwy JveCsBkyn9DMwjciTNMB/aYVlXeqy0MuZduzEQNL5qKbbgVEjdDpZXa3JEPUZHepSSL9 t5LaYHWUiL+HM684RLooqhn4Tu1VFxl6+yTzhvA5fPiFYK0snNk+FbPpfBBS1+noBnFa TG3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ON/hRDAPf2AptDjynSCH9JnA/LFyPWk7i2ryXctmn+Y=; b=Jh9WWAG4Cy/L7pi404152W+4LqdLw9hF7hhtca7ZBmA03ZHAA8AS9nlWDmk5XbqttM lFDBhM4CWFkpRuLlUJwI0v1IwswAWLDAvYOdw2Uv/T7nUKe9ZuNYYql5QEn/KCP2Ae3I ny0UCn+r6GyKxPvO5FvNUWp8XVFTycw3B5Z1EuryuJamfsn5GI+qseeQwSZeIy3LyKwn a9Se0aZyV+Y3wOLBzzRIpuWcZLvhNBBlpqzUDWGQkvfBctDdTPzmNov487FcTeNww0rL sQsuMQqA8k4pe2/FRJmoqsN22cIaZlDkL5h+7zESdukX3mmdFhRsydBNXZ9vnRiKmRps TeEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="k/thYJ/F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r9-20020a170906280900b008d2c91d5119si11057749ejc.308.2023.03.07.07.52.58; Tue, 07 Mar 2023 07:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="k/thYJ/F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231338AbjCGPdO (ORCPT + 99 others); Tue, 7 Mar 2023 10:33:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbjCGPdD (ORCPT ); Tue, 7 Mar 2023 10:33:03 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 141217C95F for ; Tue, 7 Mar 2023 07:32:50 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id x34so13611707pjj.0 for ; Tue, 07 Mar 2023 07:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678203169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ON/hRDAPf2AptDjynSCH9JnA/LFyPWk7i2ryXctmn+Y=; b=k/thYJ/FejPWQY4Da3JnlIuxHSfFvf4jPgd0UIQ0b2XdTdjVTjlWvj9Vx0coE8ZGNf TSjcSYegW3Cq0PnDGKlL2Mfhd98ZxGSjG6XDb53DyE4nz6OldnbCqYZUKhF9YiHygxIC fnVimmDFtsACmxvO0ejshyH9K8EW9IuNupb40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678203169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ON/hRDAPf2AptDjynSCH9JnA/LFyPWk7i2ryXctmn+Y=; b=CJpAPJzTYxSzwZOPb/uip4N46GoNWkC+NOI1/3f2BQ343zjKgM7EPix+C8HR9JjzDB JrywKV1VXxSXiAs0ZLlE6h0eqQfuT53lqHlrK1dmRbQYxpy5bhzmrFStfplh1hDiWS40 HjWW7bB/fDmAMWW/eLWwrzPkpmMkjlkF1vegWoMMSaCqu04HJxbxRAVmcAiRE5FznW6U I7tFjTyMXmKjtv5sKZz8wrdymeycdVwx8dxGcQjZbT5DIhbu2F6lkQeJuV0si4A2CVpf wckg+eVKjhOQ/qvinRsN7ACcPbp7xD3vmbZTh1ciSfLJiaNAQJ2Dd2AFLOM5iPplhsa6 OzKQ== X-Gm-Message-State: AO0yUKWspO0MvVyyOK8+VwUJ1mT/xHP9hssjOFRjpiNPOuS7NecHPhxV IxAiM6BwhXH5YRtgBdujlVDJJQ== X-Received: by 2002:a17:902:7798:b0:19c:bcb1:d8c3 with SMTP id o24-20020a170902779800b0019cbcb1d8c3mr12668737pll.54.1678203169556; Tue, 07 Mar 2023 07:32:49 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2023:7dda:98bb:96dd]) by smtp.gmail.com with ESMTPSA id jy16-20020a17090342d000b0019719f752c5sm8586843plb.59.2023.03.07.07.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 07:32:49 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Greg Kroah-Hartman Cc: Jiri Slaby , Bartosz Golaszewski , Daniel Thompson , linux-serial@vger.kernel.org, linux-arm-msm@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Konrad Dybcio , Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] serial: uart_poll_init() should power on the UART Date: Tue, 7 Mar 2023 07:32:12 -0800 Message-Id: <20230307073155.2.I106c39498d8094c6f5e7ada42c7db17aa5c64e48@changeid> X-Mailer: git-send-email 2.40.0.rc0.216.gc4246ad0f0-goog In-Reply-To: <20230307073155.1.Iaab0159b8d268060a0e131ebb27125af4750ef99@changeid> References: <20230307073155.1.Iaab0159b8d268060a0e131ebb27125af4750ef99@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759724859144812147?= X-GMAIL-MSGID: =?utf-8?q?1759724859144812147?= On Qualcomm devices which use the "geni" serial driver, kdb/kgdb won't be very happy if you use it but the resources of the port haven't been powered on. Today kdb/kgdb rely on someone else powering the port on. This could be the normal kernel console or an agetty running. Let's fix this to explicitly power things on when setting up a polling driver. Signed-off-by: Douglas Anderson --- drivers/tty/serial/serial_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 2bd32c8ece39..b14b5ed6fff4 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2593,6 +2593,7 @@ static int uart_poll_init(struct tty_driver *driver, int line, char *options) { struct uart_driver *drv = driver->driver_state; struct uart_state *state = drv->state + line; + enum uart_pm_state pm_state; struct tty_port *tport; struct uart_port *port; int baud = 9600; @@ -2610,6 +2611,9 @@ static int uart_poll_init(struct tty_driver *driver, int line, char *options) goto out; } + pm_state = state->pm_state; + uart_change_pm(state, UART_PM_STATE_ON); + if (port->ops->poll_init) { /* * We don't set initialized as we only initialized the hw, @@ -2626,6 +2630,8 @@ static int uart_poll_init(struct tty_driver *driver, int line, char *options) console_list_unlock(); } out: + if (ret) + uart_change_pm(state, pm_state); mutex_unlock(&tport->mutex); return ret; } From patchwork Tue Mar 7 15:32:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 65647 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:570d:b0:a1:2e52:cf23 with SMTP id h13csp1974291dyk; Tue, 7 Mar 2023 07:47:55 -0800 (PST) X-Google-Smtp-Source: AK7set+BrBwiaY8DVmGMNIryF1ImiOiNf2dN+yA84rKCighsrLQRZxQd7ABerD+tqZaF/z68veKJ X-Received: by 2002:a17:903:247:b0:19e:6ffd:a310 with SMTP id j7-20020a170903024700b0019e6ffda310mr19130431plh.48.1678204075284; Tue, 07 Mar 2023 07:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678204075; cv=none; d=google.com; s=arc-20160816; b=uPK1DxwZZT65erKnHkHo6GdJdYNndnknyJduX3i7uj7VKKNTwq5p1DmXHoT72Ouk5U 4Pf0lQTKJynX3HQMjcEIaoMGcpigApwxFsmEWcRxjLUkyPpEivRElFP0y3Nc5Kl5gvv4 VM0BBbRZyn/7AAMZ7DEqddSLQsHlPhEoqWCA+YjqnhCv0cJvcwn+zmAvbGB0YXMlzi+b PU1J7qJ/I7NwtRCbxb9/DtIjQuHGarNt3Q3Aq2jIvq7V92f875rHPx0OaOm0TMxcf2Zr ae7ofWS4mda7ZDEkEsgGhKvMxG7XIurFigVaFmix9217tFjP8YksrH61EC3PSV2OCIJZ KTeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oAaIzsWI+DXQ807RCKvS+zEYcv/H3X+nOpua3UqPND8=; b=a5uEIJX1qdVNYTDcEtsn53P0x1oNxBrfHQrA1Vy/qVgKuRP8cupV1V8J0lZAF27mhC K6PWMiRTmmDjY6TnlBQff/AoV9EMLxt2ItIeykqPAlIO2b0I+qNmKra1EQ12ppXuyhGl AMTZZKPB60lW0B9o7Vahtgyu9Vh6/0MEw8O4pE7qiY0wPm0fAIvzkaWQnevctl9MdBaT Z+ku2RcJw0FBIqLkY9MkPLRyyGCkMKdfazj7SZqFqihWeWYlmVQ6wmL9j0BFyB8KK5Dk +s0YL9iaGI/xMNgbES7Bnf615y6m9opG37P6UN4vlVEElivy3LYzp95B1WDdzN9bLfpn I3Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c+U7tgYt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g5-20020a170902934500b0019acba4e8ebsi12274756plp.124.2023.03.07.07.47.32; Tue, 07 Mar 2023 07:47:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c+U7tgYt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229792AbjCGPd3 (ORCPT + 99 others); Tue, 7 Mar 2023 10:33:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231299AbjCGPdI (ORCPT ); Tue, 7 Mar 2023 10:33:08 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B89487E78B for ; Tue, 7 Mar 2023 07:32:51 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id n6so14494079plf.5 for ; Tue, 07 Mar 2023 07:32:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678203171; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oAaIzsWI+DXQ807RCKvS+zEYcv/H3X+nOpua3UqPND8=; b=c+U7tgYtMbvwsqogjSKc1e3jIlbaa2okhG0YBUKZ+/YpKGgJjzUmnneyowcxRJm6DW 6jRthk68ytVUzM6sh77z9yVlZ5e5B8aQ/MoNxhzWxjPegCa/OgwXJGGSl/BLJRDTvUrz SIWK4/R9Du0ulewEUbp9nuwXkJNeU36Yux5/o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678203171; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oAaIzsWI+DXQ807RCKvS+zEYcv/H3X+nOpua3UqPND8=; b=74dlXQw423tRScMNgIRzRDGJsK9TLIxG+vM5VmiyarP7s/ONRqGhmQcU0p6bKTnGTH 0rVWKkoJzWHimmIzu+/aLTAJJ+jXtBRdAAIIaOayp82LAW+sNSlCZRflKCAmOfWil0Pj CliLpkMW3jwt7EyVixfqUqa2Um+djqy80rG4NyVMgQmGR47TqLIbK7RKe5Nm6B0U7TM6 fAW4fMP1JNqJ6B4amOZih5B5yD4V6DcY9nYtMXirms3ooUm095p/kzAzRdvjlDOpfxQA j33TUrlNXZk4zDYfEi1L5Bs5kzuiam3UMoXcSXcXXYtCMW3gsogbT5vlFRRDuMtGrAnr gkuw== X-Gm-Message-State: AO0yUKX+WfmsU9TXgf8dSdH+ssMwS9Rcg7cQVAIcxXo9H3Dnb2nMrUOu gEQNVIwaiq8fHfGqZbC3exiDEw== X-Received: by 2002:a17:903:1c9:b0:19e:6fd5:f4fa with SMTP id e9-20020a17090301c900b0019e6fd5f4famr15192866plh.69.1678203171195; Tue, 07 Mar 2023 07:32:51 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2023:7dda:98bb:96dd]) by smtp.gmail.com with ESMTPSA id jy16-20020a17090342d000b0019719f752c5sm8586843plb.59.2023.03.07.07.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 07:32:50 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Greg Kroah-Hartman Cc: Jiri Slaby , Bartosz Golaszewski , Daniel Thompson , linux-serial@vger.kernel.org, linux-arm-msm@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Konrad Dybcio , Douglas Anderson , Andy Gross , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] tty: serial: qcom-geni-serial: Add a poll_init() function Date: Tue, 7 Mar 2023 07:32:13 -0800 Message-Id: <20230307073155.3.Ie678853bb101091afe78cc8c22344bf3ff3aed74@changeid> X-Mailer: git-send-email 2.40.0.rc0.216.gc4246ad0f0-goog In-Reply-To: <20230307073155.1.Iaab0159b8d268060a0e131ebb27125af4750ef99@changeid> References: <20230307073155.1.Iaab0159b8d268060a0e131ebb27125af4750ef99@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759724516589788071?= X-GMAIL-MSGID: =?utf-8?q?1759724516589788071?= On sc7180 Chromebooks, I did the following: * Didn't enable earlycon in the kernel command line. * Didn't enable serial console in the kernel command line. * Didn't enable an agetty or any other client of "/dev/ttyMSM0". * Added "kgdboc=ttyMSM0" to the kernel command line. After I did that, I tried to enter kdb with this command over an ssh session: echo g > /proc/sysrq-trigger When I did that the system just hung. Although I thought I'd tested this scenario before, I couldn't go back and find a time when it was working. Previous testing must have relied on either the UART acting as the kernel console or an agetty running. It turns out to be pretty easy to fix: we can just use qcom_geni_serial_port_setup() as the .poll_init() function. This, together with the patch ("serial: uart_poll_init() should power on the UART"), allows the debugger to work even if there are no other users of the serial port. Signed-off-by: Douglas Anderson --- drivers/tty/serial/qcom_geni_serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 74a0e074c2de..00752ff783c6 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1534,6 +1534,7 @@ static const struct uart_ops qcom_geni_console_pops = { #ifdef CONFIG_CONSOLE_POLL .poll_get_char = qcom_geni_serial_get_char, .poll_put_char = qcom_geni_serial_poll_put_char, + .poll_init = qcom_geni_serial_port_setup, #endif .pm = qcom_geni_serial_pm, };