From patchwork Mon Nov 2 17:53:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 320363 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp3925244ilc; Mon, 2 Nov 2020 09:54:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwD+0wUFv0F3B7Fv8Q4QNpY75/5QX5ZqYTCzIIg2lan+BupudbquYFiUvfebLIdbPc3N0cl X-Received: by 2002:a17:906:4d93:: with SMTP id s19mr12193359eju.271.1604339654464; Mon, 02 Nov 2020 09:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604339654; cv=none; d=google.com; s=arc-20160816; b=rkRxjxpsTl0nYIoN9+bG7Vssz+NreX1dGC/rpJ9SOjSTcodBTnwwSMfu56oPIhYStU ArTDXN8BhdNnfTNpPCpcS1kel+oPkFLlYe8V2Gas9Ic67PgjP9QDFa68wWCPa/oTk2fP VZJd97xrrjnr4hkN6LoXRKl+F81tIZ6+/ryMYuGwj7xa5XWqO9STx2VQDrZeIUIbRFl4 ikf0giVhGQF9IBmNCoEptS1SFuGWW97cV3Wxg/lR0IG40SMNhMDiIzhFAJVwcKMSKcmE 1i5egYJxGBmYx34ExB5D4xkTKhtOizjfKEgG3TvkFYsRPHWJGjzSvfESFnF+faXOSu9a SK5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2yVM2+cSsEC1ByDwnNPBPLtup/RwymccxagL8bfkbms=; b=AUDNwVvSBV6PmfF0G6VAnlV+rB65mhO6fUOD34iphztjkFlUF7m3EWGKNR21EzRMEm W4hZB9ngbsldSTXLNfsRylQ/pRHodbnd+dDxWtrJPNSTrTJ/wrg8aKnPGgeBm+dYDXRd fLZ9aEaAoum9pmb/0rb42W3IJ6IyvFeZnmuTzV8Z1RG0PRHVr0XReLIYUsKR+U4Gx7ea ZCGrHVsL+roh0MGfPFCjitNW7/E4LmyELhvgNjfZ6/jEoR3WOwohTSH5fP42NqRfJM7s mTGLad3zMnok8rGiK4QUpzt7JdDuWLU2JryaflBqY5diBbd0kEUdDjNj/ybg2UTcfvF9 lBOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=liY9yaQo; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 r26si12226619ejb.125.2020.11.02.09.54.14; Mon, 02 Nov 2020 09:54:14 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-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=liY9yaQo; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S1726430AbgKBRyK (ORCPT + 8 others); Mon, 2 Nov 2020 12:54:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbgKBRyJ (ORCPT ); Mon, 2 Nov 2020 12:54:09 -0500 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C39C061A04 for ; Mon, 2 Nov 2020 09:54:09 -0800 (PST) Received: by mail-il1-x143.google.com with SMTP id q1so13731097ilt.6 for ; Mon, 02 Nov 2020 09:54:09 -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 :mime-version:content-transfer-encoding; bh=2yVM2+cSsEC1ByDwnNPBPLtup/RwymccxagL8bfkbms=; b=liY9yaQoXgmxGExwxwR7G24/uux6kd/yUeR+y82X18MFNIwOEzWDscNUWmx0wdHJMr SMg8XqP2tIi/4xEDOVcMdIRBBDfY3HheYvGh1mcY5JwxuyP7uc9TIqu8GLLuZGQrhL8K lX43UkiqjibTG5TYpdpnQVPI54c7/LKAfSp/p68hg9Hxg5ymW1eQ3QudwYnBIH8W3JN7 dyYtPlIyxT9orhkMqbUHt4iVV9+wuJzAAqMQTrFkzykmdzAGewIeCECKBIqwDbigwGrH ySeEbJeFtqjbPjRpwlgnVmJYgu5YAxc3t48mE2dH4miBv+F72CthNvAqeNK9eT/85Bzz 1DvQ== 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:mime-version:content-transfer-encoding; bh=2yVM2+cSsEC1ByDwnNPBPLtup/RwymccxagL8bfkbms=; b=ZFNz14v7DVns5ajnhYzM6Jgtl5U45pwVXUWJRCxx9XBqoZ8EvHX7jgveG4CjPDVqZH omgItGqIqCAkJUxRETVSLU/uOeL+PRG1tGevOjQScXYZw0fHjAVG0+0ufo0vAxoOaoju JmWvPLeMsATqKX6/FIU1Go/elVUI0bJfb6NY9013Jt6BcCDea7MC3heKvMRGTldviTan yKeEHaSKP3hTlXVZQRiDl+2+wdu2KrOpKulT1B196LtF76j6FP6uaNjquz0e7OJGKdn+ QTeaXZOMTPpbZCCn0G9crJB++s74KNaUD8n4Uq4NVxmAu4l/0pdTH+CxDR+s76PNHqKQ 9rgw== X-Gm-Message-State: AOAM532JMRu7YreNQmQlwLgvlcI+mCf85Y1ENPzE3SIZneKyc7EI1M6z ofMRkG7NeEvhvAVu+BCbywNNzg== X-Received: by 2002:a92:da92:: with SMTP id u18mr11971550iln.266.1604339648566; Mon, 02 Nov 2020 09:54:08 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id r4sm11089591ilj.43.2020.11.02.09.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 09:54:07 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/6] net: ipa: use version in gsi_channel_init() Date: Mon, 2 Nov 2020 11:53:57 -0600 Message-Id: <20201102175400.6282-4-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201102175400.6282-1-elder@linaro.org> References: <20201102175400.6282-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org A quirk of IPA v4.2 requires the AP to allocate the GSI channels that are owned by the modem. Rather than pass a flag argument to gsi_channel_init(), use the IPA version directly in that function to determine whether modem channels need to be allocated. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 178d6ec2699eb..eae8ed83c1004 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1894,12 +1894,15 @@ static void gsi_channel_exit_one(struct gsi_channel *channel) /* Init function for channels */ static int gsi_channel_init(struct gsi *gsi, u32 count, - const struct ipa_gsi_endpoint_data *data, - bool modem_alloc) + const struct ipa_gsi_endpoint_data *data) { + bool modem_alloc; int ret = 0; u32 i; + /* IPA v4.2 requires the AP to allocate channels for the modem */ + modem_alloc = gsi->version == IPA_VERSION_4_2; + gsi_evt_ring_init(gsi); /* The endpoint data array is indexed by endpoint name */ @@ -1961,14 +1964,10 @@ int gsi_init(struct gsi *gsi, struct platform_device *pdev, struct resource *res; resource_size_t size; unsigned int irq; - bool modem_alloc; int ret; gsi_validate_build(); - /* IPA v4.2 requires the AP to allocate channels for the modem */ - modem_alloc = version == IPA_VERSION_4_2; - gsi->dev = dev; gsi->version = version; @@ -2014,7 +2013,7 @@ int gsi_init(struct gsi *gsi, struct platform_device *pdev, goto err_free_irq; } - ret = gsi_channel_init(gsi, count, data, modem_alloc); + ret = gsi_channel_init(gsi, count, data); if (ret) goto err_iounmap;