From patchwork Tue Jan 5 16:44:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 356877 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp268993ejs; Tue, 5 Jan 2021 08:39:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLVIQMgllmMdaiXa5XDJ5zpiRnE79xMuQfvy/ol5dca3RWs/EJT1fe71Tgz+RNav1UQPLq X-Received: by 2002:a17:906:fc3:: with SMTP id c3mr14012ejk.474.1609864740803; Tue, 05 Jan 2021 08:39:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609864740; cv=none; d=google.com; s=arc-20160816; b=fypP6Q/PH/Gsg4uZUGCAj5GNak/6sb4zpg8R4zWJCe+Zko3E1pLwDWuVf71lbEn4Qp 6LfOiHcOLvsuhdeMONGJTqK5WYvImeb8Ijn03ojLsTezBTIApUWFPzMmtCo0t9r4UGj1 RQLiQljwmo6dTO4aZ1X1naDGq0syrTMMZf2yFxtV85eZlVnrE9/Llh6v/TxcuELST4pK UYM7I2qIzk1xnrsAzbwghwJUftBf9xPmWxJ1salOQnUejby5aIEji6Jwpyp3w5xgEQCL 1vyJcqOtlN0HDkZ4hDd88lz5BkhQvJ2ImMBoZWJ1rmI1oo7J/H3gKk9acAf2wdVfTkkC cOgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=PF1M4i3eJFGcGpF9DAdDv9Yckj7pk60Uyo8Jps0a91k=; b=TxHqvUkAOUHVBT5iB0ZPbPvIcG7eWCK8+M6uDoKPf5g3E8bNTs97Im9wOAy75GlpYf ICX3BsQd6ZcoSBkiDUPCnLydojuDmQPU/KBfiKhtWfkBmTcFfgMTEEZMz+jnANVo8Ic+ 1ceWzCaEN/WKExa9IzvpBFC4G8M5sWBS6HSvbX6IjtbY4BkmJXAJ7tq4dMjGJGrRH/Sh TZuAjyNRyin5P+ve8JUqChcDEtwgTkpJkIK3I0sUcqgnIE+kFvApvXbXqafhT8LDGAi4 72WirO7YHCVDkZ6jvdJI4kfNovMJV27gRW7fEbNtKB3h0wZRkWuaN350XsnXs01s7jC1 OrdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t5hLj9Q3; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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. [23.128.96.18]) by mx.google.com with ESMTP id bu24si60722edb.378.2021.01.05.08.39.00; Tue, 05 Jan 2021 08:39:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t5hLj9Q3; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727497AbhAEQho (ORCPT + 15 others); Tue, 5 Jan 2021 11:37:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725880AbhAEQho (ORCPT ); Tue, 5 Jan 2021 11:37:44 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE2BEC061574 for ; Tue, 5 Jan 2021 08:37:03 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id a12so36764348wrv.8 for ; Tue, 05 Jan 2021 08:37:03 -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; bh=PF1M4i3eJFGcGpF9DAdDv9Yckj7pk60Uyo8Jps0a91k=; b=t5hLj9Q3vakjnqhN0dIRJCwGv99R8ueJ9gfr4/1Xn2lC0XTg12i/qfqHkJfUr2w0r3 3iUJ677Is6kyGLBAXH5mg73obdc5EiQscsQCBwelq6cCEWZx3E8xHxW8dKJriVCFPen5 wqKROvQH6t0OIc2q8Eea+qa+zhO7SMpogHkc1GMnZckLoTNy8br6LqOvkzgMLt8WFAnH AsVw4Bx08B0xA5BScAepV7pYxjQec5VrDIFKo6y9pBDDse+rsdDyoSgU0loUVdS+1SQQ 90tTzMBo47h+s78PyTXP2Mf0sDy3CSrjY+o9T4F2pU2P3JiNy3C8MaMfpsK7VaWSUwZZ zIfA== 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; bh=PF1M4i3eJFGcGpF9DAdDv9Yckj7pk60Uyo8Jps0a91k=; b=OFe6tRPU9h21WApGwfJhCWL393U8rZmkgVzEHB5lpsYyWgv5jxLcr1lsDMXL979UTX 2akpTsTD9CjweuX14pXw4MRhQwZP0d9FPLJ4VVmzGoQ+SQb+4OwZmb4azQJ1xsNmVfT0 K43QUpXWUW7XZ+68Yi6dZpEXzuAuqBl4/3ZyTAZOCTqvYH2cuT51DAmNPGVuMj+CCb1a 2DzGls8wf0OMh/CkrQ93zKDFhFPWoJYkazW9DFXtIX0xhuPYSMZqw69aEWglFyXxj6VU NbkTCeMzq8nqVLq1mShv30DTAjVZs0XMDTOHANJFbzZ4o3bExZ2oHNbS+R15aH9qFfNl aUkQ== X-Gm-Message-State: AOAM531naYwyvAiNA33jVShJF5siypS9MpnKcjvJEz5m6J7ZFKnS29k4 IBgru+y6y95URJjUTFT7GB0PTeQ/HcsY0g== X-Received: by 2002:adf:e74a:: with SMTP id c10mr447223wrn.122.1609864622553; Tue, 05 Jan 2021 08:37:02 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:490:8730:2285:e92f:1a49:4891]) by smtp.gmail.com with ESMTPSA id z3sm475801wrn.59.2021.01.05.08.37.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jan 2021 08:37:02 -0800 (PST) From: Loic Poulain To: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, Loic Poulain Subject: [PATCH v2 1/2] mhi: unconstify mhi_event_config Date: Tue, 5 Jan 2021 17:44:35 +0100 Message-Id: <1609865076-13890-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Some parameters may have to be determined at runtime. It is the case for the event ring MSI vector. Signed-off-by: Loic Poulain Reviewed-by: Manivannan Sadhasivam --- v2: no change include/linux/mhi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/include/linux/mhi.h b/include/linux/mhi.h index 62da830..48b1b2a 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -290,7 +290,7 @@ struct mhi_controller_config { u32 num_channels; const struct mhi_channel_config *ch_cfg; u32 num_events; - const struct mhi_event_config *event_cfg; + struct mhi_event_config *event_cfg; bool use_bounce_buf; bool m2_no_db; }; From patchwork Tue Jan 5 16:44:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 356878 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp269002ejs; Tue, 5 Jan 2021 08:39:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYO+CLMv9EjEVireIs/Qb5Uqv+7BkuxMNyUmbtwEnOACj53QdGKt2cwp2te6wV8r+0vRE+ X-Received: by 2002:a17:906:3146:: with SMTP id e6mr56592112eje.363.1609864741671; Tue, 05 Jan 2021 08:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609864741; cv=none; d=google.com; s=arc-20160816; b=QDs+vyhlYT78BxNjm+PJFTjF+ZCBS5E9ILznT6yCSfnbnfS4W0/9avoqPls8GvsNFX 2q25h0dPThRuGB9/mykEVEF6ce/N+/fNp3srcCpyFldFx0Pq11sUlaVwqrPpsRnTCfZO vyWuuWqfWLQcW9ZN5w2d4outbZICw8KISMNY0TghBk3nc+OCz8Slz9EzIgtQWOUidFyO Gh9RGaThqNH9hFZu/e0h/BwysvDLblL5wNFj091dnbiiG2tI5tGS4Eio6OaDxFh2fTpP tOtf95N5Z38YW5+/tobQKgoWv+as9mZ3Z6JuIa3VJfFcJaiGMWRSwiiFAwBY17crIbIX NRDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=X6dhxhHPhwe4AHqAolrTY98ly8nJrzDzmlYNxRcsiWM=; b=jcgDwFh0C0LoLD5Y7wJaIdlf0BCMIh3sNqBfxGD9qDg+aRxSQD5MG5ED93jHJ9XtyQ Mcx8th3Rc81h365C3NlJlbOC1/UA+DnuqTjfYT4MQo/HY8ZYkOlUPwn3fSlssSWhSOIJ fh7DdtHuv/6Ri4FC5QrRybXIW3Ir+jCtyWmmkLgNBsOlecGpg2tQB+waskD0E6X/ZxMf 5JjZA8TgbsCT4anZCGo2UsYrzZPWlm8nF7jZO72+Nz5v8frEv9yqC2+7N86SwF0E9G2H a4h5LMolF3Sz0pxcnJMNL5917DGwbdJAWbVXtGynIWlEFWCNc+OrBOEs3jUb4lxmcmwn CFQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cubo/MD/"; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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. [23.128.96.18]) by mx.google.com with ESMTP id bu24si60722edb.378.2021.01.05.08.39.01; Tue, 05 Jan 2021 08:39:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cubo/MD/"; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1728521AbhAEQhq (ORCPT + 15 others); Tue, 5 Jan 2021 11:37:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbhAEQhq (ORCPT ); Tue, 5 Jan 2021 11:37:46 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5473BC061793 for ; Tue, 5 Jan 2021 08:37:05 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id c124so112886wma.5 for ; Tue, 05 Jan 2021 08:37:05 -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:in-reply-to:references; bh=X6dhxhHPhwe4AHqAolrTY98ly8nJrzDzmlYNxRcsiWM=; b=cubo/MD/iz2qUNad4YuZL8T6D/9Mw3b8PjNf8dVbgyLA+s6n4vQTJyCo8e7o+YbQfg hnN45oFCjBnTEulyLZ9QeGKbNkGT/vhmTFZiMsr2We9Jcfg+S8LE6Lny4BZe7Uc/TsVf XfPp1jnAJWBmp2224C0U2xFUeg8vjrlhq30t76aM4HWYI/0DGewfBYbl3B+4Ep5eDr2h ISvCHP4levfzy/CNveYh+eM9L4FXavRY8yym6N/u0TNR52dw22G+dMii+dfwDGvDOodT XaZv94dy1HN/uY3uCUP9v7vrMJ3Sm5S3bz0CqSWV+oTvTbkEzcSg+fS7caZaP+t5lR7d VvQQ== 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:in-reply-to :references; bh=X6dhxhHPhwe4AHqAolrTY98ly8nJrzDzmlYNxRcsiWM=; b=KRxFC/vTqDNWVQ6V9yb35a92eIP/Qis81w5CBZChKW4YsTcBYRsPuW9g4To0XCCclH RnovdCiMCWz3DX0q4ZexuYfj4c/eGvcT5Is00WSRGI+i037pRaIux3qMMRGhgJ81GYQb FDZSWyOExjew0SwYUB+8leQ8O0k+PrWkrptU0MqZQmiWq52CZYA7EmrBUfOviecMh21d 75KHlv2EO4aCazvFxxaIxUGH4XTqSkkyUs3ciF7ODKrtvkCMubmC8i5/pDGNEVsgVp5Q FMW1Q2pPmgKBiw8UQoGEYI5M04/3F1lgP4mag9X1gAWTTNHc9YyqbcGumroh4TvC//TD 8qlw== X-Gm-Message-State: AOAM531GPvgjKIXopow9zvw4cDr34eFZruE7XGEoseAhBoZXL3RwUWEd Wfnbu4tEcls83qlsr3s2ZmXj6B2/S5uhXw== X-Received: by 2002:a1c:630b:: with SMTP id x11mr10916wmb.138.1609864624064; Tue, 05 Jan 2021 08:37:04 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:490:8730:2285:e92f:1a49:4891]) by smtp.gmail.com with ESMTPSA id z3sm475801wrn.59.2021.01.05.08.37.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jan 2021 08:37:03 -0800 (PST) From: Loic Poulain To: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, Loic Poulain Subject: [PATCH v2 2/2] mhi: pci_generic: Fix shared MSI vector support Date: Tue, 5 Jan 2021 17:44:36 +0100 Message-Id: <1609865076-13890-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1609865076-13890-1-git-send-email-loic.poulain@linaro.org> References: <1609865076-13890-1-git-send-email-loic.poulain@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When a shared MSI vector must be used (e.g. when VTd is disabled on x86_64), each event MSI vector must be set to the shared vector idx. Signed-off-by: Loic Poulain Reviewed-by: Manivannan Sadhasivam --- v2: reword MSI warning drivers/bus/mhi/pci_generic.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.7.4 Reviewed-by: Hemant Kumar diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c index 86ff0c3..5b3a23a4 100644 --- a/drivers/bus/mhi/pci_generic.c +++ b/drivers/bus/mhi/pci_generic.c @@ -154,7 +154,7 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = { MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 3), }; -static const struct mhi_event_config modem_qcom_v1_mhi_events[] = { +static struct mhi_event_config modem_qcom_v1_mhi_events[] = { /* first ring is control+data ring */ MHI_EVENT_CONFIG_CTRL(0), /* DIAG dedicated event ring */ @@ -164,7 +164,7 @@ static const struct mhi_event_config modem_qcom_v1_mhi_events[] = { MHI_EVENT_CONFIG_HW_DATA(3, 101) }; -static const struct mhi_controller_config modem_qcom_v1_mhiv_config = { +static struct mhi_controller_config modem_qcom_v1_mhiv_config = { .max_channels = 128, .timeout_ms = 8000, .num_channels = ARRAY_SIZE(modem_qcom_v1_mhi_channels), @@ -295,8 +295,12 @@ static int mhi_pci_get_irqs(struct mhi_controller *mhi_cntrl, } if (nr_vectors < mhi_cntrl->nr_irqs) { - dev_warn(&pdev->dev, "Not enough MSI vectors (%d/%d), use shared MSI\n", - nr_vectors, mhi_cntrl_config->num_events); + dev_warn(&pdev->dev, "using shared MSI\n"); + + /* Patch msi vectors, use only one (shared) */ + for (i = 0; i < mhi_cntrl_config->num_events; i++) + mhi_cntrl_config->event_cfg[i].irq = 0; + mhi_cntrl->nr_irqs = 1; } irq = devm_kcalloc(&pdev->dev, mhi_cntrl->nr_irqs, sizeof(int), GFP_KERNEL);