Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1753297lqg; Mon, 4 Mar 2024 02:44:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXOc4lb5Ntevjg4C7rAwYNNAigpcEVjwPnagTahzFnTdyPI0n2N4YdzI6faXloNA5vzoy8bfzuFcLYh131VFj5KTPbrzVcty9Dlp1gmVw== X-Google-Smtp-Source: AGHT+IH4soO5XbOEEcxYhj+Txr6ASpAhiupD4tuaUhXr4gzkSJ4FtkN1UtE12CYqjQPSszjCZBpp X-Received: by 2002:a17:903:228a:b0:1dc:d4f9:ef21 with SMTP id b10-20020a170903228a00b001dcd4f9ef21mr8988219plh.52.1709549072955; Mon, 04 Mar 2024 02:44:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709549072; cv=pass; d=google.com; s=arc-20160816; b=PFpwsVLkQLTeVHP89Q/dlo7hiitMAtiJsOCTKwX3qKtmsnr0srUftN2kl+KsAh+4eg HbKEv9QqIQUzBuKovu+cXb8vx/KzY69sfEAnxFQTqsK8TD3WKMoNy8xz5E7objO05on7 ONZiFCNgNdMidRm+gAqIWA+ywVtwjFvb9bTOxnQBnfC8IqztRxrUtgxLNlxGUPm4iLoJ GG+yJHo0lPZq+AeUNKRo5UKc9ZB34RAPD1KdtxuiiP+5W5BmvqrErP/KCuf+Nw23Z4V6 VufO24PYw55swkXfqf8l7qSU3GxQ5JuDrE/wXAB0fAcBTgbabOhqYMkRHe8OTwcrEEbD VCqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=GnMIo/pAd4JHLRP1VZXlqka2oS6REd7bI010ZIuZm+8=; fh=C3us00+r8j81wmJDYNA+ilWUhODfhltB1d9mfYf+M10=; b=EdEMM4IIizNKfGZjF0CEnTkCmmXA1e1i+zsx5kSRYpMpK59EcXgwMvYcVyxBNJZLWr FbzgfOwOejk8CUszpFQTHKHB2TFbqE48t2Ruv0V5z2b8E/StxFq4RnfnS4Qq3LrWQahE nAaXYPqpn52Xe9pLxzb69gAD2S2tgHcwXuuYi8gi9vhnQXA8Eo+D7x4uo/DVC2zex2Ta ZjhMGsw/u34E5uZMrlFT3Alh6TBf+lAA3DEOF4O1Pz7bK+TTO9vFNjH1bVoVz8TkGPtC eLev+iPdZqfAW87iVNuzCd9mwLUhvV0IvJlYJLwslAvrA/zzagEztX6EYqX51noF+GsA kfUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-90437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90437-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h6-20020a170902ac8600b001dc3c3be4b4si7744270plr.645.2024.03.04.02.44.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 02:44:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-90437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90437-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 658D2B23067 for ; Mon, 4 Mar 2024 10:34:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E15553527F; Mon, 4 Mar 2024 10:34:27 +0000 (UTC) Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) (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 E49A5249EA; Mon, 4 Mar 2024 10:34:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709548467; cv=none; b=FiamtVMRm2Kjy7lw6oaM3hVK5gCzi9X7AEnvXdFQJX3Znf+fVLUK38In0D8J+j4YuVmgftgtcZtPZGzEJ4kFg/Aw3H4z5tckAeBP3/3rVMjVxyceI3PaGimiRgmVqoHSYfJXyoXPW8Ivn92VQh6WfZxWY7skyAciDmNHfcOSLzg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709548467; c=relaxed/simple; bh=GnMIo/pAd4JHLRP1VZXlqka2oS6REd7bI010ZIuZm+8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=lWWAZkN5KgK6+v3otMxYDOs9JAiea7ElbHF2po36GFvLufwQm1adhBa2r9mSFNVyAPYkJzxbsPHMc3q/5NBsVHPoeCpK84+ZNQubEmjW8PoEBLTZF3Hbt3eqzBqtW5JxDnixIkVnM9/pYQGff9mX4w50WE34VRPECEK0lZlAvz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-60821136c5aso28861637b3.1; Mon, 04 Mar 2024 02:34:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709548463; x=1710153263; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GnMIo/pAd4JHLRP1VZXlqka2oS6REd7bI010ZIuZm+8=; b=Tgnt8DTX9VYO85UQCn5zwwWOhHYNRPCia7Lb5QsrxqSx59dXlny2BKlhdadQgxUf2a lzt2NOL282XgeQQ0h9SPLdu3t68Rx4mRYhfFDXraTDv/o6tbHyCnWlHiMuHqytPrT0oS J0ZlAqMGSRIBkwQm0+CtiR7VsFFjftGL7Nk9pR50zuso2Gp1zS8D8imErE7tqZH0zjB4 f22JuXINqas4scXn2BJeQ5z4yA0OQGuga3WTSRrUjnLukvjdYmGwYD2/QnWe8b5D0rIA 1QoicaN+buxY9PItdBx1bv0g3obxji2v+CFeDaiRKeQ+kFRR4MDmGfyN4DgxJdVxlVBX BwUA== X-Forwarded-Encrypted: i=1; AJvYcCVhD9GAXg0D6xNuEVD+cuZa9A5MVmk4i/Fqer/00pfSQsAkIowrSXCchhGXlcVfEyvxYUaUEFjwd+JKczirnRxumQ5TAeutm6LirV3UtH0XVyzLgSSZqFXQlVkJ84RxBXEcXgrFXuSp2ZVnvQN5WSAyvhNDcCI2mzWuuRUa0MkJ/g== X-Gm-Message-State: AOJu0Yw9ph6Q9aciFyHKSMLl9iinqgOlHFAJ1NEvHAKWq+QA8VrSLK/q kX7IfHfU/s3cm9Oe/1qhU9zbAMF1Ad2o38SUY5PilOudDbbhVyIwaFOLyMx0gOs= X-Received: by 2002:a81:9847:0:b0:608:c440:620a with SMTP id p68-20020a819847000000b00608c440620amr7990467ywg.13.1709548462884; Mon, 04 Mar 2024 02:34:22 -0800 (PST) Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com. [209.85.128.178]) by smtp.gmail.com with ESMTPSA id u62-20020a816041000000b00607c9160c22sm2553915ywb.119.2024.03.04.02.34.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Mar 2024 02:34:22 -0800 (PST) Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-60982a6d8a7so36294867b3.0; Mon, 04 Mar 2024 02:34:22 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUzWclLHPvm8Tgx2cHWhjBo9UqVKzt1pxcsl3Qr1zRE581xlyNsv3Nm9uJHIsAU1ucnSo+sxludaeGNWTwnKmRSRKcuxEVSL2gfbSvBX2OjiMzVmu+ElVamX9nOCKOY3dlTlM0tnhExIvuCprJiA6SDUZUkesbLsBEZWF5agU3ANQ== X-Received: by 2002:a81:6d15:0:b0:609:879c:a72c with SMTP id i21-20020a816d15000000b00609879ca72cmr7227414ywc.42.1709548462066; Mon, 04 Mar 2024 02:34:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <010ea3a0-929e-4912-ad22-9f0cf5b1a3e2@redhat.com> In-Reply-To: <010ea3a0-929e-4912-ad22-9f0cf5b1a3e2@redhat.com> From: Geert Uytterhoeven Date: Mon, 4 Mar 2024 11:34:09 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pm_runtime_early_init() defined but not used, except on SuperH which has its own definition ? To: Hans de Goede Cc: Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "Rafael J. Wysocki" , Pavel Machek , Greg Kroah-Hartman , linux-sh@vger.kernel.org, Linux Kernel Mailing List , Linux PM , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable CC Bartosz On Sun, Mar 3, 2024 at 8:53=E2=80=AFPM Hans de Goede = wrote: > > Hi All, > > I noticed that drivers/base/power/power.h defines pm_runtime_early_init() > but nothing under drivers/base uses this. > > A grep over the entire tree shows that arch/sh/drivers/platform_early.c > does use pm_runtime_early_init() but rather then including > drivers/base/power/power.h it has its own definition / private copy > of both device_pm_init_common() and pm_runtime_early_init() from > drivers/base/power/power.h ??? > > Also the private copy of pm_runtime_early_init() in > arch/sh/drivers/platform_early.c differs from the unused one > in drivers/base/power/power.h, but only when CONFIG_PM is not set. > > When CONFIG_PM is not set then the pm_runtime_early_init() in > arch/sh/drivers/platform_early.c is a no-op, where as the one in > drivers/base/power/power.h still calls device_pm_init_common() > in this case ... > > I also wonder if given that pm_runtime_early_init() is not > used with the exception of arch/sh/drivers/platform_early.c > if the dev->power.early_init flag check in > device_pm_init_common() is really necessary ? > > On non SuperH the only (1) caller of device_pm_init_common() > is device_pm_init(), so it seems to me that the code to > avoid doing device_pm_init_common() twice is unnecessary. > > Actually it seems to me that the entire contents of > device_pm_init_common() can be moved inside device_pm_init() > and the dev->power.early_init can be completely dropped (2). > > Regards, > > Hans > > > 1) Well pm_runtime_early_init() calls it too, but that itself > is unused and can be removed, removing it is even ok-ish > for SuperH since that has its own copy anyways. > > 2) With the exception that all of this is still necessary > for SuperH I guess.