Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2599311rwb; Mon, 19 Sep 2022 07:21:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR6x6E90KpNdjRoufaKSNb4XSfbFzHV9/rXK0c0JbQWLxFxEH3TtCKAaWC1eAstVZYGPG33t X-Received: by 2002:a17:90b:4d92:b0:202:f200:a3c9 with SMTP id oj18-20020a17090b4d9200b00202f200a3c9mr31029445pjb.4.1663597316425; Mon, 19 Sep 2022 07:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663597316; cv=none; d=google.com; s=arc-20160816; b=e+DIHMBnOF1SoSsgg23GMfrizcCvaAw+/lSjEfUk+0uQy/jfGRvo1Xi9Tf1F9JTu2p pS9M0QLmtITBr6qyBJVX6u9MhYrY6LcYgrSunrMMcLWze7eWAovEhBVbQrYOn3WKHzNy 8EOOTujnRYwUw5xlGCiMslN6mI1/hbbgF+8aJcPRMBjS489goiGT7rNamu7+jBRPDyX7 MOoWkzYOyzlQfUqDbQk8tyJt4zp9GnonCptBX4qGO0kA62emf03luAko5cGmbMn0bv1T gfpdEYkPV+t41//JuSqPKcgwmDLCuhkWw9TwgELZKbrOe7tytxtxysjhl/sZY9hXOQpB Wtow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=y29nOjjE0WdGENdKB5VrsUJIzw7HpcrkvaNq9Rldol0=; b=My/ICSncQ8BZuptPa3SU9hgCktUX3peOFLHPcn5WuJ0zVZeplRqyniSyUIQ8oUyLjj QIjcEfvaB87tqYeCd7mQC4nJmiaYlbxtGRNFjOlYOXLxTaCDcyXBAN5WZfJCYMGFlci7 V4OEg+SOLncB94Lsbl/kqNHooKw/Xn7uLhx5qd1LRu0+mkQ8QU0cRrh+/e3Q1zf/6B0g nSwNFGBnw1zS/MKuGvTrWEq+DP/4cU10q2XF3KVqv/Z6XvhJxFL4fVhlP/am3c/Phytb MoHWFFcSDSeffQz2UFzmq303c8fhnqklzqpPeUtuYmKEHCOMQrlUOYRdgtw7TiB5Ybq9 wQ4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NSzXi5cw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iw3-20020a170903044300b0017829a3df70si19748314plb.390.2022.09.19.07.21.44; Mon, 19 Sep 2022 07:21:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NSzXi5cw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbiISOOk (ORCPT + 99 others); Mon, 19 Sep 2022 10:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbiISOOi (ORCPT ); Mon, 19 Sep 2022 10:14:38 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 079E5FD3C; Mon, 19 Sep 2022 07:14:37 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id i3so15831258qkl.3; Mon, 19 Sep 2022 07:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=y29nOjjE0WdGENdKB5VrsUJIzw7HpcrkvaNq9Rldol0=; b=NSzXi5cwKPoLbx17l7nM7lkVqW0fSNqt6xEcU1FJdKLrgaRNKgocf4h9h05ebjaL/g fIs+Kpi8n7dEVlwb4epyjFe+gBoYPi3HIVFM7DhapIvcp+TlcEj6PRidBtwojDUSjLLR IHKDwLv9lzzun2gpv/osSxSTQvqGk5WfNW98qVtYmI0Wdk7/xyhCLNnpZissc+DAdApj Dd7E6/kvtPlthyUZBhidRosdJynO+z2yCNwhRy916B+Lp8L8m0S4ROsjRFE0Sm+cwopC klnwL1o21qcVJ6cWONhWxYiZeH3rl4NNGfp6W1zd6UQCjHe8oRiSbfuvpa+PrTYrrNPl UR1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=y29nOjjE0WdGENdKB5VrsUJIzw7HpcrkvaNq9Rldol0=; b=0KE0sMI6UGb8+Od+SLPyqguc7dYEI6nyvpIavVjAQMEa9LPpbtIeW6kqP95FKJXIvr YFeL6GRCakE6CqGKO8MKTvzbLbQOVJ4gVFPvYq7Cu5yPxuBc0ucJW+MrntaewwwbKsuw 1IzHjl+pGvnb9pfmQwWEQyGqdoEphaQepkhiGuFnxkLdnoyaAWgt46akaUwmATdFNvDp BIBE+l8BetBRW6ugw2TX3HzTrZEPgZCA52O5uRrXlmp3YEk5EI+7beHxwcxiOI2V96zH WsJY4EgzEo2qPHtiychdYd7uT/zczAUOQF8Coot+9xwsdVD8R/SJ1pk3PjzGmniR+K4F 3bXw== X-Gm-Message-State: ACrzQf2m9jBR0gSmsPvqhXHSOAf8Pmo8+1+D0W7FVnBPyWhsAiwYeYbn FoWMjNRIzbimcYc8JZpKJHQ= X-Received: by 2002:a05:620a:4807:b0:6cf:55d:e4c3 with SMTP id eb7-20020a05620a480700b006cf055de4c3mr3968308qkb.563.1663596876017; Mon, 19 Sep 2022 07:14:36 -0700 (PDT) Received: from [192.168.1.201] (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with ESMTPSA id t13-20020a37ea0d000000b006ce60296f97sm101724qkj.68.2022.09.19.07.14.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 07:14:35 -0700 (PDT) Message-ID: Date: Mon, 19 Sep 2022 10:14:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH net-next 11/13] sunhme: Combine continued messages Content-Language: en-US To: Rolf Eike Beer , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Zheyu Ma , Nick Bowler References: <20220918232626.1601885-1-seanga2@gmail.com> <20220918232626.1601885-12-seanga2@gmail.com> <14992029.3CObj9AJNb@eto.sf-tec.de> From: Sean Anderson In-Reply-To: <14992029.3CObj9AJNb@eto.sf-tec.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/19/22 09:23, Rolf Eike Beer wrote: > Am Montag, 19. September 2022, 01:26:24 CEST schrieb Sean Anderson: >> This driver seems to have been written under the assumption that messages >> can be continued arbitrarily. I'm not when this changed (if ever), but such >> ad-hoc continuations are liable to be rudely interrupted. Convert all such >> instances to single prints. This loses a bit of timing information (such as >> when a line was constructed piecemeal as the function executed), but it's >> easy to add a few prints if necessary. This also adds newlines to the ends >> of any prints without them. > > I have a similar patch around, but yours catches more places. > >> diff --git a/drivers/net/ethernet/sun/sunhme.c >> b/drivers/net/ethernet/sun/sunhme.c index 98c38e213bab..9965c9c872a6 100644 >> --- a/drivers/net/ethernet/sun/sunhme.c >> +++ b/drivers/net/ethernet/sun/sunhme.c >> @@ -330,7 +331,6 @@ static int happy_meal_bb_read(struct happy_meal *hp, >> int retval = 0; >> int i; >> >> - ASD("happy_meal_bb_read: reg=%d ", reg); >> >> /* Enable the MIF BitBang outputs. */ >> hme_write32(hp, tregs + TCVR_BBOENAB, 1); > > You can remove one of the empty lines here. OK >> @@ -1196,15 +1182,15 @@ static void happy_meal_init_rings(struct happy_meal >> *hp) struct hmeal_init_block *hb = hp->happy_block; >> int i; >> >> - HMD("happy_meal_init_rings: counters to zero, "); >> + HMD("counters to zero\n"); >> hp->rx_new = hp->rx_old = hp->tx_new = hp->tx_old = 0; >> >> /* Free any skippy bufs left around in the rings. */ >> - HMD("clean, "); >> + HMD("clean\n"); > > I don't think this one is actually needed, there isn't much than can happen in > between these 2 prints. OK >> @@ -1282,17 +1268,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal >> *hp, * XXX so I completely skip checking for it in the BMSR for now. */ >> >> -#ifdef AUTO_SWITCH_DEBUG >> - ASD("%s: Advertising [ "); >> - if (hp->sw_advertise & ADVERTISE_10HALF) >> - ASD("10H "); >> - if (hp->sw_advertise & ADVERTISE_10FULL) >> - ASD("10F "); >> - if (hp->sw_advertise & ADVERTISE_100HALF) >> - ASD("100H "); >> - if (hp->sw_advertise & ADVERTISE_100FULL) >> - ASD("100F "); >> -#endif >> + ASD("Advertising [ %s%s%s%s]\n", >> + hp->sw_advertise & ADVERTISE_10HALF ? "10H " : "", >> + hp->sw_advertise & ADVERTISE_10FULL ? "10F " : "", >> + hp->sw_advertise & ADVERTISE_100HALF ? "100H " : "", >> + hp->sw_advertise & ADVERTISE_100FULL ? "100F " : > ""); >> >> /* Enable Auto-Negotiation, this is usually on > already... */ >> hp->sw_bmcr |= BMCR_ANENABLE; > > Completely independent of this driver, but I wonder if there is no generic > function to print these 10/100/* full/half duplex strings? There are several > drivers doing this as a quick grep shows. There's some functions to print just one link mode, but I think generally the full advertising word is printed in debugs. I'm not too worried since this is just for debug. One of my goals is to convert this driver to phylib, but I haven't dived very deep into it. --Sean