lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <W2JKFR.Y0JWFHU8ZIJU3@crapouillou.net>
Date:   Mon, 25 Jul 2022 09:47:20 +0100
From:   Paul Cercueil <paul@...pouillou.net>
To:     Arnd Bergmann <arnd@...db.de>, Ren Zhijie <renzhijie2@...wei.com>
Cc:     stanley.chu@...iatek.com,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Bart Van Assche <bvanassche@....org>,
        linux-scsi <linux-scsi@...r.kernel.org>,
        "ARM/Mediatek SoC..." <linux-mediatek@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
Subject: Re: [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error

Hi Arnd,

Le lun., juil. 25 2022 at 08:34:32 +0200, Arnd Bergmann <arnd@...db.de> 
a écrit :
> On Mon, Jul 25, 2022 at 5:38 AM Ren Zhijie <renzhijie2@...wei.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ