Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp568453pxb; Fri, 16 Apr 2021 12:24:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxovQ7UfE815CO7SCT5eSbiIhgDbuS+WJvTaJ67s8JB1GCzBKo8UW/eJff8KPxOKVvP/+v1 X-Received: by 2002:a17:906:2704:: with SMTP id z4mr9499777ejc.137.1618601084273; Fri, 16 Apr 2021 12:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618601084; cv=none; d=google.com; s=arc-20160816; b=dWsAAPHfExlNOH8U8VeE+8F1LfoREFej1P8gW7bx8YtXqfjSiSN2Qt4Za0e0jD8VKD Ita/q8JpzFSTHog2oSmhDmelrSaV7tE2huB9pyGWw/Mv3VGftbEHuF/ZsVbsSXDE8Fhg i8Z7zzYI8owVwETbP+YS1xRzHk4+gZGLUz8+1SJ4tmo9pvYuMVhs2iwBXTR6cDqTfFCO T6OxI1vFbBCKxa0irVJ77se6/Pje36+Sz7j0Cg5HsBK7cBCiM+BbqCKTiwetEtlgWes/ JR6xz/dFt7sYDpqiMko+50ZW0gqS/vPsTJMJFiXs113rr/UL7aCEn0SXyNhM3ilEwKMq 3BUQ== 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=Qyh3dyhifraV7TvjCYHtipxnGHij6ehuRY7+sUKJ6+dn18UwYc4Xa/QMEXU8CBSMIb muu6WyvPJy6HCd4yrqTVNGLAgXfnO7HkQHIT4dLWRMZWAT8T4vvYCgmz1tuNH5Z1t4Jq qEu9IvBDQnge7w91jc3fpCu8W/sa+G8pwNmoKNJESb93VRNobZ0XSfyH4gDtU/gx1jj9 vkbLvDfZ96l1a+m0i9NEjwmuBI2eExJZV7XYz9vJ16mm3mR8M71HyahJ/cDKbgFsSsZ5 M4tQFLFBsqHrFikjPR95m7XuMASHxtp97xk4PTDHCxNtXv8m1ViCE21q0FELmxbzEY49 A0lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ux1SrNQC; 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 eb8si6017865edb.103.2021.04.16.12.24.21; Fri, 16 Apr 2021 12:24:44 -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=ux1SrNQC; 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 S245325AbhDPSsB (ORCPT + 99 others); Fri, 16 Apr 2021 14:48:01 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:38308 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245178AbhDPSr4 (ORCPT ); Fri, 16 Apr 2021 14:47:56 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1618598850; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=tnS0tbzynertHhT6L+tHzRoeMC4W+zpjr81Jq14lIA4=; b=ux1SrNQCwRe/98lTOi1W5KxL87ArdsvgGVGfSMSYn/boLVPb8GZtyqCy+wCHgKtSF9Isc3xq M0Ta3YVgaDSSuwwTb12x2papCxVfXY9uLn/RQFNdQ7MxXEAlrLoS/WA1nUc+anOqi2VO1iCc uL5cbfGRfJ9OdCxsiT7Wv9ffOko= 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-n05.prod.us-east-1.postgun.com with SMTP id 6079dbb9c39407c327e5092d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 16 Apr 2021 18:47:21 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 5A2DCC433CA; Fri, 16 Apr 2021 18:47:20 +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, URIBL_BLOCKED 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 34F73C43462; Fri, 16 Apr 2021 18:47:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 34F73C43462 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 v1 5/6] bus: mhi: pci_generic: Set register access length for MHI driver Date: Fri, 16 Apr 2021 11:47:04 -0700 Message-Id: <1618598825-18629-6-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618598825-18629-1-git-send-email-bbhatt@codeaurora.org> References: <1618598825-18629-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