From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 382FDC432C0 for ; Wed, 20 Nov 2019 17:53:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 054E3206CC for ; Wed, 20 Nov 2019 17:53:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728118AbfKTRxH (ORCPT ); Wed, 20 Nov 2019 12:53:07 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:44136 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727468AbfKTRxG (ORCPT ); Wed, 20 Nov 2019 12:53:06 -0500 Received: by mail-ot1-f67.google.com with SMTP id c19so324608otr.11; Wed, 20 Nov 2019 09:53:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Uwv8oDObgXlOHyppocybq9RAMpKlTk5h/NeR2cnrypw=; b=SLo2M2SrfMO0joR4Vi096PRmD1SA0rKm0JSdxaK4CNATZCVgPHzjySrCsyQt78pljL XlawP6bVlLgkXjKJ1oW/awX+PrBQFlJY2G6R5t/4CIBWn/lAIIK3kDe3y/VvGpsxRerS rtzuPJqpNW9RtKyTFZqJybtXWvt8k6BJBwjBlpLiYwhN63myP91D2KS85DXEsA5pGOIN Ghn1MGLQzURbo41KD0KNmbAnxdTvYY8iLZOmNlRc5LKBR4qIguqUcRFzjD4pzN6nbfrr T7pZ6KkyFjtsAKOtneu+qzFY+TOkcPL30IKwjmh1yT7vRE42LAWZsGO1XaslIgCTjpar vpaA== X-Gm-Message-State: APjAAAVdX26L1m8bhAyKJ1adxv3FsEDaYCMyMoWmrBs0DRroxs25iOVd 0X08H+rJx0jsX/IzTJwO39gUNpS4 X-Google-Smtp-Source: APXvYqyYxpO+Yok/l/BmbsETZT/OFjJIE4+Qicr0Tx22dVgGKtoXrmGUpNs3GpfhXq/uvndGbsFHkg== X-Received: by 2002:a9d:f45:: with SMTP id 63mr2959739ott.214.1574272385455; Wed, 20 Nov 2019 09:53:05 -0800 (PST) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com. [209.85.210.54]) by smtp.gmail.com with ESMTPSA id h39sm8799317oth.9.2019.11.20.09.53.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Nov 2019 09:53:04 -0800 (PST) Received: by mail-ot1-f54.google.com with SMTP id c19so324551otr.11; Wed, 20 Nov 2019 09:53:04 -0800 (PST) X-Received: by 2002:a9d:7f12:: with SMTP id j18mr2846999otq.221.1574272384642; Wed, 20 Nov 2019 09:53:04 -0800 (PST) MIME-Version: 1.0 References: <20191118112324.22725-1-linux@rasmusvillemoes.dk> <20191118112324.22725-46-linux@rasmusvillemoes.dk> In-Reply-To: <20191118112324.22725-46-linux@rasmusvillemoes.dk> From: Li Yang Date: Wed, 20 Nov 2019 11:52:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 45/48] net/wan/fsl_ucc_hdlc: fix reading of __be16 registers To: David Miller Cc: Qiang Zhao , Christophe Leroy , linuxppc-dev , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , lkml , Scott Wood , Timur Tabi , Rasmus Villemoes , Netdev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 18, 2019 at 5:26 AM Rasmus Villemoes wrote: > Hi David, What do you think about the patch 45-47 from the series for net related changes? If it is ok with you, I can merge them with the whole series through the soc tree with your ACK. Regards, Leo > When releasing the allocated muram resource, we rely on reading back > the offsets from the riptr/tiptr registers. But those registers are > __be16 (and we indeed write them using iowrite16be), so we can't just > read them back with a normal C dereference. > > This is not currently a real problem, since for now the driver is > PPC32-only. But it will soon be allowed to be used on arm and arm64 as > well. > > Signed-off-by: Rasmus Villemoes > --- > drivers/net/wan/fsl_ucc_hdlc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c > index 405b24a5a60d..8d13586bb774 100644 > --- a/drivers/net/wan/fsl_ucc_hdlc.c > +++ b/drivers/net/wan/fsl_ucc_hdlc.c > @@ -732,8 +732,8 @@ static int uhdlc_open(struct net_device *dev) > > static void uhdlc_memclean(struct ucc_hdlc_private *priv) > { > - qe_muram_free(priv->ucc_pram->riptr); > - qe_muram_free(priv->ucc_pram->tiptr); > + qe_muram_free(ioread16be(&priv->ucc_pram->riptr)); > + qe_muram_free(ioread16be(&priv->ucc_pram->tiptr)); > > if (priv->rx_bd_base) { > dma_free_coherent(priv->dev, > -- > 2.23.0 > From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 289DFC432C0 for ; Wed, 20 Nov 2019 17:55:12 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1E7020878 for ; Wed, 20 Nov 2019 17:55:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1E7020878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47J9MK1NKwzDqv5 for ; Thu, 21 Nov 2019 04:55:09 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.167.194; helo=mail-oi1-f194.google.com; envelope-from=pku.leo@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47J9K35HxczDqJq for ; Thu, 21 Nov 2019 04:53:08 +1100 (AEDT) Received: by mail-oi1-f194.google.com with SMTP id e9so549774oif.8 for ; Wed, 20 Nov 2019 09:53:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Uwv8oDObgXlOHyppocybq9RAMpKlTk5h/NeR2cnrypw=; b=F391fmpWARFEHBgNGQcX610RbbKv5V50imrveK3HGGLpsW28sRzle5hpmfAu7ZEgtA SLp7R0ofq9mSRu5uwLCZeRIzTAdW+uQ3sdr8Ebol77SbAKRsjgV8t3OdMHGndxkNO0LT 5+N29dzVjznhob+2MlEeQepm4Mrbp3g1ryA2v0evABsWWysX4pmzxNJ7IpZhupPCuKHd psMa9T8lCPgM15RjCdpJR+LlcMwkDxAm46lT8LnJVr7KBX0VanHvnqbrip/Hm4NWnjvB 7KkSXd9Wl7r/6GVwC+BqHhnFRjZZu3/piC9ZzfcxCS71sceLTqcz+PYBl+ICtfWz7Bet 2Ovg== X-Gm-Message-State: APjAAAXdDTkpsp7dAdcAqLEKCJYgwLd2H2blx7sRGb8Xm7zucK7btDBZ QKa3wjfosw0e7eBgNMaaiAH2QxIk X-Google-Smtp-Source: APXvYqyRWH1ONiovMIg7TYPtLTVW4hA8N2wFbz8KiItNEvEHVvZoYy6efJcblFuDaLLHRcFCO4uS2w== X-Received: by 2002:aca:c64c:: with SMTP id w73mr3970884oif.161.1574272385648; Wed, 20 Nov 2019 09:53:05 -0800 (PST) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com. [209.85.210.41]) by smtp.gmail.com with ESMTPSA id q4sm8364684oij.52.2019.11.20.09.53.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Nov 2019 09:53:04 -0800 (PST) Received: by mail-ot1-f41.google.com with SMTP id c14so383859oth.2 for ; Wed, 20 Nov 2019 09:53:04 -0800 (PST) X-Received: by 2002:a9d:7f12:: with SMTP id j18mr2846999otq.221.1574272384642; Wed, 20 Nov 2019 09:53:04 -0800 (PST) MIME-Version: 1.0 References: <20191118112324.22725-1-linux@rasmusvillemoes.dk> <20191118112324.22725-46-linux@rasmusvillemoes.dk> In-Reply-To: <20191118112324.22725-46-linux@rasmusvillemoes.dk> From: Li Yang Date: Wed, 20 Nov 2019 11:52:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 45/48] net/wan/fsl_ucc_hdlc: fix reading of __be16 registers To: David Miller Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Timur Tabi , Netdev , Rasmus Villemoes , lkml , Scott Wood , linuxppc-dev , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Qiang Zhao Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Nov 18, 2019 at 5:26 AM Rasmus Villemoes wrote: > Hi David, What do you think about the patch 45-47 from the series for net related changes? If it is ok with you, I can merge them with the whole series through the soc tree with your ACK. Regards, Leo > When releasing the allocated muram resource, we rely on reading back > the offsets from the riptr/tiptr registers. But those registers are > __be16 (and we indeed write them using iowrite16be), so we can't just > read them back with a normal C dereference. > > This is not currently a real problem, since for now the driver is > PPC32-only. But it will soon be allowed to be used on arm and arm64 as > well. > > Signed-off-by: Rasmus Villemoes > --- > drivers/net/wan/fsl_ucc_hdlc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c > index 405b24a5a60d..8d13586bb774 100644 > --- a/drivers/net/wan/fsl_ucc_hdlc.c > +++ b/drivers/net/wan/fsl_ucc_hdlc.c > @@ -732,8 +732,8 @@ static int uhdlc_open(struct net_device *dev) > > static void uhdlc_memclean(struct ucc_hdlc_private *priv) > { > - qe_muram_free(priv->ucc_pram->riptr); > - qe_muram_free(priv->ucc_pram->tiptr); > + qe_muram_free(ioread16be(&priv->ucc_pram->riptr)); > + qe_muram_free(ioread16be(&priv->ucc_pram->tiptr)); > > if (priv->rx_bd_base) { > dma_free_coherent(priv->dev, > -- > 2.23.0 > From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 EDB38C432C0 for ; Wed, 20 Nov 2019 17:53:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE3AC20878 for ; Wed, 20 Nov 2019 17:53:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HExgePiE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE3AC20878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9grHlfyevhfixX2D3LrDsbEaJfaiww1bRRGyA5yFSDE=; b=HExgePiEOG4Dkj Hz+gCaw+cRTwX4v2HddkAkbLIoRs61NN7r6SIqJ06GKUQL4+nybMYs9CyzsrDupSl9ONdKP+j5TKQ zw7gtVGT48nn7QcwiBaFRbh8z3hwZdW74gRyPLgCMPJwVf6Kcub71elHy3eoBCvpfujfxvsnumwCD CwN3Etm0cIN5GkGhELpoNE+Q0fu3jjvY0rC8CtPTVkSQZ58p10tss91Kr3cM61VCB11sZUNupPXIF IFO6TgF4VwP18uQDwBYZ1OPsZXEa9fIHbmEGLxhjjUpqfKL1thBEUG8be9nX2Czn7PXgvX8h/oYkC NZKyKFp5NFzHKsmcgCbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXUA9-0002Ma-Qz; Wed, 20 Nov 2019 17:53:09 +0000 Received: from mail-ot1-f68.google.com ([209.85.210.68]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXUA7-0002MC-A8 for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 17:53:08 +0000 Received: by mail-ot1-f68.google.com with SMTP id 94so346714oty.8 for ; Wed, 20 Nov 2019 09:53:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Uwv8oDObgXlOHyppocybq9RAMpKlTk5h/NeR2cnrypw=; b=WYw3HgdR+4d7Anfb4GppG6en0NL/RJWY46TQVUkOfi8FJ0TkdS8MTjk8cAimSzeWuq rCX+sssiH41205mp58iufn9AyrrcKjJR5OymKb1fI/1n1hvWsE/P63qc9cQyK4RDSWYw b+Ds9JYNFwazBjU8ak+35fbWPYngKUdN1DCzFzK7BvK6JFfjcyE5aUjxFavaFfU9MZXP Qu5TSu5VAPhS6+KoAM/VkVqD0L5hgiTWFg/PFzBQmCMr6oYVM3NLz6ZfOV1fu+x0LnHR nNNYH8zU7rgLRkvS2FaVHJ8r5BH7xXr1ox4pWBRUHU5dYEJrBCEU09uJgyMwdEXfdJ++ 9f4Q== X-Gm-Message-State: APjAAAV/lCWP3hzlpIKBjVFORrgdX5jycxkcfzpclMumhMS7Q99DmfZx KYeIy7H7GwBgZpI80Ds7qfGzKcfO X-Google-Smtp-Source: APXvYqwlN56mlHfHcWiqgn85NkWAqBWlGsHClX0w3Oeq8Obgm+5ZXSLRSWcasvURaMVqQNO0vgE6kA== X-Received: by 2002:a9d:f45:: with SMTP id 63mr2959750ott.214.1574272385769; Wed, 20 Nov 2019 09:53:05 -0800 (PST) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com. [209.85.210.49]) by smtp.gmail.com with ESMTPSA id 9sm246170oiq.33.2019.11.20.09.53.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Nov 2019 09:53:05 -0800 (PST) Received: by mail-ot1-f49.google.com with SMTP id n23so313639otr.13 for ; Wed, 20 Nov 2019 09:53:04 -0800 (PST) X-Received: by 2002:a9d:7f12:: with SMTP id j18mr2846999otq.221.1574272384642; Wed, 20 Nov 2019 09:53:04 -0800 (PST) MIME-Version: 1.0 References: <20191118112324.22725-1-linux@rasmusvillemoes.dk> <20191118112324.22725-46-linux@rasmusvillemoes.dk> In-Reply-To: <20191118112324.22725-46-linux@rasmusvillemoes.dk> From: Li Yang Date: Wed, 20 Nov 2019 11:52:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 45/48] net/wan/fsl_ucc_hdlc: fix reading of __be16 registers To: David Miller X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191120_095307_353856_0C560A76 X-CRM114-Status: GOOD ( 19.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe Leroy , Timur Tabi , Netdev , Rasmus Villemoes , lkml , Scott Wood , linuxppc-dev , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Qiang Zhao Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 18, 2019 at 5:26 AM Rasmus Villemoes wrote: > Hi David, What do you think about the patch 45-47 from the series for net related changes? If it is ok with you, I can merge them with the whole series through the soc tree with your ACK. Regards, Leo > When releasing the allocated muram resource, we rely on reading back > the offsets from the riptr/tiptr registers. But those registers are > __be16 (and we indeed write them using iowrite16be), so we can't just > read them back with a normal C dereference. > > This is not currently a real problem, since for now the driver is > PPC32-only. But it will soon be allowed to be used on arm and arm64 as > well. > > Signed-off-by: Rasmus Villemoes > --- > drivers/net/wan/fsl_ucc_hdlc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c > index 405b24a5a60d..8d13586bb774 100644 > --- a/drivers/net/wan/fsl_ucc_hdlc.c > +++ b/drivers/net/wan/fsl_ucc_hdlc.c > @@ -732,8 +732,8 @@ static int uhdlc_open(struct net_device *dev) > > static void uhdlc_memclean(struct ucc_hdlc_private *priv) > { > - qe_muram_free(priv->ucc_pram->riptr); > - qe_muram_free(priv->ucc_pram->tiptr); > + qe_muram_free(ioread16be(&priv->ucc_pram->riptr)); > + qe_muram_free(ioread16be(&priv->ucc_pram->tiptr)); > > if (priv->rx_bd_base) { > dma_free_coherent(priv->dev, > -- > 2.23.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel