Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2479701imm; Wed, 3 Oct 2018 04:40:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV62cwnkijY4sv+i0cjUvXRZyoGZsbSm3FxDDscEcOs2yTvEeTXU/v3/fWesMRLH+QfLhvvsF X-Received: by 2002:a63:a745:: with SMTP id w5-v6mr1025454pgo.374.1538566819365; Wed, 03 Oct 2018 04:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538566819; cv=none; d=google.com; s=arc-20160816; b=ZvAVvnl/b6vAMGDv/RVsvzBxUPlxdfyD0dGapL6RntZ2vqEZ9G3JV5RIitTFsux3bu b0xGJ6agh00PJC4vWd8l0AZ1DtS7Zu4zZtW2JCW2Yq22E2BTBg/ZRzcJq5FkG1RnmnVi /u/GtL19t2uXZ0Mpel0vn1ygtnoGtRWeVqzTv4JVN6ciI+fo8MGHRq6GkWC9GOSOxyn8 tpjFi+hSsblqBd+3JmE8DO9Z+Lert65flYrN07kOLjeEE1sHMRHzlZjw6Lgs9j6ApJPO H1oBVdmjPs/dODEzMzKDiZglfqu9eg/vEwHg/ny34aErk03JmngAWSyaV1F19YkfNFce zNSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=3z/8t6pAKMS+Q9VsF5Q+mD/hDRbf0ObwXDgb2gx/pHg=; b=t9M+sxcnoLWbIhNB6kck1/MZ2nah7IgmgFbJre+4hDgUiEynK9WH+WH1/H7IEc9Hkp FTXebXOtyOqLkPZ1UNqfyTk9xQrBX5hh1Ao7eLbJUDvSvJnjR/j3GtzeBnlmXsLtSbxs Ls+3mAdmVY07I9FZ7uCTK389xItWtGkPeeu4N7wK0z164WGfZ0qK16ep/OFOrNCpdpRu kirMpBx08Eznj4TZIYTn1uTqSv8WzVJGFaTaaZ/IqkZYAgoLRz4fHb4/LN9hTELCwhI7 I9nbdDvcUGRG0AHHqOe9lAS6xu1OM6yl4MoZbjN1Rdie0ErqBUGILHAH+UZzLizh5cd+ MwNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=kyzoIEUx; dkim=pass header.i=@codeaurora.org header.s=default header.b=kyzoIEUx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12-v6si1267572pla.421.2018.10.03.04.40.04; Wed, 03 Oct 2018 04:40:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=kyzoIEUx; dkim=pass header.i=@codeaurora.org header.s=default header.b=kyzoIEUx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726975AbeJCS0f (ORCPT + 99 others); Wed, 3 Oct 2018 14:26:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60476 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726793AbeJCS0f (ORCPT ); Wed, 3 Oct 2018 14:26:35 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9742860C64; Wed, 3 Oct 2018 11:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538566713; bh=8c9+qWAyiMYN0k8HfwddS62SwsXVqGMuh8Smfy3ceoM=; h=From:To:Cc:Subject:Date:From; b=kyzoIEUx1DQ6Up2bpwHG4iZS2d0GLEQITZ30xZV13YTPhpA/MGic8piiRx1UKX8+J zHnhRXNVZ/HYZAAL7RjoDO/P0AC2VRQdgWVnVZn7tPFRnVAKyhSZNMs4Fp7QVdVmxn Rd0mJxjDgqdE1LWmhhZSEh/740XB/7iizpJVRk94= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4BACD607BD; Wed, 3 Oct 2018 11:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538566713; bh=8c9+qWAyiMYN0k8HfwddS62SwsXVqGMuh8Smfy3ceoM=; h=From:To:Cc:Subject:Date:From; b=kyzoIEUx1DQ6Up2bpwHG4iZS2d0GLEQITZ30xZV13YTPhpA/MGic8piiRx1UKX8+J zHnhRXNVZ/HYZAAL7RjoDO/P0AC2VRQdgWVnVZn7tPFRnVAKyhSZNMs4Fp7QVdVmxn Rd0mJxjDgqdE1LWmhhZSEh/740XB/7iizpJVRk94= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4BACD607BD Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, sricharan@codeaurora.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH] rpmsg: glink: smem: Support rx peak for size less than 4 bytes Date: Wed, 3 Oct 2018 17:08:20 +0530 Message-Id: <1538566700-29469-1-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current rx peak function fails to read the data if size is less than 4bytes. Use memcpy_fromio to support data reads of size less than 4 bytes. Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_smem.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c index 2b5cf27..7b65443 100644 --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -89,15 +89,11 @@ static void glink_smem_rx_peak(struct qcom_glink_pipe *np, tail -= pipe->native.length; len = min_t(size_t, count, pipe->native.length - tail); - if (len) { - __ioread32_copy(data, pipe->fifo + tail, - len / sizeof(u32)); - } + if (len) + memcpy_fromio(data, pipe->fifo + tail, len); - if (len != count) { - __ioread32_copy(data + len, pipe->fifo, - (count - len) / sizeof(u32)); - } + if (len != count) + memcpy_fromio(data + len, pipe->fifo, (count - len)); } static void glink_smem_rx_advance(struct qcom_glink_pipe *np, -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project