Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp649388imm; Tue, 15 May 2018 07:11:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqDsfsjHcg6Xd+UD80EzZdXNZXvszNZR0ujT+S7if5DXXlJ3RksSrpYn+24jcbhbAPvjtm+ X-Received: by 2002:a65:5cc5:: with SMTP id b5-v6mr12019125pgt.84.1526393472757; Tue, 15 May 2018 07:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526393472; cv=none; d=google.com; s=arc-20160816; b=ffO4SJXRsLccn0//abW2pGUvXa7fEyKeey4/+Dju10U6TSxgocEIwdNSnDsZUpMASM EA+oNVkQlRdvqJRQnwcj9MvKR5bKH9at78JZwwYis96Tq08XGYnF0n5yk7A2x9qAm7MB zN/3zspCDRH6DzJxx5uOwR5Kg5QaDivnzSfp2Xk1Wnb0oK3lumuvzN20i2G4gFLyUtlj Fnv42hqT1UPIh1geoJp60r2cffZXKKa2ehH9k4Vo4hvaogCH7y2mnK52b3ZFnAy87n7X Rw70mojKKghjO7wKxIO1Duq4dCd/Xn8h0luoAUwfGS2AtI7RRRAulzVaD8Kmxyj7YIkP 6liA== 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=lqj+TINQFP+kWnzlMMdUQR6yemV/55IUemgLHV6hLVM=; b=g7za71j2Oo4oLqj5AowUPylYDGk3s/uxmm+aKQob4T/bP+IfKJ4fPc9Mm/GJrfl+eF wKViO9n+esaoiOPIxKSRugoIitcCmDcgrlfhzjcbVduJRMMLOe/yZpVdYmgi9X6lQywf 9noy6zPruCcDiSfcS1US8hw8YJ4xhyD6ezBQa1kfrrJ0LusZx7wnqbGvxIH3RPvqAaR2 8Sx0hA8EDLM0uBTorlnwXU/rDscjXML7bSorXUJze0yhaVdDuDb7Lc9lDEtZLwl6nxuH ecL/7m5zVPyuQfP4ApvtBE4447kplA+EVhJsDYTDFLQW2dIEADwGb0UqDxMuzZDhjoFR /05A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=xpuXpfVn; 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 o62-v6si120413pga.94.2018.05.15.07.10.56; Tue, 15 May 2018 07:11:12 -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=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=xpuXpfVn; 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 S1753659AbeEOOGT (ORCPT + 99 others); Tue, 15 May 2018 10:06:19 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:36693 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753635AbeEOOGQ (ORCPT ); Tue, 15 May 2018 10:06:16 -0400 Received: by mail-it0-f67.google.com with SMTP id e20-v6so1837630itc.1 for ; Tue, 15 May 2018 07:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lqj+TINQFP+kWnzlMMdUQR6yemV/55IUemgLHV6hLVM=; b=xpuXpfVnJciJHOG6DFZRLXuU4+6E7jDt72SL5Xm/8lm4HLqRTT07rWWZlQbquC3xBA +VSGo2a8asNaZQaxtosHWMH+dr98/3nFtyG6HrlVP/srg5WYHl8t5RLc31IuIzeQQfWH PLjo5l5MmI6FZiwmmXSyQ1ENbLSUmlVe2fmGhw71S84lk49iznVEufg1LnpL0HuXbzFm J17b4bSSM15HHntaEjbIyI6Yn1sjr8hl+5th9+fMu0tUCf35NvoZF/k4rIPe7aU6Rn+I wJOBwyc7GPO339nyYeBmNURhhk+eDAaGFc28WDc8tqC1nSyKwIdomKH/9zD1hltUuMlt zk5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lqj+TINQFP+kWnzlMMdUQR6yemV/55IUemgLHV6hLVM=; b=ra+tNtvYzy2KDfeLO6wmcqEWs0WZkk1eHkJsOo5bOqdMdYexvEtSx7I5mOMXpHvyGh JKaLp6A7BsdrlxBong0BExnG9Gut0IMYqgMaNWnP2VPUp1aXmdvIfR2dq0ic6CQZMbv4 vTcJDp8jt8cYw+0TKTxViCHsFcf2Ws/q1U62pgwBUGtXKR8GQpKTl3RxH+cxRC0Pix9y snIND8nwBTc9eJxQM4oGGlIiNmaCDUbCX0FdngEH+BV/oiUA5cGLKbYeEgKQmuOeCvJq hRseIvG8RtXfE76VkbRzvtdiEYEO+dtLEP6JLktRQISZ2wjc43ZAuR0UCMcXCoRSMF/Z I/lA== X-Gm-Message-State: ALKqPwe3BO5KDFbzE0cpuPZfJKd1uxMGg+Tkii6PTvRhMQqgLUFc3W3b DQHM+QoAUv1U6JQZYx8yAeDl+GF2lHHVHsTdFF4gXw== X-Received: by 2002:a6b:250d:: with SMTP id l13-v6mr15110840iol.47.1526393175614; Tue, 15 May 2018 07:06:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.181.1 with HTTP; Tue, 15 May 2018 07:06:15 -0700 (PDT) In-Reply-To: References: <20180511162028.20616-1-brgl@bgdev.pl> <20180511162028.20616-11-brgl@bgdev.pl> From: Bartosz Golaszewski Date: Tue, 15 May 2018 16:06:15 +0200 Message-ID: Subject: Re: [PATCH 10/12] platform/early: implement support for early platform drivers To: Rob Herring Cc: Sekhar Nori , Kevin Hilman , David Lechner , Michael Turquette , Stephen Boyd , Arnd Bergmann , Greg Kroah-Hartman , Mark Rutland , Yoshinori Sato , Rich Felker , Andy Shevchenko , Marc Zyngier , "Rafael J . Wysocki" , Peter Rosin , Jiri Slaby , Thomas Gleixner , Daniel Lezcano , Geert Uytterhoeven , Magnus Damm , Johan Hovold , Frank Rowand , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@vger.kernel.org" , devicetree , "open list:GENERIC INCLUDE/ASM HEADER FILES" , Bartosz Golaszewski 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 2018-05-14 15:37 GMT+02:00 Rob Herring : > On Fri, May 11, 2018 at 11:20 AM, Bartosz Golaszewski wrote: >> From: Bartosz Golaszewski >> >> This introduces the core part of support for early platform drivers >> and devices. >> > > It looks like most of your prep patches are to separate the alloc and > init of platform devices because you are essentially making early > devices/drivers a sub-class. Maybe you could avoid doing that and > simplify things a bit. Comments below based on doing that... > My aim was to change as little as possible for everybody else while fixing our problem. These changes are already controversial enough without risky reusing of existing fields in common structures. I was just afraid that there are too many intricacies for it to be safe. >> +/** >> + * struct early_platform_driver >> + * >> + * @pdrv: real platform driver associated with this early platform driver >> + * @list: list head for the list of early platform drivers >> + * @early_probe: early probe callback >> + */ >> +struct early_platform_driver { >> + struct platform_driver pdrv; >> + struct list_head list; > > Couldn't you use an existing list in driver_private until you move > over to the normal bus infra. > This is something that the previous implementation did. It was quite unreadable, so I decided to go with a separate list. >> + int (*early_probe)(struct platform_device *); > > Just add this to platform_driver. > This would extend the structure for everybody else while there'll be very few such devices and not all systems would even require it. >> +}; >> + >> +/** >> + * struct early_platform_device >> + * >> + * @pdev: real platform device associated with this early platform device >> + * @list: list head for the list of early platform devices >> + * @deferred: true if this device's early probe was deferred >> + * @deferred_drv: early platform driver with which this device was matched >> + */ >> +struct early_platform_device { >> + struct platform_device pdev; >> + struct list_head list; > > Use a list in device_private? > >> + bool deferred; >> + struct early_platform_driver *deferred_drv; > > Can't you use the existing deferred probe list? > I thought about it, but I was afraid there could be some timing issues with that and decided against it. The early deferral also doesn't work in a workque, but is synchronous instead. Best regards, Bartosz Golaszewski