[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160715234953.GB30372@kroah.com>
Date: Sat, 16 Jul 2016 08:49:53 +0900
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Bin Gao <bin.gao@...ux.intel.com>
Cc: Felipe Balbi <felipe.balbi@...ux.intel.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Bin Gao <bin.gao@...el.com>,
Chandra Sekhar Anagani <chandra.sekhar.anagani@...el.com>
Subject: Re: [PATCH 1/2] usb: typec: Add USB Power Delivery sink port support
On Fri, Jul 15, 2016 at 03:41:10PM -0700, Bin Gao wrote:
> On Fri, Jul 15, 2016 at 02:21:48PM +0300, Felipe Balbi wrote:
> > Greg Kroah-Hartman <gregkh@...uxfoundation.org> writes:
> > > On Fri, Jul 15, 2016 at 01:38:12PM +0300, Felipe Balbi wrote:
> > >>
> > >> Hi,
> > >>
> > >> Bin Gao <bin.gao@...ux.intel.com> writes:
> > >> > +static void print_message(int port, bool is_cmsg, u8 msg, bool recv)
> > >> > +{
> > >> > + pr_info("sink port %d: %s message %s %s\n", port,
> > >> > + is_cmsg ? "Control" : "Data",
> > >> > + msg_to_string(is_cmsg, msg),
> > >> > + recv ? "received" : "sent(wait GOODCRC)");
> > >> > +}
> > >>
> > >> this is problematic. By default, we're all using 115200 8N1 baud
> > >> rate. This message alone prints anywhere from 50 to 100 characters (I
> > >> didn't really count properly, these are rough numbers), and that takes:
> > >>
> > >> n50chars_time = 50 / (115200 / 10) = 4.3ms
> > >> n100chars_time = 100 / (115200 / 10) = 8.6ms
> > >>
> > >> Considering you have 30ms to reply with Power Request after GoodCRC, and
> > >> considering you're printing several of these messages, they become
> > >> really expensive and eat up valuable time from tSenderReply.
> > >
> > > printk() should be async, so it shouldn't be that big of a deal.
> >
> > I can actually see this causing problems ;-) With this pr_info(),
> > sometimes tSenderReply times out and Source gives a HardReset. Without
> > pr_info(), type-c analyzer tells me we reply in less than 1ms.
> >
> > > What is wrong is that this isn't using dev_info().
> >
> > right, that too.
> >
> > --
> > balbi
>
> When we don't have a struct device pointer for this driver,
Then you should fix that, as this is a driver for hardware :)
thanks,
greg k-h
Powered by blists - more mailing lists