Received: by 10.192.165.148 with SMTP id m20csp599388imm; Fri, 27 Apr 2018 04:34:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoEEXjrUwakLD5NiJ2VB9p5/U38aJpV2FPSQ7AJ9ZNPMBTYK//eLHDF8S8m7jiQZLiM/faL X-Received: by 2002:a17:902:524:: with SMTP id 33-v6mr2020086plf.25.1524828854195; Fri, 27 Apr 2018 04:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524828854; cv=none; d=google.com; s=arc-20160816; b=jFWlnCaXMJ8NKt+tq5rUojtwQ5+bSGM4SWmMPAiqKkz4fZ5NH5M4hsLc35Gj+rUABJ jOg4WMykH2o7wUIRUjR+WiFc/N81o2wk+mh9ocdNxXyY6em+uk/y0ohk9+GK8mh9NqBD GIz93XTBFrpC0S9MPVNF1V4Rach2ydd4iTKVmbtJ8ir8oc9xpoMuh7KrLYh0P4GPb2cD JKFVkm3FNRHPOI0K52BGqAEJJnZhrpm1u7bcftgOh6kUbmb8VP81H5kgRjrCM64vwj4d 7pkAI6NRx/Wx4owFnqAmUDZd3rCdmA1/ruUpoOaxcBTCyAHw9b/KxSYaFqGynql/O7Kt vKiQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=E7gbuwZB1cGIkXYtt3ndUqInFyC3cFukHrOs1ZXoPV0=; b=wQ+SfX51udr8t31+/vY5yoWa/f8dJ4f3lXEq4Uw3ggGVSNuRJAN41T3okIsPIHJuui i+V9puFE6NMt2vUM+3ZzCvEtq5Xz9oORUbOSM8qt9Bojh68avWfPoWuZCuXXMhOB8bB6 Qp4rbL2cUM3Zp2NyvbtIGBHYyygL1Ya5kO2IDBPTVi7nfb9yxACAi8Ix6seLVLrWLOZ6 yg/z0YlWS1dv4HOzJcmwVtxk4vx1CwfCQLN1HcQWPpah4MjEd1wpNqxw08x5DoI5yhqR awcdwFIfWw73/wqmzR0UbIC/H66AZxtgCf/sNNbcPYGKC7SgE0y1gFPH2sL1x13DfEzE p88w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TGKnl2fN; 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 u3-v6si1082234plb.593.2018.04.27.04.34.00; Fri, 27 Apr 2018 04:34:14 -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=@gmail.com header.s=20161025 header.b=TGKnl2fN; 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 S1757609AbeD0Lcb (ORCPT + 99 others); Fri, 27 Apr 2018 07:32:31 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:40183 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757479AbeD0Lc3 (ORCPT ); Fri, 27 Apr 2018 07:32:29 -0400 Received: by mail-qk0-f196.google.com with SMTP id h138so302769qke.7; Fri, 27 Apr 2018 04:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=E7gbuwZB1cGIkXYtt3ndUqInFyC3cFukHrOs1ZXoPV0=; b=TGKnl2fNYQcqh15alKVqB0Hz8jwGD14IixjlhsWjnma6Xn1jCdNwy8raK+3rCTPbMV hXeR64tEK5EHaIcXnfFx/LwpPlYHuO6rsxdwvDlXHy9ooixFpDtZ8socKdnbTn12jGjz 3YzyQi3LCv7uXWNl4XXzZYMlki1U/QZZX6fKxApflmNIagV7lFWbWww0fbyF4xuB4AeX DIUCdIy5YTCqqW5v4BDININoiay6OxKIo3V2YKxDISihzmzdtiSGh8gyV71X4sVn1uNN 59QYIFqHahk3beDJnbpBQ5qB0IulI7oDZxSwd01v8vPQl3T9xZldysAbdtyvEP+QobJR Zo9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=E7gbuwZB1cGIkXYtt3ndUqInFyC3cFukHrOs1ZXoPV0=; b=HsKbRjKaE4r6Ssn9zZGspXIo2iV5LsTsMM14DedicLqsr9lTDdj4AHNhQGM9xXBiT8 ninMH7Bi4MAr1i17/LHMSdhC73c9RNi2zdCDz4Eyb6yjvdschpCZYIU2Fu3kUShGc+Iz gD+ARbhJcFCaUpMpHPgxSGoGPxOYW49WhqI/YaRRsAU3jhy3/m/1r0yNxeyvlgcioyaB SayQFUSBsxl/k+XMLXnMEJPmpEl6WVN9s/7dblxetoFIRlNbTLKTXn8AI3sBZEvSbHLH uJeomBujL/Jl1ew+DgJbYD1lOpOVdVD0tBcCpV92us4wrc843XdCauYYTb0ToNDU/E4d TvvA== X-Gm-Message-State: ALQs6tBeq5mYssiyVykaybxDgygvrDZLWHiMmyhlp9Hd9CMzWGcrKaWT KJEiTQl39IJq+mGPem/jFcnMj5Kj4/lfdLcnaGA= X-Received: by 10.55.124.198 with SMTP id x189mr1528754qkc.224.1524828748869; Fri, 27 Apr 2018 04:32:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.3 with HTTP; Fri, 27 Apr 2018 04:32:28 -0700 (PDT) In-Reply-To: <1524795811-21399-3-git-send-email-sdias@codeaurora.org> References: <1524795811-21399-1-git-send-email-sdias@codeaurora.org> <1524795811-21399-3-git-send-email-sdias@codeaurora.org> From: Arnd Bergmann Date: Fri, 27 Apr 2018 13:32:28 +0200 X-Google-Sender-Auth: 64MaS-NsGvXj4Vn5zz7BxmAU5fY Message-ID: Subject: Re: [PATCH v1 2/4] mhi_bus: controller: MHI support for QCOM modems To: Sujeev Dias Cc: Greg Kroah-Hartman , Linux Kernel Mailing List , linux-arm-msm@vger.kernel.org, Tony Truong 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 Fri, Apr 27, 2018 at 4:23 AM, Sujeev Dias wrote: > QCOM PCIe based modems uses MHI as the communication protocol. > MHI control driver is the bus master for such modems. As the bus > master driver, it oversees power management operations > such as suspend, resume, powering on and off the device. > > +- compatible > + Usage: required > + Value type: > + Definition: "qcom,mhi" > + > +- qcom,pci-dev-id > + Usage: optional > + Value type: > + Definition: PCIe device id of external modem to bind. If not set, any > + device is compatible with this node. > + > +- qcom,pci-domain > + Usage: required > + Value type: > + Definition: PCIe root complex external modem connected to > + > +- qcom,pci-bus > + Usage: required > + Value type: > + Definition: PCIe bus external modem connected to > + > +- qcom,pci-slot > + Usage: required > + Value type: > + Definition: PCIe slot as assigned by pci framework to external modem These don't seem to make any sense: You seem to have access to a regular pci_device already, so why do you need to duplicate the information about it in DT? > +- qcom,smmu-cfg > + Usage: required > + Value type: > + Definition: Required SMMU configuration bitmask for PCIe bus. > + BIT mask: > + BIT(0) : Attach address mapping to endpoint device > + BIT(1) : Set attribute S1_BYPASS > + BIT(2) : Set attribute FAST > + BIT(3) : Set attribute ATOMIC > + BIT(4) : Set attribute FORCE_COHERENT > + > +- qcom,addr-win > + Usage: required if SMMU S1 translation is enabled > + Value type: Array of > + Definition: Pair of values describing iova start and stop address Why do you need these? Can't that be handled by the PCI layer? > +- qcom,msm-bus,name > + Usage: required > + Value type: > + Definition: string representing the bus scale client name to register This probably belongs into a separate binding for the bus scale driver, right? > +static struct pci_driver mhi_pcie_driver; Please try to reorder the symbols to avoid forward declarations. > +static int mhi_platform_probe(struct platform_device *pdev) > +{ > + struct mhi_controller *mhi_cntrl; > + struct mhi_dev *mhi_dev; > + struct device_node *of_node = pdev->dev.of_node; > + u64 addr_win[2]; > + int ret; > + > + if (!of_node) > + return -ENODEV; > + > + mhi_cntrl = mhi_alloc_controller(sizeof(*mhi_dev)); > + if (!mhi_cntrl) > + return -ENOMEM; > + > + mhi_dev = mhi_controller_get_devdata(mhi_cntrl); > + > + /* get pci bus topology for this node */ > + ret = of_property_read_u32(of_node, "qcom,pci-dev-id", > + &mhi_cntrl->dev_id); > + if (ret) > + mhi_cntrl->dev_id = PCI_ANY_ID; > + > + ret = of_property_read_u32(of_node, "qcom,pci-domain", > + &mhi_cntrl->domain); > + if (ret) > + goto error_probe; > + > + ret = of_property_read_u32(of_node, "qcom,pci-bus", &mhi_cntrl->bus); > + if (ret) > + goto error_probe; > + > + ret = of_property_read_u32(of_node, "qcom,pci-slot", &mhi_cntrl->slot); > + if (ret) > + goto error_probe; Please explain what you are trying to do here, why do you register two device drivers? It looks like they both refer to the same hardware, so why isn't it sufficient to have the pci_driver? Arnd