Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5637190rwb; Mon, 5 Dec 2022 01:50:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf7UbhnDXgbhvYDOpci2l8wAnr2K5G7g3Y8ayC9br3wA4e38fomg9Ciq88TvdA3BRvuoBWD8 X-Received: by 2002:a65:458a:0:b0:477:9a46:d058 with SMTP id o10-20020a65458a000000b004779a46d058mr55330193pgq.280.1670233809012; Mon, 05 Dec 2022 01:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670233809; cv=none; d=google.com; s=arc-20160816; b=NSv6VF0s5GwCEzdNqGgjZEGRJuF3/vqOr0LqpoHI7KpTiLrZMMgfG2KiI+PWUOYe2n wmDeDkx42IYPv+4OMNkLKi6luTxOEgibCXLWlzy74etQLek3dXCk2tzf7tMLQ7Fa9MFI K6PahVK5piofy+KVH8/EIENyWONUfvryU2ZX4sqVMWeSHKBR5Cyvnf+ea2+CqJmnzG69 fz+3bd4jjAeTuXshIiqmIMG0ikPSjCUdzQOw0241WUUKJjp93deXaEzPzRC6nWPVxW0t qJqyNHXDohxqGb9G2JYvmpblK0ZdCvxZPWyWNUUGyIhDaAp4EvSeeMj0YmPWtjqq7lwB 221w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5qbDaGH7SxSOuNbBpoFU+Fv5BbMKCKWXUuqKmkohWi8=; b=YTgGGHBGaTnwl2V5ILZPvn2rVI/PacglinXi3t3CeCcGm+TOggxfBDiILBGkLgQbL2 YxaTe88jTf7bhZGAeJNnj8/ldxyuedBtz/zNaQ+aJRdLQmfmzYcgFtvEmybFD/KZasoV wlaCgHf+zv5qHCuZwSFDMJ/yeKqXvq+2ulqPPUBYC0ZhNETn0EPD86zKp7ChqdURGE1W 9ZLYudyfZJZlEzNY3xoalu2EPTR/GLzBZJ3+MabN8OI1Zybj/7ohrh6jJCAcYGE3kLMP vJEgD7NHOjcwWDaehpCW7JFcM1xCh884gXweNDzRNQiLJb+dxezAsVR9BpdD+SPYs4lA 0WCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=cPmFGuam; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q34-20020a63f962000000b00473d2108701si13045504pgk.198.2022.12.05.01.49.58; Mon, 05 Dec 2022 01:50:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=cPmFGuam; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232233AbiLEIou (ORCPT + 82 others); Mon, 5 Dec 2022 03:44:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232282AbiLEIoe (ORCPT ); Mon, 5 Dec 2022 03:44:34 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1FCB13EB3 for ; Mon, 5 Dec 2022 00:44:32 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id fc4so19035817ejc.12 for ; Mon, 05 Dec 2022 00:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5qbDaGH7SxSOuNbBpoFU+Fv5BbMKCKWXUuqKmkohWi8=; b=cPmFGuam2aBecAMlmcUyuOsMDwpOJSwj8E0eek914Ml1didv0+EWnvtYZZWII2G1bZ E/cI2iocc/oiHCsHP3ftqYOCy0Fm9OsdD3JUkLFg0UnaGeISpI6f0C5wKDM+yr5QkyHD KhOvBQwTMiB2VFYVyB1VWYoEzhG6nFqJiBV24= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5qbDaGH7SxSOuNbBpoFU+Fv5BbMKCKWXUuqKmkohWi8=; b=sAn7B1KNbRcse8sRdw+pOsgPUaOZM2r1qFG4elVPXVRRlY3frlFXpZ51lUUztJ71K9 iY6DsowVm1MJvyCYq55Ns+VsPsaIixMGApTgInAJqsCogKXo4X3XF5/sYVojxGsECBIX WTOkucbnWNSsFmE3tQUU6Ub12xIgbbcVPLlNu0q6zpGRkBMEzUAObFIut+8FIdEPe8gu /Hn1oUVoRwHg4TuO0srktiGm+QCyYuM81fLDhtKHe9WuuSWK3cFY76IPgEfIjTiMENSC TZ27pFOqgqtNJKnPQsTpqPYAbfZKqdWqs0D9dq0O5zFub238cQo6VcY2ZZ0UiF1tJolP QNIg== X-Gm-Message-State: ANoB5pkJUm1A3NzrYTJ2KaQ4p3Ps8X4Hucer9Vysz+H63vhy9L1czakA DgX9c7QOpnHGkbs9TTsEzvtkWg== X-Received: by 2002:a17:907:8dcc:b0:7b2:b5aa:f1e0 with SMTP id tg12-20020a1709078dcc00b007b2b5aaf1e0mr7199260ejc.54.1670229871432; Mon, 05 Dec 2022 00:44:31 -0800 (PST) Received: from [172.16.11.74] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id k9-20020a17090646c900b0072af4af2f46sm5958974ejs.74.2022.12.05.00.44.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 00:44:30 -0800 (PST) Message-ID: <72eb4e63-10a8-702b-1113-7588fcade9fc@rasmusvillemoes.dk> Date: Mon, 5 Dec 2022 09:44:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] net: fec: don't reset irq coalesce settings to defaults on "ip link up" Content-Language: en-US, da To: Greg Ungerer Cc: Joakim Zhang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Rasmus Villemoes In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/12/2022 08.15, Greg Ungerer wrote: > Hi Rasmus, > > On 23 Nov 2022, Rasmus Villemoes wrote: >> Currently, when a FEC device is brought up, the irq coalesce settings >> are reset to their default values (1000us, 200 frames). That's >> unexpected, and breaks for example use of an appropriate .link file to >> make systemd-udev apply the desired >> settings >> (https://www.freedesktop.org/software/systemd/man/systemd.link.html), >> or any other method that would do a one-time setup during early boot. >> >> Refactor the code so that fec_restart() instead uses >> fec_enet_itr_coal_set(), which simply applies the settings that are >> stored in the private data, and initialize that private data with the >> default values. >> >> Signed-off-by: Rasmus Villemoes > > This breaks The ColdFire parts that use the FEC hardware module at the > very least. It results in an access to a register (FEC_TXIC0) that does > not exist in the ColdFire FEC. Reverting this change fixes it. > > So for me this is now broken in 6.1-rc8. Sorry about that. Since we no longer go through the same path that ethtool would, we need to add a check of the FEC_QUIRK_HAS_COALESCE bit before calling fec_enet_itr_coal_set() during initialization. So something like diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 93a116788ccc..3df1b9be033f 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1186,7 +1186,8 @@ fec_restart(struct net_device *ndev) writel(0, fep->hwp + FEC_IMASK); /* Init the interrupt coalescing */ - fec_enet_itr_coal_set(ndev); + if (fep->quirks & FEC_QUIRK_HAS_COALESCE) + fec_enet_itr_coal_set(ndev); } Or perhaps it's even better to do the check inside fec_enet_itr_coal_set() and just return silently? Either way, I don't know if it's too late to apply this fix, or if df727d4547 should just be reverted for 6.1 and then redone properly? Greg, can you check if the above fixes it for you? Rasmus