Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754188AbbLDRut (ORCPT ); Fri, 4 Dec 2015 12:50:49 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:35818 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbbLDRur convert rfc822-to-8bit (ORCPT ); Fri, 4 Dec 2015 12:50:47 -0500 MIME-Version: 1.0 In-Reply-To: <56609BBC.8010806@hurleysoftware.com> References: <1447338836-8785-1-git-send-email-matwey@sai.msu.ru> <1447338836-8785-3-git-send-email-matwey@sai.msu.ru> <20151112195707.5e9cb1d8@lxorguk.ukuu.org.uk> <5644F4F2.2080408@hurleysoftware.com> <20151114152536.693d964c@lxorguk.ukuu.org.uk> <564A2BF5.8030305@hurleysoftware.com> <564CC472.8010505@hurleysoftware.com> <565F7CA2.5030505@hurleysoftware.com> <56605491.1070206@hurleysoftware.com> <56609BBC.8010806@hurleysoftware.com> From: "Matwey V. Kornilov" Date: Fri, 4 Dec 2015 20:50:25 +0300 X-Google-Sender-Auth: gS0L0tUUOCalj0Y5mkfrcmS-P3Y Message-ID: Subject: Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag for struct serial_rs485 To: Peter Hurley Cc: One Thousand Gnomes , Greg KH , jslaby@suse.com, linux-kernel , linux-serial@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2956 Lines: 89 2015-12-03 22:45 GMT+03:00 Peter Hurley : > On 12/03/2015 12:29 PM, Matwey V. Kornilov wrote: >> 2015-12-03 17:41 GMT+03:00 Peter Hurley : >>> Hi Matwey, >>> >>> On 12/03/2015 12:50 AM, Matwey V. Kornilov wrote: >>>> I am working on v4, where I completely redesigned implementation. And >>>> now I think that it is considerably better than v3. >>>> It looks like the following: >>>> https://github.com/matwey/linux/commits/8520_rs485_v4 >>>> But it is not ready yet, there is a bug somewhere. >>>> >>>> In the v4, each subdriver decides separately if it needs rs485 >>>> emulation support. Then it enables it like the following: >>>> https://github.com/matwey/linux/commit/4455e425fc045713fb921ccec695fe183f1558f0 >>>> Before calling serial8250_rs485_emul_enabled, the driver enables >>>> interrupt on empty shift register (they are always there for omap_). >>> >>> Looks good. >>> >>> Are you testing with CONFIG_SERIAL_8250_DMA=n first to simplify the >>> debug effort? DMA adds a completely different tx path. >> >> Many thanks for the advice. I've just found that the bug is not in my code =) >> Even with pure 4.3.0 I cannot open /dev/ttyS5 more than once. It just >> hangs on open() and the process is in S+ state. > > Hmm, that's odd. So > > $ stty -a < /dev/ttyS5 > > hangs if something like below is running? > > $ cat > /dev/ttyS5 > Nonblocking mode works, blocking mode hands on tty_port_block_til_ready https://bugzilla.kernel.org/show_bug.cgi?id=108851 > >>> Also, before submission, please shorten the identifiers. And Greg hates >>> functions returning bool so just expanded serial8250_rs485_emul_enabled() >>> inline. I would like to keep it as API to hide implementation details. In other words, I don't want to inline it in omap_8250_rs485_config. >> >> Am I allowed to use `re' instead of rs485_emul in names? > > Long names and constructs tend to obscure the execution flow. > Some of the names could be reduced where the meaning is obvious: > > serial8250_rts_on_send > serial8250_rts_after_send > serial8250_handle_start_timer > serial8250_handle_stop_timer > > These two I would inline into their lone call site: > > serial8250_rs485_emul_startup() > serial8250_rs485_emul_shutdown() > > serial8250_rs485_emul_start_tx => __start_tx_rs485 > > rs485_emul => sw485/em485/emul485/soft485 ? > > Or just rs485 (except for the field name and structs so as not to confuse > it with the port->rs485) > > Just my 2ยข > > Regards, > Peter Hurley > > -- With best regards, Matwey V. Kornilov. Sternberg Astronomical Institute, Lomonosov Moscow State University, Russia 119991, Moscow, Universitetsky pr-k 13, +7 (495) 9392382 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/