linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naresh Kamboju <naresh.kamboju@linaro.org>
To: Ray Chi <raychi@google.com>,
	linux-mips@vger.kernel.org,
	Linux-Next Mailing List <linux-next@vger.kernel.org>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org,
	open list <linux-kernel@vger.kernel.org>,
	kyletso@google.com, badhri@google.com,
	lkft-triage@lists.linaro.org
Subject: Re: [PATCH 1/2] usb: dwc3: add a power supply for current control
Date: Thu, 4 Mar 2021 22:54:56 +0530	[thread overview]
Message-ID: <CA+G9fYvVdQ7t3AkguKXJDG5iNEpSXfF=U189ZPVz21tWQ3r+dg@mail.gmail.com> (raw)
In-Reply-To: <20210222115149.3606776-2-raychi@google.com>

While building linux next 20210304 the following builds failed,
 - mips (cavium_octeon_defconfig) with gcc-8
 - mips (cavium_octeon_defconfig) with gcc-9
 - mips (cavium_octeon_defconfig) with gcc-10

On Mon, 22 Feb 2021 at 17:24, Ray Chi <raychi@google.com> wrote:
>
> Currently, VBUS draw callback does no action when the
> generic PHYs are used. This patch adds an additional
> path to control charging current through power supply
> interface.
>
> Signed-off-by: Ray Chi <raychi@google.com>
> ---
>  drivers/usb/dwc3/core.c | 15 +++++++++++++++
>  drivers/usb/dwc3/core.h |  4 ++++
>  2 files changed, 19 insertions(+)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index f2448d0a9d39..d15f065849cd 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1238,6 +1238,8 @@ static void dwc3_get_properties(struct dwc3 *dwc)
>         u8                      rx_max_burst_prd;
>         u8                      tx_thr_num_pkt_prd;
>         u8                      tx_max_burst_prd;
> +       const char              *usb_psy_name;
> +       int                     ret;
>
>         /* default to highest possible threshold */
>         lpm_nyet_threshold = 0xf;
> @@ -1263,6 +1265,13 @@ static void dwc3_get_properties(struct dwc3 *dwc)
>         else
>                 dwc->sysdev = dwc->dev;
>
> +       ret = device_property_read_string(dev, "usb-psy-name", &usb_psy_name);
> +       if (ret >= 0) {
> +               dwc->usb_psy = power_supply_get_by_name(usb_psy_name);
> +               if (!dwc->usb_psy)
> +                       dev_err(dev, "couldn't get usb power supply\n");
> +       }
> +
>         dwc->has_lpm_erratum = device_property_read_bool(dev,
>                                 "snps,has-lpm-erratum");
>         device_property_read_u8(dev, "snps,lpm-nyet-threshold",
> @@ -1619,6 +1628,9 @@ static int dwc3_probe(struct platform_device *pdev)
>  assert_reset:
>         reset_control_assert(dwc->reset);
>
> +       if (!dwc->usb_psy)
> +               power_supply_put(dwc->usb_psy);
> +
>         return ret;
>  }
>
> @@ -1641,6 +1653,9 @@ static int dwc3_remove(struct platform_device *pdev)
>         dwc3_free_event_buffers(dwc);
>         dwc3_free_scratch_buffers(dwc);
>
> +       if (!dwc->usb_psy)
> +               power_supply_put(dwc->usb_psy);

# to reproduce this build locally:

 tuxmake --target-arch=mips --kconfig=cavium_octeon_defconfig
--toolchain=gcc-8 --wrapper=sccache
--environment=SCCACHE_BUCKET=sccache.tuxbuild.com --runtime=podman
--image=public.ecr.aws/tuxmake/mips_gcc-8 config default kernel
xipkernel modules dtbs dtbs-legacy debugkernel headers
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=mips
CROSS_COMPILE=mips-linux-gnu- 'CC=sccache mips-linux-gnu-gcc'
'HOSTCC=sccache gcc' cavium_octeon_defconfig
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=mips
CROSS_COMPILE=mips-linux-gnu- 'CC=sccache mips-linux-gnu-gcc'
'HOSTCC=sccache gcc'
kernel/sched/fair.c:8384:13: warning: 'update_nohz_stats' defined but
not used [-Wunused-function]
 static bool update_nohz_stats(struct rq *rq)
             ^~~~~~~~~~~~~~~~~
mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_remove':
drivers/usb/dwc3/core.c:1657: undefined reference to `power_supply_put'
mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_get_properties':
drivers/usb/dwc3/core.c:1270: undefined reference to `power_supply_get_by_name'
mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_probe':
drivers/usb/dwc3/core.c:1632: undefined reference to `power_supply_put'

Build link,
https://gitlab.com/Linaro/lkft/mirrors/next/linux-next/-/jobs/1071668201#L146

-- 
Linaro LKFT
https://lkft.linaro.org

  reply	other threads:[~2021-03-04 17:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 11:51 [PATCH 0/2] an additional path to control charging current Ray Chi
2021-02-22 11:51 ` [PATCH 1/2] usb: dwc3: add a power supply for current control Ray Chi
2021-03-04 17:24   ` Naresh Kamboju [this message]
2021-02-22 11:51 ` [PATCH 2/2] usb: dwc3: add an alternate path in vbus_draw callback Ray Chi
2021-03-03 15:01 ` [PATCH 0/2] an additional path to control charging current Heiko Thiery
2021-03-03 15:26   ` Heiko Thiery
2021-03-04  8:21     ` Greg KH

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='CA+G9fYvVdQ7t3AkguKXJDG5iNEpSXfF=U189ZPVz21tWQ3r+dg@mail.gmail.com' \
    --to=naresh.kamboju@linaro.org \
    --cc=badhri@google.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kyletso@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=raychi@google.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;
as well as URLs for NNTP newsgroup(s).