Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp4047473pxy; Tue, 4 May 2021 16:42:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU15gf8sVIVYKeqgP5HxxGLk05qpek17AByvO7LZTemVZJ0uycRt62kMtR9gyhmept4zLW X-Received: by 2002:a17:907:3e0b:: with SMTP id hp11mr15382764ejc.171.1620171735925; Tue, 04 May 2021 16:42:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620171735; cv=none; d=google.com; s=arc-20160816; b=QI+a4rc1jUUWTP1yxGqZqtf87ayF5YYFvM+XdExzaJNPnDyfLURguoGxaAzbtThv4b 9JZVvNjBjElfRrYtehuU4pMfegwOJPbE9H1hM3v1R7YZ20SFnvvfKRS/SJMcSwupIFma wR9z1bzLcen9QSxOD8vbr403KxCeUF0npQZ4V0RBuQFD7TY36Odv+McLSZrsXVuS1io6 pseIG4sDdgh/UdBLCDzd7o2fuZCPW/fnfG3ljzAUkb1h6WQFy7vVxLa7Ec+nWBqYToG6 OyNbsxaPHW8iyG2ujCu1IlvoPdDtFm9JZk2lMC5oN0fipNCnATZQ7VfPGhKl+yqtw9KH C4cw== 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:dmarc-filter:sender:dkim-signature; bh=tnS0tbzynertHhT6L+tHzRoeMC4W+zpjr81Jq14lIA4=; b=VD0AAK2RYFQtlzfpgSWhKF7Pw87UB3vAF+vOzxZYByjpTcbKEXZBFi98KcSsJ2xN3k QTK3HY3oBRBCDGs8a406zNENrY/i5C0DKwNegVdKpVXxvMRI1qYYR9YzUVn9VKbp1Knj lWEoNkWAUYqRu+En/o5I/LHF+wz24CPyJVp1Tus9ZjjIASfbYCz7QPd2f7fD100jqBYA 1uoFRGbdkY4rqAIQe7wkUeyxUE1vQdloDQXh/VctEikkM519IiG84Ez20Rto0arUz6T0 dHWPQEVTiasKmfrvHOCWYGWleJ7JGzsy7KfKfY/yLaD9itOBzDWRJn8lfxyx40OKGJXa 2qoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=tWhpV8sw; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si703016ejm.66.2021.05.04.16.41.52; Tue, 04 May 2021 16:42:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@mg.codeaurora.org header.s=smtp header.b=tWhpV8sw; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231574AbhEDXjR (ORCPT + 99 others); Tue, 4 May 2021 19:39:17 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:62893 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231502AbhEDXjN (ORCPT ); Tue, 4 May 2021 19:39:13 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1620171497; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=tnS0tbzynertHhT6L+tHzRoeMC4W+zpjr81Jq14lIA4=; b=tWhpV8swAvCFq9r+E7GU9TeHMwkZw4uVew7AAes1aaXgI1SLHaAf8lydMj3rfR9nUMGsUq6e QZGseC2TnQ66GXzBkN2zLAwGzovGSxTH+L6Y8uSCNCVO84F08lKxDq1/6rCTqEaaaqx09HG4 EkzI6hblY+SBQoHGWhCA2vp2puQ= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-east-1.postgun.com with SMTP id 6091dae22cbba88980c9b1fb (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 04 May 2021 23:38:10 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B2EFFC4323A; Tue, 4 May 2021 23:38:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from malabar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bbhatt) by smtp.codeaurora.org (Postfix) with ESMTPSA id CF8ACC433D3; Tue, 4 May 2021 23:38:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CF8ACC433D3 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=bbhatt@codeaurora.org From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, linux-wireless@vger.kernel.org, kvalo@codeaurora.org, ath11k@lists.infradead.org, Bhaumik Bhatt Subject: [PATCH v2 5/6] bus: mhi: pci_generic: Set register access length for MHI driver Date: Tue, 4 May 2021 16:37:57 -0700 Message-Id: <1620171478-35679-6-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620171478-35679-1-git-send-email-bbhatt@codeaurora.org> References: <1620171478-35679-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org MHI driver requires register space length to add range checks and prevent memory region accesses outside of that for MMIO space. Set it from the PCI generic controller driver before registering the MHI controller. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/pci_generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c index 7c810f0..fb7889f 100644 --- a/drivers/bus/mhi/pci_generic.c +++ b/drivers/bus/mhi/pci_generic.c @@ -463,6 +463,7 @@ static int mhi_pci_claim(struct mhi_controller *mhi_cntrl, return err; } mhi_cntrl->regs = pcim_iomap_table(pdev)[bar_num]; + mhi_cntrl->reg_len = pci_resource_len(pdev, bar_num); err = pci_set_dma_mask(pdev, dma_mask); if (err) { -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project