From patchwork Mon Aug 2 05:12:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 490303 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp1600444jas; Sun, 1 Aug 2021 22:13:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVgJfwy2kmeyqT4wTVbmSFCCxta3kdCA+618xgbyBwbU+XEfSTcQnQXK+mCg4qiPrpRaKp X-Received: by 2002:a92:d5cf:: with SMTP id d15mr5235579ilq.194.1627881222568; Sun, 01 Aug 2021 22:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627881222; cv=none; d=google.com; s=arc-20160816; b=mWp2NlyBTG5seOEVj8Xzdd6K/eAFUv+LWZjxPMXj2v1XSmdTk7rs+UI8Ckph517Ng6 PauzJ435G0xZi8THYDbFwdA/TI2ZGdk77G5ib2IyD5AkzuBnKjmbbuAed1YwR/NSI1AZ 6ZuHMrD7FC0HJN0FvJ5O+aSleE+PagNOrxk1/WY3R4VHlsCzXWxQCrTYAfGL6OYn3Gms ArrSM5RA7rJgoFk4SMdPZF/wz++czDBR9lrQylFTpbXyH3GbvruZTFgwkj8GLb4eL0VJ chkcCv9i9glvfYzJFqPjXuRljYN9s0pnVc5hmoUU/OcIeiy/KaV8Z2OgjAOFZhARkUkT tIsg== 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=xLy2JCSTScJC/CK8z3byKrwnTVUJYxPG2t6CbTYmLVrdWdaX/Mx9LB/6JDfHL5SywC W9F6ftdmRko+OLCfGRmNKeo5/MS58KzLHuWmjUMqs8OnutNjPDSYk+s/od90FKviBtve M9XlEVQ8Dn1rBS8HTPoXpfxC40WuAaXG1eosJDbn9/xikTy69ck4/ayhsZhQGyyILBFO 5qfFoH2fRgBxeGwHGBtG8Dbg2YGb2UZ6WNPKCfXJtFm8VrYvEGJEJsx+TsUcE4x+NWfA 2OpKBUmUMPAJ2HEVvqHW0CabEfsHJhuJO2Za1bp9SOw90eREcWjBLTq9yw2jsPr4mgfE Jhhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="x/mIjNE+"; 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 s8si12449525ilo.76.2021.08.01.22.13.42; Sun, 01 Aug 2021 22:13:42 -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="x/mIjNE+"; 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 S232249AbhHBFNt (ORCPT + 17 others); Mon, 2 Aug 2021 01:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhHBFNr (ORCPT ); Mon, 2 Aug 2021 01:13:47 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3EB7C061798 for ; Sun, 1 Aug 2021 22:13:37 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id a20so18443186plm.0 for ; Sun, 01 Aug 2021 22:13:37 -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=x/mIjNE+24kV1H5SQ6ix8OLO7gv+5Tz0esOdFtziEesVaCOm1kXKAxxCQdJ2+bR4Vi U+2T4GTCWg/BOhvjPFSktswOBLHuFvwGmCiZa2HEAd91mM3g50TkcN9+8DLQb/nrqAiy W8uXSZLCoFjayPTMOf/HW8jVNOw7LMI2XK92t6Le0Phf34ruyQ6sqVRk8h7TRWoHqpap NBfnd9vEXtdO8x5c2lohK+IESBH3mW623HSV460BCNkdlRTR8bPiJrF71NrVeGAyKDZy X0I07I71EJn/rtt8SZrgqGgbN4Sn10VSPLUHcgDsx3Zp7/GUuA5AZL4Qu3rmsA0xhbzg q1Ww== 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=DjJPUoWI4ECy2lqklIpfnRg7ncAIy9IAlND+FwaSkUZJDIfE0HTwuZjYHDq5Ad2Dii 6bUrySgJ1pfduSjtwuJamwCP55mqPYmdSi9ZDDTp6+W9/4bRZtBX0srQ+5u2xodwfcVn XpC0MvgZ2RH5Y+5lkA6HaEr/IgR4RJlm8yhIniufiUxlTfhZE9CfBWspNLpOoe0QvV95 xegujl1J47vvGJFgbOU2O0FrFJpj5JRr4sPKTQvgStYo1mcnY0wYRRyr9f+rYMaEFFue fW1njd8B/j4gdDvl9trjhYnEBcm7Ls6GmXewE/w3pDrIdEykLkgppVXSd/Ddrp0+6d8U b0SQ== X-Gm-Message-State: AOAM532UYvswXHhluQC3aHtj5IZ+aVDlDRSbL8fmWhzZ01k3tDrDZOFM mwtBeoQjJeKPr9gq57ol+6O8 X-Received: by 2002:a17:90b:514:: with SMTP id r20mr15221889pjz.80.1627881217301; Sun, 01 Aug 2021 22:13:37 -0700 (PDT) Received: from localhost.localdomain ([2409:4072:6e99:242f:6391:b1b4:1ad8:fbdf]) by smtp.gmail.com with ESMTPSA id x26sm9947000pfm.77.2021.08.01.22.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 22:13:36 -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, Jeffrey Hugo , Manivannan Sadhasivam Subject: [PATCH 05/10] bus: mhi: Add MMIO region length to controller structure Date: Mon, 2 Aug 2021 10:42:50 +0530 Message-Id: <20210802051255.5771-6-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210802051255.5771-1-manivannan.sadhasivam@linaro.org> References: <20210802051255.5771-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;