From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752169AbcHFUYr (ORCPT ); Sat, 6 Aug 2016 16:24:47 -0400 Received: from smtprelay0141.hostedemail.com ([216.40.44.141]:35665 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751404AbcHFUYp (ORCPT ); Sat, 6 Aug 2016 16:24:45 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2828:2898:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:4321:5007:6117:6119:6120:7901:7903:10004:10400:10848:11026:11232:11657:11658:11914:12043:12048:12296:12517:12519:12740:13069:13311:13357:13439:13894:14181:14659:14721:21080:21212:21433:30054:30064:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: cart52_bf94e17be217 X-Filterd-Recvd-Size: 2721 Message-ID: <1470515081.28648.20.camel@perches.com> Subject: Re: [PATCH v2 12/14] net: ethernet: ti: cpsw: fix int dbg message From: Joe Perches To: Ivan Khoronzhuk , netdev@vger.kernel.org, mugunthanvnm@ti.com, grygorii.strashko@ti.com Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, dlide@ti.com Date: Sat, 06 Aug 2016 13:24:41 -0700 In-Reply-To: <1470480524-6851-13-git-send-email-ivan.khoronzhuk@linaro.org> References: <1470480524-6851-1-git-send-email-ivan.khoronzhuk@linaro.org> <1470480524-6851-13-git-send-email-ivan.khoronzhuk@linaro.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2016-08-06 at 13:48 +0300, Ivan Khoronzhuk wrote: > While poll handlers there is no possibility to figure out > which network device is handling packets, as cpdma channels > are common for both network devices in dual_emac mode. Currently, > the messages are printed only for one device, in fact, there is two. > So, better to print integrated num_tx value for both devices if > any of them is allowed to. [] > diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c [] > @@ -378,6 +378,7 @@ struct cpsw_common { >   bool rx_irq_disabled; >   bool tx_irq_disabled; >   u32 irqs_table[IRQ_NUM]; > + int intr_dbg_msg; Looks like this should be bool and should be placed after tx_irq_disabled [] > @@ -1848,8 +1853,35 @@ static u32 cpsw_get_msglevel(struct net_device *ndev) >   >  static void cpsw_set_msglevel(struct net_device *ndev, u32 value) >  { > + int i; > + struct cpsw_priv *sl_priv; >   struct cpsw_priv *priv = netdev_priv(ndev); > + struct cpsw_common *cpsw = priv->cpsw; > + >   priv->msg_enable = value; > + > + /* There is no possibility to at napi poll level > +  * to know which netdev is handled, so enable > +  * common dbg msg print if any interface is enabled to to? too? > +  */ > + cpsw->intr_dbg_msg = 0; > + if (!cpsw->data.dual_emac) { > + if (netif_msg_intr(priv)) > + cpsw->intr_dbg_msg = 1; > + return; > + } > + > + for (i = 0; i < cpsw->data.slaves; i++) { > + ndev = netdev_priv(cpsw->slaves[i].ndev); > + if (!ndev) > + continue; > + > + sl_priv = netdev_priv(ndev); > + if (netif_msg_intr(sl_priv)) { > + cpsw->intr_dbg_msg = 1; > + break; > + } > + } >  } >   >  static int cpsw_get_ts_info(struct net_device *ndev,