From: Randy Dunlap <rdunlap@infradead.org>
To: Adam Ford <aford173@gmail.com>
Cc: Aleksandr Nogikh <nogikh@google.com>,
l.stach@pengutronix.de, inki.dae@samsung.com,
jagan@amarulasolutions.com, m.szyprowski@samsung.com,
airlied@gmail.com, daniel@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
syzkaller@googlegroups.com, dvyukov@google.com
Subject: Re: drivers/gpu/drm/bridge/samsung-dsim.c link error
Date: Thu, 3 Aug 2023 19:37:07 -0700 [thread overview]
Message-ID: <d8a57aee-bb8a-dc5a-7c4f-b8a293d37bec@infradead.org> (raw)
In-Reply-To: <CAHCN7xKG=8ygSi8st31fe+t3Mn+k-7VUHKixFCZUuuDLOX8-kQ@mail.gmail.com>
On 8/3/23 19:26, Adam Ford wrote:
> On Thu, Aug 3, 2023 at 9:01 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> Hi--
>>
>> On 8/3/23 08:24, Adam Ford wrote:
>>> On Thu, Aug 3, 2023 at 9:42 AM Aleksandr Nogikh <nogikh@google.com> wrote:
>>>>
>>>> Hello,
>>>>
>>>> We've been seing the following linker error on arm64 syzbot instances:
>>>>
>>>> ld.lld: error: undefined symbol: phy_mipi_dphy_get_default_config_for_hsclk
>>>>>>> referenced by samsung-dsim.c:731 (drivers/gpu/drm/bridge/samsung-dsim.c:731)
>>>>>>> drivers/gpu/drm/bridge/samsung-dsim.o:(samsung_dsim_init) in archive vmlinux.a
>>>>
>>>> Steps to reproduce on the latest linux-next:
>>>>
>>>> $ git checkout next-20230803
>>>> $ wget -O '.config' 'https://raw.githubusercontent.com/google/syzkaller/master/dashboard/config/linux/upstream-arm64-kasan.config'
>>>> $ make CC=clang ARCH=arm64 LD=ld.lld CROSS_COMPILE=aarch64-linux-gnu- olddefconfig
>>>>
>>>> This also prints:
>>>>
>>>> WARNING: unmet direct dependencies detected for GENERIC_PHY_MIPI_DPHY
>>>> Depends on [n]: GENERIC_PHY [=n]
>>>> Selected by [y]:
>>>> - DRM_NWL_MIPI_DSI [=y] && DRM_BRIDGE [=y] && DRM [=y] && COMMON_CLK [=y] && OF [=y] && HAS_IOMEM [=y]
>>>> - DRM_SAMSUNG_DSIM [=y] && DRM [=y] && DRM_BRIDGE [=y] && COMMON_CLK [=y] && OF [=y] && HAS_IOMEM [=y]
>>>>
>>>> $ make CC=clang ARCH=arm64 LD=ld.lld CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc)
>>>>
>>>> The kernel should have still compiled fine even despite the message above, right?
>>
>> No. See drivers/Makefile:
>> obj-$(CONFIG_GENERIC_PHY) += phy/
>>
>> so the drivers/phy/ subdir is only built when CONFIG_GENERIC_PHY is set,
>> but it's not set.
>>
>>>> Could you please take a look?
>>>
>>> GENERIC_PHY_MIPI_DPHY was enabled to use
>>> phy_mipi_dphy_get_default_config() which takes in the pixel clock,
>>> bits-per-pixel, number of lanes and phy structure. It applies a bunch
>>> of math based on the info passed and fills in the structure, but that
>>> function itself doesn't appear to be referencing phy code, so it's
>>> likely safe.
>>>
>>> I think this can be resolved by enabling GENERIC_PHY. I just checked
>>> linux-next and when I built the arm64 defconfig, it enables
>>> GENERIC_PHY=y, so I don't think this is an issue. I also checked the
>>
>> defconfig doesn't matter in this case. The .config that was provided has:
>> # CONFIG_GENERIC_PHY is not set
>> CONFIG_GENERIC_PHY_MIPI_DPHY=y
>>
>
> Where/how was the .config generated?
>
Aleksandr posted a link to the config file above.
> Are you building linux-next or something else? The .config file
> generated when I build the arm64 defconfig show both enabled:
linux-next.
> $ grep GENERIC_PHY .config
> CONFIG_GENERIC_PHY=y
> CONFIG_GENERIC_PHY_MIPI_DPHY=y
>
Yes, this is not a defconfig file.
>
>> but yes, selecting GENERIC_PHY (needed in 3 places) does fix the warnings
>> and build error. 2 instance in drm/bridge/Kconfig and one in
>> drm/bridge/cadence/Kconfig (found by inspection).
>>
>>
>>
>>> multi_v7_defconfig for ARM and it also sets GENERIC_PHY=y for 32-bit
>>> ARM people using some of the Exynos boards.
>>>
>>> I don't know what version of Linux you're trying to build, but I can't
>>> replicate your issue.
>>
>> I had no problem replicating the kconfig warnings and build error.
>
> If you can replicate the problem, I'd suggest submitting a patch.
Sure, I'll do that.
--
~Randy
next prev parent reply other threads:[~2023-08-04 2:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 14:42 Aleksandr Nogikh
2023-08-03 15:24 ` Adam Ford
2023-08-04 2:01 ` Randy Dunlap
2023-08-04 2:26 ` Adam Ford
2023-08-04 2:37 ` Randy Dunlap [this message]
2023-08-04 2:42 ` Adam Ford
2023-08-04 2:47 ` Randy Dunlap
2023-08-04 10:19 ` Aleksandr Nogikh
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=d8a57aee-bb8a-dc5a-7c4f-b8a293d37bec@infradead.org \
--to=rdunlap@infradead.org \
--cc=aford173@gmail.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=dvyukov@google.com \
--cc=inki.dae@samsung.com \
--cc=jagan@amarulasolutions.com \
--cc=l.stach@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=nogikh@google.com \
--cc=syzkaller@googlegroups.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
all inboxes | Powered by JetHome®