Received: by 10.192.165.148 with SMTP id m20csp1102544imm; Wed, 2 May 2018 14:12:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoPvyp6DaflkBBApLgglufcIJiL2ll54ewDZxpvhdLhRr08FzEriCS0RS3UnX3s3n4e9oVr X-Received: by 2002:a63:b908:: with SMTP id z8-v6mr17257058pge.436.1525295571180; Wed, 02 May 2018 14:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525295571; cv=none; d=google.com; s=arc-20160816; b=Ro+UFW0GZ28QcdiGlB5u1oBCnp/rUSTF0EACmMTIR1kpaxtuBNNyyJ/yXtdiQM7Q2m KCf5HLYTTuV72De4qvz1DGfzxKmkwoQm7B+3uuVJxnXmtdmD2mRtXf/MCcSJ1olabiKi oL0SdRaFODwW3Dvubb6rNwpyGMW90pQyJxw9CsjX9QagMos6MYjkbdgZ2Q02zE53yhQO yFXc5tDFUnR4NY1X+Z/mIidc64aPkC8VcUb04loTHqBdhmCIEPAW/Q8uit6L5jh8WKcV qqEuIaixPDuNITkt8EzrfwhHstl3+YfWW8x2jtX4QjpqSiU+HqxR00vr6bPwbWCmgWBM CidA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=iAsDCiysLpb2MDNHCAHWgQ1LWxmW6WediMztGiEoDpw=; b=oea167mKRPz8td3ehSs1/qCuhF3soBQ7neYtMUn5gX5IbNnxvDnA7XWbjF/irUvAmk QFfHURl/LiYda5HxOxWuIyrnuDL9HFCsSgtGYEToMEIhz24qzRWdyRXfcu07Ln585iHR Z4GoLKQmvwZqm94l15WyXScRisTqDMSkIgz+9KLwBjImt5r0sPY4T316wJZCCLQi8r21 g0cC7w3/xcJxExX2Kkc8PqzrqHRt+pL/rsBCY09vKEoKqR+IwqaL/mxABeQglx7GCw6s JAH0OGV9v4rFZoKl5bmXaQctgYOIuZ1xRCNp+rfF2Xvv8I76trXFgsV2IQPUo6K3gMwc nabw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=r2PLEGWa; 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 71-v6si12433711plb.511.2018.05.02.14.12.36; Wed, 02 May 2018 14:12:51 -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=fail header.i=@gmail.com header.s=20161025 header.b=r2PLEGWa; 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 S1751420AbeEBVLT (ORCPT + 99 others); Wed, 2 May 2018 17:11:19 -0400 Received: from mail-ua0-f196.google.com ([209.85.217.196]:43313 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbeEBVLQ (ORCPT ); Wed, 2 May 2018 17:11:16 -0400 Received: by mail-ua0-f196.google.com with SMTP id d4so2122775ual.10; Wed, 02 May 2018 14:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=iAsDCiysLpb2MDNHCAHWgQ1LWxmW6WediMztGiEoDpw=; b=r2PLEGWaY1T6Px5JAlXfemmOMDHZctGxX6cA19UoVM4d2gRSB7K7jiDvskJ6fmhmj0 YR6NIxwIifcfs1w5x677LPdgyQZG1756mZQWMxxn8Fu17AZo8Lg5FYP/Xa9hY94UyxLI o9+wUexeGcDOrA1eEWNvU0y6nDE0ACqujTMscL5Qq91C8Bh16CAEhGaIIOeVcXL6RQUr eqZnyrM76B8d7UVMBPVNWksHtZkIIJirgVwZcJpirYYD51nSF6HbRRjYOBxnInzWNx5G Wf1Gp+VtE/CwnNkrGV0B1A13zlClF7GCExEbXZkEVJhSYE3+0ONIDW46pSStr9G02b5y VDLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=iAsDCiysLpb2MDNHCAHWgQ1LWxmW6WediMztGiEoDpw=; b=SdPy+7Ch2w4FE0EV07BWMMqk8Hu+8YnaLPOPtcVI00fMX6UAJAEIpZsazMVa4gsk8P G+bqGwCrfrBV4wLUgaOgqG5MIEkpezSOCGf+P8ocnJFzgQTBbUT33t8t2tOToSSDwr5k s+HZ0fNaLFim5w62hAFOHVP3RqPtwxaIhrcr3ZQre8uhaCA+Rvh33sXb8IyrPj/mHqTs o5GvIhUo0rQTwEQ2ewBQRbmRKxgMMgePg/LtLmU8XjkaRuYXUF/INnu4EWG490UEZDPK H+jMels5EOVbfz+WSJMhtNzwjGCiN4t6HUnauyscHNlF7OhiP5adepsARptPBjsJgj/3 7lrg== X-Gm-Message-State: ALQs6tDXwJpI3ErHzPYWZrNXBYa2xoykuXcGh2YTw5RQWVVlmQxft3aM 2XuAksSh/0Qkx3uUnJ0wIxFajV68GA5k1U/knZY= X-Received: by 10.176.81.6 with SMTP id e6mr21206509uaa.33.1525295475271; Wed, 02 May 2018 14:11:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.122.10 with HTTP; Wed, 2 May 2018 14:11:14 -0700 (PDT) In-Reply-To: References: <20180426152920.21569-1-brgl@bgdev.pl> <20180426173151.GJ3094@brightrain.aerifal.cx> <6d1f9114-f1d1-961f-4f36-74adff059dc3@lechnology.com> From: Geert Uytterhoeven Date: Wed, 2 May 2018 23:11:14 +0200 X-Google-Sender-Auth: S0uXDNy5rykkEpHG0jUizsZyJH4 Message-ID: Subject: Re: [PATCH RFC PoC 0/2] platform: different approach to early platform drivers To: Arnd Bergmann Cc: Bartosz Golaszewski , Mark Rutland , Rich Felker , Jan Kiszka , Michael Turquette , Sekhar Nori , Jarkko Sakkinen , Heikki Krogerus , Frank Rowand , Yoshinori Sato , Kevin Hilman , "Rafael J . Wysocki" , Bartosz Golaszewski , Andy Shevchenko , Michal Suchanek , DTML , David Lechner , Marc Zyngier , Rob Herring , Linux ARM , Arend van Spriel , Stephen Boyd , Greg Kroah-Hartman , Dmitry Torokhov , Linux Kernel Mailing List , Peter Rosin 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 On Fri, Apr 27, 2018 at 2:40 PM, Arnd Bergmann wrote: > On Fri, Apr 27, 2018 at 1:53 PM, Bartosz Golaszewski wrote: >> 2018-04-27 12:18 GMT+02:00 Arnd Bergmann : >>> On Fri, Apr 27, 2018 at 10:57 AM, Bartosz Golaszewski >>> wrote: >>>> 2018-04-27 9:52 GMT+02:00 Arnd Bergmann : >>>>> On Fri, Apr 27, 2018 at 4:28 AM, David Lechner wrote: >>>> My patch tries to address exactly the use cases we're facing - for >>>> example by providing means to probe devices twice (early and late) and >>>> to check the state we're at in order for users to be able to just do >>>> the critical initialization early on and then continue with regular >>>> stuff later. >>> >>> Maybe the problem is reusing the name and some of the code from >>> an existing functionality that we've been trying to get rid of. >>> >> >> I'm not reusing the name - in fact I set the prefix to earlydev_ >> exactly in order to not confuse anyone. I'm also not reusing any code >> in the second series. > > Ok. > >>> If what you want to do is completely different from the existing >>> early_platform implementation, how about starting by moving that >>> out of drivers/base/platform.c into something under arch/sh/ >>> and renaming it to something with an sh_ prefix. >>> >> >> Yes, this is a good idea, but what about the sh-specific drivers that >> rely on it? Is including headers from arch/ in driver code still an >> accepted practice? > > I think it's fine here, since we're just move it out of the way and > there are only very few drivers using it: > > drivers/clocksource/sh_cmt.c:early_platform_init("earlytimer", > &sh_cmt_device_driver); > drivers/clocksource/sh_mtu2.c:early_platform_init("earlytimer", > &sh_mtu2_device_driver); > drivers/clocksource/sh_tmu.c:early_platform_init("earlytimer", > &sh_tmu_device_driver); > drivers/clocksource/timer-ti-dm.c:early_platform_init("earlytimer", > &omap_dm_timer_driver); > drivers/tty/serial/sh-sci.c:early_platform_init_buffer("earlyprintk", > &sci_driver, > > For timer-ti-dm, it seems like a leftover from old times that can > be removed. The other four are shared between arch/sh and > arch/arm/mach-shmobile and already have some #ifdef > to handle those two cases. Sh-sci is also used on arm64, for R-Car Gen3 SoCs. While the latter has CMT and TMU hardware blocks, so far we haven't enabled support for it yet (just using the ARM arch timer is too convenient? ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds