Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp236156lqn; Thu, 11 Apr 2024 22:33:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJDHp+P6anb4/RwJZfA0g+GQYvxpDw93oz65ctHd4UERvJS9cUmGvUjoERSGW80Vl6hvPHBPUzCMb7H/j18WNLeWxRECUeEzHwhvT3MQ== X-Google-Smtp-Source: AGHT+IHBoGhVNGz5n3nxp2VjP5XX257kJDYbpn/xizwF66Ba0Q3bxqAO9YHoTq04AIj4qoeBDUs3 X-Received: by 2002:a05:6808:618b:b0:3c5:f4fc:2f0 with SMTP id dn11-20020a056808618b00b003c5f4fc02f0mr1427199oib.53.1712899984744; Thu, 11 Apr 2024 22:33:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712899984; cv=pass; d=google.com; s=arc-20160816; b=E1hDIC1EkLdYJhRWKpDJMtzhpFGVFB6U+ln65/TCPUoA5r8I9qg8HGShANLeyAxOjJ ilAdqa7W6GPHs7QpQpQCPGtmU0xRmeiz1TNiuRp9JlvxILMDcFJoh+re2MieO9k+RN/G OMDA6T+C5LWt9jA3qLRqABR8cmUD51Crp17rQyqSkFxMYGN5tjt7JhJBGKhVHiHCx/Kl bcADIWjNDvGflVgXa//KwI3Pk09Jcj5hUkR54N9/z/H0Zs6EOUvsoQLrAv0J9lsTyLMs 6Nh4qaBJvxjPwL4taBylAeqNF73ZyCUIXm8mptzJXUE2REfvWwIDOvgQ4rAtm2wfWzT4 KlQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=fkZu08swlbXArXRtRYpF1By2zsiAltvNt7vYo8OheZo=; fh=J1GCOiwvynrQ2Mi5klaDBfiWbtvIRFvDRafL7yXGXhU=; b=ZQGKPRAsF5A528IFIYzRhAMndVTT8w8zaFjmdA0G4uQ2fdMKJdf6nOMeQ6UYlqdp/B dUZSyiJ9wIFvjth5POO3qaDj/5Q+ufG04w7VPJzr1FbKBMldX5Bp//CrYuquM8F4vEAd C682Xj9HGywG7Y3Ip1k81GpXbQkRnyu6sFSnkbAF7nIxN1Ijza6PPvnwt7zIHZTmSsve ydQlXFU6rXH50ySearlxeNvbXQhLKMQQVorpvysWCpCE4t+4CnisDUOHCvCoihEszdTN oiTxV/3DFF5m0AAD2r2n7+j4Gr3LCzRYXuJ6tL8CqNC0B6uSIoVik6u7UDLFIM0sna6j GLHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="DzjNtb/9"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-141982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t12-20020a05622a148c00b00434897509b5si2948324qtx.688.2024.04.11.22.33.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 22:33:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="DzjNtb/9"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-141982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 668BE1C225EA for ; Fri, 12 Apr 2024 05:33:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B05021BC35; Fri, 12 Apr 2024 05:32:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DzjNtb/9" Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (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 81B2D2F4A; Fri, 12 Apr 2024 05:32:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712899974; cv=none; b=MMrFrf3oLzH++NAi5CNi+1i4EL2xeq2Z8rZebwshjuPUi3dSOyr1OVNVwIHwjJo/+AK4sYTlofDrN82ZNivf8FLgamHio4pZqBfG3W9ZPaB1jrPViMT4NxfkUwh2omymc9aa0NiGkc+txisoCAHOC71gXNJznBnZGUkWDPvpIJ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712899974; c=relaxed/simple; bh=LeNIrOB+CpAK7CxcmRCtZ/nGX+ykzuZDuTvsE5OrGig=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mAahegin/6LROLWBbEwbmt6ztltnrf3tIqhjQhMv87Vg3TCM2Pbg4O9wzaAJN0R4SiCGrjujH+iJixPn6hrvkLaiTWI8qMRKmKL+lg8XuV0Zi3Bf+uMUjU/sUyJE8Fq2xBTtVsL+lfR7S2FbyUyJnauN7tAEZmgwaqlpar6ROb8= 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=DzjNtb/9; arc=none smtp.client-ip=209.85.160.43 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 Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-22f078f1aecso337090fac.3; Thu, 11 Apr 2024 22:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712899972; x=1713504772; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fkZu08swlbXArXRtRYpF1By2zsiAltvNt7vYo8OheZo=; b=DzjNtb/9r8uBmn0XtLUUsSrtAlZpmgyBJMR3rFOp5wN0Hj4ujnG4chWNls8KkmnaQj yjoThp0+I+uJAIaXszJXxnQgm1Xs6DczuTqaFxLuZt4VTG6lHki8fvdHeTkZRcxXsDpV E/ERa9Qmzoqg8Z8QHRt1cXibtUFKMOyw5Ky+d7ewFFH1+Q1sBSenYc1lPgI58gaHXggQ eF2pJtQQaUDEmVUwIpt3jYX3NNCxCGqFbPWD8lnxmX+3c9BJw+vxuKDDm+ypSi/Fkl8w BFtgcTArdDmKGHJsSWf0LSndmF9Yad0NswOIBuTNGMGHrLfLvx/i/ea6nE3s47MdFb7k kQ7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712899972; x=1713504772; h=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=fkZu08swlbXArXRtRYpF1By2zsiAltvNt7vYo8OheZo=; b=Wei5x8V+q2PzAvv0jBNHq66UcV/W3Ftwj6qKkcfpQZTWPGC+YnHokgqPp4v2Fq6aWA eNadqRoFrEc0KFplr/SCd9mm+RelvC7PjZDt42XezD0D3VDdCSJwxk1F4c+pw28vlSaP 0Gm4OQwZRYhzKtzz5gYPa/ZseLdLAuAZIWGgBV5Esru4igBlOY5z8vXE7cbnILLAPnxL FGgBVorbew7hy27I8Rw0HCVOWM4P3SXPg4JoX2InvbtyEMErT15hm8PmftpL3It6oqoo v27EGenL4UMP0lAslAcvmd7DYh4a+FLs+tfwd5yWzSUSpLG37uhosBEyNsUdXqb89t83 20Pg== X-Forwarded-Encrypted: i=1; AJvYcCUj4+ttmP1nZDb3uLgFWaDDUfLbP0jRjSpU76e4/F4KD7tA9zJvFMYO7Fyg1XV7DsDyb0fINsd5+P8LUOuBfB0zAQ7k1o0ggbBrd9ZdvQhB8cIvdl+blOgtcYqztagZkWjdBg65cz7qoNCxBxmnuAGJzVO/cMWM5neH9D1mvzNyoa8AIXToBWZQsoE= X-Gm-Message-State: AOJu0YycGaaCK988cki+xlGGyEdNix++RimhcZjC+9I9Rj6sWTzKLA9P ddTzNevV5fmCd0OoaxOV1CuRiKphoGkD1xs82zbSTkHvPENZLsh29T3CBHMzwhLLS3a8+MjE/0m 4i6bIODdbBN2W42F7A5py4NNE1Lo= X-Received: by 2002:a05:6870:611f:b0:22e:c4d1:4844 with SMTP id s31-20020a056870611f00b0022ec4d14844mr1666786oae.18.1712899972566; Thu, 11 Apr 2024 22:32:52 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240404071350.4242-1-linux.amoon@gmail.com> <20240404071350.4242-7-linux.amoon@gmail.com> <20240409015352.ocpjbgxrx636jmk4@synopsys.com> <20240410232623.6gaupt6t725hhype@synopsys.com> <20240411222145.rkjz3cfzudjfnkdt@synopsys.com> In-Reply-To: <20240411222145.rkjz3cfzudjfnkdt@synopsys.com> From: Anand Moon Date: Fri, 12 Apr 2024 11:02:36 +0530 Message-ID: Subject: Re: [PATCH v2 6/6] usb: dwc3: exynos: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() To: Thinh Nguyen Cc: Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar , Christophe JAILLET , Johan Hovold , "linux-usb@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-samsung-soc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Hi Thinh, On Fri, 12 Apr 2024 at 03:52, Thinh Nguyen wrote: > > On Thu, Apr 11, 2024, Anand Moon wrote: > > Hi Thinh, > > > > On Thu, 11 Apr 2024 at 04:56, Thinh Nguyen wrote: > > > > > > On Wed, Apr 10, 2024, Anand Moon wrote: > > > > Hi Thinh, > > > > > > > > On Tue, 9 Apr 2024 at 07:24, Thinh Nguyen wrote: > > > > > > > > > > On Thu, Apr 04, 2024, Anand Moon wrote: > > > > > > Use the new PM macros for the suspend and resume functions to be > > > > > > automatically dropped by the compiler when CONFIG_PM_SLEEP are disabled, > > > > > > without having to use #ifdef guards. If CONFIG_PM_SLEEP unused, > > > > > > they will simply be discarded by the compiler. > > > > > > > > > > > > Signed-off-by: Anand Moon > > > > > > --- > > > > > > v2: add __maybe_unused to suspend/resume functions in case CONFIG_PM is > > > > > > disabled. > > > > > > > > > > The compiler discards the code, yet we still need __maybe_unused? > > > > > > > > > Earlier version had not added this since but I removed the > > > > guard.CONFIG_PM_SLEEP. > > > > added __maybe_unused just to safeguard the function. > > > > > > > > I have tried to build with config by disabling CONFIG_PM and CONFIG_PM_SLEEP > > > > but could get the warning compilation by adding flag W=1 > > > > -Werror=unused-function. > > > > > > > > > > > > > > > > > > > > > But since these CONFIG_PM and CONFIG_PM_SLEEP cannot be disabled, > > > > I am not getting any warning related to these functions. > > > > > > > > Do you want me to remove __maybe_unused ? > > > > > > > > > > The warning was there as expected. You should to use it along with > > > DEFINE_SIMPLE_DEV_PM_OPS(). Let me know if you still see the same > > > warning. > > > > > > > But the warnings are related to the following macros > > > > #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL) > > > > #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr)) > > #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr)) > > > > So if we can disable CONFIG_PM and CONFIG_PM_SLEEP options > > the relevant function with the above macro will be set to NULL. > > in this case, the compiler will discard the function in SET_SYSTEM_SLEEP_PM_OPS > > > > There are differences if you use SET_SYSTEM_SLEEP_PM_OPS vs the new > macro. It's noted in this commit: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1a3c7bb088266fa2db017be299f91f1c1894c857 > > Please try it out. Thank you very much for this input I will drop the __maybe_unused from my patch series. and switch to use DEFINE_SIMPLE_DEV_PM_OPS macro for suspend resume functions > > Thanks, > Thinh Thanks -Anand