Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5410240pxu; Thu, 22 Oct 2020 01:14:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXRLSmCn6gvcvTBaHaFhJleb7OyVpxVT35KJ1JQwMKr6cjuq6ZKyExxGbSMKBC0+emhxfY X-Received: by 2002:a17:906:8385:: with SMTP id p5mr1103134ejx.538.1603354479232; Thu, 22 Oct 2020 01:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603354479; cv=none; d=google.com; s=arc-20160816; b=OtsYHBN6kSDtpG3ZcA6xT7P5SiPlGVUvMdpydDDf05/p88pmyq2Xu8fOOXLkFkXSR5 kEgkXmA150a/cZIVWjL9Zh+x3umW0Ioc3bM34MPIAj+UauTW+WI6d5DaAfga2+YeYsMu Rphm5FVzj9oDDdpnoqn9/QabclCsYO1zPAZvBYdk5YnHNKR3nl9lVdDC42bo+D/W+PMj khZQqx32RjVh4JnS/YBki1iz2DlAOw77iSOQT7qfTVw1YckTVbHiRtGV0DyKxyorA+JR nYMCUjucK3doSvYnL0iMMruDRYWFgVHYRcfLRb7NYyUeKHYbkq1BH6fPNlyYXrhpc6mk BUJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=1OlvWwOgoux6/fPxLT9WF2cH0mqTQd64St1QOgGJBc8=; b=nJq6llLhTUvNqPeFjsSukIofdS0MWlmsnG7eZmY6BW/4PAmVPhNN6CjZ3jXovg2OHk YRN0v+0WQibzopS9IYPn1noo/5ywqi749z527x+Zvjia76ndZaY3frKGk2oVxANj+Dm5 TKQkXC70K+zEua735kXoWPLv8bQyRay1F5yZy9J9bSfuefW8KZ3jtrKx+kFpD7sKpVQP PW2Ed5L/qhifC2ipsrQkmDPwivUc8+vta8msATVjrHMtFZLRUgMWwBBgCll2zVey7Qbt Vkra9BmR7DdWznGZF7T1IZzwAWA+7n4/XfW5uumi9QVn7BnVwAkfe9tWAlzHdD3gy9DD tX2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm2si385530edb.310.2020.10.22.01.14.17; Thu, 22 Oct 2020 01:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895341AbgJVDXx (ORCPT + 99 others); Wed, 21 Oct 2020 23:23:53 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:47052 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442457AbgJVDXx (ORCPT ); Wed, 21 Oct 2020 23:23:53 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 67D7A2287E; Wed, 21 Oct 2020 23:23:49 -0400 (EDT) Date: Thu, 22 Oct 2020 14:23:57 +1100 (AEDT) From: Finn Thain To: Laurent Vivier cc: Brad Boyer , Greg KH , linux-kernel@vger.kernel.org, Joshua Thompson , linux-serial@vger.kernel.org, Benjamin Herrenschmidt , linux-m68k@lists.linux-m68k.org, Geert Uytterhoeven , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Michael Ellerman Subject: Re: [PATCH] serial: pmac_zilog: don't init if zilog is not available In-Reply-To: <311d17ed-75fa-a7fe-6c70-177a6eec4519@vivier.eu> Message-ID: References: <20201020162303.1730562-1-laurent@vivier.eu> <20201020162844.GA865546@kroah.com> <468bbbef-4745-3b16-b6f4-30b46ebcdc33@vivier.eu> <20201020173745.GA882703@kroah.com> <387fd2aa-b181-c41f-0581-0a7e79a44e41@vivier.eu> <20201020183246.GA912431@kroah.com> <20201020224446.GA15066@allandria.com> <311d17ed-75fa-a7fe-6c70-177a6eec4519@vivier.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1463811774-718802136-1603337037=:6" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463811774-718802136-1603337037=:6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 21 Oct 2020, Laurent Vivier wrote: > Le 21/10/2020 =C3=A0 01:43, Finn Thain a =C3=A9crit=C2=A0: >=20 > > Laurent, can we avoid the irq =3D=3D 0 warning splat like this? > >=20 > > diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_= zilog.c > > index 96e7aa479961..7db600cd8cc7 100644 > > --- a/drivers/tty/serial/pmac_zilog.c > > +++ b/drivers/tty/serial/pmac_zilog.c > > @@ -1701,8 +1701,10 @@ static int __init pmz_init_port(struct uart_pmac= _port *uap) > > =09int irq; > > =20 > > =09r_ports =3D platform_get_resource(uap->pdev, IORESOURCE_MEM, 0); > > +=09if (!r_ports) > > +=09=09return -ENODEV; > > =09irq =3D platform_get_irq(uap->pdev, 0); > > -=09if (!r_ports || irq <=3D 0) > > +=09if (irq <=3D 0) > > =09=09return -ENODEV; > > =20 > > =09uap->port.mapbase =3D r_ports->start; > >=20 >=20 > No, this doesn't fix the problem. >=20 Then I had better stop guessing and start up Aranym... The patch below seems to fix the problem for me. Does it work on your=20 system(s)? diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index a621fcc1a576..4e802f70333d 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -776,16 +776,12 @@ static struct resource scc_b_rsrcs[] =3D { struct platform_device scc_a_pdev =3D { =09.name =3D "scc", =09.id =3D 0, -=09.num_resources =3D ARRAY_SIZE(scc_a_rsrcs), -=09.resource =3D scc_a_rsrcs, }; EXPORT_SYMBOL(scc_a_pdev); =20 struct platform_device scc_b_pdev =3D { =09.name =3D "scc", =09.id =3D 1, -=09.num_resources =3D ARRAY_SIZE(scc_b_rsrcs), -=09.resource =3D scc_b_rsrcs, }; EXPORT_SYMBOL(scc_b_pdev); =20 @@ -812,10 +808,15 @@ static void __init mac_identify(void) =20 =09/* Set up serial port resources for the console initcall. */ =20 -=09scc_a_rsrcs[0].start =3D (resource_size_t) mac_bi_data.sccbase + 2; -=09scc_a_rsrcs[0].end =3D scc_a_rsrcs[0].start; -=09scc_b_rsrcs[0].start =3D (resource_size_t) mac_bi_data.sccbase; -=09scc_b_rsrcs[0].end =3D scc_b_rsrcs[0].start; +=09scc_a_rsrcs[0].start =3D (resource_size_t)mac_bi_data.sccbase + 2; +=09scc_a_rsrcs[0].end =3D scc_a_rsrcs[0].start; +=09scc_a_pdev.num_resources =3D ARRAY_SIZE(scc_a_rsrcs); +=09scc_a_pdev.resource =3D scc_a_rsrcs; + +=09scc_b_rsrcs[0].start =3D (resource_size_t)mac_bi_data.sccbase; +=09scc_b_rsrcs[0].end =3D scc_b_rsrcs[0].start; +=09scc_b_pdev.num_resources =3D ARRAY_SIZE(scc_b_rsrcs); +=09scc_b_pdev.resource =3D scc_b_rsrcs; =20 =09switch (macintosh_config->scc_type) { =09case MAC_SCC_PSC: diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilo= g.c index 96e7aa479961..95abdb305d67 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -1697,18 +1697,17 @@ extern struct platform_device scc_a_pdev, scc_b_pde= v; =20 static int __init pmz_init_port(struct uart_pmac_port *uap) { -=09struct resource *r_ports; -=09int irq; +=09struct resource *r_ports, *r_irq; =20 =09r_ports =3D platform_get_resource(uap->pdev, IORESOURCE_MEM, 0); -=09irq =3D platform_get_irq(uap->pdev, 0); -=09if (!r_ports || irq <=3D 0) +=09r_irq =3D platform_get_resource(uap->pdev, IORESOURCE_IRQ, 0); +=09if (!r_ports || !r_irq) =09=09return -ENODEV; =20 =09uap->port.mapbase =3D r_ports->start; =09uap->port.membase =3D (unsigned char __iomem *) r_ports->start; =09uap->port.iotype =3D UPIO_MEM; -=09uap->port.irq =3D irq; +=09uap->port.irq =3D r_irq->start; =09uap->port.uartclk =3D ZS_CLOCK; =09uap->port.fifosize =3D 1; =09uap->port.ops =3D &pmz_pops; ---1463811774-718802136-1603337037=:6--