Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11042641imu; Thu, 6 Dec 2018 10:33:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/W9h2LsgUc8Emn7qrQy05aU7Kz1AZU9n/icVVCeKhqyWv995r2t6RWgClnkkoexV2eX1PgK X-Received: by 2002:a62:f907:: with SMTP id o7mr29018780pfh.244.1544121221953; Thu, 06 Dec 2018 10:33:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544121221; cv=none; d=google.com; s=arc-20160816; b=r/PWrVgtal+8c9Psy/qRdPvoSG+jvarcRFwDt6b7DGp5yy/ATImfRs3dvGF3FJjOyD IrfjJMj2UigoMTEg2h2iOa74c8j0Nz6ntv7mW3SiDzIFfW4qjq6SoN6Yi6OGk4shK7Xh A5HwckHWnQG8vBz4ybaJnC2XrHWlHIrSmi89RaCKzcwtsLXjdTCrrabfQJjFDvPtraDx kHfa/lFICqoas8oIVIYXfsFR0/BsLMR1f+aZWYzewzR8ilCIXRtDM2w9OSQ8k96GU1x5 vFv46MFCvqQF/gdlspFgIzj4Z4RW2uKXiMKbQI+mTewYss4ZI4aJl6nqiRm00nrxpUj0 702Q== 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:dkim-signature; bh=gh7ZUgbqrm9SKh0ksdnDI4M+/U5pKyJCDXFkPytmxoM=; b=xR7LhCbnTZgUmQ4lpQm2AF/QYPge7Y22NhrKWP0gled5xbkN/qIissoTYSe51jqnHs +6KMyNND31orQrzlO9uQPFWD0/rZd6+bGsMWQqXPp8bBaUKywhq3dWw5MSS5GXLX1sIu K82i3wosmBxHtUzToQTPah3sxJVAjwro5c7u0OI1BP9FN9NqNBNycKCaxAKUOG5yqPn2 zhMx9TZ0qw9vwVySCXNc9nUUvV4IHFR0GszksYXEas6L/2z21BXeXK8Yb2p+SNEjuLeG lTpGyBxDEbnVI4shiBN4bJKqmHkG42KXSdLQcM7pO5M6VWYDKcWWjVeivKzEUn96U/mu kgFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bXP02Z9G; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h69si768654pge.121.2018.12.06.10.33.24; Thu, 06 Dec 2018 10:33:41 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=bXP02Z9G; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725992AbeLFSc1 (ORCPT + 99 others); Thu, 6 Dec 2018 13:32:27 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:33249 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbeLFSc1 (ORCPT ); Thu, 6 Dec 2018 13:32:27 -0500 Received: by mail-ot1-f68.google.com with SMTP id i20so1377850otl.0; Thu, 06 Dec 2018 10:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gh7ZUgbqrm9SKh0ksdnDI4M+/U5pKyJCDXFkPytmxoM=; b=bXP02Z9Gb28E8s2oQwdlkV1NSnxuPgDJcJcA0ztO6hK/ntk2OWocyJMFxXJaEUdwZN opZYmWQJ1hZOWN+HSQyiXeax50rFsT5E0G4vvhfq3sUqgUtGLcPGDWIVjKCkfA+iGMuz aeN1pEi2NEGrOr2AL1wFQPQu+hqKVGFDvVrTXQZH6n3pUceZPItp18WO3gwyUnX6+cRA QyxK9kliQ0EgKg9VKYhdL4VFhUOA9o5VGDAshwrUXLDmKPb286Y2UjX5bDZhaBQzsja+ HCH5v0+f+8PK3fu+WruUOjiv/ugznYs4xpvRDHJRzPOiO/nnhQJBp/A0o+MKArUtFaNC 8a0Q== 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=gh7ZUgbqrm9SKh0ksdnDI4M+/U5pKyJCDXFkPytmxoM=; b=lyo1/64KjSPQ5NCORy177GZGmB01H9zgKpj+3JZgQEfQ8BaL39L1eZh8R8iaAVqxFq Gb9g3hiZdHurfXcMYJNzH+ppfvXwOqh5qgh2M2uW7qH7g2WDMvPwaYcPU3PNWFFsEmb+ APeSwK7aBmCoxNcugNvmphdV7YDpxvVJd56BLjKgyG6uYnI224GYPCq0EWdbBYtOcdbT s3ACkV7iHmkjPZfnzXFoxQiylNsFj/P0KQNZNo95TyNpQ/wMbvu4Dv1GtAQFbquCJzOz vvOUrlKp/rhb8jSk4mjh8rRFsy19Str714MH9bzPOahuerKS3/e50P++rj4OErQ1iiAT 0LIw== X-Gm-Message-State: AA+aEWb7unCsEGEBc8/egwHHE/3Ck23HjJJucDcZa7q5AeZIWbkfA2vw 9pvP3aMfgL+b/TqvpedNwOjq4n5qL5llKc8lhTE= X-Received: by 2002:a9d:b8e:: with SMTP id 14mr17687346oth.279.1544121146030; Thu, 06 Dec 2018 10:32:26 -0800 (PST) MIME-Version: 1.0 References: <20181204220224.27324-1-TheSven73@googlemail.com> <20181204220224.27324-2-TheSven73@googlemail.com> <20181205101659.GA27058@kroah.com> <20181205191724.GA434@kroah.com> <20181206140750.GB18947@kroah.com> In-Reply-To: <20181206140750.GB18947@kroah.com> From: Sven Van Asbroeck Date: Thu, 6 Dec 2018 13:32:14 -0500 Message-ID: Subject: Re: [PATCH v5 1/6] fieldbus_dev: add Fieldbus Device subsystem. To: gregkh@linuxfoundation.org Cc: Sven Van Asbroeck , robh+dt@kernel.org, Linus Walleij , Lee Jones , mark.rutland@arm.com, =?UTF-8?Q?Andreas_F=C3=A4rber?= , treding@nvidia.com, David Lechner , noralf@tronnes.org, johan@kernel.org, Michal Simek , michal.vokac@ysoft.com, Arnd Bergmann , john.garry@huawei.com, geert+renesas@glider.be, robin.murphy@arm.com, paul.gortmaker@windriver.com, sebastien.bourdelin@savoirfairelinux.com, icenowy@aosc.io, Stuart Yoder , maxime.ripard@bootlin.com, Linux Kernel Mailing List , devicetree 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 Hi Greg, On Thu, Dec 6, 2018 at 9:07 AM Greg KH wrote: > > And as these are really devices, why not make them a "device" and a bus? > What type of topology do you have on these busses? Are everything > "flat" and connected directly to a PCI/USB/platform device? Or are > there multiple devices attached to a single controller? > > It really feels like you want to use 'struct device' and a bus_type and > not a class here to me... > I don't believe that the bus/device abstraction is appropriate for fieldbus peripherals. But obviously I'm not a fieldbus or kernel expert, so I keep an open mind to any elegant solutions I may have missed. The name FieldBUS is misleading - it's an industrial network, not a bus. The underlying network technology varies: Profinet runs over Ethernet, Profibus over RS485. The topology is typical for networks AFAIK. The actual layout of the raw packets exchanged over the network is proprietary; fieldbus cards will typically implement this internally, and hide the details. To the user, a fieldbus card typically exposes shared memory regions. For example, a robotic arm may store its arm angle at offset 27 of its memory region. The PC controlling the arm writes a new value to offset 27 in the memory of its own fieldbus card. The cards then communicate over the network, the memory in the arm's fieldbus card is updated, and the arm is notified of the data change by an interrupt. Like I said, I'm by no means a fieldbus expert. But this 'feels' unlike a device/bus abstraction. And it also doesn't 'feel' right to make this part of the network stack. But I keep an open mind. Sven