From patchwork Fri Jun 25 12:33:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 466854 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1417924jao; Fri, 25 Jun 2021 05:35:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxKUlWc8oa4Fo891Q1BKPKYrPhElW2qIb4Kn0U3FOAsnh+6BZPPrjNMRewA2ESldOhRfHP X-Received: by 2002:a05:6402:375:: with SMTP id s21mr13936178edw.203.1624624512505; Fri, 25 Jun 2021 05:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624624512; cv=none; d=google.com; s=arc-20160816; b=r21CYQsNQH1N32WcvHJGot1rtZ8cor5xFHnNtvnCtCGwwFBToDDHXX59lK6Qb0CrZI J6EqLVtSYm/p3+ccAB06TLmTjSgWCaQAudqqaLn0g/UfdXv6PiloIv/kaqWJeKBKU2xd 2ORvAgKPISmsUQ4t4vsbAqMhbHqNeDw+fllDQBCzxb7O6ZEE6DPMDaucfcTwNPLxtGJT XniewQUsnzYIiENaH+LA9cJhi9UjVoaCaVXgjN4NVACPm0G8oPw/E5rlw9xIdWzLHnPa 7/rqWuTMZKzZ+9Le61d4CPfRwunZHwN5lWIot2wMBGLCdWNjN2sb7za3Cz2VsdIaStf/ P56Q== 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=4vCP14x51ZT3xHTsGRwNOFfupBHNf+HcNjz+uJv37tc=; b=InUn5pxgXYNn4UDwlOB4I7P64rMHxukqlCroblhkRJE5JMdi1xnM08vBPeRO8hwm8L HcWevlL61GLkP8cHTntalo6tia/yyYkoDcS/m1NJeftHg701p6UD1UtTIeWCDZzxZHGq JdJx0lK9pJbxw8GVkkmyLmtNqf0uFVkOilfM0DvTL6hnhPIdNyfiGlrNs4q7Mg6F60Zf nLadohuhGVhZMUYgy40v9mTWqNckjZAzmAtgB853t4jNqgrMZ8shyL0zjXla66C0gRGH RRQjqg0vQfaGojHGg0WTA+7+5KxWHDsPAJDMimQ5VNZJF7x0eAH/3wWpiBpVpG+/0MOH +/MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ktHLP1O9; 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 qp24si7221044ejb.742.2021.06.25.05.35.12; Fri, 25 Jun 2021 05:35:12 -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=ktHLP1O9; 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 S230274AbhFYMh3 (ORCPT + 17 others); Fri, 25 Jun 2021 08:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231666AbhFYMhO (ORCPT ); Fri, 25 Jun 2021 08:37:14 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32465C061766 for ; Fri, 25 Jun 2021 05:34:52 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id 21so7954112pfp.3 for ; Fri, 25 Jun 2021 05:34:52 -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=4vCP14x51ZT3xHTsGRwNOFfupBHNf+HcNjz+uJv37tc=; b=ktHLP1O9pdgttROJ/3d/zqYT2d35eagqTUHjpN0GfpcWbPh7NmalFXQtu1zu/5tXsw Xvbdhc4o67mkTGwm6o+sVB7IRHNMPMtU4HvrruA2ocB4SRyeqMtU8VsZ00zxspnkPavM Z60HD6xD5u9uBTB0ChMeaNa2cPkxVXw3wW2Ync+7cJu+5qb+VHjaPRyLjXiVgdXzKldw 1EB63Ag0x8+SRu0ahaJJnn3nBZXkzSYipqu/XKY5IrbCXV1RM/6nGJZc8otYplg1zgiI 5Uk/i8znvTY2xXXPPpmko1myRwptIkqzqj42Yr5iri2at2qR6RSBmHN5oUXnWSHaUmLZ SGjg== 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=4vCP14x51ZT3xHTsGRwNOFfupBHNf+HcNjz+uJv37tc=; b=VJSO6Hm2GRdNH+ksuf0mV99CD43L0Ls3KTF+VvmuoPgfJs5VYyDIPrx33cnyQBLN39 G3Q9/qrPjlwt84XULJete8fZDzaBWlmbyT1ueMyn2lKhV61mkajGuITy5meqdplUmN2K YpIJJFm794nPEVw6pahvEcuUQrKm2ACSTIuQ8TiKlcRJQxSfyLPoiyRUiGNrpD/ZG0QL p1cLKDHG4YoD32u9JX6GPy4R85qJ01LIBUf55UGsg1PAJr7u8JTN/9yWsVo2OPp+QAb7 P3KZx+1af22YkpWm5pBPOsXaV7RiOUamujo6Ic8MJV4iX3iQoIyeHbF3mX8Tumt0Autq aiZw== X-Gm-Message-State: AOAM530ffimnSm31aT50pl7AZYFrt6fZAfAiT4kSKe4/osJ5MA9oXtsM FolThSjDTdfSIRqtzlEOds3J X-Received: by 2002:a62:53c1:0:b029:2ef:25e8:d9e5 with SMTP id h184-20020a6253c10000b02902ef25e8d9e5mr10439876pfb.74.1624624491735; Fri, 25 Jun 2021 05:34:51 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 05:34:51 -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, Jeffrey Hugo , Manivannan Sadhasivam Subject: [PATCH 07/10] bus: mhi: Add MMIO region length to controller structure Date: Fri, 25 Jun 2021 18:03:52 +0530 Message-Id: <20210625123355.11578-8-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 Make controller driver specify the MMIO register region length for range checking of BHI or BHIe space. This can help validate that offsets are in acceptable memory region or not and avoid any boot-up issues due to BHI or BHIe memory accesses. Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1620330705-40192-4-git-send-email-bbhatt@codeaurora.org Signed-off-by: Manivannan Sadhasivam --- include/linux/mhi.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 diff --git a/include/linux/mhi.h b/include/linux/mhi.h index 5e08468854db..b8ca6943f0b7 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -303,6 +303,7 @@ struct mhi_controller_config { * @rddm_size: RAM dump size that host should allocate for debugging purpose * @sbl_size: SBL image size downloaded through BHIe (optional) * @seg_len: BHIe vector size (optional) + * @reg_len: Length of the MHI MMIO region (required) * @fbc_image: Points to firmware image buffer * @rddm_image: Points to RAM dump buffer * @mhi_chan: Points to the channel configuration table @@ -386,6 +387,7 @@ struct mhi_controller { size_t rddm_size; size_t sbl_size; size_t seg_len; + size_t reg_len; struct image_info *fbc_image; struct image_info *rddm_image; struct mhi_chan *mhi_chan;