Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp320279imm; Wed, 3 Oct 2018 17:03:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ON04jHbpysYUKm90/OmSfJJyxO1AX8rxZpre19MB+e4NJklF9fW9CI8UbhdzoUbSTt+an X-Received: by 2002:a17:902:758b:: with SMTP id j11-v6mr3939528pll.5.1538611429232; Wed, 03 Oct 2018 17:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538611429; cv=none; d=google.com; s=arc-20160816; b=BlSq8CwMTZeROipL0Q3EJx3xhaxV653J07izBzvtP7fR5ZLOh7n/hXjjFInTbBOScU nbncp4bDMj0O7Bn+eBBF0jXPsiqZbMOscMzs690zvQPU0wubWLPR/yInbnGUbGfirs1D bW2kIIKeVfeViMDfiC9DRCPgb4oqcXiUBLae9vQaVOWQGgOn1odPBQl+pf3ZEzhY1WL7 WuaJj5JG1ytfplUN5wo6gpk/7XlKmcTsDu5eLsMf3oZKTHVohwakGbd3f1beRAhVMbNG cUtxIdB2eS74LIxkdcze0D/CJDq/BTg/ejAv/yXOyBHRscD/Lz2N+o6znEcyMBtmcWoP 8lZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=S4vGGkCwhf8/MaME1La4b4mfOsAlD6XQqFqX9USLO7Y=; b=CcvOOHDCSvP1wPh9UZwaEbJtrvL64Muz0LqHhd+2hmbcDBi8Z4BVezlCTUXVNW9KCB 5a8omuNMoLVPeM7+tIAKphr/MixQOn4mDlZ/pY4+j+HycxrF8TsoS/7iLJZAibwys6Uk Ff/x4gYc1kDbAh4RkFwddGSL5oZA/8D6nnDye46Q8HjJDNx1mTs+AeOQtN6HBiwBCg0j wQ+v9SxRaiZXq947KvYDKtLx40TlTCWvXAebk5B5axob8h9ZQ+ucj+0m54AtRbOYNgPz Cgs7lQW+ENXnVR/YnbNBLSGATjnx2W2kyqJao4yRNLA4FXEC/2l4AiJM/869Ob0IGbh+ WkzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aPPsGfXS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13-v6si3047265pgi.518.2018.10.03.17.03.32; Wed, 03 Oct 2018 17:03:49 -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=@linaro.org header.s=google header.b=aPPsGfXS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbeJDGyF (ORCPT + 99 others); Thu, 4 Oct 2018 02:54:05 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33949 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbeJDGyF (ORCPT ); Thu, 4 Oct 2018 02:54:05 -0400 Received: by mail-pf1-f195.google.com with SMTP id k19-v6so2458013pfi.1 for ; Wed, 03 Oct 2018 17:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=S4vGGkCwhf8/MaME1La4b4mfOsAlD6XQqFqX9USLO7Y=; b=aPPsGfXSXEZIH24bOO6hbuk0K3VQOp/5GjOkta8Yuv13dmlSnRfzeBuBI8A6P4pJ35 iuw+RPlIKqEZEgr4r3Wc8x3QJfRmyfqIKjofAN0QdglM82aQCAz2zeEYnx4k4PqUV8CF 0YLrtOWth87bHCwTcD4P+UfIYeYwBd+MERIYU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=S4vGGkCwhf8/MaME1La4b4mfOsAlD6XQqFqX9USLO7Y=; b=kZarv2jTmkYsM534OMgLEtsTEExZ9/7qIqOsvioOyhULAjZ/eK/F9lpi9MFAsF7yDq 1veWxPozWyzgK9t4Db37jbEAnon32Q2NIkD2/WEFFN+nacOr1QUgwbLHVsd/wdwmXvl6 vK3XkH+VCzBr64DTdTClkyNuW8qI0yfD0fduU7nbBahcBoHUVKp4JjV5Gv3PE8+2gl// SGMH959F1Pth+FLtfvvBDauJRfcg+AnXlcqFUkO1Krk2cxr9jRRLiumUGdPVFuR+8qUX WR7ilwG86GcQsbXMkjAdg4jqocaroqFzK4Fsz3Bm3mnbfj34tkyjQ+aXJyg6BtaNkcIS 7PnA== X-Gm-Message-State: ABuFfoj4LXEVCP/6IPK1qzib3xsB+MKQn5qWJ/bHGQQYBD10fuZzA3zo nD1sY1yqqmCDxe8LoyxdRGGltOJ0Vot9Dw== X-Received: by 2002:a62:fcd8:: with SMTP id e207-v6mr3950567pfh.132.1538611407306; Wed, 03 Oct 2018 17:03:27 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id q24-v6sm4602733pfi.165.2018.10.03.17.03.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Oct 2018 17:03:26 -0700 (PDT) Date: Wed, 3 Oct 2018 17:03:24 -0700 From: Bjorn Andersson To: Arun Kumar Neelakantam Cc: ohad@wizery.com, clew@codeaurora.org, sricharan@codeaurora.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rpmsg: glink: smem: Support rx peak for size less than 4 bytes Message-ID: <20181004000324.GT2523@minitux> References: <1538566700-29469-1-git-send-email-aneela@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1538566700-29469-1-git-send-email-aneela@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 03 Oct 04:38 PDT 2018, Arun Kumar Neelakantam wrote: > 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 Applied, with a fixes tag and Cc stable. Thanks, Bjorn > --- > 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 >