From patchwork Wed Aug 24 23:24:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 74639 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp558021qga; Wed, 24 Aug 2016 16:26:05 -0700 (PDT) X-Received: by 10.98.22.212 with SMTP id 203mr10646291pfw.74.1472081165504; Wed, 24 Aug 2016 16:26:05 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e184si11924874pfa.193.2016.08.24.16.26.05; Wed, 24 Aug 2016 16:26:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755738AbcHXX0C (ORCPT + 27 others); Wed, 24 Aug 2016 19:26:02 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:32824 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932436AbcHXXYo (ORCPT ); Wed, 24 Aug 2016 19:24:44 -0400 Received: by mail-oi0-f68.google.com with SMTP id s207so3061699oie.0; Wed, 24 Aug 2016 16:24:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z9qeRk5FO9oHR8u15kkI+9hlbNGeZHhpGXXKrxVQBB8=; b=CWmpTa+zzJlRoeprdqintC7Uy67yL28dTqunFF8h+cPs239DNZjtmsfIMJS9gWTzvs Y4KUclX3DhOF+CXhs8QxH+qnjrmSo8L4poUCPaJvb8qbB2uJSY/SpawaRxypw0mwrgsE iCceaEgQLEQYOVIZl+WY3Zyl/KO0PMwgcZwGcmNuDD1dOEnUNppsoEtApy64Rkhs7XG4 EOrPPCWWusdEhi57eixBTXU/0/EajQ1w9oTYpk/gGISu6MDVlUpiVP8jhTaPEeL4PLEZ qq2gWHu039IMA10S/oQOzI7PcJ3ihgya33NHGWC5otzmXZn7nexc/TUcwdpKCxliQf+a Cp/g== X-Gm-Message-State: AEkoouui7emEHAVf9TZ2qvPLlvseGM0E2pzS/Opk7Fj3YJkEi6xePkgaQojvGaDQEN30Hg== X-Received: by 10.157.16.100 with SMTP id o33mr4523320oto.90.1472081083123; Wed, 24 Aug 2016 16:24:43 -0700 (PDT) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id a5sm1322910oii.3.2016.08.24.16.24.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Aug 2016 16:24:42 -0700 (PDT) From: Rob Herring To: Greg Kroah-Hartman , Marcel Holtmann , Jiri Slaby , Sebastian Reichel , Arnd Bergmann , "Dr . H . Nikolaus Schaller" , Alan Cox Cc: Loic Poulain , Pavel Machek , Peter Hurley , NeilBrown , Linus Walleij , linux-bluetooth@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/6] serio: serport: hacks to get DT probe to work Date: Wed, 24 Aug 2016 18:24:33 -0500 Message-Id: <20160824232437.9446-4-robh@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160824232437.9446-1-robh@kernel.org> References: <20160824232437.9446-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For DT matching, the serio->dev.parent is expected to be the UART device which is the tty's parent device. Not sure if this change has any side effects, but this is all just for testing. The spinlock causes deadlocks if serio_write is called from interrupt handler as write_wakeup gets called. This could be fixed by clearing TTY_DO_WRITE_WAKEUP if the spinlock is locked, but just doing quick hack for now. Signed-off-by: Rob Herring --- drivers/input/serio/serport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.3 diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c index 9c927d3..a938c2b 100644 --- a/drivers/input/serio/serport.c +++ b/drivers/input/serio/serport.c @@ -183,7 +183,7 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, u serio->open = serport_serio_open; serio->close = serport_serio_close; serio->port_data = serport; - serio->dev.parent = tty->dev; + serio->dev.parent = tty->dev->parent; serio_register_port(serport->serio); printk(KERN_INFO "serio: Serial port %s\n", tty_name(tty)); @@ -253,10 +253,10 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty) struct serport *serport = (struct serport *) tty->disc_data; unsigned long flags; - spin_lock_irqsave(&serport->lock, flags); +// spin_lock_irqsave(&serport->lock, flags); if (test_bit(SERPORT_ACTIVE, &serport->flags)) serio_drv_write_wakeup(serport->serio); - spin_unlock_irqrestore(&serport->lock, flags); +// spin_unlock_irqrestore(&serport->lock, flags); } /*