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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 21144C5472C for ; Mon, 26 Aug 2024 21:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:To:Date:From:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VApVdDfxKyIda0Fc340q9PZEeoaKy91HY6fQC9GFL0U=; b=bbRAUFWpQ5KAwVBwzWX9T84xGo cO7DJqhBOwYjVJ8pmsCveFbGNsc+tQsTrsP8RZha1b60CbmblQ4EPNFifN3SENF5NDkWFIk4M+iUM OiCFq0idKPpWcaXO5LmzS/eV/9ZF7Sr6W/nebKmNwu+JusMfnocIRSLYfr3GFsDhwzvjN/tG9HM7n YqpcsN4Oj1+vhqrQVQIZe2t08gDhVlXTyuWb3EKlve+t1DHP7L0GBzIW0oXFV6Un5rdmvB/9p9bBQ C4oNlah1dnprYaVFg9+EauuBcTRCD+9k+impicIBU3dfwVQRh9uOW9FTqOY2mFlfpOkdzWZOjKXLb PK8/Ya8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sih3c-00000008lmp-31Ci; Mon, 26 Aug 2024 21:15:24 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sifvi-00000008ZeW-2Ywu for linux-arm-kernel@bombadil.infradead.org; Mon, 26 Aug 2024 20:03:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:Date:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VApVdDfxKyIda0Fc340q9PZEeoaKy91HY6fQC9GFL0U=; b=P4Cy+8Vvl74i8dGAnCe8S2Okin vWAYvpDCghoA+2bUOnf+tu/PUW8Mls8N2+lAJxaxnhiHTxRdjkaEwnxljGaV3W5crFhNrjKQI1v0o QKFmFRPoeuKQb58XQ9qd90zdiX9o8ldWoPdoAv+Kli7ZFbzCAhnCB6iJCLgwqlqJ/UBjMSwmyjino q48xKrzsbz/vfeLdzjfx1GOgl8wy50OG32xICi4X9Q/FKqb2yz9f2ySmgAwBqNcr06PEfcEjXsJ7w Xq7JvB7C9Wc0aPI1X9/VbnOLUoJkvoloTQPbDWxHP+9bnvC0N9T3Mba6YlmP802TzGZHQpNQvk1ey octEZiXA==; Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sifve-0000000AjIg-36n7 for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 20:03:08 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5bf068aebe5so6077512a12.0 for ; Mon, 26 Aug 2024 13:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1724702584; x=1725307384; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=VApVdDfxKyIda0Fc340q9PZEeoaKy91HY6fQC9GFL0U=; b=PYilye5/pOfYd9jmdh+cpeEnz+FRZ8qrJ8ODjLj/KF3EOgMtII4VMpknN1zN8+kkKo Q6sYC5aLRpowSO0+n/IurCcmEMGwqLgcgsJurj+xDEk5zSBfeS/8/WgFKH7rRkl1nz0i W14DYCgzse2doxc1b/8Ed7qSPYORiQ7C+brf6T+hQVP3eU3CY287dZw/o5gALpTWy4a4 OcOHwLeocIfngvMJFzmqBAJo7wvhUnoLgi2laobxGo78O+NQmInCS+wt4U4AWL0HwHNF 1jQtgNlKKw0f82DtSPrLhsTcZ6C9nIOTDxIXg5W4DXUg2z9LiD1fFUiHnPRGlvFcxV1b 25qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724702584; x=1725307384; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VApVdDfxKyIda0Fc340q9PZEeoaKy91HY6fQC9GFL0U=; b=FuN8IpU2ArobbG618i08bTNnpghgt7dFab5UNEIZFlhSqFqqB7Ra4GaCiTJvI3wUXD kvMdSM8PPQtKS/GWguE7viumh1suFWE7qeuEuOzhoqeWHcST/KBT5OEiiJ9WCkgJAJAV 91+Jyt1guIpxk0/tD7djX3CHwIB1JXLeklGJlC4/n4JceFnsJ5VmYArhl6NKbvT6PxBf j6omyXO7UVxjZdEax7FIPa7exvuy/iRvbeDxBeWJRMINnta6LEx9UInBuML7eNRxXBJb oNkXfOdyl3KqKRLYaBRMmD9hJlhsEz4caEdXX5eDMNlA8QbyYxCMx+U+1uMDi7LJjdFD LMNg== X-Forwarded-Encrypted: i=1; AJvYcCWtGFL3szjHCaOaFWWWQonLNQLRZoaedDBhaA7yPNi696xRw7YXtkPOsSwIfya0qcA2KKRpEl4yvi4Hx99ZSw6N@lists.infradead.org X-Gm-Message-State: AOJu0YzGWWhpIIcOe2tX+FgWfWso5VHiKCRgTCrLCEWXKW7OTt8d2miF OWmhvcbDcg/0EIuyodFZ0HOWEXdqVpejFTvdRXFUdmVmwUg+UACaLNXygQG+4Xc= X-Google-Smtp-Source: AGHT+IEJun9KfUteMfL59uNTGUHEpSrl0T1D6SDZ8OvEGiIZBnAyJPah0ll1ZtxJIi9VNurPdw/FLQ== X-Received: by 2002:a05:6402:40c5:b0:5be:dc90:d13f with SMTP id 4fb4d7f45d1cf-5c08915b944mr8842242a12.5.1724702583173; Mon, 26 Aug 2024 13:03:03 -0700 (PDT) Received: from localhost ([87.13.33.30]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c0bb1f62bcsm137523a12.35.2024.08.26.13.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 13:03:02 -0700 (PDT) From: Andrea della Porta X-Google-Original-From: Andrea della Porta Date: Mon, 26 Aug 2024 22:03:09 +0200 To: Florian Fainelli Subject: Re: [PATCH 10/11] net: macb: Add support for RP1's MACB variant Message-ID: Mail-Followup-To: Florian Fainelli , Andrea della Porta , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Broadcom internal kernel review list , Linus Walleij , Catalin Marinas , Will Deacon , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nicolas Ferre , Claudiu Beznea , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Saravana Kannan , Bjorn Helgaas , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arch@vger.kernel.org, Lee Jones , Andrew Lunn , Stefan Wahren References: <775000dfb3a35bc691010072942253cb022750e1.1724159867.git.andrea.porta@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_210307_149998_8FBBDB2A X-CRM114-Status: GOOD ( 33.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Catalin Marinas , Michael Turquette , Claudiu Beznea , Eric Dumazet , Dragan Cvetic , Will Deacon , linux-clk@vger.kernel.org, linux-arch@vger.kernel.org, Rob Herring , Saravana Kannan , Lee Jones , Broadcom internal kernel review list , linux-pci@vger.kernel.org, Jakub Kicinski , Paolo Abeni , Linus Walleij , devicetree@vger.kernel.org, Conor Dooley , Arnd Bergmann , linux-gpio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Bjorn Helgaas , Andrea della Porta , linux-arm-kernel@lists.infradead.org, Derek Kiernan , Stephen Boyd , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Stefan Wahren , netdev@vger.kernel.org, Krzysztof Kozlowski , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Florian, On 10:01 Wed 21 Aug , Florian Fainelli wrote: > On 8/20/24 07:36, Andrea della Porta wrote: > > RaspberryPi RP1 contains Cadence's MACB core. Implement the > > changes to be able to operate the customization in the RP1. > > > > Signed-off-by: Andrea della Porta > > You are doing a lot of things, all at once, and you should consider > extracting your change into a smaller subset with bug fixes first: > > - one commit which writes to the RBQPH the upper 32-bits of the RX ring DMA > address, that looks like a bug fix > > - one commit which retriggers a buffer read, even though that appears to be > RP1 specific maybe, if not, then this is also a bug fix > > - one commit that adds support for macb_shutdown() to kill DMA operations > > - one commit which adds support for a configurable PHY reset line + delay > specified in milli seconds > > - one commit which adds support for controling the interrupt coalescing > settings > > And then you can add all of the RP1 specific bits like the AXI bridge > configuration. > > [snip] > > > @@ -1228,6 +1246,7 @@ struct macb_queue { > > dma_addr_t tx_ring_dma; > > struct work_struct tx_error_task; > > bool txubr_pending; > > + bool tx_pending; > > struct napi_struct napi_tx; > > dma_addr_t rx_ring_dma; > > @@ -1293,9 +1312,15 @@ struct macb { > > u32 caps; > > unsigned int dma_burst_length; > > + u8 aw2w_max_pipe; > > + u8 ar2r_max_pipe; > > + bool use_aw2b_fill; > > phy_interface_t phy_interface; > > + struct gpio_desc *phy_reset_gpio; > > + int phy_reset_ms; > > The delay cannot be negative, so this needs to be unsigned int. > > > + > > /* AT91RM9200 transmit queue (1 on wire + 1 queued) */ > > struct macb_tx_skb rm9200_txq[2]; > > unsigned int max_tx_length; > > diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c > > index 11665be3a22c..5eb5be6c96fc 100644 > > --- a/drivers/net/ethernet/cadence/macb_main.c > > +++ b/drivers/net/ethernet/cadence/macb_main.c > > @@ -41,6 +41,9 @@ > > #include > > #include "macb.h" > > +static unsigned int txdelay = 35; > > +module_param(txdelay, uint, 0644); > > + > > /* This structure is only used for MACB on SiFive FU540 devices */ > > struct sifive_fu540_macb_mgmt { > > void __iomem *reg; > > @@ -334,7 +337,7 @@ static int macb_mdio_wait_for_idle(struct macb *bp) > > u32 val; > > return readx_poll_timeout(MACB_READ_NSR, bp, val, val & MACB_BIT(IDLE), > > - 1, MACB_MDIO_TIMEOUT); > > + 100, MACB_MDIO_TIMEOUT); > > Why do we need to increase how frequently we poll? Thanks for your feedback, I will save all your precious suggestions for a future patch that will enable the macb ethernet. As stated in the cover letter, right now this specific patch is not intended to be upstreamed as is but it's just here for testing purposes, hence its 'raw' state. For sure the ethernet contained in RP1 will be one of the first device I will try to bring upstream, so I'll apply your comments there. Maybe the next time I will also add a better explanation about the state of a specific patch in the commit comment itself, and not only in the cover letter, just to be more explicit. Many thanks, Andrea > -- > Florian >