Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7877967imu; Thu, 15 Nov 2018 03:03:10 -0800 (PST) X-Google-Smtp-Source: AJdET5ci0R8DVUFoxPipqBJr/M3QYdR8Yc2ssHMFkJFFvCfK6nHNwAFBUXEl06nuVFffWSaOYtQD X-Received: by 2002:aa7:86d3:: with SMTP id h19-v6mr5855779pfo.225.1542279790048; Thu, 15 Nov 2018 03:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542279790; cv=none; d=google.com; s=arc-20160816; b=GayXn5CtdAwcDJ7cCqWFD5dC2DjecAUfqT8qxAlWenGyrQXHijBrdV9GGaoYU0qZQj OTG+1eE6/2ubZy7MalG0jRw7cdUxUS1owCbsc5CHd8Uq6p/UhnQ0QpTIg/ceMk6UI9se K/YU/ePjMT4YHwUDrsYYRjPz0AYSb6sS62L2JlcEhCdwrYZCW2kJKCEMmsiPxgiqhl0R mwQa/ndZ/mNDo/iFv6auwMB08Ep/NiUp8zHlUjHJJxp2vwotgQdDZt/fxDyjJCKWrHiG HeXQOV8mhyKZzaC7c1PVftpvGtA/jW8l46HBGHxIz148ljG9t/bQWlu9ZUQFDe/t93Wq Psbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=h3FHK8EvY+Zjy0akwJHZcKL9VGkiMyUmpn5Xcm9XYl0=; b=URN1mFC3YuQr3h3lcVfwaMgymeP98CuO9SjcNKI+P3lmyZ9Mb8GnFX8U2zTf1uQPM0 qamXYNTyAKFdz7hrLxM16Dw0P9BxLgAG2sItlwnBgR6nXxlrAuMbfJeUexeJmaP9yHuo /7XYeR8uncypEtpWZh0bzTsqDEUBF9PDRvs/bocuvCtbj74qeuRaRP2kivXeRWWc34ir h/GEV9TP39noxP1RMdPysi6H4EF4z9kO1AesuM4avmmD2WrqjBTzNjo9SndSybc4bzHD WnVERucqPJiFvn6mojo7NvshQE3vdx7A9eooBQLWDlh9z4211sW7o6uN2syoIXMiuWf2 59lQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si17936438pgd.567.2018.11.15.03.02.54; Thu, 15 Nov 2018 03:03:10 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388294AbeKOVI6 (ORCPT + 99 others); Thu, 15 Nov 2018 16:08:58 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44826 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732953AbeKOVI6 (ORCPT ); Thu, 15 Nov 2018 16:08:58 -0500 Received: by mail-pf1-f194.google.com with SMTP id b81-v6so9028000pfe.11; Thu, 15 Nov 2018 03:01:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h3FHK8EvY+Zjy0akwJHZcKL9VGkiMyUmpn5Xcm9XYl0=; b=KPi0hiWTDH6Jiy2qOxDAhcZdrKki3cyUUrjIN2CFz2z/qq6udtYXzgd96c1iClVLx8 qMtokfdqesp8NmbPVU/EsmsTwP2ImT8rlz+Kh24Zvoi1+Fgii4N0hFd9ieVqyewLhCXr 2iBGcubeRCFXZTIlSYoWLkdKzfey4ZKHsrDt1xb/MifKUhYGauKv+gUzeA4RQhlnsMj4 psI2hAA0+o/UOyKCjOT1Zb3hQ3KSy5QC1LwjZgQFeJweXplbFFIfEsXgWbYXfQI1Qc6v Ob8BkRiB2UKAd7G2zHTM55dN1haEe65NytrOD9KBb0BHww4WeuxwJ1uTNkhtVhvhMAmP oyFg== X-Gm-Message-State: AGRZ1gIQixPH2Ekon2RsLrsJAp+m3wt/yXFxa9esd5GeO00K9YGA51yW g+jOIpQzqU46WQRI2mLU5MkEQSo7o73ygKNerjE= X-Received: by 2002:a62:302:: with SMTP id 2-v6mr6085108pfd.135.1542279696518; Thu, 15 Nov 2018 03:01:36 -0800 (PST) MIME-Version: 1.0 References: <20181020101045.15991-1-paul.walmsley@sifive.com> <20181020101045.15991-3-paul.walmsley@sifive.com> In-Reply-To: <20181020101045.15991-3-paul.walmsley@sifive.com> From: Emil Renner Berthing Date: Thu, 15 Nov 2018 12:01:25 +0100 Message-ID: Subject: Re: [PATCH v3 2/2] tty: serial: add driver for the SiFive UART To: paul.walmsley@sifive.com Cc: linux-serial@vger.kernel.org, paul@pwsan.com, Palmer Dabbelt , wesley@sifive.com, jslaby@suse.com, Linux Kernel Mailing List , julia.lawall@lip6.fr, Greg Kroah-Hartman , linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, Thanks for the patch! On Sat, 20 Oct 2018 at 12:12, Paul Walmsley wrote: > +/* > + * > + */ Interesting comment ;) > +static int __init sifive_serial_console_setup(struct console *co, char *options) Unfortunately I get this error unless I remove the __init: ... GEN .version CHK include/generated/compile.h AR built-in.a LD vmlinux.o MODPOST vmlinux.o WARNING: vmlinux.o(.data+0x14e48): Section mismatch in reference from the variable .LANCHOR0 to the function .init.text:sifive_serial_console_setup() The variable .LANCHOR0 references the function __init sifive_serial_console_setup() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console FATAL: modpost: Section mismatches detected. Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. make[1]: *** [scripts/Makefile.modpost:98: vmlinux.o] Error 1 make: *** [Makefile:1040: vmlinux] Error 2 I have CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_SIFIVE=y CONFIG_SERIAL_SIFIVE_CONSOLE=y and it happens both on v4.20-rc2 and v4.19. Without the __init everything seems to work fine though. > +#else > + > +#define SIFIVE_SERIAL_CONSOLE NULL > + > +static inline void __ssp_add_console_port(struct sifive_serial_port *ssp) > +{} > +static void __ssp_remove_console_port(struct sifive_serial_port *ssp) > +{} Missing "inline"? > +static int __init sifive_serial_init(void) > +{ > + int r; If you're sending a v4 anyway, here and in the the probe function using int ret; for this kind of variable is a common idiom and hence easier to read. /Emil