From patchwork Mon Jun 22 14:26:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 191336 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1092844ile; Mon, 22 Jun 2020 07:27:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9CkOD5Tge/dx+BC/SZ1XXhkt6xBKQiekbIc6cEmNLemefUipZXPRhKWAZY1v0dh4O4Hyh X-Received: by 2002:a17:906:3154:: with SMTP id e20mr16598509eje.171.1592836068977; Mon, 22 Jun 2020 07:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836068; cv=none; d=google.com; s=arc-20160816; b=HDcH2+gEhwUTT1TrHowTc1P3SL8UuVSON/+tJU2aNmXmGYQ4b59u9TzyptrwAsHNg4 ukTxKR4FGY+dck1+1x3mr3RPZCt0JB6Mq2IST27Z5KtJZyG5y2bMFPdPn/pyn8QZ3Wti HiZVVVsOY3eSF6E8MV33q2Goi+zZPRohRY5im7jinh5XB3nkpKDucw/F5bwYFbvsx2+I +Y1gxf8mwqBJGnrddR/zoMrwOSz59zwiQ5plwaFpL0FqaUptcIGql6tnMH3MdjKXcxwE 8owwalnL+HQGwnODGYGs+aW6Cjb3pl8LlMnOhw8OAKpyjH7hstkxLX2o4o+1P/Y4zRau 7KSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Q8XZGlRV/H7ipjUMwZ0R6upcC6zi/GhiQnizl6ayNWQ=; b=m8j8vRV2T+3EBto/PSAFFo1no0li9+Jp1iX12gsMNtu4HgbNRfArQ+AHM51t/J2t5p Uw4vRyJSOp+m++CNDr+mqMcYvy2G8G2+SvSChYrgVA4a1d8xiB9R4oIn7PL4x5/St3o4 Fjl7+Fdap7cGjEeLxMHBVzhxN4vzew+dOXWDv9wCrHAvqmcVtaG5bVs412h/xpxgE578 CqvF46+zkzLirW7f4EX90ytOOqmmKw5lGorgTCPzsdunmrw6Q3jGC/0jj1hWBlokLP07 CDnC+hRw0N2fOiXuuYTp5NMO2/1YqmGB3bsUPSiv3FsGzYVYkd1voCy3tnleJuba4pS5 dG/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iES2Z3LS; spf=pass (google.com: domain of linux-serial-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-serial-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 y16si9037717ejr.344.2020.06.22.07.27.48; Mon, 22 Jun 2020 07:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-serial-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=iES2Z3LS; spf=pass (google.com: domain of linux-serial-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-serial-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 S1729783AbgFVO1q (ORCPT + 1 other); Mon, 22 Jun 2020 10:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729799AbgFVO1p (ORCPT ); Mon, 22 Jun 2020 10:27:45 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEB73C061573 for ; Mon, 22 Jun 2020 07:27:45 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id d10so5753809pls.5 for ; Mon, 22 Jun 2020 07:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q8XZGlRV/H7ipjUMwZ0R6upcC6zi/GhiQnizl6ayNWQ=; b=iES2Z3LS/+1ufp5YulU7Lewvw1bchggk2aWycD2ouwUfDqw/J2BDmhkYLoA5Q8Xi1/ czE87Id/eTsr/WIJUHU8BJT+s05ule9+LYv0Ido5T4GknU8qZXkBGUNrJUw9Yoc9s4/b GbKx6DlF9lfyzRTu+u41x/JFhfpsQDL13xVlQtBdo9b5QcM3gFxunzDEApVgBt2ZCiMC fe4kGGgabD666+6T0pGDqHa2rTr0hbLHGBP9dQ91Z9MHTbd+skiPXa44ljD14bUyQwDe IqyvhXNM6ncGGDSSPex+2Zmrr3VIqDY+mSqst1UwK3XIJ5tQNVugk+49gE/f2ylISQlv Zfzw== 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:in-reply-to :references; bh=Q8XZGlRV/H7ipjUMwZ0R6upcC6zi/GhiQnizl6ayNWQ=; b=lDJZHEskMkBUqgfWceurRmu1ibsgU9o/05KGpl1QAdiTW+O54PNHUSqj5Of7H9xHIi Bl3q2z2jRxHrHcdIqP2V5NjYLFh4VTgNZ3IQ+iPJgmfFZrcp4YuSIBpAHmxzqvtAWwLk 1JJUP0pW5QJ7f0n0Q9QlQOpnBzhOzU9p8Xn6tHoDlK1q1Rrs2c3DYVBY4e/vGl/MQBR5 VbRQ582Zw0oy2f1JSwqpGGSyoz8ZTo6GgDcBIWytCHSrHoEOwpmkkT1ei92OfHeUCBaw gcNlrseB8uh7Ll57A9MmaKWqIPxh0bhES4uinGFDcvG4SUJBvmy9ZR0P+Qtu5mpOmhGB ux4A== X-Gm-Message-State: AOAM5310oUXXob+x/L4SXLSjfwLfP18RdUadX4kuKdB82ithcJqn4Mca 2exD/J0aQQsVooBNS21phGsA0g== X-Received: by 2002:a17:90a:36cf:: with SMTP id t73mr19089365pjb.100.1592836065367; Mon, 22 Jun 2020 07:27:45 -0700 (PDT) Received: from localhost.localdomain ([117.252.67.186]) by smtp.gmail.com with ESMTPSA id d6sm14547939pjh.5.2020.06.22.07.27.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2020 07:27:44 -0700 (PDT) From: Sumit Garg To: kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org Cc: gregkh@linuxfoundation.org, daniel.thompson@linaro.org, jason.wessel@windriver.com, dianders@chromium.org, jslaby@suse.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, Sumit Garg Subject: [PATCH 5/7] serial: 8250: Implement poll_get_irq() interface Date: Mon, 22 Jun 2020 19:56:22 +0530 Message-Id: <1592835984-28613-6-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592835984-28613-1-git-send-email-sumit.garg@linaro.org> References: <1592835984-28613-1-git-send-email-sumit.garg@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Daniel Thompson Support kgdb NMI console feature via implementing poll_get_irq() interface. This will allow usage of RX interrupts to support kgdb entry while serial device is operating in polling mode. Signed-off-by: Daniel Thompson Signed-off-by: Sumit Garg --- drivers/tty/serial/8250/8250_port.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.7.4 diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index f77bf82..1473b1a 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2138,6 +2138,21 @@ static void serial8250_put_poll_char(struct uart_port *port, serial8250_rpm_put(up); } +static int serial8250_get_poll_irq(struct uart_port *port) +{ + unsigned int ier; + struct uart_8250_port *up = up_to_u8250p(port); + + serial8250_rpm_get(up); + + ier = serial_port_in(port, UART_IER); + ier |= UART_IER_RLSI | UART_IER_RDI; + serial_port_out(port, UART_IER, ier); + + serial8250_rpm_put(up); + return port->irq; +} + #endif /* CONFIG_CONSOLE_POLL */ int serial8250_do_startup(struct uart_port *port) @@ -3141,6 +3156,7 @@ static const struct uart_ops serial8250_pops = { #ifdef CONFIG_CONSOLE_POLL .poll_get_char = serial8250_get_poll_char, .poll_put_char = serial8250_put_poll_char, + .poll_get_irq = serial8250_get_poll_irq, #endif };