Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp656457ybm; Tue, 21 May 2019 01:00:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8yF3eMiQzRp1pAvKwj4WfSAzreFqraESSF487t0sjiNu7cETjgOIA6C7u5FZtejA+k1gK X-Received: by 2002:a63:7413:: with SMTP id p19mr78305576pgc.259.1558425621406; Tue, 21 May 2019 01:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558425621; cv=none; d=google.com; s=arc-20160816; b=EzwN+A7/mtSb8k93KfzlXiluWLRqrOcwUl47fnk/cLChCsSpncjwUuuB5Gg112rRj5 XmkpOoGkj+XzK+7aZh7+SeTJ3dXz6XS/3R5Ia+HLOaSuLUZAwNf1YFlaBGxzi+xSOou7 vy6JGOJA6NpKJA9PdVYeti57p0Lv/xHIQXuJK5M+7vKjvuROQosMWlc9dh9d8i6AENA5 mUKqdanEbXwAPBOZblhYY4iFKbueJDrW8XcJn57RDErGpRFtdvEDlvp+bWvI9JvfxpWg VAKcWbNNgJg1MluNH8ROqIIsD2f5xM/3YcAxY6C84iCQqxjFuiPNx+lzv7K3Tem5lrFy 49sQ== 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=p/GfCtmqLs5V/u3rJvsxM4G96Nj4OiIWtjGPDXWU4uA=; b=bEfSa07qthwpwP7h5QnfnVMGli4xM/77WmXFr5uU2e6p03H0CUd11G6FuGm9lk1oxC qHmjMqv3BMQQm9juBXsJSnf8V+Y/VzLCQu26QxkqGhRtbIoAAKoNhOIutg4cCPFySCkm JeEm4/FU9ssd01518YfCMtTS5NTs2XlfgDN9qxtSug2DbuOwZNECvTViwA/lV6hDm51Q QYZw42QzO6Kw3z1lxk1JI4O6VDLgIIdSqnf94XNsapzi5IpQxLvi5ZNYNQQXwhmvaxxi bzkwvDUrvmy7oHjG/1K+nqlCoOPO0hRq9AAVXs7JLyFsNCTI4H8QX4UrK6IN2riS7x/e jpsA== 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 f2si21028614pgb.543.2019.05.21.01.00.06; Tue, 21 May 2019 01:00:21 -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; 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 S1726419AbfEUH65 (ORCPT + 99 others); Tue, 21 May 2019 03:58:57 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:37686 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbfEUH65 (ORCPT ); Tue, 21 May 2019 03:58:57 -0400 Received: by mail-qt1-f196.google.com with SMTP id o7so19442699qtp.4; Tue, 21 May 2019 00:58:56 -0700 (PDT) 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=p/GfCtmqLs5V/u3rJvsxM4G96Nj4OiIWtjGPDXWU4uA=; b=jLnCfR2vsrdnKWBSb6GSRnA6qNEfNJpXLXqEsTVJPNofKhvr/j+N+2lZvRKte7LCfS 0my86ONw5n8HQBSaRtKJ+BElyravA7BSM45BA5jq+hkAhE5KKcGkUw+ZvxTMO4t+P4+D SPDhEQAB1zwQK35oi34ZUtmoMfXFBkFY7ySL+CvDJ7vikIwBi6yYcrVdVePEipq//020 MA0/cAjY8Dg0Btv0I+fvMWtXu+OsP1OtTZCBz7/eXKKCKpAAHJVwhz1ULYM4t2/FjidN OPQCkX7H2zsQgJuVPu9XUH/ZxLHb/RP6jYrv4t6zvnGpJAjzNFwtl7e91lAWUm0v5Z6z 2fcg== X-Gm-Message-State: APjAAAXtgOIXjoWGWp58pQP9iuaF1hZxLJbUWGTZUivfF4XUmiBkVCoL 7Sq98GpHx3Rp3a9G4k05AlomOVDygY1IDYXs6GA= X-Received: by 2002:a05:6214:c4:: with SMTP id f4mr14416531qvs.93.1558425535884; Tue, 21 May 2019 00:58:55 -0700 (PDT) MIME-Version: 1.0 References: <0b74e9ad12360b56bc0a3c2ca972798c424f2610.1548790896.git.lsun@mellanox.com> <1558115345-32476-1-git-send-email-lsun@mellanox.com> <20190520155658.GA14165@kroah.com> <20190520191209.GA29776@kroah.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 21 May 2019 09:58:38 +0200 Message-ID: Subject: Re: [PATCH v5 1/2] platform/mellanox: Add bootctl driver for Mellanox BlueField Soc To: Liming Sun Cc: Greg KH , Andy Shevchenko , Darren Hart , Vadim Pasternak , David Woods , "platform-driver-x86@vger.kernel.org" , "linux-kernel@vger.kernel.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 On Mon, May 20, 2019 at 10:44 PM Liming Sun wrote: > > -----Original Message----- > > From: Greg KH > > Sent: Monday, May 20, 2019 3:12 PM > > To: Liming Sun > > Cc: Andy Shevchenko ; Darren Hart ; Vadim Pasternak ; David > > Woods ; platform-driver-x86@vger.kernel.org; linux-kernel@vger.kernel.org > > Subject: Re: [PATCH v5 1/2] platform/mellanox: Add bootctl driver for Mellanox BlueField Soc > > > > On Mon, May 20, 2019 at 06:07:44PM +0000, Liming Sun wrote: > > > > > +static struct platform_driver mlxbf_bootctl_driver = { > > > > > + .probe = mlxbf_bootctl_probe, > > > > > + .driver = { > > > > > + .name = "mlxbf-bootctl", > > > > > + .groups = mlxbf_bootctl_groups, > > > > > + .acpi_match_table = mlxbf_bootctl_acpi_ids, > > > > > > > > Why is an acpi driver a platform driver? Isn't there a "real" acpi > > > > driver interface you should be tieing into instead? > > > > > > > > Only use a platform driver as an absolute last resort. I don't think > > > > that is the case here. > > > > > > The driver is trying to configure boot-swapping and display secure state, > > > and is defined/initiated in ACPI table in UEFI. It seems a little hard to > > > categorize this driver to any existing subsystem. Any suggestion > > > where it might be a better fit (like drivers/misc, drivers/firmware, etc)? > > > Please correct me if I misunderstand the comments. Thanks!. > > > > The comment was asking why an acpi driver is a platform driver, but then > > I went and looked now at a bunch of acpi drivers, and they all are > > platform drivers :( > > > > Anyway, drivers/acpi/ seems like the best place for this file, right? > > My understanding is that the "drivers/acpi" is mainly for the acpi common code. > The vendor or platform specific drivers are spread in other various directories, > most of which are 'platform' drivers. It depends on how closely you are following the acpi specification. If you just implement access to a standard ACPI feature, or you have added your interface to the ACPI specification, then the driver should work on any system that supports this feature. > For this driver, we didn't find better sub-component for it, thus put it under > 'drivers/platform/mellanox' which is vendor specific driver by its name. drivers/platform/mellanox/ would be a good place for drivers running on a host platform with a bluefield accelerator card as an add-on, but as I understand, this is a driver that actually just runs in Linux on the bluefield itself, so it should go in a different place. We use drivers/soc/ for things that are specific to one SoC, and that are typically used by other drivers, but that don't have (and should not have) a generic abstraction, which probably is not the case here either. What we do have in drivers/power/reset is a couple of drivers that set the "reboot reason", communicating that to the firmware for the next boot, using the reboot_mode_register() interface. I don't know too much about that interface, but maybe you can use that instead of adding another sysfs interface? If you have a complex firmware on the system that you can talk to, there is also drivers/firmware/ as another option to put abstractions into. Arnd