Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1839676imm; Thu, 7 Jun 2018 00:56:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKLwoyarhMj6+IZPsqyyvVLLr581U6D5ZJVWAC1f5vNUglY3rhNVi0bckhiKwSLY801UL1O X-Received: by 2002:a17:902:1023:: with SMTP id b32-v6mr909685pla.145.1528358199674; Thu, 07 Jun 2018 00:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528358199; cv=none; d=google.com; s=arc-20160816; b=clgRfznWNVFWaf1vHUN3jpy0F3TzJPNyhqQXVEARcaeygTOb5ldY24BRDOWPIZc9b+ X3CR29bifYVHrl3w+hTuSxZdEH0ao9OG/f0d4IgX/c1Ujh2eiTaW7bNXPH/7tIgRcXVq hczHlgzG+hTgAcCG7S3PcTqK+w1ZvQno5Y1y6cO/Mbzr8/qbqmfk+MZirFTsF4DDQ7Rl t4+fTS/rgx5zod68cLa34LvM+c2VZJtmnm8Vcmlk54pdvepzEn8WAay59VSNv0MMpFIE z5L4NeY+uSCs2h3+a8b3ntsSVyH8cBJWqecmq+aiiHiNAz7aYtLDVs7w1EGzpOeWIKeJ UDwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Zjsr9iM5NRJN32C3bN3+dJkd6WuNgwbA2/gzfYnlOKE=; b=pUEaq6cKjys0f7NvbfAcgrtQw2aUfekJk9spXjXDRVtFoYLEIeUii2TRho6q02ZMmW MUtlZcsm9Zqw22/htagIRVZDOAnjTnKRWc+RVOl9d2EHXhz64yCRkFZSMGyGwM7OYHhx PnKtQUTMgx93T1PcxSp8C1pHjBzpHbFoWO8TbWJ6BDzZGjQHzK9G09esfQc5QVgk+U5A bVNyRgXdA6wf+94uvI5yJU4v103+Zcxi8aLZDY/6/fVUY6oHOMwa1kAfnYj4qIOPIaC/ qn8QoN/suCH1Lp+Gm2pHjx+mCccUKSdR348ocl56k3wMQ/0GwZj2tFwvDtmKOuX5oQtW 5UfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hartkopp.net header.s=strato-dkim-0002 header.b=l4x+7Vyb; 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 g12-v6si6286945pgu.515.2018.06.07.00.56.25; Thu, 07 Jun 2018 00:56:39 -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=@hartkopp.net header.s=strato-dkim-0002 header.b=l4x+7Vyb; 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 S1753306AbeFGHWt (ORCPT + 99 others); Thu, 7 Jun 2018 03:22:49 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.51]:17538 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752620AbeFGHWr (ORCPT ); Thu, 7 Jun 2018 03:22:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1528356162; s=strato-dkim-0002; d=hartkopp.net; h=In-Reply-To:Date:Message-ID:From:References:Cc:To:Subject: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=Zjsr9iM5NRJN32C3bN3+dJkd6WuNgwbA2/gzfYnlOKE=; b=l4x+7Vybs48rMJhlIzKH5MSwTPXyQIZk/+r3nJIgG6Gckhmq5vYRcI2bm8kZWzljCp xbkF8cQRcN7qKj/VPYExIlWVg936D8WjqWockqsxrwsXfHdBxAxPmG5LkY8PC1nJzGiu Q4ZsSA8W+TIkGkOMK1BMnGl9zlQUVc6m8KpZIBycfgU5Jgxg6AbsCiRKXHug7SqyCQ8O tDgRYQ0qoXzcW09oYEYKS1n6284SdQwnjIUgOeyrocm4jtweA/IvPCcvN2daFPb8fHcP 7JwQRhrIHwITsZnCueYGZNASlmT4r053E313542DqHN8CY4nH7Jh/8ftIANSdve4ofe5 G7Xg== X-RZG-AUTH: ":P2MHfkW8eP4Mre39l357AZT/I7AY/7nT2yrDxb8mjG14FZxedJy6qgO1rHLMalyLi1fNpX87/zI=" X-RZG-CLASS-ID: mo00 Received: from [10.180.29.82] by smtp.strato.de (RZmta 43.10 DYNA|AUTH) with ESMTPSA id j0912bu577MfD33 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 7 Jun 2018 09:22:41 +0200 (CEST) Subject: Re: [PATCH 0/5] can: enable multi-queue for SocketCAN devices To: Mark Jonas , Wolfgang Grandegger , Marc Kleine-Budde Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, hs@denx.de, yi.zhu5@cn.bosch.com References: <1528224240-30786-1-git-send-email-mark.jonas@de.bosch.com> From: Oliver Hartkopp Message-ID: Date: Thu, 7 Jun 2018 09:22:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1528224240-30786-1-git-send-email-mark.jonas@de.bosch.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/05/2018 08:43 PM, Mark Jonas wrote: > Upon request by Marc Kleine-Budde this patch series does not only > contain our patch to enable enable multi-queue for SocketCAN devices > but also a driver (Companion driver suite) which makes active use of > this feature. > > The driver suite implements > - two CAN interfaces > - one generic command interfaces > and offers a SocketCAN as well as a char device interface. The > SocketCAN interface supports multi-queue. > > The functionality bases on an external peripheral chip named Companion. > It offers two CAN interfaces, each has 8 prioritized transmit FIFOs as > well as one receive FIFO. Besides CAN, undisclosed additional functions > can be accessed through the char device. > > A standard SPI interface with two additional lines for flow control is > used. The Companion chip is the SPI slave. > > The driver suite consists of three separate drivers. The following > diagram illustrates the dependencies in layers. > > /dev/companion SocketCAN User Space > ------------------------------------------------------------------- > +----------------+ +---------------+ > | companion-char | | companion-can | > +----------------+ +---------------+ > +----------------------------------+ > | companion-spi | > +----------------------------------+ > +----------------------------------+ > | standard SPI subsystem | > +----------------------------------+ Linux Kernel > ------------------------------------------------------------------- > | | | | | | Hardware > CS-+ | | | | +-BUSY > CLK--+ | | +---REQUEST > MOSI---+ | > MISO-----+ > > companion-spi > core.c: handles SPI, sysfs entry and interface to upper layer > protocol-manager.c: handles protocol with the SPI HW > queue-manager.c: handles buffering and packets scheduling > > companion-can > makes use of multi-queue support and allows to use tc to configure > the queuing discipline (e.g. mqprio). Together with the SO_PRIORITY > socket option this allows to specify the FIFO a CAN frame shall be > sent to. > > companion-char > handles messages to other undisclosed functionality beyond CAN. > > Zhu Yi (5): > can: enable multi-queue for SocketCAN devices > spi: implement companion-spi driver > char: implement companion-char driver > can: implement companion-can driver > spi,can,char: add companion DT binding documentation > > .../devicetree/bindings/spi/bosch,companion.txt | 82 ++ > drivers/char/Kconfig | 7 + > drivers/char/Makefile | 2 + > drivers/char/companion-char.c | 367 ++++++ > drivers/net/can/Kconfig | 8 + > drivers/net/can/Makefile | 1 + > drivers/net/can/companion-can.c | 694 ++++++++++++ Please place the companion driver in drivers/net/can/spi/companion.c It also makes more sense in the Kconfig structure. Probably this naming scheme also makes sense for linux/drivers/char/spi/companion.c then ... If not it should be named at least drivers/char/companion-spi.c or drivers/char/spi-companion.c BR Oliver > drivers/net/can/dev.c | 8 +- > drivers/spi/Kconfig | 2 + > drivers/spi/Makefile | 2 + > drivers/spi/companion/Kconfig | 5 + > drivers/spi/companion/Makefile | 2 + > drivers/spi/companion/core.c | 1189 ++++++++++++++++++++ > drivers/spi/companion/protocol-manager.c | 1035 +++++++++++++++++ > drivers/spi/companion/protocol-manager.h | 348 ++++++ > drivers/spi/companion/protocol.h | 273 +++++ > drivers/spi/companion/queue-manager.c | 146 +++ > drivers/spi/companion/queue-manager.h | 245 ++++ > include/linux/can/dev.h | 7 +- > include/linux/companion.h | 258 +++++ > 20 files changed, 4677 insertions(+), 4 deletions(-) > create mode 100644 Documentation/devicetree/bindings/spi/bosch,companion.txt > create mode 100644 drivers/char/companion-char.c > create mode 100644 drivers/net/can/companion-can.c > create mode 100644 drivers/spi/companion/Kconfig > create mode 100644 drivers/spi/companion/Makefile > create mode 100644 drivers/spi/companion/core.c > create mode 100644 drivers/spi/companion/protocol-manager.c > create mode 100644 drivers/spi/companion/protocol-manager.h > create mode 100644 drivers/spi/companion/protocol.h > create mode 100644 drivers/spi/companion/queue-manager.c > create mode 100644 drivers/spi/companion/queue-manager.h > create mode 100644 include/linux/companion.h >