From patchwork Mon Jul 26 15:39:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 485845 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3981010jao; Mon, 26 Jul 2021 09:18:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFfdtwiMihxHzfQdYWtQZV4/V331bWgoWv5BjY/banF2Q0UWWKtorf2O0UQsLp8xRrhmzW X-Received: by 2002:a05:6402:5142:: with SMTP id n2mr22612829edd.10.1627316307540; Mon, 26 Jul 2021 09:18:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627316307; cv=none; d=google.com; s=arc-20160816; b=HW3YEi63sqltt1AIMy8wbeLq7sSMnv7/arC9/qHW4fkB4F61JYRAtn+XWA+bVVFi2i lXCbMnPgCEDMQY8wj+8YhGNdE1ToP8xD/M+B4XhNlLI7t15Li05OuyXpby41d+Oy2ke2 wU8LA3TDRckV7LHMqpOGsFuNUsFac6p2IY+//RGZ7eFtfcK6NxuBeNBIh6ro9TZGMRKU uv+4+4VjxXX7PiLeEw2TiI3hCqTKZTjJmwj28UmB6wtznbatioLDOJdkVMrTbwim8wNJ 1NfRwtRByN0wgxFNhfCIGSlGqg0Z4KjFQK9rFcfHZBEYp6I7Om2A/FdqwjVpxIT69tHW tQ7w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OfrJNc0D3dEkzv11HFc++RwL6NIR7fXmooOW4ffglas=; b=W3Zc8KqMsXMUoZQjO/o2gYrzAD/EXki8YGKdaVTIJOJqIDJjQlsc+ZVk1UZaI7yEtK QufSSa8TdB3pD1pXioqJ7YnGqqWGgnw0YsszobGDJOOcXIXdyf4uUMZ4Fqse977Stekg f04rSk5mF/L9Cks4sB/90pY0ZE61qmHoeQGLfcqF3T9D+hECmZ+DXd8PPBdtCvSu1tVe fRF4QHRpckOVfWgX6cPndyQx86NJP0oiJxNZkxf/gVl6hNCjmMNmSpEtmJEvTuDqyZzd Lqwj7GxF9SbI8AQbs2ABgZZfPOef6mEeb2kYllYNIW6TeCzK7HYm60rE/nG78pXbH8j2 g/cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GzG0+gZ0; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pv18si289902ejb.567.2021.07.26.09.18.27; Mon, 26 Jul 2021 09:18:27 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=GzG0+gZ0; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233876AbhGZPgS (ORCPT + 12 others); Mon, 26 Jul 2021 11:36:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:54078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237707AbhGZPgB (ORCPT ); Mon, 26 Jul 2021 11:36:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB20F60FC1; Mon, 26 Jul 2021 16:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627316188; bh=NU/UYTw5csGX16z4Y0aEdc2v5/xMTL/7VmbglNmRjFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GzG0+gZ0fjKWYgAwNUlXlgSvg7HUmnAzn9DjwCzC3KEtLAp+IVqpCHRpGdLWx4cW9 KMVovhThVsNjGH/KXawiUbZA0RWB4AK5pPTAt3mbt/uRW4FX0eqZC3r4SoS6FqoBK/ 12c04VSPhpicyYc+/1vKkdSJ15HeL3RK6xCnEP5g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hemant kumar , Manivannan Sadhasivam , Loic Poulain , Manivannan Sadhasivam Subject: [PATCH 5.13 189/223] bus: mhi: pci_generic: Fix inbound IPCR channel Date: Mon, 26 Jul 2021 17:39:41 +0200 Message-Id: <20210726153852.383489674@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153846.245305071@linuxfoundation.org> References: <20210726153846.245305071@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Loic Poulain commit b8a97f2a65388394f433bf0730293a94f7d49046 upstream. The qrtr-mhi client driver assumes that inbound buffers are automatically allocated and queued by the MHI core, but this doesn't happen for mhi pci devices since IPCR inbound channel is not flagged with auto_queue, causing unusable IPCR (qrtr) feature. Fix that. Link: https://lore.kernel.org/r/1625736749-24947-1-git-send-email-loic.poulain@linaro.org [mani: fixed a spelling mistake in commit description] Fixes: 855a70c12021 ("bus: mhi: Add MHI PCI support for WWAN modems") Cc: stable@vger.kernel.org #5.10 Reviewed-by: Hemant kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Loic Poulain Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210716075106.49938-4-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/bus/mhi/pci_generic.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) --- a/drivers/bus/mhi/pci_generic.c +++ b/drivers/bus/mhi/pci_generic.c @@ -75,6 +75,22 @@ struct mhi_pci_dev_info { .doorbell_mode_switch = false, \ } +#define MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(ch_num, ch_name, el_count, ev_ring) \ + { \ + .num = ch_num, \ + .name = ch_name, \ + .num_elements = el_count, \ + .event_ring = ev_ring, \ + .dir = DMA_FROM_DEVICE, \ + .ee_mask = BIT(MHI_EE_AMSS), \ + .pollcfg = 0, \ + .doorbell = MHI_DB_BRST_DISABLE, \ + .lpm_notify = false, \ + .offload_channel = false, \ + .doorbell_mode_switch = false, \ + .auto_queue = true, \ + } + #define MHI_EVENT_CONFIG_CTRL(ev_ring, el_count) \ { \ .num_elements = el_count, \ @@ -213,7 +229,7 @@ static const struct mhi_channel_config m MHI_CHANNEL_CONFIG_UL(14, "QMI", 4, 0), MHI_CHANNEL_CONFIG_DL(15, "QMI", 4, 0), MHI_CHANNEL_CONFIG_UL(20, "IPCR", 8, 0), - MHI_CHANNEL_CONFIG_DL(21, "IPCR", 8, 0), + MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(21, "IPCR", 8, 0), MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0), MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0), MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 2),