From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Bin Gao <bin.gao@linux.intel.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Bin Gao <bin.gao@intel.com>,
Chandra Sekhar Anagani <chandra.sekhar.anagani@intel.com>
Subject: Re: [PATCH 1/2] usb: typec: Add USB Power Delivery sink port support
Date: Fri, 15 Jul 2016 20:11:41 +0900 [thread overview]
Message-ID: <20160715111141.GB23645@kroah.com> (raw)
In-Reply-To: <87mvljgp9n.fsf@linux.intel.com>
On Fri, Jul 15, 2016 at 01:38:12PM +0300, Felipe Balbi wrote:
>
> Hi,
>
> Bin Gao <bin.gao@linux.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.
What is wrong is that this isn't using dev_info().
> This should really be a pr_debug() or, better yet, a tracepoint.
Yes, that would be best (dev_dbg() or a tracepoint.)
thanks,
greg k-h
next prev parent reply other threads:[~2016-07-15 11:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 2:14 [PATCH 1/2] usb: typec: Add USB Power Delivery sink port support Bin Gao
2016-07-15 6:31 ` Oliver Neukum
2016-07-15 22:33 ` Bin Gao
2016-07-15 7:25 ` Felipe Balbi
2016-07-15 8:44 ` Oliver Neukum
2016-07-15 10:30 ` Felipe Balbi
2016-07-15 13:13 ` Felipe Balbi
2016-07-15 23:49 ` Bin Gao
2016-07-18 7:07 ` Felipe Balbi
2016-07-19 5:39 ` Bin Gao
2016-07-19 8:29 ` Felipe Balbi
2016-07-15 10:38 ` Felipe Balbi
2016-07-15 11:11 ` Greg Kroah-Hartman [this message]
2016-07-15 11:21 ` Felipe Balbi
2016-07-15 22:41 ` Bin Gao
2016-07-15 23:49 ` Greg Kroah-Hartman
2016-07-19 5:30 ` Bin Gao
2016-07-19 8:30 ` Felipe Balbi
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=20160715111141.GB23645@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bin.gao@intel.com \
--cc=bin.gao@linux.intel.com \
--cc=chandra.sekhar.anagani@intel.com \
--cc=felipe.balbi@linux.intel.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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