From patchwork Fri Jun 25 12:33:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 466856 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1418000jao; Fri, 25 Jun 2021 05:35:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhrOUciBOK2kVVukaC35WuKmrIJwI13qoEvqh0DKf2c77gyTULVhBWjppVpe+IPrXnuCHb X-Received: by 2002:a05:6402:35cf:: with SMTP id z15mr14484100edc.208.1624624517487; Fri, 25 Jun 2021 05:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624624517; cv=none; d=google.com; s=arc-20160816; b=triA2Q3rQ64Wezjpyp+wb8plPKhNiTUL9+K04O5gYmLA1bfZtH2ELILo8DRyhyn84Q jZANjkIhKTYpCRODLC1cBb9PD0O/2yS02CK9p3YcXWQvO3u/gTpTKmRBDxjZCHtnco/m wnTflCehsrcu8l4nR6l/I/FBy4cMdH5MzKaK8qV5rPPhDhT9OUovVJBX4iHS0TWWH+V8 7BhKiKGvh/fCt0WBI06FRqD+C/SwD5OypjmXTMoVqmMQ+2ylqUOSs3JIuPTSg7OtE5vf 7SzYUCTiovqE+mUqlGK1GxKIxn/0EtMO5OiSB2jyfAnB2Ptpo5MnIN6UhJOfGUSAy2pw Q8jQ== 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=3DgnnTTSnmT/peV2biYKlFU/kMTbnc/Zi2T2QGThm6g=; b=FDnBszICZOu/NGWuIHHhMVp25w985ybs22LFXc8ZrpmPlRNtWaFdVlk5Jemq0kKW+b 8Q1A7/TOfzgxa2FWfbXg8Rb2KTfaGp1TE/BFhvbXXIcnS99dYgKYShZpUurdd3gFHsC6 gjTqjKLDSesJXxSpBawte6+VwNAr4rmX7HC4w9pNuyPYE3cv/BbWvMxst5eNrcOJ50Jv LNk1YdmLWx1FweQy+y+YbExxcBQJqRkJrEF8FxE4I3n7MiNlEQ7r1cf5cAiEtX75pUqD IYqDZRAfmitToODTUK3OhYgKAtwlbhPylYPUHQLErlo+2dVZ5QOnRiX/nQ9K3iSFzCSJ h/lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z6mW3ccQ; 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 q2si6532256edb.244.2021.06.25.05.35.17; Fri, 25 Jun 2021 05:35:17 -0700 (PDT) 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=Z6mW3ccQ; 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 S231579AbhFYMhf (ORCPT + 17 others); Fri, 25 Jun 2021 08:37:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231693AbhFYMh0 (ORCPT ); Fri, 25 Jun 2021 08:37:26 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3A33C0617AE for ; Fri, 25 Jun 2021 05:35:02 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id s137so307038pfc.4 for ; Fri, 25 Jun 2021 05:35:02 -0700 (PDT) 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=3DgnnTTSnmT/peV2biYKlFU/kMTbnc/Zi2T2QGThm6g=; b=Z6mW3ccQN2YBGjwffpJ73Duxw2kzlNc3b4cHutlQBqVWyoJmNhswvJXGEFOk2WB5qU kkptZQqQ1o481oe2WiehWE3FNtq02Zue2ZCHyjqalzIbhNv1tv4hC6nNIgCErdBHfQ/3 kiD/2TB8H6xe2KvJFKhX72fI9SB2dWoCQvSKi6QFLbdKivWUTD4h706ganAsEcxqYaDM D0OBejyeEFuIUE1WqugERo3plTuoYotGPM3hdP3UYJT2oT7VFSriD8mTV5eXqWyo6uX7 lji/5RU/ZK/yqAuRBPWtPr3giwKCHRX57uZ8iHyG/P6X5pp0s7hjjTqXy/pSEoSTzWz2 0iVw== 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=3DgnnTTSnmT/peV2biYKlFU/kMTbnc/Zi2T2QGThm6g=; b=dALwAmv7kOl4p/Bz8n6Zk9qEor13Wvfe7EbYFR/EE8E1Iu285Adlo0v0Ia4GfBdrMF 3IkFgEtsNtEFQrbiJfsLYkirVvITCjUHEAY2HCqQBQs+NydVV9y/94WDorpRQztYRwJ1 iJAvpelPDjrZDzxGILltfwFHZRqTD2xi/rjowSsiLxlcAXvaXUgoTr0fYtkaYd2CYAKI yT1TI0UV2Ja4uC8HuQvgJTdbRU0oggKLawiz7ZQtviGVG1FpFAqrbT8Xy9NhY6RSzJS2 eete53Qzhbwk0FKNGB+yP2qx6ZYTxsS+9WQXBKCZbXmcUsCrmnJfNoRLJqWkZGqiMlwO LAPA== X-Gm-Message-State: AOAM530j6tE25J5uA38Zrp6FUOfe3IuHk8/v5NG8WKfd1dkBBxKBQP5X hS4BwjA76c1UoOf1ilic9DDS X-Received: by 2002:a05:6a00:2491:b029:308:d524:1a26 with SMTP id c17-20020a056a002491b0290308d5241a26mr5630575pfv.45.1624624502242; Fri, 25 Jun 2021 05:35:02 -0700 (PDT) Received: from localhost.localdomain ([2409:4072:600b:2a0:ed5d:53e7:c64e:1bac]) by smtp.gmail.com with ESMTPSA id y7sm6077780pfy.153.2021.06.25.05.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 05:35:01 -0700 (PDT) From: Manivannan Sadhasivam To: gregkh@linuxfoundation.org Cc: hemantk@codeaurora.org, bbhatt@codeaurora.org, linux-arm-msm@vger.kernel.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, kvalo@codeaurora.org, ath11k@lists.infradead.org, Manivannan Sadhasivam Subject: [PATCH 09/10] bus: mhi: pci_generic: Set register access length for MHI driver Date: Fri, 25 Jun 2021 18:03:54 +0530 Message-Id: <20210625123355.11578-10-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210625123355.11578-1-manivannan.sadhasivam@linaro.org> References: <20210625123355.11578-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bhaumik Bhatt 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 Reviewed-by: Hemant Kumar Reviewed-by: Loic Poulain Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1620330705-40192-6-git-send-email-bbhatt@codeaurora.org Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/pci_generic.c | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c index 89f71e6db23f..8bc6149249e3 100644 --- a/drivers/bus/mhi/pci_generic.c +++ b/drivers/bus/mhi/pci_generic.c @@ -508,6 +508,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) {