Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp797961imm; Wed, 6 Jun 2018 06:12:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ3QCU7njQUaBXbepk+c/R7V6cRsNUfFkR8Tz6pb7Xqidzc0Isb43qUWY02fAl6JEFCXF54 X-Received: by 2002:a65:5d09:: with SMTP id e9-v6mr2576343pgr.150.1528290774643; Wed, 06 Jun 2018 06:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528290774; cv=none; d=google.com; s=arc-20160816; b=E8YNQpiiruaneT5HAZBA/AxJtSE1XKv8AM0VMAzYeKXHkEbjCbInw+pE+D4TQqF3v9 5wDjz+4AjQAuwKeg850JIV4lxSqfaRHbytdBaVhfDGxA+S+DOS19FijyR0exM0pYSzpt 2E23NBDX5IvR25FlL2zxJwSE8gliDNOXnEMHpMcOsJXnxS1RvHuggR6m2s7eZ9tvgQz2 tuRC6gmPHklogxWy6yNDTLy0SAyx3XgGX6L0P/zdVwtxICnmuho6HSC1TFc4hvoXSZDm h5IVVyqsFmHK09+X0TyRZo/sjSpWJbTem37nWnqWT7AKuXm4nXu5LhPnhNcf56AWI27O DiCQ== 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:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=fMWvMlkPftRP+5g/h5T1fm2Hpdbb4TGFAch8fBgZoWw=; b=L1hO/xmgzeKgqkFmaMqn72WB9/D4InCtABsp/zmBtYQQs3dGaX9/ELBtE7j0ERv3AI zQGBWDWjPWE31CjQthWDqkprYYSRvgivPTrplKsEDKYXxRPMyC0cS26rnQAngKYL+74v dr0c02Jnb+lpM89CXFllk/KU4NgMGShQypzUQiZdyiYiKKUPUg4sdQDUkmiP2kWJZRfO slb3U8ppGWkQRcn3kRPP9dCC1EQZn99MKwkH45arhNaHtM0qxXuYVOCQ5MU9P7lTWB5u wRDr1J7GLhbPNuas46dHbKnxJQetWeUIsFOLPlpfA7Ese8GV2bHM7edodmnoxt5Uyi6v /YNw== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2-v6si40494801pgq.278.2018.06.06.06.12.40; Wed, 06 Jun 2018 06:12:54 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752142AbeFFNLx (ORCPT + 99 others); Wed, 6 Jun 2018 09:11:53 -0400 Received: from mga07.intel.com ([134.134.136.100]:28426 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751851AbeFFNLu (ORCPT ); Wed, 6 Jun 2018 09:11:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2018 06:11:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,483,1520924400"; d="scan'208";a="46874170" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga007.jf.intel.com with ESMTP; 06 Jun 2018 06:11:47 -0700 Message-ID: <2abe2137e699e5ae3100b97316da469f6d1c9bb9.camel@linux.intel.com> Subject: Re: [PATCH 1/4] serial: 8250: Copy em485 from port to real port. From: Andy Shevchenko To: Giulio Benetti Cc: matwey.kornilov@gmail.com, Greg Kroah-Hartman , Jiri Slaby , Matthias Brugger , Kees Cook , Allen Pais , Sean Young , "open list:SERIAL DRIVERS" , open list Date: Wed, 06 Jun 2018 16:11:46 +0300 In-Reply-To: <0bc400b1-6178-2021-c9a3-3190d1a1de32@micronovasrl.com> 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> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = {}; > 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 which 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. -- Andy Shevchenko Intel Finland Oy