All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	linux-tegra@vger.kernel.org, Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <krzk@kernel.org>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2] phy: tegra: depend on COMMON_CLK to fix compile tests
Date: Tue, 16 Mar 2021 19:14:45 +0300	[thread overview]
Message-ID: <d280c555-5ee4-7803-ada1-88257f809816@gmail.com> (raw)
In-Reply-To: <CA+Eumj4WirHRgr3si=nkQpNdUBcCwqLXvs-ihSi2nuJokxg=Xw@mail.gmail.com>

16.03.2021 18:51, Krzysztof Kozlowski пишет:
> On Tue, 16 Mar 2021 at 16:47, Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.com> wrote:
>>
>> On Tue, 16 Mar 2021 at 16:43, Dmitry Osipenko <digetx@gmail.com> wrote:
>>>
>>> 16.03.2021 10:55, Krzysztof Kozlowski пишет:
>>>> From: Krzysztof Kozlowski <krzk@kernel.org>
>>>>
>>>> The Tegra USB PHY driver uses Common Clock Framework thus it cannot be
>>>> built on platforms without it (e.g. compile test on MIPS with RALINK and
>>>> SOC_RT305X):
>>>>
>>>>     /usr/bin/mips-linux-gnu-ld: drivers/usb/phy/phy-tegra-usb.o: in function `tegra_usb_phy_init':
>>>>     phy-tegra-usb.c:(.text+0x1dd4): undefined reference to `clk_get_parent'
>>>>
>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
>>>>
>>>> ---
>>>>
>>>> Changes since v1:
>>>> 1. Depend on COMMON_CLK always, not only for compile test.
>>>> ---
>>>>  drivers/usb/phy/Kconfig | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
>>>> index 52eebcb88c1f..7500e77a7d01 100644
>>>> --- a/drivers/usb/phy/Kconfig
>>>> +++ b/drivers/usb/phy/Kconfig
>>>> @@ -163,6 +163,7 @@ config USB_MXS_PHY
>>>>  config USB_TEGRA_PHY
>>>>       tristate "NVIDIA Tegra USB PHY Driver"
>>>>       depends on ARCH_TEGRA || COMPILE_TEST
>>>> +     depends on COMMON_CLK
>>>>       select USB_COMMON
>>>>       select USB_PHY
>>>>       select USB_ULPI
>>>>
>>>
>>> But if COMMON_CLK is disabled, then include/linux/clk.h provides a stub
>>> for clk_get_parent(), meaning that MIPS has its own COMMON_CLK, no?
>>
>> Hi,
>>
>> It depends on the platform. Not all of them implement every clk API,
>> so you can have failures:
>> https://lore.kernel.org/lkml/202102170017.MgPVy7aZ-lkp@intel.com/
> 
> Ah, you mentioned the stub, so let me clarify more. The common clk
> stubs are not used for cases like !COMMON_CLK && HAVE_LEGACY_CLK (or
> HAVE_CLK, I don't remember). This is why you can have a MIPS platform
> defining some of the clock operations thus not using COMMON_CLK at all
> (and neither the stubs).

I see now that the stubs depend on CONFIG_HAVE_CLK and not COMMON_CLK,
thanks.

This raises question about why those platforms select CONFIG_HAVE_CLK,
while not implementing it fully. Sounds like a better fix should be to
add the missing stubs to the MIPS clk implementation, which should avoid
the need to patch each driver individually.

https://elixir.bootlin.com/linux/v5.12-rc3/source/arch/mips/ar7/clock.c#L489

  reply	other threads:[~2021-03-16 16:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16  7:55 [PATCH v2] phy: tegra: depend on COMMON_CLK to fix compile tests Krzysztof Kozlowski
2021-03-16 15:43 ` Dmitry Osipenko
2021-03-16 15:47   ` Krzysztof Kozlowski
2021-03-16 15:51     ` Krzysztof Kozlowski
2021-03-16 16:14       ` Dmitry Osipenko [this message]
2021-03-16 16:20         ` Krzysztof Kozlowski

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=d280c555-5ee4-7803-ada1-88257f809816@gmail.com \
    --to=digetx@gmail.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzk@kernel.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.