From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1227AC4363A for ; Tue, 20 Oct 2020 23:28:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8FBFA223BF for ; Tue, 20 Oct 2020 23:28:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439291AbgJTX2e (ORCPT ); Tue, 20 Oct 2020 19:28:34 -0400 Received: from cynthia.allandria.com ([50.242.82.17]:41706 "EHLO cynthia.allandria.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439288AbgJTX2e (ORCPT ); Tue, 20 Oct 2020 19:28:34 -0400 X-Greylist: delayed 2619 seconds by postgrey-1.27 at vger.kernel.org; Tue, 20 Oct 2020 19:28:33 EDT Received: from flar by cynthia.allandria.com with local (Exim 4.84_2) (envelope-from ) id 1kV0N4-00040j-JM; Tue, 20 Oct 2020 15:44:46 -0700 Date: Tue, 20 Oct 2020 15:44:46 -0700 From: Brad Boyer To: Laurent Vivier Cc: 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 Message-ID: <20201020224446.GA15066@allandria.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-m68k@vger.kernel.org On Tue, Oct 20, 2020 at 08:42:53PM +0200, Laurent Vivier wrote: > Le 20/10/2020 ?? 20:32, Greg KH a ??crit??: > > On Tue, Oct 20, 2020 at 08:19:26PM +0200, Laurent Vivier wrote: > >> Le 20/10/2020 ?? 19:37, Greg KH a ??crit??: > >>> Why not fix it to work properly like other arch checks are done > >> I would be happy to do the same. > >> > >>> Put it in a .h file and do the #ifdef there. Why is this "special"? > >> > >> I don't know. > >> > > > > Yup, that would be a good start, but why is the pmac_zilog.h file > > responsible for this? Shouldn't this be in some arch-specific file > > somewhere? > > For m68k, MACH_IS_MAC is defined in arch/m68k/include/asm/setup.h > > If I want to define it for any other archs I don't know in which file we > can put it. > > But as m68k mac is only sharing drivers with pmac perhaps we can put > this in arch/powerpc/include/asm/setup.h? Wouldn't it be better to rearrange this code to only run if the devices are present? This is a macio driver on pmac and a platform driver on mac, so shouldn't it be possible to only run this code when the appropriate entries are present in the right data structures? I didn't look at a lot of the other serial drivers, but some other mac drivers have recently been updated to no longer have MACH_IS_MAC checks due to being converted to platform drivers. Brad Boyer brad@allandria.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E8B5C4363D for ; Tue, 20 Oct 2020 23:30:23 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F07E2223BF for ; Tue, 20 Oct 2020 23:30:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F07E2223BF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=allandria.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CG8xR11lDzDqgM for ; Wed, 21 Oct 2020 10:30:19 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=allandria.com (client-ip=50.242.82.17; helo=cynthia.allandria.com; envelope-from=flar@allandria.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=allandria.com X-Greylist: delayed 2612 seconds by postgrey-1.36 at bilbo; Wed, 21 Oct 2020 10:28:36 AEDT Received: from cynthia.allandria.com (cynthia.allandria.com [50.242.82.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CG8vS5fnMzDqRg for ; Wed, 21 Oct 2020 10:28:36 +1100 (AEDT) Received: from flar by cynthia.allandria.com with local (Exim 4.84_2) (envelope-from ) id 1kV0N4-00040j-JM; Tue, 20 Oct 2020 15:44:46 -0700 Date: Tue, 20 Oct 2020 15:44:46 -0700 From: Brad Boyer To: Laurent Vivier Subject: Re: [PATCH] serial: pmac_zilog: don't init if zilog is not available Message-ID: <20201020224446.GA15066@allandria.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg KH , linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Geert Uytterhoeven , linux-serial@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Joshua Thompson Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Oct 20, 2020 at 08:42:53PM +0200, Laurent Vivier wrote: > Le 20/10/2020 ?? 20:32, Greg KH a ??crit??: > > On Tue, Oct 20, 2020 at 08:19:26PM +0200, Laurent Vivier wrote: > >> Le 20/10/2020 ?? 19:37, Greg KH a ??crit??: > >>> Why not fix it to work properly like other arch checks are done > >> I would be happy to do the same. > >> > >>> Put it in a .h file and do the #ifdef there. Why is this "special"? > >> > >> I don't know. > >> > > > > Yup, that would be a good start, but why is the pmac_zilog.h file > > responsible for this? Shouldn't this be in some arch-specific file > > somewhere? > > For m68k, MACH_IS_MAC is defined in arch/m68k/include/asm/setup.h > > If I want to define it for any other archs I don't know in which file we > can put it. > > But as m68k mac is only sharing drivers with pmac perhaps we can put > this in arch/powerpc/include/asm/setup.h? Wouldn't it be better to rearrange this code to only run if the devices are present? This is a macio driver on pmac and a platform driver on mac, so shouldn't it be possible to only run this code when the appropriate entries are present in the right data structures? I didn't look at a lot of the other serial drivers, but some other mac drivers have recently been updated to no longer have MACH_IS_MAC checks due to being converted to platform drivers. Brad Boyer brad@allandria.com