Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4058996pxv; Mon, 28 Jun 2021 20:55:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCFeYiGC3LXT+hbTa4R1TWOQ3MV870GayUpp1mGak+WngcQr1LBELj6nJKvHHnlp06dEZk X-Received: by 2002:a17:906:eca1:: with SMTP id qh1mr4114590ejb.287.1624938942323; Mon, 28 Jun 2021 20:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624938942; cv=none; d=google.com; s=arc-20160816; b=zAg276ddJ0CDYMz5MgE1iHiNYR2MNwDmxsLupbbIXBdxECpWxWJFpB30LLtLjPV4Ch NR6SKArn+r9LxcVwtqUEk1TYVlBZI9MdKrvg1zlky9YwwXeCrs4ZGmdogXQmUFAJiHEe DJCWmrgrT2g/SE+naIRQe5IZVhDBDga6mMC9kcaQF/aIy+bIHYjXsI352im6WUG2AuEV 6JL9WzhNQ7eWdNxTcyMxthY6tfUF7qURf4pN6R8pHhjjD+vTZJEKT6XRAqXttstsDYrl uKBE7Uo/saW95mCq90xh1jRSUs2//aKKeNDGIc/Kho5JpxS7DHeuL5iFTQurn7lQ1Flh XdMg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=dkUNM8jdJCoRaLeA7nV+tVdGzxcR6mPGSyJ1qqnC+yk=; b=D75dLdRKSFU5RpB++nVcZ+PricTqdKyeR+VzM04QyFjEL3k37Z3M26FmtAsn6ju9pY u7N+HzpDCQ5A0296lU9IJiOj/AwojZ0tlR+Ii59KsNWz52zkBF4ou1yq85UB+idj9Jhe RZH49LBe+Lp1nvKLSQ2gIgIuzxtWiBO1+KPMDDdhxirAgZEYBu810PTgtLH7LVnseK0c hzA9uWGIe+7dbcCcDEdutRkSxHz5s2cUFBzDbqvEu1AOJe7C0A1IlmD1aMB7cvF0PzlD OfOJTsPqm5xiJFmi5wUDKsuA1z9VJcuQ7FaKEJEzcFyXaU3TApAZh94XZX7h73e9FaCO RajQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=pkEjhJOU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si15972872ejl.424.2021.06.28.20.55.18; Mon, 28 Jun 2021 20:55:42 -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=@alliedtelesis.co.nz header.s=mail181024 header.b=pkEjhJOU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232124AbhF2D4d (ORCPT + 99 others); Mon, 28 Jun 2021 23:56:33 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:52115 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231920AbhF2D4b (ORCPT ); Mon, 28 Jun 2021 23:56:31 -0400 Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 8BF92806B6; Tue, 29 Jun 2021 15:54:03 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1624938843; bh=dkUNM8jdJCoRaLeA7nV+tVdGzxcR6mPGSyJ1qqnC+yk=; h=From:To:Cc:Subject:Date; b=pkEjhJOUvq9Vv02PlUE9CrasFw6V80gkD2E2sYCPe7WFRFvIFFn/Iyavv4krXAdg2 Y3xJ7VG6ziEh08fPcOPPbIgskqwUAZg0EHWAeQwOhaxqJc2Ydn0RyI8oig1opuN0W9 3eySou7oGivC5e/WnO/I457ZGlRuzdE+pNx0V2ojU2ASU93RcYdkD6/nzlLcOmv7t/ 5BB5dFkUZv6p3rHnggYoBbPn+EcWE9i/ah61cnFsAzAraJ92kaebbrzVzr0Dr+ax5l jMJKXyUmjBJpmmVYMoZ3JKzzMk4n9xvObG0FtKRR4+Eck746tueUm0ZGvsjEC+rmp6 Ve13LGtwfV7Dg== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Tue, 29 Jun 2021 15:54:03 +1200 Received: from pauld-dl.ws.atlnz.lc (pauld-dl.ws.atlnz.lc [10.33.23.37]) by pat.atlnz.lc (Postfix) with ESMTP id 468E413EE58; Tue, 29 Jun 2021 15:54:03 +1200 (NZST) Received: by pauld-dl.ws.atlnz.lc (Postfix, from userid 1684) id 40ECB1E030B; Tue, 29 Jun 2021 15:54:03 +1200 (NZST) From: Paul Davey To: Manivannan Sadhasivam Cc: Hemant Kumar , Bhaumik Bhatt , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Davey Subject: [PATCH v3 0/2] bus: mhi: Fix MHI on big endian architectures Date: Tue, 29 Jun 2021 15:53:55 +1200 Message-Id: <20210629035357.11091-1-paul.davey@alliedtelesis.co.nz> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SEG-SpamProfiler-Analysis: v=2.3 cv=IOh89TnG c=1 sm=1 tr=0 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=r6YtysWOX24A:10 a=LpQP-O61AAAA:8 a=4bNo0gKVkgJuf2YILAYA:9 a=pioyyrs4ZptJ924tMmac:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I encountered some problems getting the MHI driver to work on an Octeon 3 platform these seem to all be related to endianness issues. The modem interface appears to require the DMA structures to be in little endian, however the MHI core driver was assembling them in native endianness. Using little endian explicitly allows the interface to function as expected. Changes in v3: - removed change of doorbell helper functions db_val type from dma_addr_t to __le64 favouring doing conversion only when writing to context wp fields. =20 Changes in v2: - use __fls instead of find_last_bit in pm_state conversion patch as requested by Hemant Kumar Paul Davey (2): bus: mhi: Fix pm_state conversion to string bus: mhi: Fix MHI DMA structure endianness drivers/bus/mhi/core/debugfs.c | 26 +++---- drivers/bus/mhi/core/init.c | 43 ++++++------ drivers/bus/mhi/core/internal.h | 119 ++++++++++++++++---------------- drivers/bus/mhi/core/main.c | 22 +++--- drivers/bus/mhi/core/pm.c | 4 +- 5 files changed, 109 insertions(+), 105 deletions(-) --=20 2.32.0