From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbcGOWhQ (ORCPT ); Fri, 15 Jul 2016 18:37:16 -0400 Received: from mga09.intel.com ([134.134.136.24]:41262 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbcGOWhO (ORCPT ); Fri, 15 Jul 2016 18:37:14 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,370,1464678000"; d="scan'208";a="1007764574" Date: Fri, 15 Jul 2016 15:41:10 -0700 From: Bin Gao To: Felipe Balbi Cc: Greg Kroah-Hartman , Heikki Krogerus , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Bin Gao , Chandra Sekhar Anagani Subject: Re: [PATCH 1/2] usb: typec: Add USB Power Delivery sink port support Message-ID: <20160715224110.GB159605@worksta> References: <20160715021405.GB128987@worksta> <87mvljgp9n.fsf@linux.intel.com> <20160715111141.GB23645@kroah.com> <87k2gngn8z.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k2gngn8z.fsf@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2016 at 02:21:48PM +0300, Felipe Balbi wrote: > Greg Kroah-Hartman writes: > > On Fri, Jul 15, 2016 at 01:38:12PM +0300, Felipe Balbi wrote: > >> > >> Hi, > >> > >> Bin Gao 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, a dev_info(NULL, fmt, ...) is equivalent to pr_info(). So we have to use dev_info() here? But I agree at least it should be pr_debug().