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: 10661683 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 D7BEE1751 for ; Tue, 30 Oct 2018 22:12:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6C872A89E for ; Tue, 30 Oct 2018 22:12:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B91132AA78; Tue, 30 Oct 2018 22:12:09 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 618032A89E for ; Tue, 30 Oct 2018 22:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pHJmcjQSXiBN4U8Vkmi9ChP7fp2idqAyvY4/zZlgQl8=; b=PFllwkBos6goLC A00KSzoEHNPaIbscFcoRPNe14dSTBqQ55RwIS/GKBnjIwI4+nVCI0sCbzbuz7kxOid+I3G2PO+J2w mpWQ9oFG4SiXs0/kdItrcQqkYo6sYrULOwlKu4gQ0YUK03jn9f/sWJDHpM63TUvvTAwCFMYt1KiEJ e3qyoOMhR0MNH+oXStOZRBbOXsAVYhJDhYtXaE0tpoohoUeUfyeadGI/aeE8eZHrsnoXtRTl0SK/h wE1WM33UdomD62FZwPKl9dJ9We9ht45UXOfpuVzG7XnFHdqBD8qYr+zhjzoDlS7Iel4HOZowbvrlR HXXa2z17XzbpjN7JBruA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHcF0-0007J8-Es; Tue, 30 Oct 2018 22:12:02 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHcEq-00078C-G3 for linux-arm-kernel@lists.infradead.org; Tue, 30 Oct 2018 22:11:53 +0000 Received: by mail-pl1-x643.google.com with SMTP id b9-v6so6224351pls.7 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=bYF4VCMU/PHv1J6eZwiBEKkX7jOka4Dn33Wt9SBojnLJ1TnH6RyT8cCY/fgeog7zi8 5MvwpKd/rJNOKfmTjdXpwsF55kaaVqjp/AUxmM6hgx4E4dyX3h7EdIBhNykFHcIEeLZn xF71aeQ18N00//flv9kbVVZ4SBb94VtKKi+mZJh0AGsNBl31Sp+8W3VXIv2ATh/aIN9S dZ9/i3+GDkL96hpgrJDfup4svdrebqk8K95TL1smyNOqX3AK71EbT0G6mKAvU0OTRjNO J1EzWfvJ7pdu6Wh4gWXyxTYpFR15eskcimHRi8YV1iSWcqzHxTVWc4kzpK8k1A+4hvWS wmhw== X-Gm-Message-State: AGRZ1gJqpXSRKDOxmHwJUdQHcN1r3dru6+U4Aq+WePxHjjQu6gPH50jm tNVihllKcJ/p4RidHXm6ijTjGA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_151152_561283_90EF385A X-CRM114-Status: GOOD ( 13.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dan.carpenter@oracle.com, vigneshr@ti.com, linux-aspeed@lists.ozlabs.org, andrew@aj.id.au, linux-arm-msm@vger.kernel.org, Douglas Anderson , tony@atomide.com, joel@jms.id.au, linux-serial@vger.kernel.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, jk@ozlabs.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-)