Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp90918pxb; Wed, 18 Aug 2021 16:51:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXPcvNl2hiqA8ujQ43Oh6gzyC1/gaB58JpZ4Yx/hG/akhVoipa+ZSHSK9gW8IOeVeYG8IQ X-Received: by 2002:a92:c0c9:: with SMTP id t9mr7894829ilf.79.1629330718367; Wed, 18 Aug 2021 16:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629330718; cv=none; d=google.com; s=arc-20160816; b=0th6CHC0RuFbvAN9g3Fy1o5zVyku9qLwCrouV0OFjUd/SYbQ0RStcEKOaf8jslItbS sasCQO3Kj8Rb5ukP1WQJPnxOX7Ghu7Cop81HdEs++oQXhV/ozL/BypCerzhEqVYOJuDO jziNrzSS0ZSq0jyEVHpmbgJ3BTbIuMr8BhgkDJBUB6lonnJlQQpTpoZYaFMeIzQ3tcWC zlnTML8FbBoXXDcqW7t7pOvxSDs1Fx4zSQ1J6a7TYFwxfglbcro1zyODaEyaMIaLc0n0 ZbMsN4DXeBj/MNa7uhBhG/3l8kqIgLXQaonifpBbtyT0njRcYD+uuiB0N0LkszHyHjLQ 2OnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=dtKKhIrAycIFftfoGO6XhO2cMGewtxBU3p3mQrdub+w=; b=H6TnWVEvpc/rV6iq/KivKAjmuATmeFVys+YDGW1s3BLSKlh5xiHhY+wYjktes2UmHE QEMA0cUhFu1+EnKG6GOZALBSSnGaEDJ2kviDJgd7JF8I4dActpQxW3bt67/QYnREQvWp 4dbWudfH6aoNpj7qB7DyW/PhocorZZ9JYzsXSpSRznhu87vN/GYGwPIvZbEf6nr2w4Ev KQsq5A6ZbPHpDDx32gpO14htMdWRnzMM7IrXAlz9WSuMjVuQoa5HopgXRcpGp1XhGbpO iZrRz71gHnID7Uli0OeEq5Br1vzX1CqX/H2ikcIwZiUxa6UkJJ/6NnubEfACzqDT7qDI 5gqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=cc7VF9m5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 q20si1302418ilj.61.2021.08.18.16.51.47; Wed, 18 Aug 2021 16:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=cc7VF9m5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235345AbhHRXvj (ORCPT + 99 others); Wed, 18 Aug 2021 19:51:39 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:34855 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235065AbhHRXvh (ORCPT ); Wed, 18 Aug 2021 19:51:37 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1629330662; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=dtKKhIrAycIFftfoGO6XhO2cMGewtxBU3p3mQrdub+w=; b=cc7VF9m5Feudw0ZbDjrZquu6nDUpzgtr7vwLye8jOIN05xdUZZytpuIM+lwevpt22AX3tLOU VFDLARra7E07SvWKa+3/bsEk8dNnO94Gz655Z2wGw9aOvRlf1TUMt+UdwFJ3z/3jj5fsXbN3 TcQ4Ks5d087qHdf7u+W98nr1DN8= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 611d9cd79507ca1a34fb88be (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 18 Aug 2021 23:50:47 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 8DD8BC43618; Wed, 18 Aug 2021 23:50:46 +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 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 A7EC2C43460; Wed, 18 Aug 2021 23:50:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org A7EC2C43460 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=codeaurora.org From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, quic_jhugo@quicinc.com, Bhaumik Bhatt Subject: [PATCH v1 0/2] MHI MMIO register write updates Date: Wed, 18 Aug 2021 16:50:32 -0700 Message-Id: <1629330634-36465-1-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of MHI MMIO writes, the register field write function needs to do reads before writes are performed. Propagate read failures such that callers are made aware of those and can take appropriate action instead of running blind. Optimizing the MMIO initialization function to use mhi_write_reg() in most cases should also be done to improve design. These patches were tested on X86_64 architecture with Ubuntu 18.04 and SDX65 attach. Bhaumik Bhatt (2): bus: mhi: core: Bail on writing register fields if read fails bus: mhi: core: Optimize and update MMIO register write method drivers/bus/mhi/core/boot.c | 25 ++++++++++----- drivers/bus/mhi/core/init.c | 70 +++++++++++++++++++++++------------------ drivers/bus/mhi/core/internal.h | 7 +++-- drivers/bus/mhi/core/main.c | 9 ++++-- 4 files changed, 67 insertions(+), 44 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project