From patchwork Tue Oct 30 22:11:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10661669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 112761751 for ; Tue, 30 Oct 2018 22:11:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0FF42A89E for ; Tue, 30 Oct 2018 22:11:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E36F02AA78; Tue, 30 Oct 2018 22:11:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 717432A89E for ; Tue, 30 Oct 2018 22:11:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728424AbeJaHG5 (ORCPT ); Wed, 31 Oct 2018 03:06:57 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:33677 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728352AbeJaHG4 (ORCPT ); Wed, 31 Oct 2018 03:06:56 -0400 Received: by mail-pl1-f195.google.com with SMTP id x6-v6so6246072pln.0 for ; Tue, 30 Oct 2018 15:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=D0pMcIsnEt81rWJlcRW0J2SRCGfulXloQ+oYP7/eotQ=; b=fplzpfYFb+xUQzs8XUx5+vyk0nIzHHGuq1bvJPRmsADpnQpHz/KU1UidUfKSq2pQx0 pyXxWlAjY6hYEi0alGsxZlEuPODEimHWPYRTh7pBpTmXIpDZZO78ZyoiWZITYEN981tE 5ytrE5e0RQWwfXr9VS1VkLEry0ZUA4L5jhudM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=D0pMcIsnEt81rWJlcRW0J2SRCGfulXloQ+oYP7/eotQ=; b=Qo6hRXfZ8muG8HvQunKEuLAc2NbEOc70rAYkpW1JxDDCzuo/a4nMgEWzx3Z3IhnuWC +8hiAvByyEk8MppB7mif8rh+k5Qfe6WZXjv/WuYC6NoD9ZzjRm0mFDmQLOlUiIa6nhGc bpShjDsT+EzJ2mDWDUACXY+enqqfml4dIKLTkDfdBybm2a4qiRX/k/qWSIe0eXHi0BRA PennI9yMhq25J6Eye2dJrjpsm73oIZbIbo269HSyxJYqTss8eVo6dvvEQ7TsJsozQ0C+ ssXY/SpgXppCYGayD3umKspbVcftUt+dWya7NOxaxHUZVpYOoJT2cWVUvgSOgh6hPlcD H9EA== X-Gm-Message-State: AGRZ1gIESUBt3vONjBwAdyF43fEVt916Wv1u5Bjv/C3s2JuRutmlrEZz JV/Gbq0c1HG8x3qEIEjthR49HQ== X-Google-Smtp-Source: AJdET5fzK1jhD9SwNhtjzDOLmFkI0NdcQiEmj7f9TY9L7R5uRwOQDbzF7X9+CRectRQC1C8P4+wkKw== X-Received: by 2002:a17:902:96a:: with SMTP id 97-v6mr516368plm.284.1540937501085; Tue, 30 Oct 2018 15:11:41 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:c8e0:70d7:4be7:a36]) by smtp.gmail.com with ESMTPSA id b11-v6sm12844491pgi.10.2018.10.30.15.11.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 15:11:40 -0700 (PDT) From: Douglas Anderson To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-arm-kernel@lists.infradead.org, vigneshr@ti.com, linux-aspeed@lists.ozlabs.org, andrew@aj.id.au, tony@atomide.com, joel@jms.id.au, linux-serial@vger.kernel.org, linux-arm-msm@vger.kernel.org, andriy.shevchenko@linux.intel.com, dan.carpenter@oracle.com, jk@ozlabs.org, Douglas Anderson Subject: [PATCH v2 0/5] serial: Finish sysrq on qcom_geni; fix sysrq vs. lockdep on 8250 Date: Tue, 30 Oct 2018 15:11:02 -0700 Message-Id: <20181030221107.79758-1-dianders@chromium.org> X-Mailer: git-send-email 2.19.1.568.g152ad8e336-goog MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I started out this series trying to make sysrq work over the serial console on qcom_geni_serial, then fell into a rat's nest. To solve the deadlock I faced when enabling sysrq I tried to borrow code from '8250_port.c' which avoided grabbing the port lock in console_write(). ...but since these days I try to run with lockdep on all the time, I found it caused an annoying lockdep splat (which I also reproduced on my rk3399 board). ...so I instead changed my qcom_geni_serial solution to borrow code from 'msm_serial.c' I wasn't super happy with the solution in 'msm_serial.c' though. I don't like releasing the spinlock there. Not only is it ugly but it means we are unlocking / re-locking _all the time_ even though sysrq characters are rare. ...so I came up with what I think is a better solution and then implemented it for qcom_geni_serial. Since I had a good way to test 8250-based UARTs, I also fixed that driver to use my new method. When doing so, I ran into a missing include in serial_core.h. NOTE: I didn't have a way to test msm_serial.c at all, so I didn't switch that (or all other serial drivers for that matter) to the new method. NOTE: from a serial point of view v2 is the same as v1 but I've removed the extra kgdb-related patches and made it obvious that this is really for all sysrq, not just kgdb. I've also generally tried to curate the CCs more properly. Douglas Anderson (5): serial: qcom_geni_serial: Finish supporting sysrq serial: core: Allow processing sysrq at port unlock time serial: qcom_geni_serial: Process sysrq at port unlock time serial: core: Include console.h from serial_core.h serial: 8250: Process sysrq at port unlock time drivers/tty/serial/8250/8250_aspeed_vuart.c | 6 +++- drivers/tty/serial/8250/8250_fsl.c | 6 +++- drivers/tty/serial/8250/8250_omap.c | 6 +++- drivers/tty/serial/8250/8250_port.c | 8 ++--- drivers/tty/serial/qcom_geni_serial.c | 10 ++++-- include/linux/serial_core.h | 38 ++++++++++++++++++++- 6 files changed, 63 insertions(+), 11 deletions(-)