From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 9F15C31B81A for ; Fri, 5 Dec 2025 14:07:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764943626; cv=none; b=n9UpLR1mC/my3N9bCTUvF5e6YOFjVs/F3TiOhLu+s2RIcVqAzJBmLJN6sFvDUFRAG8fSZzD81yH/XRYv4gEXuCIq3fUC1XUzXBr+17YZkhX0b6PcEstezCK9HqBh1LIKTz8Ednovo1SL2igs/DEp/pdGIYWvxO+t/fmRrU45sPg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764943626; c=relaxed/simple; bh=v0aLSz6eztCCXc5Q60HoWtsEgndbijRcO8K/h9nqE18=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=a/GokQZawVkdXe2Z0nD7s3Zgp1bgG5GjvVB+UaVhQKA9Nzo+FRERZmQITLO1q6QCxV3AcSV6vmWatlqtgUg6qjxhKYae3vJBkV0JDflET4K0l/uDLpCN/7XtB+WkUH3jxWFFL5ufXUVc9i75fpcbno8ySAgRt0+UEOfj1Htv/2Y= 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=TI0qeUry; arc=none smtp.client-ip=209.85.128.44 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="TI0qeUry" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-47928022b93so4725825e9.0 for ; Fri, 05 Dec 2025 06:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764943621; x=1765548421; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=q9++XxvnUn686kk2ddDofJD+D0ZU/VRf4pIN8y4vJ3I=; b=TI0qeUrypK/wyM0Fqaq91N5G4cxxF+ZjIB5JRJFIlGtmU21c5xWpjDtVb90bUPMVEs u6CqwaXs+MKG5uW94Qpy59OI0ffkL1SV/fWT6oU9xaiKtQ4Gu1piS5df8LBw/YG85PuI BPRgmgOdwvtXL07tXfIaADWXamxIurrr9skDhE8u4iRYZGVLmnQgyGkfFSo4NpQihOu2 RpyPlimWZwQRrGJ66pjSTBWSGed9bHJBPTHGa3ERL0lxwhZ0awqKPNOiw31VZhROXQQs n7952aJwZqEOfV5SeyFJl/zylhXlM6COV4TgHnotxDCcvoScv28ZcXHHgLwv9cNrWFWU uGsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764943621; x=1765548421; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q9++XxvnUn686kk2ddDofJD+D0ZU/VRf4pIN8y4vJ3I=; b=eGIPDJc7pXv5mTqI+buwvpkW0wVTautMiDnyVUOuHGUKokBhNcDrYuQr5mTRv5DWQi BnbcthMtdYD04cFwngJFR/7KyvbtoW9Tk22VMHUZ7Grvy4fhCE6AW6R7OYDzdjrn0a25 wb1XyY0X7Fgw3jVfUPC9WxvSq4R6AZ8OhCtGivffw8J4Q+j3f8YN3NMEB1d3KfPa6hZJ SW3x3iyH19jemw+nLw7rGoJ7fHnQ+asvXDVvroxQbee+jgRYf3/ip9r7gH03sTW3Tsjj PMjF0s+jQ3o+uSYf4OsrwoU57Wtre9qeaFE9w3UKjEVFR3CmuPp0eo4scpP5TXcCRPE+ Tn+A== X-Forwarded-Encrypted: i=1; AJvYcCXmqPmC3qRD1Tgno/0IGDy7l1x9gHmO7m5oFYrm/APLewa8YDAwmCMYPhvbHECFAP31zZJbuiypvTgdi+I=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+IJKG+m0JzMRDKPACNJGle+uFX1EiLUBHh24AuYVL8kmZYIzp 4EJ3R4zQjESFb1mRWV5eZmWar4kdnNkEvkz6A4dC409HR1sUWenAzuT1q46jVA== X-Gm-Gg: ASbGnctfeQMUdwJGKPAZyHhYEiCpxVtXthOTIyBAIpw5efs7Z3abqitA1kevv8sGnqX bKEwWPYlcPnL0WJTecnyw2UflP1RbVLEe2z9I4h1Pgt351g2KfZhbydIJyEMFKdMd9RMVNWfwen HlyR6f/VWl4r+ACnQR8Qfzl8A99gSHTJtCjLnSknAslTcl3TdmG+K9JTTZuhuBXFTwKXSXoSRP3 1Q0ZpRJUeZY9g6UnpAWghVBqAPJF4pl+L5T1x5urcDs4uAFii3KwqEj7GWKtsEIIPSW+7l1xEFL YaIoefio5FB6+XPu1ocYIfDLaNEpG+IfX9dWVQ+8NX5fHI+mqIegDSJ0BsduHp9dGSoN1YxQI/s gDC070bPTEwy4bcHehqc6CJFE2/di+W98Xq6N2BWKu5doR9BE9UYIL+fZjEH4KFo7YIq5L0Ayqz fbpA== X-Google-Smtp-Source: AGHT+IG0wT+8z7qTds8v5+fhOTpqMvzgVhp1qMAUU1xLhi0SRHqu+YGYMW+KXhxXqSyk0JI3SZhWpQ== X-Received: by 2002:a05:600c:630e:b0:477:9c40:2fa1 with SMTP id 5b1f17b1804b1-4792c8f9e58mr46567795e9.4.1764943621044; Fri, 05 Dec 2025 06:07:01 -0800 (PST) Received: from skbuf ([2a02:2f04:d106:d600:456d:8d57:7a7:f1e7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4792b17588asm60066835e9.17.2025.12.05.06.06.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Dec 2025 06:06:58 -0800 (PST) Date: Fri, 5 Dec 2025 16:06:55 +0200 From: Vladimir Oltean To: Daniel Golle Cc: Andrew Lunn , Hauke Mehrtens , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Rasmus Villemoes , "Benny (Ying-Tsan) Weng" , John Crispin Subject: Re: [PATCH net] net: dsa: mxl-gsw1xx: manually clear RANEG bit Message-ID: <20251205140655.mxe32abnagpvjuri@skbuf> References: <97389f24-d900-4ff0-8a80-f75e44163499@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Dec 05, 2025 at 01:56:39PM +0000, Daniel Golle wrote: > On Fri, Dec 05, 2025 at 02:45:35PM +0100, Andrew Lunn wrote: > > On Fri, Dec 05, 2025 at 01:32:20AM +0000, Daniel Golle wrote: > > > Despite being documented as self-clearing, the RANEG bit sometimes > > > remains set, preventing auto-negotiation from happening. > > > > > > Manually clear the RANEG bit after 10ms as advised by MaxLinear, using > > > delayed_work emulating the asynchronous self-clearing behavior. > > > > Maybe add some text why the complexity of delayed work is used, rather > > than just a msleep(10)? > > > > Calling regmap_read_poll_timeout() to see if it clears itself could > > optimise this, and still be simpler. > > Is the restart_an() operation allowed to sleep? Isn't regmap_set_bits() already sleeping? Your gsw1xx_regmap_bus accesses __mdiobus_write() and __mdiobus_read() which are sleepable operations and there's no problem with that.