From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 629221FDE3A for ; Fri, 17 Jan 2025 12:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737116365; cv=none; b=CPk1Q45fta0L9OpEuUd3dPpQkyyM7optHSzf7ql0dwW1yegz7Q/8UZ4dydUmW6FTvap3JKnbOMMlFISGA4rVh3uMPiqkvSiq11hxrt0VBpf/weEbop7Z8Wwkz7aYcPx/mcP9IheBLyjofyoZt/G+zNQ6Mts73IYZBEAiTG1U+5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737116365; c=relaxed/simple; bh=Ov6RyDvlBV40EYwFXuzQXiVzA/WzwQtDr93JFljbJYc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XKET/MAeeMI8c5O5Fvlz88EgTDHKIXbIIYct3becZ+TbZkZsCu3yXfcJY2/6Qux5SscA67E6ZKLgjZ3778+RELKnpkANZC9+R7aYxfFoW9hl5/j7+AI4d/wBeufpLXQaH/vuR2NqsHPm4us419QSe6qCtf8WmPRVu06VTiLuD74= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=nsn5Vlz+; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="nsn5Vlz+" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-385dece873cso1115208f8f.0 for ; Fri, 17 Jan 2025 04:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1737116362; x=1737721162; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=G6R97ZJ/eTJmxy+gIbZqfH/ad7ajv9h0FEj5S8dEJik=; b=nsn5Vlz+gfyiYtcyqHbAxRfNyBigN+mCvFt7XMzV805Pnw4a4KH7j18wz572eTjy3O gSK5eYYmTTzQF1o0lRMpx051Ffjw0Cf/ykh8T41yMEdSH8THvyp7f61WF4eGYYtEKc60 Maw8/qJM+KEPOAmW2sI3Nb0ydyTvwZFBkwYCA+5MNox4/axmfRPEVjY9EBcl2bxyJMO1 YBGWSvTa/iU2oFhUijxjr8FRISqdHxqvFzYD5mti0XQVXZC78/IbgjzcqaD3oBdOAMcc jBcLqjoALYDOZGJxhfo9u/Dm3CQtJ1MVatsJJN5/P2DZtmSc4TTRrbrafPGeCulIpihU /EFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737116362; x=1737721162; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G6R97ZJ/eTJmxy+gIbZqfH/ad7ajv9h0FEj5S8dEJik=; b=bNqIVK3i0SqYz5pLfKkb+oaA3yzEe5VuotjVeyzd0hXFnlHFt1guctY07zV0VHo0mg Q4fWWj9GDvEZPphpqzI+6VpTgStkpb+QTqx0mhPLECqFNeS3k4MY1E1Qe0UDD+BiZ5Eb m0rHyBCKE7yFGfPqxOWnV23oaxvW/UF6glV8c3TEgkcQplbTH1xsFgeaOgkL1SuEJb74 mARHxAiIPQw3fwPQCxD6H6BzFA5/1o/V3T9gD0hkGTm2wJSOtB/HsS/CAB2PbfZi2kxA Y2yph6uajgSwktFlWzw9We5Baz9BJP4am8++BQPvG7pVBZ5TWaTxeXd/Y4oWU2UO7Apb wEOQ== X-Forwarded-Encrypted: i=1; AJvYcCUdEM8fhe2lhnQpq0PbZjIkvBxAtbsJIQJZ3P8+AK75pEI5E0ThTUxHr3FGiuBl08QcX9N1va5dRMKrNSg=@vger.kernel.org X-Gm-Message-State: AOJu0YxtvyYv6oWrHY/G9RctaQvr1UjN71x0P/z6hnOX9f/18Nl+h+Rq Quu6Z0TWa8WzR5+l2FQEWKtRjKFBDoXHdUQ6tjd7iAvW4DysqRx1Q8DveyQxEFo= X-Gm-Gg: ASbGnctC8QnNeHaqlbbBQ5EweeOWJrf4W7z3AkNITKrz8JMqFlgJHpNujfB6z2C6VrP MZLO5YOhSMJ168smaJKs8HgZ8UUH3lUfY4FA3Rztune/KRJA3T9WsxuFMSuiPdqQw2hjNlHJngk fxuZ+ZH/cxc/nTZC8dj6RDjKnqhY+oa9f76UDX0ubeYpjPe9THMxfZj0RlMiR8qC7X083/yDbh4 38jq6JXSHeP5kZ/+BnII0aHL5NB1/uUYXcYEGfhjttG3eE3Q7DgEdSXLco0gT9RBA== X-Google-Smtp-Source: AGHT+IFiHsjzhhmivgjSF5VfJ0c3FKWNde2pUo4Vnzewlo1Hnuu5vdVh/ypoJIqfonBn0h5h7oo9dg== X-Received: by 2002:a5d:4d04:0:b0:385:e429:e59e with SMTP id ffacd0b85a97d-38bf57c9337mr1823143f8f.52.1737116361664; Fri, 17 Jan 2025 04:19:21 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.165]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf3221c25sm2355234f8f.23.2025.01.17.04.19.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jan 2025 04:19:21 -0800 (PST) Message-ID: <3fe00f86-60f3-42a2-9491-7b876531c215@tuxon.dev> Date: Fri, 17 Jan 2025 14:19:15 +0200 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 net-next v21 3/5] net: Add the possibility to support a selected hwtstamp in netdevice To: Kory Maincent Cc: Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Radu Pirea , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Willem de Bruijn , Jonathan Corbet , Horatiu Vultur , UNGLinuxDriver@microchip.com, Simon Horman , Vladimir Oltean , donald.hunter@gmail.com, danieller@nvidia.com, ecree.xilinx@gmail.com, Andrew Lunn , Thomas Petazzoni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier , Rahul Rameshbabu , Willem de Bruijn , Shannon Nelson , Alexandra Winter References: <20241212-feature_ptp_netnext-v21-0-2c282a941518@bootlin.com> <20241212-feature_ptp_netnext-v21-3-2c282a941518@bootlin.com> <4c6419d8-c06b-495c-b987-d66c2e1ff848@tuxon.dev> <20250117130656.23a41605@kmaincent-XPS-13-7390> From: Claudiu Beznea Content-Language: en-US In-Reply-To: <20250117130656.23a41605@kmaincent-XPS-13-7390> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 17.01.2025 14:06, Kory Maincent wrote: > On Fri, 17 Jan 2025 13:57:41 +0200 > Claudiu Beznea wrote: > >> Hi, Kory, >> >> On 12.12.2024 19:06, Kory Maincent wrote: >>> Introduce the description of a hwtstamp provider, mainly defined with a >>> the hwtstamp source and the phydev pointer. >>> >>> Add a hwtstamp provider description within the netdev structure to >>> allow saving the hwtstamp we want to use. This prepares for future >>> support of an ethtool netlink command to select the desired hwtstamp >>> provider. By default, the old API that does not support hwtstamp >>> selectability is used, meaning the hwtstamp provider pointer is unset. >>> >>> Signed-off-by: Kory Maincent >> >> I'm getting this error when doing suspend/resume on the Renesas RZ/G3S >> Smarc Module + RZ SMARC Carrier II board: >> >> [ 39.032969] ============================= >> [ 39.032983] WARNING: suspicious RCU usage >> [ 39.033000] 6.13.0-rc7-next-20250116-arm64-renesas-00002-g35245dfdc62c >> #7 Not tainted >> [ 39.033019] ----------------------------- >> [ 39.033033] drivers/net/phy/phy_device.c:2004 suspicious >> rcu_dereference_protected() usage! > > Thanks for the report. > Oh so it seems there are cases where phy_detach is not called under RTNL lock! > > This should solve the issue: > - hwprov = rtnl_dereference(dev->hwprov); > + rcu_read_lock() > + hwprov = rcu_dereference(dev->hwprov); > /* Disable timestamp if it is the one selected */ > if (hwprov && hwprov->phydev == phydev) { > rcu_assign_pointer(dev->hwprov, NULL); > kfree_rcu(hwprov, rcu_head); > } > + rcu_read_unlock(); Just tested. The issue is gone. You can add my: Tested-by: Claudiu Beznea Thank you, Claudiu > > I will send a patch soon. > > Regards,