Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1796057imm; Thu, 7 Jun 2018 00:04:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKMQeJiGI3U8neu3OIhED8VjpRd2y2HU6RSCtwXi4y83SEUhNVdCM1kWmQLym72Qxv7OIeY X-Received: by 2002:a17:902:9689:: with SMTP id n9-v6mr727504plp.363.1528355091358; Thu, 07 Jun 2018 00:04:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528355091; cv=none; d=google.com; s=arc-20160816; b=tI53tDeGDMOQDUeZ0kpRlEpCbxLRd8osJR1Li94dl+0aH87iXCdGgUTO+dgfTaatOP dpQWlbCOEeEN7crSX3zCuHY+7TLNbyfZCPG1FR9LCJBtiSb2Gxzp/cHo+IOgPusoc7n9 jQWmPSbXscfLkjpm6Vr0chB0yR/wzQc7QcGv7TR4AxZ+XG7CLQzMdvjwkzDxIzb1Xru6 zSWOLWqXa1j5gjtVkYSruK7LLQWbkh6dPOtAR+slQIY2sxGGfqNVmZBEMa+XI/V2BUxy jDt0U8Y4DRwbgJ+Fak6gr+FiFnaqv1c7UeyucSU5GiYh8ze9ajm1m/XilgP5CMgPMZcc 3o8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=VoitM8Xx0E3CEC04YfM5LZS2AeqLeaJqYhEnY6yZBvY=; b=vTMoTYlmaMUZLtgLpMndSeO0LGL2vVs4Oxk20ioUrJ8aIJl+RZmpcm/tYlTg1GnHr5 HEJZE9gbYUTDkB1YVGV8ILIrk6qJ+hHIW5mMLgJmT09Xy634Kojru7+gNCIwd8sMkcl4 B3heGJHKrTesP0mUQB2yqi/YihetSjjzBHs/YGkHeH9DpicZ85XplxN9mD4GMsoQEJ+d lTBLjnV9Pa+9BiDwDgB5Fo/DY9e4WLi/frMzCpaaJ3NV95bS7k8PUD2q686m8nGGX5K7 C4YqR4xl6AQfze3pGC2g3B8p65JddSWdV7/QmzQIEwEzHcQ4njQNkW+fXM3OiB6H8ZWv EPCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kk3+JKQ1; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6-v6si54018371plp.60.2018.06.07.00.04.36; Thu, 07 Jun 2018 00:04:51 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kk3+JKQ1; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753078AbeFGHEJ (ORCPT + 99 others); Thu, 7 Jun 2018 03:04:09 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:42966 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752565AbeFGHEH (ORCPT ); Thu, 7 Jun 2018 03:04:07 -0400 Received: by mail-oi0-f65.google.com with SMTP id k190-v6so7634375oib.9; Thu, 07 Jun 2018 00:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VoitM8Xx0E3CEC04YfM5LZS2AeqLeaJqYhEnY6yZBvY=; b=kk3+JKQ1FCkQepXeCwfcjgJW9z5brylVRVEaqQML/8XkqET54K5XPAKVqC9OzFAMEE UFHqgYOq8NajN0ylZzJst10QMbjWD7XHCFZyi8sN9rcxBPAG3dBGTGUqAQjXs3xRwjGV Ark+0h8tVZfqxdlWhePTYFYTuO9row3l0BPu+In8eShQhMeBWeusKQdlS7zmAwAKp88o UMcOs8yNXp3D9xw/vU6bEH7k/4wQgIEnMO+RIDq6+fM5j/QmMmQJyQZIY730SmAmUwZK J9OIxcXVkWpUPWsXs6k3F5EanC49dumApJY26vyn5mKzCeuA2WKqLC4TcCX2GIgbcsI6 alpQ== 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:content-transfer-encoding; bh=VoitM8Xx0E3CEC04YfM5LZS2AeqLeaJqYhEnY6yZBvY=; b=tcu3PV88Vk8RQv04oMIpfwSF/mucbj++1nyr4olxfksBPW2LnuUJWVJ3fH+FMJJB4o b2I2MmruFEtj3cuuEfYfll/jdHbfRHL/tbmPsgcJipcTdvpo/Y1rv8e91jy6XGMaochF VW6Inbsw3vDPdp/KbjWYXlDxB1xXQRGHIXp95zBya9yWP3OIJ7aHKRMjq6HZP0/0peTH pcQ8VMKgdeKfJQv9FZo69K0o7KUIFgOJvUWM/ckJuxWs45hmTsWwb/ANqrXmb+c88oyY Ll25eFAw23LMo9GS3EIjP9eQo45PEnlrEf1tbmqSk33ugHqvyAJhAsCRahSptwjXczH5 i96g== X-Gm-Message-State: APt69E3ztZ0QEI7mrk2Uc4sSsm7ydayVzGT6MVQhTacohCobNLm2eWn3 YZBEeMcvOyvPWajTtTTkgcklKKnvRk5wm9GuMAo= X-Received: by 2002:aca:ea55:: with SMTP id i82-v6mr318388oih.260.1528355046250; Thu, 07 Jun 2018 00:04:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:743:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 00:03:45 -0700 (PDT) In-Reply-To: References: <20180606094942.71190-1-giulio.benetti@micronovasrl.com> <20180606094942.71190-4-giulio.benetti@micronovasrl.com> <069f5cd3309e83d13c74929f240720b232ea7251.camel@linux.intel.com> <0bc400b1-6178-2021-c9a3-3190d1a1de32@micronovasrl.com> <2abe2137e699e5ae3100b97316da469f6d1c9bb9.camel@linux.intel.com> From: "Matwey V. Kornilov" Date: Thu, 7 Jun 2018 10:03:45 +0300 Message-ID: Subject: Re: [PATCH 1/4] serial: 8250: Copy em485 from port to real port. To: Giulio Benetti Cc: Andy Shevchenko , Greg Kroah-Hartman , Jiri Slaby , Matthias Brugger , Kees Cook , Allen Pais , Sean Young , "open list:SERIAL DRIVERS" , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-06-06 22:15 GMT+03:00 Giulio Benetti = : > Il 06/06/2018 20:55, Matwey V. Kornilov ha scritto: >> >> 2018-06-06 16:11 GMT+03:00 Andy Shevchenko >> : >>> >>> On Wed, 2018-06-06 at 14:15 +0200, Giulio Benetti wrote: >>>> >>>> Il 06/06/2018 13:56, Andy Shevchenko ha scritto: >>>>> >>>>> On Wed, 2018-06-06 at 11:49 +0200, Giulio Benetti wrote: >>>>>> >>>>>> em485 gets lost during >>>>>> >>>>>> Copy em485 to final uart port. >>>>>> >>>>> >>>>> Is it needed at all? >>>>> >>>>> The individual driver decides either to use software emulation (and >>>>> calls explicitly serial8250_em485_init() for that) or do HW assisted >>>>> stuff. >>>> >>>> >>>> In 8250_dw.c, during probe(), I need to call dw8250_rs485_config() >>>> against local struct uart_8250_port uart =3D {}; >>>> Inside serial8250_register_8250_port() not all uart fields are >>>> copied(em485 too). >>>> So after probe, em485 is NULL. >>>> >>>> Another way could be to call dw8250_rs485_config() against real uart >>>> port, after calling serial8250_register_8250_port(), >>>> would it make sense? >>> >>> >>> Look at OMAP case closely. They have a callback to configure RS485 whic= h >>> is called in uart_set_rs485_config() which is called whenever user >>> space does TIOCGRS485 IOCTL. >>> >>> So, it's completely driven by user space which makes sense by my >>> opinion. >> >> >> AFAIU, Giulio wants to add support for rs485-enabled-at-boot-time >> device tree option (see bindings/serial/rs485.txt for reference). > > > Yes, I want to add support for "rs485-enabled-at-boot-time" property, > maybe I had to write better commit log and a cover letter. Sorry. > >> I suppose it is only important for use-case when rs485 used as slave >> (peripheral role). > > > It's important also for master, because RTS, if RTS_AFTER_SEND is set, > remains not asserted(trasnmission) until userspace opens that serial port= . > And it makes no sense, because how are you going to transmit and receive not opening the port and not running an application? It is master who transmits the data first. So, before all systems going to work you have to open the port from userspace. In case of slave this of course makes sense. > Sorry again for not explaining myself well. > > > -- > Giulio Benetti > CTO > > MICRONOVA SRL > Sede: Via A. Niedda 3 - 35010 Vigonza (PD) > Tel. 049/8931563 - Fax 049/8931346 > Cod.Fiscale - P.IVA 02663420285 > Capitale Sociale =E2=82=AC 26.000 i.v. > Iscritta al Reg. Imprese di Padova N. 02663420285 > Numero R.E.A. 258642 --=20 With best regards, Matwey V. Kornilov