From patchwork Fri Apr 16 18:46:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhaumik Bhatt X-Patchwork-Id: 423464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66597C433B4 for ; Fri, 16 Apr 2021 18:47:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4676C613BB for ; Fri, 16 Apr 2021 18:47:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245105AbhDPSrr (ORCPT ); Fri, 16 Apr 2021 14:47:47 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:21684 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237334AbhDPSrr (ORCPT ); Fri, 16 Apr 2021 14:47:47 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1618598842; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=WQvVexLWxw1M6NAH+Y9/0k5Les7MF2MKFVbtaZACYgw=; b=jYiTZjau9/mO0aX/yFuYamrNV/pqsUCNpkzUQgy9qPCYfPX/cvj7SGszQiUvVyOn5huhQfQY J+EvJejdBeJsJAxfE9vmr+miSXTBcPtN0n8X267RLEUmEe633UGUQkI+ORyPO8NUv7CUIfDV V8/yY+SUaHoi5wvgj28kUjfoEEo= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 6079dbb5853c0a2c46db0c9e (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 16 Apr 2021 18:47:17 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A201FC433CA; Fri, 16 Apr 2021 18:47:16 +0000 (UTC) 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 9D772C43461; Fri, 16 Apr 2021 18:47:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9D772C43461 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 0/6] BHI/BHIe improvements for MHI power purposes Date: Fri, 16 Apr 2021 11:46:59 -0700 Message-Id: <1618598825-18629-1-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch series improves the power up behavior by allowing MHI host driver to set BHI and/or BHIe offsets early on in the preparation phase and fail pre-power up if offsets are not found or not within a limited MMIO region. This also allows MHI host to clean up the offsets in the unprepare after power down phase. Going forward, controllers will be required to specify a reg_len field which will be used to check whether the BHI/BHIe offsets are in range or not. This series has been tested on X86_64 architecture with the PCI generic driver as controller and an SDX55 device. Bhaumik Bhatt (6): bus: mhi: core: Set BHI/BHIe offsets on power up preparation bus: mhi: core: Set BHI and BHIe pointers to NULL in clean-up bus: mhi: Add MMIO region length to controller structure ath11k: set register access length for MHI driver bus: mhi: pci_generic: Set register access length for MHI driver bus: mhi: core: Add range checks for BHI and BHIe drivers/bus/mhi/core/init.c | 58 +++++++++++++++++++++++------------ drivers/bus/mhi/core/pm.c | 28 +++-------------- drivers/bus/mhi/pci_generic.c | 1 + drivers/net/wireless/ath/ath11k/mhi.c | 1 + include/linux/mhi.h | 2 ++ 5 files changed, 47 insertions(+), 43 deletions(-)