Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp661742ybl; Fri, 31 Jan 2020 05:52:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxKEmc7MO/VKebL/9Q8KjPNef6jK2FoO9eUpqWIQcfsvPqpVAFzskyVIU72l9DsttHv3VuN X-Received: by 2002:a9d:4e92:: with SMTP id v18mr7183490otk.47.1580478745602; Fri, 31 Jan 2020 05:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580478745; cv=none; d=google.com; s=arc-20160816; b=miF6fkvETUoaiD2LnfCotT+FGwX4CDr7xs88QxNrNTbUAj7KkQL3eedK6JVMBcYla7 dEdRVgjZJetSNcF4ql5MphRU5sf5RZwst+siCny7kStVx3o4E2llLqH0maGz05pn0us9 yhOQfT+XDuz5ck+xgzM+N871JXk6x4Oh8jJA7qrjcFpdrwqygbAXBlnQiXJOjONPKlo7 prAvuOQtG0UtfE90YZg47/e57jzSFMMUu5DSmYPNHmYXc6wP1lqPUp2SZ0M+pMCwp1+n inuVRuKhKxdkYzxWzkdmILYar7fD7/nUyE6tGMsvTlK6M1Yajmq9Txx4fzJOFRBZjhLo 2HQA== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=juqgOO2FL60raSBrCGSqEUGB0rKVEh3eeYHpqpHB/eU=; b=zJKHDpS+ht9bTfhid5AujzMjia9A7MjpiX3YZIz20nR1wKMueI/6wF2o2HKVXHHiZP fy9K2QEwl1AT0jQmc/10v8dQTPxtgbKy6919B4dx9ho7CuqaBYnCxnWjQxmfVbuTula0 A+1S+JyK77BnxvfhTLa8VW9LwMbsyQ+HNPtstLCcb7t0RuL1wsO3zaTVBd4t12h9Fyjp D6pxvhsOlpq1ACzK/aRo0wShx6PIdTt3HiAi1tG0kCHHVeBVW3YZTo2P0PZtVoFAs56n hzFGimwVcqhpAZA2UbyEPUjm6xDfwN7bOXUpKnkIWS1B2G34VxeHD30q49S+83dk7P8l LEuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s5ARJ9CR; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si2717601oth.243.2020.01.31.05.52.14; Fri, 31 Jan 2020 05:52:25 -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=@linaro.org header.s=google header.b=s5ARJ9CR; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728768AbgAaNuV (ORCPT + 99 others); Fri, 31 Jan 2020 08:50:21 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:35715 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728500AbgAaNuU (ORCPT ); Fri, 31 Jan 2020 08:50:20 -0500 Received: by mail-pl1-f196.google.com with SMTP id g6so2766012plt.2 for ; Fri, 31 Jan 2020 05:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=juqgOO2FL60raSBrCGSqEUGB0rKVEh3eeYHpqpHB/eU=; b=s5ARJ9CROh+uPH+LpnaPq04a3AKX183oEk1aHAqV044nv5oq4gkZP3SJPiaQu6FKEV RY95MNXwujsxWQ1Hs3pUSWPGtKLJj2OPxWlKcMLU36fkCTlxloTvPFuSfz1TZLTYKGfg Uo7TWRmJIHs8dNdw0NA6rcjroWvpgUptSbY2E9DKQ0BpJ5aN5R6SxMQ0UaFIL+xBbOSb PZmr+r5xlURUYBhI3ykB/bWWtRqljNdoC/ACSf8uXvcqJvSoyZ6yAPg7kcpS/amwyB6e I9xvGciuu/O4+ZVmVmwwDuC5vgnZ8Nkwx/+HdDv+12/UCr/wucVqj95fH7BdN9sCW6GH Es0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=juqgOO2FL60raSBrCGSqEUGB0rKVEh3eeYHpqpHB/eU=; b=DiA+z2tdH88vUKV7fAYcncxSXtfx0rz/kDVyUAEOhxhite6y0ExIILobZFYDfIZUN6 UEQ+QPa+QH1Oia1sS4/PGCSptGwCrSa9gzzDyWXO++HbJ+heevYrDutJWS/AacN051N/ HuxnHKvDTDo7g3iHztm0ytIIIkVr/TIPj2hXngkdpnjqWwPp3NGlxCp996wYlxq9nVQS lew4P09+h2gRTECo+frf/ximnG4MfLBK7ON7GWqqzhAQ0R9JKly7n+/J0cqJt+xjMXcu zEQgyVNQf3Ryewq5pVTQynW806isQ5c4l3uM8TTWKdidCBvJ+rClpXajZdNhFKHPL/ye IJHg== X-Gm-Message-State: APjAAAXiffhvWjA5mfm2bI1beNCkKJPfhd3zH8Cuix/XPQiqsc9HYywN 5Um1WB1BDp5uJpJ1vpJq+fTd X-Received: by 2002:a17:90a:bd97:: with SMTP id z23mr5184198pjr.19.1580478618523; Fri, 31 Jan 2020 05:50:18 -0800 (PST) Received: from localhost.localdomain ([103.59.133.81]) by smtp.googlemail.com with ESMTPSA id p3sm10625632pfg.184.2020.01.31.05.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jan 2020 05:50:17 -0800 (PST) From: Manivannan Sadhasivam To: gregkh@linuxfoundation.org, arnd@arndb.de Cc: smohanad@codeaurora.org, jhugo@codeaurora.org, kvalo@codeaurora.org, bjorn.andersson@linaro.org, hemantk@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH v2 00/16] Add MHI bus support Date: Fri, 31 Jan 2020 19:19:53 +0530 Message-Id: <20200131135009.31477-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This is the second attempt at adding the MHI (Modem Host Interface) bus interface to Linux kernel. MHI is a communication protocol used by the host processors to control and communicate with modems over a high speed peripheral bus or shared memory. The MHI protocol has been designed and developed by Qualcomm Innovation Center, Inc., for use in their modems. The first submission was made by Sujeev Dias of Qualcomm: https://lkml.org/lkml/2018/4/26/1159 https://lkml.org/lkml/2018/7/9/987 This series addresses most of the review comments by Greg and Arnd for the initial patchset. Furthermore, in order to ease the review process I've splitted the patches logically and dropped few of them which were not required for this initial submission. Below is the high level changelog: 1. Removed all DT related code 2. Got rid of pci specific struct members from top level mhi structs 3. Moved device specific callbacks like ul_xfer() to driver struct. It doesn’t make sense to have callbacks in device struct as suggested by Greg 4. Used priv data of `struct device` instead of own priv data in `mhi_device` as suggested by Greg. This will allow us to use dev_set{get}_drvdata() APIs in client drivers 5. Removed all debugfs related code 6. Changes to the APIs to look uniform 7. Converted the documentation to .rst and placed in its own subdirectory 8. Changes to the MHI device naming 9. Converted all uppercase variable names to appropriate lowercase ones 10. Removed custom debug code and used the dev_* ones where applicable 11. Dropped timesync, DTR, UCI, and Qcom controller related codes 12. Added QRTR client driver patch 13. Added modalias support for the MHI stack as well as client driver for autoloading of modules (client drivers) by udev once the MHI devices are created This series includes the MHI stack as well as the QRTR client driver which falls under the networking subsystem. The reference controller implementation is here: https://git.linaro.org/people/manivannan.sadhasivam/linux.git/tree/drivers/net/wireless/ath/ath11k/mhi.c?h=ath11k-qca6390-mhi It will be submitted later along with ath11k patches. Following developers deserve explicit acknowledgements for their contributions to the MHI code: Sujeev Dias Siddartha Mohanadoss Hemant Kumar Jeff Hugo Thanks, Mani Changes in v2: * Added put_device to mhi_dealloc_device * Removed unused members from struct mhi_controller * Removed the atomicity of dev_wake in struct mhi_device as it is not required * Reordered MHI structs to avoid holes * Used struct device name for the controller device * Marked the required and optional mhi_controller members for helping the controller driver implementation * Cleanups to the MHI doc * Removed _relaxed variants and used readl/writel * Added comments for MHI specific acronyms * Removed the usage of bitfields and used bitmasks for mhi_event_ctxt and mhi_chan_ctxt * Used __64/__u32 types for structures representing hw states * Added Hemant as a co-maintainer of MHI bus. He is from the MHI team of Qualcomm and he will take up reviews and if possible, maintainership in future. Manivannan Sadhasivam (16): docs: Add documentation for MHI bus bus: mhi: core: Add support for registering MHI controllers bus: mhi: core: Add support for registering MHI client drivers bus: mhi: core: Add support for creating and destroying MHI devices bus: mhi: core: Add support for ringing channel/event ring doorbells bus: mhi: core: Add support for PM state transitions bus: mhi: core: Add support for basic PM operations bus: mhi: core: Add support for downloading firmware over BHIe bus: mhi: core: Add support for downloading RDDM image during panic bus: mhi: core: Add support for processing events from client device bus: mhi: core: Add support for data transfer bus: mhi: core: Add uevent support for module autoloading MAINTAINERS: Add entry for MHI bus net: qrtr: Add MHI transport layer net: qrtr: Do not depend on ARCH_QCOM soc: qcom: Do not depend on ARCH_QCOM for QMI helpers Documentation/index.rst | 1 + Documentation/mhi/index.rst | 18 + Documentation/mhi/mhi.rst | 218 ++++ Documentation/mhi/topology.rst | 60 ++ MAINTAINERS | 10 + drivers/bus/Kconfig | 1 + drivers/bus/Makefile | 3 + drivers/bus/mhi/Kconfig | 14 + drivers/bus/mhi/Makefile | 2 + drivers/bus/mhi/core/Makefile | 3 + drivers/bus/mhi/core/boot.c | 508 ++++++++++ drivers/bus/mhi/core/init.c | 1301 ++++++++++++++++++++++++ drivers/bus/mhi/core/internal.h | 699 +++++++++++++ drivers/bus/mhi/core/main.c | 1576 +++++++++++++++++++++++++++++ drivers/bus/mhi/core/pm.c | 967 ++++++++++++++++++ drivers/soc/qcom/Kconfig | 1 - include/linux/mhi.h | 661 ++++++++++++ include/linux/mod_devicetable.h | 13 + net/qrtr/Kconfig | 8 +- net/qrtr/Makefile | 2 + net/qrtr/mhi.c | 207 ++++ scripts/mod/devicetable-offsets.c | 3 + scripts/mod/file2alias.c | 10 + 23 files changed, 6284 insertions(+), 2 deletions(-) create mode 100644 Documentation/mhi/index.rst create mode 100644 Documentation/mhi/mhi.rst create mode 100644 Documentation/mhi/topology.rst create mode 100644 drivers/bus/mhi/Kconfig create mode 100644 drivers/bus/mhi/Makefile create mode 100644 drivers/bus/mhi/core/Makefile create mode 100644 drivers/bus/mhi/core/boot.c create mode 100644 drivers/bus/mhi/core/init.c create mode 100644 drivers/bus/mhi/core/internal.h create mode 100644 drivers/bus/mhi/core/main.c create mode 100644 drivers/bus/mhi/core/pm.c create mode 100644 include/linux/mhi.h create mode 100644 net/qrtr/mhi.c -- 2.17.1