Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp732725imm; Wed, 6 Jun 2018 05:16:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLMHYlvZjL3KjQe5c/x6nv81FAAiffjbF04n5i+6S3X6oZGjcsiqJxq8N02qdm2Ey5Wkoym X-Received: by 2002:a63:7f5c:: with SMTP id p28-v6mr2378675pgn.64.1528287375548; Wed, 06 Jun 2018 05:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528287375; cv=none; d=google.com; s=arc-20160816; b=GoKFOIFLvt/lFnWDhANJv/9fastHWSGMsxYJpbBlNnEyHglRXw9UD2GoHhEAdLkDBa hgKNh6knYHuiRMu2vlwUses69BOV7GjdCOoXbNSMQxn26BA2OnGkMD6Y77mGmgeR2a00 XL945rny+7nwDSvvrRsGganBb8bLW82mOOrAU+ZB1eo9oo0JtWxNXYjgk6K/QaNKI2JD gTA+fBQLjvcSC1XsFSwelqh/LvYB+xaIuL0TBmnOwnllgMg5zdm2NHE76W4NOOW0Tb3S uEGvLV7Dok+Qvn4xSZ18R2+tJJTqp6X76AEfr5WDikYo6DOzhpw9TpaFWeTwP4YU1YCp SZGA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=STLmKYkmalFQya+si6JVfSEf4w0cQ8oaZdpWDmCZ4/k=; b=Ic2xMdjMkgJFrW7tI3UCnWOp72749NtdNBM6iOnok83uRVIuygj7IOT3BiZrn98+pa UJXZUGT+T4CtYf6FT45hs5GxM+7y1qLf6/ySb4hvA+unYYtc5hCnU6CI56xeq66Chpy5 rzvTOs2A+PxvHmci8xh/eK//0vo3JROwQcFfHHmcm4KQE6tjwacYVTegdUBItkm5ZvGz YCAMXC8XjpMY2OohW0Ko3GeQrIb6pPq8glLE8RN29efBQERNvO4Vk4Fm/Tegor5Gy2aG yBlq08nhxOPF+Ga0Mfdc6weeZRbRFVuwecgiQk4Ni8+MaxTzUJCDvKTIVtdLqcvMeoSa e1oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=J51/VRhq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14-v6si41651569pgc.216.2018.06.06.05.16.00; Wed, 06 Jun 2018 05:16:15 -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=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=J51/VRhq; 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 S1752021AbeFFMP3 (ORCPT + 99 others); Wed, 6 Jun 2018 08:15:29 -0400 Received: from mail.micronovasrl.com ([212.103.203.10]:60514 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbeFFMP1 (ORCPT ); Wed, 6 Jun 2018 08:15:27 -0400 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id 63369B0072E for ; Wed, 6 Jun 2018 14:15:26 +0200 (CEST) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:to:subject:subject; s=dkim; t= 1528287325; x=1529151326; bh=eIDc7dEH7D1Y2Gg6Aa605YBQ9waIpro/zcO 7s4wCAxA=; b=J51/VRhq8uzTHty5mFQ4BGdbsx/V3u1uUbKz2GxMB4hIT+GUEHB NQcKIugK+seS6g2c1SlU41r+rt2asXrT+F0KjPQueVeuiBbL/Gb6dTXooxBpplIN FlH0vVxL6i7WGj+OrdrLc7Ypy1oGL6x11kgIk8p3//ApWmUvrdUeeezc= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=unavailable autolearn_force=no Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HL3t7DXSTVic for ; Wed, 6 Jun 2018 14:15:25 +0200 (CEST) Received: from [192.168.2.109] (62-11-51-166.dialup.tiscali.it [62.11.51.166]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 41529B00330; Wed, 6 Jun 2018 14:15:21 +0200 (CEST) Subject: Re: [PATCH 1/4] serial: 8250: Copy em485 from port to real port. To: Andy Shevchenko Cc: matwey.kornilov@gmail.com, Greg Kroah-Hartman , Jiri Slaby , Matthias Brugger , Kees Cook , Allen Pais , Sean Young , "open list:SERIAL DRIVERS" , open list References: <20180606094942.71190-1-giulio.benetti@micronovasrl.com> <20180606094942.71190-4-giulio.benetti@micronovasrl.com> <069f5cd3309e83d13c74929f240720b232ea7251.camel@linux.intel.com> From: Giulio Benetti Message-ID: <0bc400b1-6178-2021-c9a3-3190d1a1de32@micronovasrl.com> Date: Wed, 6 Jun 2018 14:15:14 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <069f5cd3309e83d13c74929f240720b232ea7251.camel@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: it Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 serial8250_register_8250_port(). >> >> 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? > >> Signed-off-by: Giulio Benetti >> --- >> drivers/tty/serial/8250/8250_core.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/tty/serial/8250/8250_core.c >> b/drivers/tty/serial/8250/8250_core.c >> index 9342fc2ee7df..c8c2b260c681 100644 >> --- a/drivers/tty/serial/8250/8250_core.c >> +++ b/drivers/tty/serial/8250/8250_core.c >> @@ -994,6 +994,7 @@ int serial8250_register_8250_port(struct >> uart_8250_port *up) >> uart->port.rs485_config = up- >>> port.rs485_config; >> uart->port.rs485 = up->port.rs485; >> uart->dma = up->dma; >> + uart->em485 = up->em485; >> >> /* Take tx_loadsz from fifosize if it wasn't set >> separately */ >> if (uart->port.fifosize && !uart->tx_loadsz) > -- 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 € 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642