From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70ADD37FF50 for ; Fri, 31 Jul 2026 07:36:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785483371; cv=none; b=Ig0QzbfEQU0yesQsKywpj5BuQcngAN6ecihpbexXMaXNdi//SpxARpDwVrQDZmfRceQCFoplIXoSAflfFSm4eQSr/u2fH+C20yTf+fies/eVMrL+gDCndF10W0cnPKgiN1jR0CE6nTRpd/CdIxNVYs9VlnqYBXbtli8XLK9lJFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785483371; c=relaxed/simple; bh=jaBPw11WtBpAsW2lmPiE+rjzVucIjiP5mn3f2jaHqG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z40Lj7hoQTir31jQA8u8AHQz4DM3X7AFS0x7ISXjRzmplXCXWLKy14uICGEDQJ71QWVNaCx6RmNkZSV+6AHDp9gutRJaWSkFcu9Vnxs+N3TJBYw/XhkvuwD2KMJkcmLNwLzeCkrF46mkTSvZ8yZrW86q5B3ge3CV5ytw7DEvJR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=khhMamu1; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="khhMamu1" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-47f707e5d75so438714f8f.1 for ; Fri, 31 Jul 2026 00:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785483366; x=1786088166; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3Rvnc4OeOnPEfVntwCGgYK4aj0ASFa6o50BvZ74uNJc=; b=khhMamu1MCDW4p7JdgjldDdKs4PLlwTQ8wc9H1NRiPKxUE3MapZoySbSiP4ly3TWf3 zIV4iDPw09YbCetGl6R6hsQsNrN1dX6Yn3ItHZknaNeLOG1c/rpP6jorinWa9398KC1+ 2E58u7UszltuFM8H89hsaPlj4BgX6BCwpzQPecfR68R3V7d/Mhe+mX+FmlZAQoFF7lBL r2o6NUX8peM0A+pkv2EcddzbiAbEbfyuMoKw/xPJ5qXOqhpkSdr42tVcYxybb7LuG882 0Lin38nrNHcDbAogpLAVR0PsNGR5lihM0wm0IxpTRJEP4nMvvpfzWUqKJiN3zzlzoLdZ sSqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785483366; x=1786088166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3Rvnc4OeOnPEfVntwCGgYK4aj0ASFa6o50BvZ74uNJc=; b=bCPIrrvrIK9Jy8hg2l0s7xwtBrmZjYqJ9Q01ivEskOVLAgRGw/OMBDpAHTuDZg/BoS 1SKHqh0H4DPTkLzt8gRAZsQYHwAmB3ABSXrTidQzm2J1MuVt72Tm6zHHzTiHK0u35VXC TP7+s3Ef4sniVWVH8dtdsBpi/pl41vEp3BL3bt527YG8IRJqerCfcpta1rI1IGmWB/tz P2WZW02rKweRjnh3t1XnQZQHj3er9AXCneUBKw3zVahQy1yLBm1REQ0dql8X37dev2A6 bDyPCL36U/JDMqdA6y/SZtkyBGSE3Ylnbyuj7h+cEmy8WOQRyqZbfcB4pTuGo2xTBWwL OGsQ== X-Forwarded-Encrypted: i=1; AHgh+Rpqp7BYgEDoGNuSSe7H08IEYgS9x17EYChjFzT2waTYSr3rLlvBgTvUTolna/C4YurcLK0InzTL/7SuMJY=@vger.kernel.org X-Gm-Message-State: AOJu0YxwdJRmOlRuLDjk6nrYWduJu13/VQjFtBcA7tGin88Ys0vLZm8U c5Nt5mMXdQCLNanydVDF+QnxlDurnr4QUAcF0+Af9suqeg4+D0rOUAnp X-Gm-Gg: AR+sD123OvPCm/g6fGL9GYfUPEg+XDRzZHyqEW9rX4HYnPi1B5sYFAnFxT+nppRXS2x 1L05Q1NGuzDfmDSl/IAvUffe4PI5VHkl9MKle1tDUeXiBuNZoHVDNTG7chGNjEVKMfNOoFA+rzJ Wm5ypNJeY/t721FMjvFMhWDT3ciLjaCgLNMahY+qfd3B88OAvXkQd/Iy8pDcpQFdJf8SCnBwf9X eejyUxpE8iZ8ckip6YpBLr9acpMq79qqoJuMqK1F2hZULMGoixDHS1nG2OFzfa5AmCbT8fhU5zb zx9F4WY0FYGjquILoxLoLCGXViDYAF9Y2BJyzuA1hzF/AvHuIgjRhxSbTUPZpuDXWdDCqLw6c0K Me/5Y4FRvLloh/1Uj3qRZHw+hggOtXxazFQsuCv4TOXHxrhUyUfxQTSgSzcdrUhD0gXGmCUC+oB Uow1eSLNEEK2XfxHG6KDP3l3Yu9jgyRNOFzBwej5FOcjkacoEPf+Hwje0LG4imtyz9n2naeEgEc +ADGX3JOf0m1JW9Tc97+Pa1UI4/DLhhui3aaFOT0g== X-Received: by 2002:a05:6000:4a0a:b0:47f:cb39:10c4 with SMTP id ffacd0b85a97d-47fd2abac8emr2630603f8f.12.1785483366028; Fri, 31 Jul 2026 00:36:06 -0700 (PDT) Received: from INBSWN167928.ad.harman.com (bba-86-96-6-50.alshamil.net.ae. [86.96.6.50]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fd456a5a4sm1751576f8f.20.2026.07.31.00.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 00:36:05 -0700 (PDT) From: Abid Ali To: kuba@kernel.org Cc: alexandre.torgue@foss.st.com, andrew+netdev@lunn.ch, davem@davemloft.net, dev.taqnialabs@gmail.com, edumazet@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, maxime.chevallier@bootlin.com, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, pabeni@redhat.com Subject: Re: [PATCH v2] net: stmmac: enable MAC rx/tx after DMA start Date: Fri, 31 Jul 2026 07:35:48 +0000 Message-ID: <20260731073548.1145-1-dev.taqnialabs@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260730160715.5ba5e272@kernel.org> References: <20260730160715.5ba5e272@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Thu, 30 Jul 2026 16:07:15 -0700 Jakub Kicinski wrote: > Looking at the patch - isn't it a bit awkward to handle Rx and Tx > together? We want to keep Rx blocked to prevent incoming frames, > but Tx should be allowed so that Tx can egress? netif_tx_start_all_queues() runs after stmmac_mac_set() in both __stmmac_open() and stmmac_xdp_open(), so no frame can be queued in the window between DMA start and MAC enable. So I expect this reorder to be fine and see no issue of coupling them together. > Grepping around I'm not seeing any flushing of Tx. Aren't there > issues with this driver if we stop the interface while it was > paused by link partner? I haven't run into these issues myself, but as Qingfang noted in this thread the proper release sequence per the programming guide needs more steps: stop TX DMA -> wait TPS (TX DMA stop confirmation) -> wait TX drain -> disable MAC RX/TX -> drain RX FIFO -> stop RX DMA -> wait RPS This is a pre-existing gap in the driver, currently it just clears the SR/ST bits for each channel and returns. Implementing the proper sequence would need readl_poll_timeout on TPS/RPS status bits per channel (up to 16 TX + 16 RX in my case), plus handling timeouts if the status never updates in teardown. The startup reorder is tested and verified to fix the RX hang I have seen. Would it make sense to take this on its own (only the startup reorder, with the teardown changes removed from v2) and address the teardown at a later point as I see multiple open points on what would be the right implementation to have there. Thanks, Abid