From patchwork Fri Mar 5 19:16:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 393584 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp690458jai; Fri, 5 Mar 2021 11:09:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVVPR0TLyiU3zDXJlEjYCDDLzPL+MYUgegXn1t8xi6edJnQq//OjtArkgXRs5nZfg21njH X-Received: by 2002:a05:6402:3049:: with SMTP id bu9mr10813290edb.104.1614971347860; Fri, 05 Mar 2021 11:09:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614971347; cv=none; d=google.com; s=arc-20160816; b=a/KLoBOI59ewin3Z15zeqnXjk9NGgl6zrQh+Q5/pPeKhhno31gmbk+1VTT63P2Nb54 09lfG3A35Gspg4Rx3jm3mWb4tporx4pNHOLoAfXvOuLTl/u5dle2RY2ocjRldzppjV3Q eTgL2rT6FgCEg0Vy7T6khyA+XDTUDUD9ylZs1r7+b+INq7tLNevboQcAcOp+VsGypAZB MwVpi4ujGshsH5JV75oybFV9RbaTkR+sKMphzuEH82zG8SlVrGJonuqNxOYczVDiS5Fb WWvDPKmqBkMZVdaD5S2eNF1DnNC6c7xhMXBaiMrNJ4eSxT/f1g4hK9DeQ2bRC6XFAObC Mkhw== 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=VV6l2UYIK3KjG62wbZQyRbbCwbcaL9xMG+xJectCaSQ=; b=LPxqpFt7mtmU6oDdMJkikwUPDHU3+kaAXcMU5+G6fg5BbEUZ8qEJeNDJ9Nwl8fP1Xc yOKwyKPOqapr8T5fpXQvRa/chG4tEooFk3VI963SLArqqCERXL+ehlF+BiWs8LGhLdY8 ZQaKfEOHitOTnnSyp++LpLD3t2+Zy/edLIFpwQ3A6Wu96GRckukYNHlvcZ5GUrcE2U5/ bv31oMb7XFCYJQVmKGwb8zsH7vJ+Ua23KoVgfKwhtoNInUfgui1oueZ/qaUO/o4awk7n 4HTL8uXjKUSSaB2lQJotsdQVKHl48EUfLVS8iffphXritynEIS0ll1Un/doA5M2+2teU Vr0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bzxxKMo6; 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 ml22si1089671ejb.629.2021.03.05.11.09.07; Fri, 05 Mar 2021 11:09:07 -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=bzxxKMo6; 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 S229589AbhCETIf (ORCPT + 16 others); Fri, 5 Mar 2021 14:08:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbhCETIX (ORCPT ); Fri, 5 Mar 2021 14:08:23 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6046FC061574 for ; Fri, 5 Mar 2021 11:08:22 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id d11so3238673wrj.7 for ; Fri, 05 Mar 2021 11:08:22 -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=VV6l2UYIK3KjG62wbZQyRbbCwbcaL9xMG+xJectCaSQ=; b=bzxxKMo6Ogos8ed1bQ6s6udD/kJ9kQL+1u7FQeFbjidgEvu7cBJ7VGiE9Pl9+cvX6e sAxLTFoXPOWnUBZO+tojPnSHCleOjw8eb0nXTbsvx62naFi+h5VJUSF4vHvLERKNnEgS F+Y5H5XYcK759NObYrQN1pJafRKkCHwrDg3Rz2QYQQLWZ25uoKjeglKuDYYP+cQe9QDS g05OmBw0+CVQ8pPD47CPwJpMmx/Zkwgq8omYzjfg2wPGAmUUhyh3Z2y32D0d38oz3xb4 d7g0qt2PpP8wSNmdXp408Op28gMqny3F4UIx7sw+wNwW1pV/wwTqhldsgf4eBj+8lXre C6xw== 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=VV6l2UYIK3KjG62wbZQyRbbCwbcaL9xMG+xJectCaSQ=; b=YRz4hbaM9lj+3UavwkuTdmVVSCfaB9z4d2pd3AqzRwjnoPij9cHgRjSqK14yvRLGd9 WpZvqqCiJA8OKgH4zpbsgDPmdZlwwyJNSB+GKGYGS30nvdhGKuQ8ySND/3aMcodAibKh 19Kz2leNRE8OhkpOC9jArycYpGYgQy30QNpwxEyseXZHVQvvi9oiQk7jAAxposDNWea+ hqKfLHW9bx7ne3AnM0fSjQ/0N2E3Sw29DhGRfERsyYTymZYTH8zakL/Ub5eg6NpL8Qt0 PQ1BIGb6qgHFfqWynhBEIPmCf4T2jsdhWa8rbp17P194Y6x7O2Me5JMLhSv0MGIGemzS hd4A== X-Gm-Message-State: AOAM532E7bN//o4vzEoRh/jUJVZY+GzZ2ST1ZpLCs9760BCe4zhAy9fA rROp8TR+LXxTGi53LHH6+pPyRQ== X-Received: by 2002:adf:fe09:: with SMTP id n9mr11017306wrr.104.1614971300978; Fri, 05 Mar 2021 11:08:20 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:55da:a740:2edb:1c7e]) by smtp.gmail.com with ESMTPSA id c11sm5355437wrs.28.2021.03.05.11.08.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Mar 2021 11:08:20 -0800 (PST) From: Loic Poulain To: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, Loic Poulain Subject: [PATCH v3 1/6] mhi: pci_generic: Parametrable element count for events Date: Fri, 5 Mar 2021 20:16:43 +0100 Message-Id: <1614971808-22156-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 Not all hardwares need to use the same number of event ring elements. This change makes this parametrable. Signed-off-by: Loic Poulain Reviewed-by: Manivannan Sadhasivam --- v2: no change v3: no change drivers/bus/mhi/pci_generic.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c index 8187fcf..c58bf96 100644 --- a/drivers/bus/mhi/pci_generic.c +++ b/drivers/bus/mhi/pci_generic.c @@ -71,9 +71,9 @@ struct mhi_pci_dev_info { .doorbell_mode_switch = false, \ } -#define MHI_EVENT_CONFIG_CTRL(ev_ring) \ +#define MHI_EVENT_CONFIG_CTRL(ev_ring, el_count) \ { \ - .num_elements = 64, \ + .num_elements = el_count, \ .irq_moderation_ms = 0, \ .irq = (ev_ring) + 1, \ .priority = 1, \ @@ -114,9 +114,9 @@ struct mhi_pci_dev_info { .doorbell_mode_switch = true, \ } -#define MHI_EVENT_CONFIG_DATA(ev_ring) \ +#define MHI_EVENT_CONFIG_DATA(ev_ring, el_count) \ { \ - .num_elements = 128, \ + .num_elements = el_count, \ .irq_moderation_ms = 5, \ .irq = (ev_ring) + 1, \ .priority = 1, \ @@ -127,9 +127,9 @@ struct mhi_pci_dev_info { .offload_channel = false, \ } -#define MHI_EVENT_CONFIG_HW_DATA(ev_ring, ch_num) \ +#define MHI_EVENT_CONFIG_HW_DATA(ev_ring, el_count, ch_num) \ { \ - .num_elements = 2048, \ + .num_elements = el_count, \ .irq_moderation_ms = 1, \ .irq = (ev_ring) + 1, \ .priority = 1, \ @@ -156,12 +156,12 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = { static struct mhi_event_config modem_qcom_v1_mhi_events[] = { /* first ring is control+data ring */ - MHI_EVENT_CONFIG_CTRL(0), + MHI_EVENT_CONFIG_CTRL(0, 64), /* DIAG dedicated event ring */ - MHI_EVENT_CONFIG_DATA(1), + MHI_EVENT_CONFIG_DATA(1, 128), /* Hardware channels request dedicated hardware event rings */ - MHI_EVENT_CONFIG_HW_DATA(2, 100), - MHI_EVENT_CONFIG_HW_DATA(3, 101) + MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100), + MHI_EVENT_CONFIG_HW_DATA(3, 2048, 101) }; static struct mhi_controller_config modem_qcom_v1_mhiv_config = {