Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1272687imm; Tue, 5 Jun 2018 11:45:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIgP27BP00lSzuSra4j9clE4blOdHFvFTAr0gLDLHqxVw2T23xnHOZDyvewpMVyWoREF/GD X-Received: by 2002:a17:902:bc44:: with SMTP id t4-v6mr27798352plz.139.1528224342746; Tue, 05 Jun 2018 11:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528224342; cv=none; d=google.com; s=arc-20160816; b=QNO3vndsDNkFD5TPQsJRSR0DmCbxlEn3B7T+o09Z18NTSJzfkdkjbwQYBLPmYqrm2j uoywnVGpnqW/gXY+zU+IyNtceYKRwS5OWH1UZj4jOpll8h+lf9+RGMi2UiGkw6dtcCV4 FMaUOEcuANfksvicpiLA8OhEEH1opD28RHoasH8rdLY9zxyX1zGxvAtiEtuxfVihO7vi UCeLEj31GHrpQDJQI+E0byzDh8X6WsY7CkNW11bNhIiP3PzbM+sqEzO7RlDS1ulDD8F7 LfZaHDcHrfxFacDDE8lcr1mM2wEeYy/2RV2FixssB+u7Y28fIQgbk6gEt0Am5rxN7sxo OgIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=fxy2iXUobQGuB4KY4CLKMgfukyNQLS7KssJcA1m6NZQ=; b=e59PrD1W6NK86Af2UsJftuDq2T042ZSDvKkavMPx3a6HxcqAOJ8PxNb+DO04OGb9YU Y/KETveqNtGJXezHwbAV9S2W5jZpG5O22cjJXkz9XTG63WebbpwNSCr+7WOITSzND7xT NEZ17OfkvFW9O/wYBLAnI/j00hcqWwhWP0DPXDGr5TA3A0YgMTReDGFwk4xaE83Gv6Mo p+Sp2FOwvVvpuQlbzOh0sflGsgJ8QlLSZHNMpoOCPCRD+ofwkOke3KSXOAqIYZ+taCm3 uHULf9qnFf+2OOPrzEcCl7V7eluMA6ns9aqOPHn/vEjnkDd8xWWDcm+sFICLeNAFD9lP eThA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@de.bosch.com header.s=2015-01-21 header.b=ULHQGUNW; 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=fail (p=NONE sp=NONE dis=NONE) header.from=de.bosch.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 126-v6si8374048pgi.254.2018.06.05.11.45.27; Tue, 05 Jun 2018 11:45:42 -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=@de.bosch.com header.s=2015-01-21 header.b=ULHQGUNW; 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=fail (p=NONE sp=NONE dis=NONE) header.from=de.bosch.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752005AbeFESoz (ORCPT + 99 others); Tue, 5 Jun 2018 14:44:55 -0400 Received: from de-out1.bosch-org.com ([139.15.230.186]:48968 "EHLO de-out1.bosch-org.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886AbeFESov (ORCPT ); Tue, 5 Jun 2018 14:44:51 -0400 Received: from si0vm1948.rbesz01.com (unknown [139.15.230.188]) by fe0vms0187.rbdmz01.com (Postfix) with ESMTPS id 410ghb0l6zz1XLFYb; Tue, 5 Jun 2018 20:44:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1528224287; bh=VWVvtQcFtizFszwm8DZJOIWoEBPFxwMLO8vkqid52IA=; l=10; h=From:From:Reply-To:Sender; b=ULHQGUNWFKAoEDsyN60N+L+F4q2jeqFrVuWxfO7BOYnDCdD6t/f+VlRG0pVf2cwZu RPcvOUtuBNrNOqRKFVG2S5ZtOyrMhCGRb6/8/AkpQmv7LUFs8DKBLs0ORWdtwyY/3x qgsiqgo41QYEUXlOSShQKw3iSNCmSE1r+G6t2ahY= Received: from si0vm2082.rbesz01.com (unknown [10.58.172.176]) by si0vm1948.rbesz01.com (Postfix) with ESMTP id 410ghb0JlHz1S1; Tue, 5 Jun 2018 20:44:47 +0200 (CEST) X-AuditID: 0a3aad16-bcfff70000000413-16-5b16da1a1985 Received: from fe0vm1652.rbesz01.com ( [10.58.173.29]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by si0vm2082.rbesz01.com (SMG Outbound) with SMTP id 67.09.01043.A1AD61B5; Tue, 5 Jun 2018 20:44:42 +0200 (CEST) Received: from SI-HUB1000.de.bosch.com (si-hub1000.de.bosch.com [10.4.103.106]) by fe0vm1652.rbesz01.com (Postfix) with ESMTPS id 410ghZ5LpqzBcvN; Tue, 5 Jun 2018 20:44:46 +0200 (CEST) Received: from luchador.grb-fir.grb.de.bosch.com (10.19.187.97) by SI-HUB1000.de.bosch.com (10.4.103.106) with Microsoft SMTP Server id 14.3.319.2; Tue, 5 Jun 2018 20:44:46 +0200 From: Mark Jonas To: Wolfgang Grandegger , Marc Kleine-Budde CC: , , , , , Mark Jonas Subject: [PATCH 0/5] can: enable multi-queue for SocketCAN devices Date: Tue, 5 Jun 2018 20:43:55 +0200 Message-ID: <1528224240-30786-1-git-send-email-mark.jonas@de.bosch.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: H4sIAAAAAAAAA22SX0wTWRjFuZ1hOjSMGaZQPwroZtQXglgBQ6OiBh+2iVmzIdkH5WF3kIE2 0oIzBYH4UBXUKlkFV3e3IjYsRsWAQLZsARWpRsBE0a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linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ++++++++++++ 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 -- 2.7.4