From patchwork Wed Jul 26 13:26:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 9864787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6A11602B1 for ; Wed, 26 Jul 2017 13:26:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2FE928740 for ; Wed, 26 Jul 2017 13:26:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D774928758; Wed, 26 Jul 2017 13:26:28 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 4718428772 for ; Wed, 26 Jul 2017 13:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421AbdGZN0Z (ORCPT ); Wed, 26 Jul 2017 09:26:25 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:37034 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbdGZN0Y (ORCPT ); Wed, 26 Jul 2017 09:26:24 -0400 Received: by mail-vk0-f65.google.com with SMTP id r199so1110571vke.4; Wed, 26 Jul 2017 06:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tlu62j5bnziZToCDTGDL5vnlQCAWVZNO65C5OebJgXI=; b=Fed/p5BaUxffkBtEJwXjqWeBfrCWYc4TTh0yoLF4BkPRr1EJY5AooSg6J4RM0itSRx jsqbiq+fJzsQyQIsIw/aZ+HtZgH9+BSYSXkyAnGacZZH6cjJmdSfQaZlFWDLN6cWxogd U6v8QD9NuFEA/39oShTgUeFjaX+wXvkH7H9aTvXNHC+rVuQwgHs2mWoYjI6O+ODBySwi Oy1cgTv8QbKb2GDjd6iigWrl2dNFtQY8sg6R4hBDkGVoYeftCggXwDFuwKnWziTHdr1h AWvpagZAyGF1aWv6zAibV/eywOyebvkFXyTOKsLiaGiCvbGzIn1uvTQSQqXl8oquL/2f we5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tlu62j5bnziZToCDTGDL5vnlQCAWVZNO65C5OebJgXI=; b=IQotFAnahCFSR8dq10Cu5Z609P1vf9+sEYQhbSMM2tG/a81Wi0Z/uYeYQYzWQJHYJm PXbWiLShXHmWVkTsjlZfpFo1LE6C+fbJoTJY1uE9NL7+gmgd2REoXS0lFHW04h+Kfsll 28F/ny8xREdgVdPW9dfdsfQLsdHs3g+pDpx3pkNypZceCLB6VV0caAKRLOznI5VL8WET uY4/BWuF5xf+VWotLSOZcZRdwDqQ1mruWSDky0kOnGpsIHj5gR/eZi6mWQ/6uv1P1Cma Qp5JOyTxtR0j9+J310fAm39QKe77RtTcr+evURsb5bztlgWA3U3w8q5gghdLYGeMHvNH GOQA== X-Gm-Message-State: AIVw11231T1gjd9bONNbtWWARe5/o87FQ3f8IitJaYjt3jU0zU1O5ExS 6th5Enzt+7KBNqo9uhcJrZXPhPc8kcai X-Received: by 10.31.97.135 with SMTP id v129mr530145vkb.51.1501075583875; Wed, 26 Jul 2017 06:26:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.94.110 with HTTP; Wed, 26 Jul 2017 06:26:03 -0700 (PDT) In-Reply-To: <1500974314.29303.222.camel@linux.intel.com> References: <1500921580.29303.220.camel@linux.intel.com> <1500974314.29303.222.camel@linux.intel.com> From: Yegor Yefremov Date: Wed, 26 Jul 2017 15:26:03 +0200 Message-ID: Subject: Re: 8250: Use mctrl_gpio helpers To: Andy Shevchenko Cc: "linux-serial@vger.kernel.org" , Greg Kroah-Hartman , Mika Westerberg , "Jarkko Nikula (jarkko.nikula@linux.intel.com)" , "linux-omap@vger.kernel.org" , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Peter Hurley Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Jul 25, 2017 at 11:18 AM, Andy Shevchenko wrote: > On Tue, 2017-07-25 at 07:43 +0200, Yegor Yefremov wrote: >> On Mon, Jul 24, 2017 at 8:48 PM, Yegor Yefremov >> wrote: >> > Hi Andy, >> > >> > On Mon, Jul 24, 2017 at 8:39 PM, Andy Shevchenko >> > wrote: >> > > Hi! >> > > >> > > Since my big ACPI GPIO fix made the vanilla, I think we may return >> > > back >> > > the commit 4ef03d328769 ("tty/serial/8250: use mctrl_gpio >> > > helpers"). >> > > >> > > I just have tested it on two x86 boards: >> > > 1) Broxton (without _DSD properties) >> > > 2) ApolloLake (with _DSD properties for RX and CTS pins) >> > > >> > > Opinions, more testing? > > Alas, I did more deep testing and the patch breaks the console. > > It looks like we need to distinguish what those GPIOs are used for: > a) modem control lines, or > b) wakeup source. > > There are few options to distinguish: > 1) check if GPIO resource is marked as wakeup source (ACPI only) > 2) use "wakeup-source" device property, for now looks like there is no > serial driver is using it (might be collision with the real wake capable > serial drivers) > 3) similar to 2), though introduce another property like "oob-wakeup- > source" or any variations of that > 4) something else? > >> > > >> > > I would like to have more independent testing (Mika? Others?). >> > > >> > > Btw, Yegor, do we still need it? >> > >> > Yes, I do. Thanks for looking at it again. This is almost the only >> > part missing before Baltos systems could be copletely upstreamed. >> > >> > Yegor >> > >> > > P.S. I cherry-picked it on top of recent linux-next and tried. I >> > > can >> > > send a formal patch, but I think it's not needed (it applies >> > > smoothly). >> >> Btw have you also tested this patch [1]? >> >> [1] http://www.spinics.net/lists/linux-serial/msg24053.html > > See above. This patch basically is not needed anymore, we need something > else. AFAIK this patch was needed in order to avoid serial port breakage, where some modem signals were defined in ACPI tables. Mika and some other devs reported the issue as "tty/serial/8250: use mctrl_gpio helpers" was part of the kernel. Perhaps I should just augment my patch like this? if (mctrl_gpios_desc[i].dir_out) flags = GPIOD_OUT_LOW; Yegor --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index d2da6aa..a6245efb 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include @@ -124,6 +126,12 @@ struct mctrl_gpios *mctrl_gpio_init_noauto(struct device *dev, unsigned int idx) for (i = 0; i < UART_GPIO_MAX; i++) { enum gpiod_flags flags; + char mctrl_property[10]; + + sprintf(mctrl_property, "%s-gpios", mctrl_gpios_desc[i].name); + if (!device_property_present(dev, mctrl_property) || + of_property_read_bool(dev->of_node, "wakeup-source")) + continue;