public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Arnd Bergmann <arnd@arndb.de>, Ren Zhijie <renzhijie2@huawei.com>
Cc: stanley.chu@mediatek.com,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Bart Van Assche <bvanassche@acm.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	"ARM/Mediatek SoC..." <linux-mediatek@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error
Date: Mon, 25 Jul 2022 09:47:20 +0100	[thread overview]
Message-ID: <W2JKFR.Y0JWFHU8ZIJU3@crapouillou.net> (raw)
In-Reply-To: <CAK8P3a0LCaMoWArcQNY5qayUABgRXWEogrtQQ-sbR+zY6n=O4w@mail.gmail.com>

Hi Arnd,

Le lun., juil. 25 2022 at 08:34:32 +0200, Arnd Bergmann <arnd@arndb.de> 
a écrit :
> On Mon, Jul 25, 2022 at 5:38 AM Ren Zhijie <renzhijie2@huawei.com> 
> wrote:
>>  在 2022/7/13 16:48, Arnd Bergmann 写道:
>> 
>>  I try to use the new marcos SYSTEM_SLEEP_PM_OPS and RUNTIME_PM_OPS 
>> to
>>  replace the old ones, and remove #ifdef around the declarations in 
>> the
>>  header, my local changes attach below.
>> 
>>  But it seems  that doesn't work, which has ld errors:
>> 
>>  aarch64-linux-gnu-ld: Unexpected GOT/PLT entries detected!
>>  aarch64-linux-gnu-ld: Unexpected run-time procedure linkages 
>> detected!
>>  drivers/ufs/host/ufs-mediatek.o: In function 
>> `ufs_mtk_runtime_resume':
>>  ufs-mediatek.c:(.text+0x1d0c): undefined reference to
>>  `ufshcd_runtime_resume'
>>  drivers/ufs/host/ufs-mediatek.o: In function 
>> `ufs_mtk_runtime_suspend':
>>  ufs-mediatek.c:(.text+0x1d64): undefined reference to
>>  `ufshcd_runtime_suspend'
>>  Makefile:1255: recipe for target 'vmlinux' failed
>>  make: *** [vmlinux] Error 1
>> 
>>  (CONFIG_PM and CONFIG_PM_SLEEP are both not set, and
>> 
> 
> It appears that there is a mistake in the RUNTIME_PM_OPS()
> macro definition, can you try this patch on top?
> 
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index 871c9c49ec9d..84592229d754 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -334,9 +334,9 @@ struct dev_pm_ops {
>         .restore_noirq = pm_sleep_ptr(resume_fn),
> 
>  #define RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
> -       .runtime_suspend = suspend_fn, \
> -       .runtime_resume = resume_fn, \
> -       .runtime_idle = idle_fn,
> +       .runtime_suspend = pm_ptr(suspend_fn), \
> +       .runtime_resume = pm_ptr(resume_fn), \
> +       .runtime_idle = pm_ptr(idle_fn),

Not a mistake, the pm_ptr() macros are not needed here, because the 
dev_pm_ops pointer must always be wrapped with pm_ptr().

The proper fix is:

-  .pm     = &ufs_mtk_pm_ops,
+  .pm     = pm_ptr(&ufs_mtk_pm_ops),

Cheers,
-Paul

> 
>  #ifdef CONFIG_PM_SLEEP
>  #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
> 
> Commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate
> old ones") introduced all the macros with the intent of using pm_ptr()
> and pm_sleep_ptr() in them, and I think Paul accidentally forgot to 
> add
> those in this instance.
> 
>        Arnd



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      parent reply	other threads:[~2022-07-25  8:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04  2:56 [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error Ren Zhijie
2022-07-11  1:23 ` Ren Zhijie
2022-07-12  1:31   ` Stanley Chu
2022-07-11 16:18 ` Bart Van Assche
2022-07-12  8:27 ` Arnd Bergmann
2022-07-13  1:44   ` Ren Zhijie
2022-07-13  8:48     ` Arnd Bergmann
2022-07-25  3:38       ` Ren Zhijie
2022-07-25  6:34         ` Arnd Bergmann
2022-07-25  7:00           ` Ren Zhijie
2022-07-25  7:11             ` Arnd Bergmann
2022-07-25  8:47           ` Paul Cercueil [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=W2JKFR.Y0JWFHU8ZIJU3@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=arnd@arndb.de \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=renzhijie2@huawei.com \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox