lkml.org 
[lkml]   [2019]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] platform/chrome: Add CrOS USB PD logging driver
On Fri, Apr 5, 2019 at 2:09 PM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
>
> Hi Guenter,
>
> Missatge de Guenter Roeck <groeck@google.com> del dia dv., 5 d’abr.
> 2019 a les 21:59:
> >
> > Hi Enric,
> >
> > On Wed, Apr 3, 2019 at 6:54 AM Enric Balletbo i Serra
> > <enric.balletbo@collabora.com> wrote:
> > >
> > > From: Guenter Roeck <groeck@chromium.org>
> > >
> > > The CrOS USB PD logging feature is logically separate functionality of
> > > the charge manager, hence has its own driver. The driver logs the event
> > > data for the USB PD charger available in some ChromeOS Embedded
> > > Controllers.
> > >
> > > Signed-off-by: Guenter Roeck <groeck@chromium.org>
> > > [remove APPEND_STRING macro and minor cleanups]
> > > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > > ---
> > >
> > [ ... ]
> >
> > > +
> > > +static void cros_usbpd_print_log_entry(struct ec_response_pd_log *r,
> > > + ktime_t tstamp)
> > > +{
> > [ ... ]
> > > +
> > > + pr_info("PDLOG %d/%02d/%02d %02d:%02d:%02d.%03lld P%d %s\n",
> > > + rt.tm_year + 1900, rt.tm_mon + 1, rt.tm_mday,
> > > + rt.tm_hour, rt.tm_min, rt.tm_sec,
> > > + ktime_to_ms(tstamp) % MSEC_PER_SEC,
> >
> > 0day rightfully complains that this introduces a 64-bit divide
> > operation. I don't know if do_div() works here since it tries to
> > modify the first parameter. Maybe we need an interim variable to store
> > ktime_to_ms(tstamp). Something like
> >
> > s64 temp = ktime_to_ms(tstamp);
> > ...
> > do_div(temp, MSEC_PER_SEC),
> >
>
> I did something similar this afternoon and pushed again for the auto
> builders to play with.
>
> + div_s64_rem(ktime_to_ms(tstamp), MSEC_PER_SEC, &rem);
>
> Unfortunately, 0day now reports another error
>
> drivers/platform/chrome/cros_usbpd_logger.o: In function
> `cros_usbpd_print_log_entry':
> >> cros_usbpd_logger.c:(.text+0x5a0): undefined reference to `__aeabi_ldivmod'
>

I think that may have been with the earlier version of the code. Your
top of tree doesn't include the SHA that is reported as failing.

Guenter

\
 
 \ /
  Last update: 2019-04-05 23:39    [W:0.038 / U:43.092 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site