Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1043899lqe; Sun, 7 Apr 2024 16:37:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxVnOSpxtXO2k5PmifEw0fV2NOaSLGLZYwEDaElVJywX8CRnEoHLQLboszQ1gDIGAsyLgFHZjvSWjkzdMHCtpWyVjl/gDmnW8Q9xcuPw== X-Google-Smtp-Source: AGHT+IGwjlbIcXOL4QlMr/gQppBSm8n2lIBPbwa6zHisdOtdbRhucK4sBwtdbH8FhQVj6JEyndNK X-Received: by 2002:ac8:7fca:0:b0:434:ae42:f1dd with SMTP id b10-20020ac87fca000000b00434ae42f1ddmr444759qtk.11.1712533044070; Sun, 07 Apr 2024 16:37:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712533044; cv=pass; d=google.com; s=arc-20160816; b=BYD19DxfUMnvvRMwsnbNQMfDrtWnQlRTdGp5VAfRkSTUCozS5kkVmvwfw8mlUdS8o3 8jOWkVDa7RwUWwBFReFUpUEzPSuZDOmZ1dd+8Z6nQYpTb+ktLO6QQJ4LF0yndQRsRipt cYQJcMZz6gxBlAOyhaI52ychcZe16r5JlIC4cfWaphwWszEtEnVpw4/Q5EYc3bFIiYkC b2InJgsAlVvdNjCo10xwCuAbznLSUsClR6NmD2pQLmv1EmmppK2WgO8mzJlRuicwxwf4 Rxdw6SBgCuNaXpUY4phEOf+xmzVxpyi/qlOL4+8WLYp0QqJE3txot7xFFgQFaM6PcYVI JERA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XvxGHKXAL5OYw4aHkDg1FEOOSDfqeGjy+1O6bUapRZk=; fh=IePHo3u5H9IJvTHHyAYvjCIk6jCFC1UzNPs09wF6OR0=; b=muv1Q+HeXzkiwoxuo6MpXG++eMG7Wb9PUgyZPQJvf8BZ3h8c8ZItdG7iO3jZjWtP5V MsMWI90yD2r+E70kn6B10VSmpP54PQgkGb3v5joPPNMVswjQMxjZHgTiQlc1B5VGrhQt CQ6aTabVS1kQ4kXgHb6nQX7uitS1qmJZFEh0ZotEe3iBpGG4DbxbqzVrexiWIGf7wtNz BGIv8in0ZFQnKPM/hscospHmSWstQ0c/5HuoyGf4iHCkepi5FWltGUiu7nAcZsYQAs+2 C1El0WZgHncsf3q8JB7j2tMb1ueRLXTTYSp9m+QpobZ+QDNIQ+OdquTVknRInnBi/SUD jHtg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HVxV9vva; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-134665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e13-20020ac85dcd000000b00432c6e9f05asi7134480qtx.530.2024.04.07.16.37.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 16:37:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HVxV9vva; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-134665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C802B1C2030F for ; Sun, 7 Apr 2024 23:37:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36AE544C81; Sun, 7 Apr 2024 23:37:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HVxV9vva" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 50C303BBD4; Sun, 7 Apr 2024 23:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712533033; cv=none; b=CbgUtk2GNif3E5oQUMWLW2T/YQDYUZpT5tS/qWtyTOhPdj8OWWIigouSeD1rDoDBfR21/9ZyfuO6FwXqTY1KM9fiCMqVQxr8oD2UGn04n5gjX0aPBQqgmaYdnU91vSYB79aAUaI3db3VtOIqwHiiVJpPLCp04eCPvoBd+gdjBv4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712533033; c=relaxed/simple; bh=50CUNTe1kjs1rAWmd6fasZtqFBjC0nWodYXdh3hAMVM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZNyTFTeIqEz5T2UcssrDZ7P85DBC01YYjAFObI9vWdl757D++2w5ExwaclKyFR7b/cA/nNfGLsLTtmUgMOJ4+UuVrPMLERiQtV7za01qQsV+ySwy53hgS/ObN9EBvTDiQwK4+EtgkEROYFoG3Eo90z+TKynHQcpe2NfYBTxfGQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HVxV9vva; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89BBDC433F1; Sun, 7 Apr 2024 23:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712533032; bh=50CUNTe1kjs1rAWmd6fasZtqFBjC0nWodYXdh3hAMVM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HVxV9vvadjUq4BWg+JF4IMDstY3ssCcogUZspNddMzCTsR5zBzBj5i8+jPSDpm/ew JkpIgb6tqs/qeRaPvIRFjeYRuj/vc7PmrL5rwo+45D4AVHIgoIBnc3cn8U1srFUiJX BBOZcWDcmJmcTatMbPWOEemxzcDNRZtWt4QecR2omdF68Y8n8RfIULlozupzb80x4S mDT5mEuyhXjDVvOhhVoQOBa91UagVJiQ5C4lG8rYuc1R9KBD32JXY9dnFmj9kIE5tu WKQsSCv4ZTsaNCtn5wuSTd2R3LllXPjEJNlDA6Cb4I+dnULlJWHgI1S34a5OUfc0Wm 3BBnJpvHZGzBA== Date: Sun, 7 Apr 2024 19:37:12 -0400 From: Sasha Levin To: Florian Fainelli Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jacob Keller , "David S . Miller" , opendmb@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Subject: Re: [PATCH AUTOSEL 6.8 39/68] net: mdio: mdio-bcm-unimac: Manage clock around I/O accesses Message-ID: References: <20240329122652.3082296-1-sashal@kernel.org> <20240329122652.3082296-39-sashal@kernel.org> <888b10eb-cdd5-43bb-a501-471aa28b1153@broadcom.com> 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; format=flowed Content-Disposition: inline In-Reply-To: <888b10eb-cdd5-43bb-a501-471aa28b1153@broadcom.com> On Tue, Apr 02, 2024 at 05:41:44AM -0700, Florian Fainelli wrote: > > >On 3/29/2024 5:25 AM, Sasha Levin wrote: >>From: Florian Fainelli >> >>[ Upstream commit ee975351cf0c2a11cdf97eae58265c126cb32850 ] >> >>Up until now we have managed not to have the mdio-bcm-unimac manage its >>clock except during probe and suspend/resume. This works most of the >>time, except where it does not. >> >>With a fully modular build, we can get into a situation whereby the >>GENET driver is fully registered, and so is the mdio-bcm-unimac driver, >>however the Ethernet PHY driver is not yet, because it depends on a >>resource that is not yet available (e.g.: GPIO provider). In that state, >>the network device is not usable yet, and so to conserve power, the >>GENET driver will have turned off its "main" clock which feeds its MDIO >>controller. >> >>When the PHY driver finally probes however, we make an access to the PHY >>registers to e.g.: disable interrupts, and this causes a bus error >>within the MDIO controller space because the MDIO controller clock(s) >>are turned off. >> >>To remedy that, we manage the clock around all of the I/O accesses to >>the hardware which are done exclusively during read, write and clock >>divider configuration. >> >>This ensures that the register space is accessible, and this also >>ensures that there are not unnecessarily elevated reference counts >>keeping the clocks active when the network device is administratively >>turned off. It would be the case with the previous way of managing the >>clock. >> >>Reviewed-by: Jacob Keller >>Signed-off-by: Florian Fainelli >>Signed-off-by: David S. Miller >>Signed-off-by: Sasha Levin > >Please drop this patch, it is usable in isolation and needs 2 >additional patches to be meaningful: > >https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ee2b4cf8b281606bbf332cbd73ce2a73eac417f0 >https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git >/commit/?id=ba0b78371c46b2104197ff2c244f13f011ddfa80 Ack, thanks! -- Thanks, Sasha