From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9ECF313532 for ; Thu, 18 Dec 2025 12:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766060090; cv=none; b=NfgGOJrAwGDfHfGtgSaNdgVQqVHihcl0BvLfAxEGxLFo9dV/l5VpEorbhqkNv87axkhsgJ4n2TJvraZyfafyFRvOd/V/F3z9R4E2OugNqsI7hi1RQtQ0lqqTAideRcjD0WPKIeThJEBYdNs9gIrx/8jt9xGfba8XvJh+mYDZ+R0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766060090; c=relaxed/simple; bh=zZq/z6A+c1YO3amUlGXD/9ir5S5QJCBcNizEkWsYebE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=b0FNZPMMZbIahqP6kMfLhCgx9fmEuEVd+aDu0bNYp96hhqNkc45CpLMx/Tuzn0OAdt5SJNy+sFmNOs80KOMWcSkGtYk5z4MwwHN1BxpdS5z64y59gqZT31KoeGcjBp2e6MAMS6cYMBR6ZUM65i5eXp6aFxnIDC/2wbAF34S6dIw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IfuBAzed; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=r3O3W1ql; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IfuBAzed"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="r3O3W1ql" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766060087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cgRR9HkYxgKFCBqZFhUlWNzAPSgCWmIS+3s3iTb+nEc=; b=IfuBAzedwb1bHDHO+23+VbFcPaEGPAQFXtsTK27SVwNSquY2Aine/DeUH8o3/40WK2oekd fG0bHPSS2+wAe4Sy8eI4sPNF5w7GwKQiUHh1bdG87ei93FuMSygEKmguTwkFuwLU7mNoAT zk0l8PQExubnhCVQF1kRty1XlxxvmhE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-112-aRjpx_P7OAGUy1YBJq-pUQ-1; Thu, 18 Dec 2025 07:14:45 -0500 X-MC-Unique: aRjpx_P7OAGUy1YBJq-pUQ-1 X-Mimecast-MFC-AGG-ID: aRjpx_P7OAGUy1YBJq-pUQ_1766060085 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-430fd96b440so299236f8f.1 for ; Thu, 18 Dec 2025 04:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1766060085; x=1766664885; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cgRR9HkYxgKFCBqZFhUlWNzAPSgCWmIS+3s3iTb+nEc=; b=r3O3W1qlxUucZv5On9l38WllYhU62W6ObD9rAuyh6hMhaRCYhlAHCyl20suJOvDTGL 4lcnr2nZF4Tp5JlSNwJp03kqlnNBNERYSVsxjDjD0HLAEuAlSQ1+PjbIGllGb+wAAr4p ElOcFqoy1LvT0pTwXLw9tvHydsIVoZv9ie55lNG6w4Ih7rgCFGrBsk/xtudnfSUOJs6h wNeAf3FqnINT8xuAYLKkWs0LuGKU8yxFdIYxdz0gwwJMiuDQbNFIPUJ6kLTnwnWWG5ge kqiFSA+nuiIq+rD6rSMiMHppVNTyoXZjn46bKUpE1Zr5BCi1wPI4C1gvAsHR+QhNeDqK ebSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766060085; x=1766664885; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cgRR9HkYxgKFCBqZFhUlWNzAPSgCWmIS+3s3iTb+nEc=; b=nvEHJcpYojuLRnHtELOHOF5QoortTz59197otkjigxf54HxChuIs88UrppmqSXYrGr HYQsXyLBNKTC7wiAuonzktT0zJr+g3rwqYANaRD3KlJly0at43/s7Chkl6Tvt93Fotem bjyQd67u9r1R6oAtj8SM7EZBx0xupuP2h+gsi2ige4JcQOQuyhHdKPfeliIb4x0psadY bk4+AdvalQbZKXqIVOPyGOVyvUjKVCMuMVA7VU00rFv/5sX2KFGFkt87G4w+PHpbV0U8 DQB0feTSFWap0/tKZ8TDfXoXA6TUUp52yPmgzS1Ko+qlCnBgUmJduMm8Br2q/P+zXuXa jsTA== X-Forwarded-Encrypted: i=1; AJvYcCU3W8n3korcroPPYOK6lwaHUjzLfPKH78or15DVULZxx5cwzDXhQaHF6Q+nzSsF4Q2cIFnndfh/fzrMDIw=@vger.kernel.org X-Gm-Message-State: AOJu0Yxt15yIuPgsNLjc6ucNTSfUqCCEBnuttijCu2bwvp733ss/EJvL nfxGgBxmos78ip95i6tkebDcEgiL9CEoIrT/jqXT0lO+QMbCsHd5fLsxGzaACIyszk6r99BcwCU tuuUUn55TGLCd+CxFa3ruX98kTwstK+R94zi+otZ5A33cEs9guV6+IOWfFz2+Z0Mo+g== X-Gm-Gg: AY/fxX4HvOElTndvavjX0wCLiaMumyAvDllfuBS7G+SYTpimbDAZjGeotjgOvpPoGPX usrjQTOgcN4PoKNqRZ26nTjAYWQrBypwwcau6+f+DyaQSpDLUkRtk1iLPYukk1QAfvNS5+2uUI+ E7ul4fr4BAS+ePMCLQgdYqAcZJ3F1bAouhUYNHDedukodF+Ui6OsdzYrutYWIIyPq4wdZ1TkusL iezRsT5HEF4sWZ/cN10rNr+b3VuhI6Isv+MMn03HWysqdmmsP7BXcBNXSgAPjz8PPHGaTppjuf2 jNmmzzB7PmBvUIefT2dLc812kBSGfp1zNJW/FgTX2RCg/oJ9QkPirlFIy9H7+YjvofOimewgcjF vR591+WCwJ+NegQ== X-Received: by 2002:a05:6000:2f81:b0:42b:47da:c313 with SMTP id ffacd0b85a97d-42fb4476da0mr21110620f8f.3.1766060084555; Thu, 18 Dec 2025 04:14:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0An4Sok3enuv2kgkb9o1arBJPUDV09ozAK/U7xjG+0Sp9Co7WHhQ+s/88Jm0Y8UT/MGGhcA== X-Received: by 2002:a05:6000:2f81:b0:42b:47da:c313 with SMTP id ffacd0b85a97d-42fb4476da0mr21110595f8f.3.1766060084083; Thu, 18 Dec 2025 04:14:44 -0800 (PST) Received: from [192.168.88.32] ([212.105.155.159]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43244934cf5sm4767319f8f.1.2025.12.18.04.14.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Dec 2025 04:14:43 -0800 (PST) Message-ID: Date: Thu, 18 Dec 2025 13:14:42 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] net: macb: Relocate mog_init_rings() callback from macb_mac_link_up() to macb_open() To: Xiaolei Wang , nicolas.ferre@microchip.com, claudiu.beznea@tuxon.dev, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, rmk+kernel@armlinux.org.uk, Kexin.Hao@windriver.com Cc: netdev@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org References: <20251209085238.2570041-1-xiaolei.wang@windriver.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20251209085238.2570041-1-xiaolei.wang@windriver.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/9/25 9:52 AM, Xiaolei Wang wrote: > In the non-RT kernel, local_bh_disable() merely disables preemption, > whereas it maps to an actual spin lock in the RT kernel. Consequently, > when attempting to refill RX buffers via netdev_alloc_skb() in > macb_mac_link_up(), a deadlock scenario arises as follows: > Chain caused by macb_mac_link_up(): > &bp->lock --> (softirq_ctrl.lock) > > Chain caused by macb_start_xmit(): > (softirq_ctrl.lock) --> _xmit_ETHER#2 --> &bp->lock Including the whole lockdep splat instead of the above would be clearer; in fact, I had to fetch the relevant info from there. > Notably, invoking the mog_init_rings() callback upon link establishment > is unnecessary. Instead, we can exclusively call mog_init_rings() within > the ndo_open() callback. This adjustment resolves the deadlock issue. > Given that mog_init_rings() is only applicable to > non-MACB_CAPS_MACB_IS_EMAC cases, we can simply move it to macb_open() > and simultaneously eliminate the MACB_CAPS_MACB_IS_EMAC check. This part is not clear to me: AFAICS the new code now does such init step unconditionally, which looks confusing. I think such step should still be under the relevant conditional (or you need to include a better/more verbose explanation describing why such check is not really needed). > Fixes: 633e98a711ac ("net: macb: use resolved link config in mac_link_up()") > Cc: stable@vger.kernel.org > Suggested-by: Kevin Hao > Signed-off-by: Xiaolei Wang Side note: you still need to include the 'net' tag into the subj prefix. /P