From patchwork Sun Sep 18 23:26:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979612 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54A48ECAAD8 for ; Sun, 18 Sep 2022 23:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229610AbiIRX0f (ORCPT ); Sun, 18 Sep 2022 19:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiIRX0c (ORCPT ); Sun, 18 Sep 2022 19:26:32 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3B3815FEC; Sun, 18 Sep 2022 16:26:31 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id j10so16825642qtv.4; Sun, 18 Sep 2022 16:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=1+b05cqSjYOhMfSGBFr62HIBLVaTy7MEzbuck1eH+8Y=; b=N6NyIgfZB82Ka5NyWlidDmf7Okir7WBPDTc/jWpI0waszy8mwzp/hyvd0RrBYV/a9B EN0XLs/hVH35FS2qDnjGjGBgQzOMjYYEAtRJxXFnDb5KywtOMo+QIuRydpXyOJtXqyke yqQ3bdWnisPz5tZUdTRTq/onf1FUOB6Hra4l3fFyeK0I2t93RDAbL626kHB7Jq2TG67g 9OWKkdjOfhgPlT/SirAsNE905H4DsNes1Vtuw7CJVj2oyfP26FkDJ4sBFFE7rAsQSXPg PejL5ym+CRreYE06HOwuujmKkyuSd9+9ztv+4dMlNGC5KxexjHyoks4nFo8lpPKVb3tf Nw/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=1+b05cqSjYOhMfSGBFr62HIBLVaTy7MEzbuck1eH+8Y=; b=mlvTzkRjeCPm560dcroKpS57RXlts6tSWMgmELOT4676CM+zne4GCluGNYk/VhT8C/ 76MqSDT7W9HiprzKG6KYYPNXwQ6ZOQVZLPCiG3trY8otoKe00kuD0V0klaHus8OfMjlm KHKuoQMNDODy1LssSSqFmVYLedOEXbInCHiRTddNETDK7zFLSsgElNFf/I1WczjnJiHR rkDQm0D7CO8/YPGVO0QEitjqfgpGjPyRiwR4PriVaDPBWthDnqY4zXcj+GffmvupV/x5 svtSQ2333IkOw+YHXeOJf4TvV/EWuQ6BfNtZYirxLTUtqzC/OmYYNag5Qcyr7NXml4N2 KBUA== X-Gm-Message-State: ACrzQf0a6ENsf1H2K2C6o2ca9e8fnjvYCMvb31CxbssGxIimUM84I6SA FEB/UcTgx9AQS872g8EeB0w= X-Google-Smtp-Source: AMsMyM7uUQXU294s9Ff4coj0w1UhznDiWom1HV45ftfLHNuvsE8YNFpxIppWEsCpEWlYCG4Nbz2w3g== X-Received: by 2002:ac8:7f03:0:b0:35c:e89b:f972 with SMTP id f3-20020ac87f03000000b0035ce89bf972mr2558090qtk.679.1663543591001; Sun, 18 Sep 2022 16:26:31 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id h188-20020a37b7c5000000b006ce622e6c96sm10941488qkf.30.2022.09.18.16.26.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:30 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 01/13] sunhme: remove unused tx_dump_ring() Date: Sun, 18 Sep 2022 19:26:14 -0400 Message-Id: <20220918232626.1601885-2-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Rolf Eike Beer I can't find a reference to it in the entire git history. Signed-off-by: Rolf Eike Beer Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index e660902cfdf7..987f4c7338f5 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -135,25 +135,9 @@ static __inline__ void tx_dump_log(void) this = (this + 1) & (TX_LOG_LEN - 1); } } -static __inline__ void tx_dump_ring(struct happy_meal *hp) -{ - struct hmeal_init_block *hb = hp->happy_block; - struct happy_meal_txd *tp = &hb->happy_meal_txd[0]; - int i; - - for (i = 0; i < TX_RING_SIZE; i+=4) { - printk("TXD[%d..%d]: [%08x:%08x] [%08x:%08x] [%08x:%08x] [%08x:%08x]\n", - i, i + 4, - le32_to_cpu(tp[i].tx_flags), le32_to_cpu(tp[i].tx_addr), - le32_to_cpu(tp[i + 1].tx_flags), le32_to_cpu(tp[i + 1].tx_addr), - le32_to_cpu(tp[i + 2].tx_flags), le32_to_cpu(tp[i + 2].tx_addr), - le32_to_cpu(tp[i + 3].tx_flags), le32_to_cpu(tp[i + 3].tx_addr)); - } -} #else #define tx_add_log(hp, a, s) do { } while(0) #define tx_dump_log() do { } while(0) -#define tx_dump_ring(hp) do { } while(0) #endif #ifdef HMEDEBUG From patchwork Sun Sep 18 23:26:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979613 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E324DECAAD8 for ; Sun, 18 Sep 2022 23:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbiIRX0h (ORCPT ); Sun, 18 Sep 2022 19:26:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbiIRX0e (ORCPT ); Sun, 18 Sep 2022 19:26:34 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E644015FEE; Sun, 18 Sep 2022 16:26:32 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id s13so20746099qvq.10; Sun, 18 Sep 2022 16:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=f+EB9tqLDfuk22q0YdPsKDLRjPXinWklcbx8HraxOVo=; b=I2+xccWvrZ0XXRNZEQITFL2gQNhv4pJwsGkZzOhgnZ1qNYUG+tgOoYAD6QmoRjEXs4 U9i6/ZMQnIuLzpXXCRNt9ozzsatN7H/6bwgCr/vSR77KtS7eLCDDX6/9rV3n04GOIxxa g/TrLrOrW1GXyaxTexrI6gJMnGbmTganmfgYLTpqW/fqruEUXzPrBWT7i5+gHkn+Y3Fw HOUdWxSkAKguN1hI8cjYc+OyJpDCrq+VfPAdfbjB95sd9QgrEFxt0f2ZhTICkFescMD6 DE/mKWRz8mQgyGMuo8yMcirzZ3GNhdJJ7TwvcV6loxmnxDtnR8Es3MaZZJ5ZFF+Ab+hx PwxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=f+EB9tqLDfuk22q0YdPsKDLRjPXinWklcbx8HraxOVo=; b=VW51kJ/yr+3636WUDEEEw0xMGhBeobcd2WcHUeGwgH/SEb2yW4P8N5XzIz3MTG/fdR W1S6lF6NWIre/SgdD9eawUBiCTcPHWN0q97Ty6ZIf3sfm7NbthK+uFfPynKfj3fLnTKu XZ5xrbXZZ/I0ZCOCKzIYN5iwqaypqYKStHe6QuymRwpbOmxeQd9zqID5LGGlQ+VpCq7V Ed0eY3wzmm/b6lPnwVUGjsNVmTL+gmPaORMusBmp9D2luIgLyhaDrUizRzbwNMAVTUOw 8AZCw3OcAdp2k3yUgBe6ysZR9GsJ0ccIcn6s3GeeNtNY+NoqYgSAhvnF9zxtv6aEC0D3 cHlA== X-Gm-Message-State: ACrzQf3XySCWdGiJyYck6iLD7I5wdOyO7s6rgnuKSXP3BdSkZy74GIov AMFW92Wt3MbwyrY6x0ELHXA= X-Google-Smtp-Source: AMsMyM6bfOdqaOW1K2DcyF3MARq9SuQrZvAU6Vaf6Cc+JBM5haTVHrhRFCvmveQQ7VKwW5RYJX+EJQ== X-Received: by 2002:ad4:5de2:0:b0:4ac:c356:2605 with SMTP id jn2-20020ad45de2000000b004acc3562605mr12950372qvb.50.1663543592143; Sun, 18 Sep 2022 16:26:32 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id bs22-20020ac86f16000000b0035cdd7a42d0sm3357339qtb.22.2022.09.18.16.26.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:31 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 02/13] sunhme: Remove version Date: Sun, 18 Sep 2022 19:26:15 -0400 Message-Id: <20220918232626.1601885-3-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Module versions are not very useful: > The basic problem is, the version string does not identify the sources > with enough accuracy. It says nothing about back ported fixes in > stable kernels. It tells you nothing about vendor patches to the > network core, etc. https://lore.kernel.org/all/Yf6mtvA1zO7cdzr7@lunn.ch/ While we're at it, inline the author and use the driver name a bit more. Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 987f4c7338f5..7340d0f2ef93 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -61,15 +61,8 @@ #include "sunhme.h" #define DRV_NAME "sunhme" -#define DRV_VERSION "3.10" -#define DRV_RELDATE "August 26, 2008" -#define DRV_AUTHOR "David S. Miller (davem@davemloft.net)" -static char version[] = - DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n"; - -MODULE_VERSION(DRV_VERSION); -MODULE_AUTHOR(DRV_AUTHOR); +MODULE_AUTHOR("David S. Miller (davem@davemloft.net)"); MODULE_DESCRIPTION("Sun HappyMealEthernet(HME) 10/100baseT ethernet driver"); MODULE_LICENSE("GPL"); @@ -2451,8 +2444,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info { struct happy_meal *hp = netdev_priv(dev); - strscpy(info->driver, "sunhme", sizeof(info->driver)); - strscpy(info->version, "2.02", sizeof(info->version)); + strscpy(info->driver, DRV_NAME, sizeof(info->driver)); if (hp->happy_flags & HFLAG_PCI) { struct pci_dev *pdev = hp->happy_dev; strscpy(info->bus_info, pci_name(pdev), sizeof(info->bus_info)); @@ -2488,8 +2480,6 @@ static const struct ethtool_ops hme_ethtool_ops = { .set_link_ksettings = hme_set_link_ksettings, }; -static int hme_version_printed; - #ifdef CONFIG_SBUS /* Given a happy meal sbus device, find it's quattro parent. * If none exist, allocate and return a new one. @@ -2973,9 +2963,6 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, goto err_out; SET_NETDEV_DEV(dev, &pdev->dev); - if (hme_version_printed++ == 0) - printk(KERN_INFO "%s", version); - hp = netdev_priv(dev); hp->happy_dev = pdev; From patchwork Sun Sep 18 23:26:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979614 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D59DC6FA82 for ; Sun, 18 Sep 2022 23:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229685AbiIRX0j (ORCPT ); Sun, 18 Sep 2022 19:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbiIRX0f (ORCPT ); Sun, 18 Sep 2022 19:26:35 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2863A15FCA; Sun, 18 Sep 2022 16:26:34 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id g2so16668536qkk.1; Sun, 18 Sep 2022 16:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=8EAn0cvdlfoIPExkywDlAWVYcfVTv9+DcRGm06t9Xe0=; b=iW6tucCCgZ5pZY72nI38Eu2AUCumKfVLIqoaDS2hX5URAg5jqvPLE9VLTtRdEYYd90 5w7Nfx+C9vgKRRN31+AbjvVFURwJJZzGHkGyEzLGu3/P6E5J1kEZXrz4yKSy2r/h5pt0 ++D1N3q1IR2bCmgPECOy3BvLE++gxTi/UB0GwznzP5YycquEdqfeQp5hNx5g988/g5XX lLxMwvPscvOylDyZ5H0NKJ5xACaNAN4ytNIElbWIoODOGBepbmlMDUuhy2T60mCjxPf0 G+QXiVu6IR0yIg8zNMW6cwUnHqUULCuKO/ZaQZXnygMkHZN7yhJ2U13BEYwBR0o0DkkA 5i6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=8EAn0cvdlfoIPExkywDlAWVYcfVTv9+DcRGm06t9Xe0=; b=D21d07mm+f2JuVkHkvENWwxk+OYdbPcTkjCCCbdM7WXlRgr5W51J6z2kShWktb52Gp jRtb1iT9VQvKl2CTklrnKrV1fJ/m9uKpM0krZpn3lHi/us0gnICjTBOsuXdbn63U3YsN kpFI8qHiiYUT0MFVFKzT7HUz+A1wpnQmy44EGT7dVGHH1V0vXJaSJF+OISIyQq4h2qBs RuaMjzHMNOtAVf/etTgtNJZfdXATkisqVK06CeEkLsdpKQ6ec0TzCH+7zEczsDSVG/Jx uOKtylRTXKt8NRDUT6KtesKu+XU5zlLodo9ogTsv5RWrEnJnQXqtRPs7Hr9B1TpdZ56F RXwQ== X-Gm-Message-State: ACrzQf2xxG3Vey6flG7m5UrcOXrvBjHXJjMloOVwAfWmXTqGEo38J3PC TMIHuFAiYFcxD5njw4GDM3A= X-Google-Smtp-Source: AMsMyM7hM1MM7LF1QdJVTos4SleSEL5rhfJ3Ek6St9qQNr2e/LRqf7tOpo+FGJsh6PIXiZeqN/aKNw== X-Received: by 2002:ae9:c105:0:b0:6ce:e3d8:73af with SMTP id z5-20020ae9c105000000b006cee3d873afmr5306664qki.105.1663543593335; Sun, 18 Sep 2022 16:26:33 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id de42-20020a05620a372a00b006b945519488sm11637265qkb.88.2022.09.18.16.26.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:33 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 03/13] sunhme: forward the error code from pci_enable_device() Date: Sun, 18 Sep 2022 19:26:16 -0400 Message-Id: <20220918232626.1601885-4-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Rolf Eike Beer This already returns a proper error value, so pass it to the caller. Signed-off-by: Rolf Eike Beer Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 7340d0f2ef93..1fc16801f520 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2940,11 +2940,12 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, strcpy(prom_name, "SUNW,hme"); #endif - err = -ENODEV; + err = pci_enable_device(pdev); - if (pci_enable_device(pdev)) + if (err) goto err_out; pci_set_master(pdev); + err = -ENODEV; if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { qp = quattro_pci_find(pdev); From patchwork Sun Sep 18 23:26:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979616 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26A7FC54EE9 for ; Sun, 18 Sep 2022 23:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbiIRX0k (ORCPT ); Sun, 18 Sep 2022 19:26:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbiIRX0g (ORCPT ); Sun, 18 Sep 2022 19:26:36 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A25815FE6; Sun, 18 Sep 2022 16:26:35 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id d17so18726404qko.13; Sun, 18 Sep 2022 16:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=NzRHpoTpsrlpXyhZKqhzPJYHc2m+m1CqpwVJsw9K03E=; b=kZeSSlfdoy1P2sRt7qqoYGoAwx/phSjyxHfbIhEjMZBES67nE6a/V8YBKay0f2rrD1 YIs75LEnHpo8naj28BLdOLQIW6Hpx8p9emiSgBxj/NdcR/82q0f+9hFm17osGRdiZSXC p40pbWovrMEU4XGx8DoDfJ27skCkVsXuGT8w+RdugpYaQeTleD9aqIKop+BRHcKMQEeR 3eOv35ju6HRE680IitbvhstObMFfTatrUo5WULT3j/Cb0An+SWGL4SVMjuFK1Ynh6ntZ gjkCjnxBTRWWtk8XM2QZoLVkp0g9saBEgAq0AgFmJ3jI1gJE9AzLg5xqFPm5Qs+3fv4P osvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=NzRHpoTpsrlpXyhZKqhzPJYHc2m+m1CqpwVJsw9K03E=; b=N8RYzELwlA5kWreskD3HqQ2DbrVnQ2taNt3v5/YTODmhafqB08RCxJ5Tzg2aHEDeDR VFF8qQO1n+mN4JEZw3mUd5GZ7w4+JNronGqg0rkE3ZoUpBFavgs263WCu8cMIEcl8K5v b5zVLHexEe52Wj+kWgUKvfGdGf/cXeTAm2mAuKD2E516swHghEBndif/wJ4nBgePMe/2 nsSIqMHe4zHTVqvS8Y7OADUAdt1HpZ8dAsX3Ga3VsdZgt0U55wIQb7nGplSB6q23n23K 4WtV4dz+haSMplaVXetEQSPacWRg92JFFaGJsWnM/lR72bPByDfBeXbd5Tuo//p5L7QL RKVQ== X-Gm-Message-State: ACrzQf0Wau4+lJpIZIqn8Jm2G+sHR7/ei3HrxyxvCjCJGo1HV7+BOvMK oaKKpDJgUCc+ceMyTQB+KmQ= X-Google-Smtp-Source: AMsMyM7PjPfYV3Nu5YuKR04p6vKlxlfFu079PmgEeMgdFwF8iV7l0jUBHfo7DbrvBos/kfvJS0IFiw== X-Received: by 2002:a05:620a:4c:b0:6ce:b5f:1320 with SMTP id t12-20020a05620a004c00b006ce0b5f1320mr11402514qkt.569.1663543594531; Sun, 18 Sep 2022 16:26:34 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id hf22-20020a05622a609600b0035ba90126e7sm9347886qtb.91.2022.09.18.16.26.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:34 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 04/13] sunhme: Return an ERR_PTR from quattro_pci_find Date: Sun, 18 Sep 2022 19:26:17 -0400 Message-Id: <20220918232626.1601885-5-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In order to differentiate between a missing bridge and an OOM condition, return ERR_PTRs from quattro_pci_find. This also does some general linting in the area. Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 33 +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 1fc16801f520..52247505d08e 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2569,30 +2569,33 @@ static void quattro_sbus_free_irqs(void) #ifdef CONFIG_PCI static struct quattro *quattro_pci_find(struct pci_dev *pdev) { + int i; struct pci_dev *bdev = pdev->bus->self; struct quattro *qp; - if (!bdev) return NULL; + if (!bdev) + return ERR_PTR(-ENODEV); + for (qp = qfe_pci_list; qp != NULL; qp = qp->next) { struct pci_dev *qpdev = qp->quattro_dev; if (qpdev == bdev) return qp; } + qp = kmalloc(sizeof(struct quattro), GFP_KERNEL); - if (qp != NULL) { - int i; + if (!qp) + return ERR_PTR(-ENOMEM); - for (i = 0; i < 4; i++) - qp->happy_meals[i] = NULL; + for (i = 0; i < 4; i++) + qp->happy_meals[i] = NULL; - qp->quattro_dev = bdev; - qp->next = qfe_pci_list; - qfe_pci_list = qp; + qp->quattro_dev = bdev; + qp->next = qfe_pci_list; + qfe_pci_list = qp; - /* No range tricks necessary on PCI. */ - qp->nranges = 0; - } + /* No range tricks necessary on PCI. */ + qp->nranges = 0; return qp; } #endif /* CONFIG_PCI */ @@ -2949,11 +2952,15 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { qp = quattro_pci_find(pdev); - if (qp == NULL) + if (IS_ERR(qp)) { + err = PTR_ERR(qp); goto err_out; + } + for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) - if (qp->happy_meals[qfe_slot] == NULL) + if (!qp->happy_meals[qfe_slot]) break; + if (qfe_slot == 4) goto err_out; } From patchwork Sun Sep 18 23:26:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979615 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CAE3ECAAD8 for ; Sun, 18 Sep 2022 23:26:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbiIRX0n (ORCPT ); Sun, 18 Sep 2022 19:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbiIRX0h (ORCPT ); Sun, 18 Sep 2022 19:26:37 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D7EB1706F; Sun, 18 Sep 2022 16:26:36 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id w2so16013457qtv.9; Sun, 18 Sep 2022 16:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=fE6pbLFuvOBFl/qQDGBZID4Mdah+fQ2KIzxGhkxVu4I=; b=RUrkD50oGE2toQWqsl48izVpbUiAuDLIAxZymk9mDlml91BifmOP1SPi52uJPxDaQw tE2HMkOx/SGEvvlScvFXaICsGk2f6qTiIIAuTV6Fr/A3jzI2dgKf9Rd13mN2cx4FJ8bH 7jDPi8rZir2206T/Njv6GMw6+9h6g5co0HG4EB/aeljWw6X52xg3Z0BNX4IJjIczrwcV snLLfcJywi0vOmwd0PYhhU5KKCzecwQGHFA0C9V6DmeFSd7GksTU7O5VetAkuaO1stqH BJIePJlkY8sLCGf0qqCtowVuIwVXJh2bNWd9wAJlFd3fA+yI5hM7iGklbXbkhMgItMb+ YgvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=fE6pbLFuvOBFl/qQDGBZID4Mdah+fQ2KIzxGhkxVu4I=; b=QEgZY6JJKT6Qxik5/E/0sKfSjLCBNtJhnt2OyrGnYyOQHYf1XPS7HCZTJVCoh/uocM h6AL81UYSIVYH27NoUEV/SSQYP8woLT5PoUge8GC/4l2ysG2rg7sYi3punv5u8d9PlQi by3yCmgB13K1WJk/RaAAICg5obepOA5lQM7aBHZn1uGj+jO+pwaA71w/CQBKzmJU59mH SvjgAorK/3tZh4P42HY/ay/Rrdk8vBIcMRiGt6e4Ub7r3umTtpImeRn7dzt3z0y68wbp mmaN7+i4SJUkzDAuAs37wX62UNtcIeRbrMU9NyzLhcqoMmMCQY3MOi+TfgRY4lYzjHB+ 9ssg== X-Gm-Message-State: ACrzQf0CrREnx8SXERpe7wnQ46LbRdhHEzLV5gKyDzd1mHxdKpxppCU+ RQ9BT9kMawPj2FagftWZGVw= X-Google-Smtp-Source: AMsMyM67DyvZKtU6y8aSRS2AK+4kPqIsYQC/Y8AEn27FDx4O5hbUgGyoopGNyuJ7xDi6wEmSvGKPcw== X-Received: by 2002:a05:622a:1d1:b0:35b:a6be:6d97 with SMTP id t17-20020a05622a01d100b0035ba6be6d97mr13239065qtw.550.1663543595699; Sun, 18 Sep 2022 16:26:35 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id j6-20020a05620a410600b006b5cc25535fsm12208517qko.99.2022.09.18.16.26.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:35 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 05/13] sunhme: Regularize probe errors Date: Sun, 18 Sep 2022 19:26:18 -0400 Message-Id: <20220918232626.1601885-6-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This fixes several error paths to ensure they return an appropriate error (instead of ENODEV). Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 52247505d08e..f0b77bdf51dd 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2948,7 +2948,6 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, if (err) goto err_out; pci_set_master(pdev); - err = -ENODEV; if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { qp = quattro_pci_find(pdev); @@ -2985,18 +2984,22 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, } hpreg_res = pci_resource_start(pdev, 0); - err = -ENODEV; + err = -EINVAL; if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); goto err_out_clear_quattro; } - if (pci_request_regions(pdev, DRV_NAME)) { + + err = pci_request_regions(pdev, DRV_NAME); + if (err) { printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, " "aborting.\n"); goto err_out_clear_quattro; } - if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == NULL) { + hpreg_base = ioremap(hpreg_res, 0x8000); + err = -ENOMEM; + if (!hpreg_base) { printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); goto err_out_free_res; } @@ -3066,7 +3069,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &hp->hblock_dvma, GFP_KERNEL); - err = -ENODEV; + err = -ENOMEM; if (!hp->happy_block) goto err_out_iounmap; From patchwork Sun Sep 18 23:26:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979617 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48CCAC6FA8B for ; Sun, 18 Sep 2022 23:26:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229718AbiIRX0p (ORCPT ); Sun, 18 Sep 2022 19:26:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbiIRX0j (ORCPT ); Sun, 18 Sep 2022 19:26:39 -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 B5A5317078; Sun, 18 Sep 2022 16:26:37 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id i3so14800597qkl.3; Sun, 18 Sep 2022 16:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=JdFB9H2fXhd3Z1WZzCu6//J9s0r6PlHJ8gGLyEB00zg=; b=TXlccmiVEsDGRbQnV7BASGzt4sEUad+DQFPND5M+iTj+2F/I2atXCtHz3682243KzZ iTI6IejNV8eY7Rq4TzqzgyCMv7h1A1pbsVGS4f4rG2zvWNJz3+HK31olsIgq+a9emfa1 RETBorFBtp/HMPbMaRdzfpq0aDgqU3SvFVxOHzv3FMlpmO41NZLKUi3hsVSBy6us7Z25 kfwj+ZX1KNn71M1Me1HQnNwiGTxhG5nSW4b5uTkwUmSXxRxJ4f15x0ee4P9/XykYefSO Ln1pYt5227miLtKmGFMWOl65QnWU2xXJZJ8TFJoZBERoxOJQ2rIxcSY1XfrHiwCgaag6 cmpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=JdFB9H2fXhd3Z1WZzCu6//J9s0r6PlHJ8gGLyEB00zg=; b=CDvroR9S4rxLB8Z9NdIZ4+2j5UcWw1mppwj352J+QIwmIpKcS8PaTZpZqYXFGCKM7T rl/aE0ZeuhWQXGluBPsBzD7n7mr56Y5evJsG3LTuGj7Y6mnw314kp5lcR4nfX1MZDgx2 8tcIIdh2upK+dvziNrKADu+NRoRCB9/VVDD5Gs3Q98bRWaOULt1LUm4VZMDD/VPgiEd3 5RBl9AONIURsPkwRY0v60v972ZKu2q58kG35UjTBg2ZZrv0flO46xQUKadfGHsZjhfae voZu5P4k5XWX9oBEg+eosNVhxOHEfMHkWmxOlGOS5a4B/4JvSMZ2GcXKKIj2uvt0UWy/ N2AQ== X-Gm-Message-State: ACrzQf2gcBn7P+a0lskh39noup0kl/eSkXywEgtIq1snF+Pb+K4CG79B LftdiFVhk1YOzjvM/WQXJAA= X-Google-Smtp-Source: AMsMyM696lzlk7eyntCIaHFv3GvSCnrNoEY+T7wf3dv58ghXQV1EOFLiFMbTTt7/Q/W3Y5R+Lc/Qnw== X-Received: by 2002:a05:620a:575:b0:6ce:4035:1978 with SMTP id p21-20020a05620a057500b006ce40351978mr11249192qkp.451.1663543596893; Sun, 18 Sep 2022 16:26:36 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id bs14-20020a05620a470e00b006b58d8f6181sm11188699qkb.72.2022.09.18.16.26.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:36 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 06/13] sunhme: switch to devres Date: Sun, 18 Sep 2022 19:26:19 -0400 Message-Id: <20220918232626.1601885-7-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Rolf Eike Beer This not only removes a lot of code, it also fixes the memleak of the DMA memory when register_netdev() fails. Signed-off-by: Rolf Eike Beer [ rebased onto net-next/master; fixed error reporting ] Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 60 +++++++++---------------------- 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index f0b77bdf51dd..cde0d8062fd3 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2926,7 +2926,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, struct happy_meal *hp; struct net_device *dev; void __iomem *hpreg_base; - unsigned long hpreg_res; + struct resource *hpreg_res; int i, qfe_slot = -1; char prom_name[64]; u8 addr[ETH_ALEN]; @@ -2943,7 +2943,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, strcpy(prom_name, "SUNW,hme"); #endif - err = pci_enable_device(pdev); + err = pcim_enable_device(pdev); if (err) goto err_out; @@ -2964,10 +2964,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, goto err_out; } - dev = alloc_etherdev(sizeof(struct happy_meal)); - err = -ENOMEM; - if (!dev) + dev = devm_alloc_etherdev(&pdev->dev, sizeof(struct happy_meal)); + if (!dev) { + err = -ENOMEM; goto err_out; + } SET_NETDEV_DEV(dev, &pdev->dev); hp = netdev_priv(dev); @@ -2983,25 +2984,26 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, qp->happy_meals[qfe_slot] = dev; } - hpreg_res = pci_resource_start(pdev, 0); err = -EINVAL; if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); goto err_out_clear_quattro; } - err = pci_request_regions(pdev, DRV_NAME); - if (err) { + hpreg_res = devm_request_region(&pdev->dev, pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0), DRV_NAME); + if (IS_ERR(hpreg_res)) { + err = PTR_ERR(hpreg_res); printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, " "aborting.\n"); goto err_out_clear_quattro; } - hpreg_base = ioremap(hpreg_res, 0x8000); + hpreg_base = pcim_iomap(pdev, 0, 0x8000); err = -ENOMEM; if (!hpreg_base) { printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); - goto err_out_free_res; + goto err_out_clear_quattro; } for (i = 0; i < 6; i++) { @@ -3067,11 +3069,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, hp->happy_bursts = DMA_BURSTBITS; #endif - hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, - &hp->hblock_dvma, GFP_KERNEL); + hp->happy_block = dmam_alloc_coherent(&pdev->dev, PAGE_SIZE, + &hp->hblock_dvma, GFP_KERNEL); err = -ENOMEM; if (!hp->happy_block) - goto err_out_iounmap; + goto err_out_clear_quattro; hp->linkcheck = 0; hp->timer_state = asleep; @@ -3105,11 +3107,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, happy_meal_set_initial_advertisement(hp); spin_unlock_irq(&hp->happy_lock); - err = register_netdev(hp->dev); + err = devm_register_netdev(&pdev->dev, dev); if (err) { printk(KERN_ERR "happymeal(PCI): Cannot register net device, " "aborting.\n"); - goto err_out_free_coherent; + goto err_out_clear_quattro; } pci_set_drvdata(pdev, hp); @@ -3142,41 +3144,14 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, return 0; -err_out_free_coherent: - dma_free_coherent(hp->dma_dev, PAGE_SIZE, - hp->happy_block, hp->hblock_dvma); - -err_out_iounmap: - iounmap(hp->gregs); - -err_out_free_res: - pci_release_regions(pdev); - err_out_clear_quattro: if (qp != NULL) qp->happy_meals[qfe_slot] = NULL; - free_netdev(dev); - err_out: return err; } -static void happy_meal_pci_remove(struct pci_dev *pdev) -{ - struct happy_meal *hp = pci_get_drvdata(pdev); - struct net_device *net_dev = hp->dev; - - unregister_netdev(net_dev); - - dma_free_coherent(hp->dma_dev, PAGE_SIZE, - hp->happy_block, hp->hblock_dvma); - iounmap(hp->gregs); - pci_release_regions(hp->happy_dev); - - free_netdev(net_dev); -} - static const struct pci_device_id happymeal_pci_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) }, { } /* Terminating entry */ @@ -3188,7 +3163,6 @@ static struct pci_driver hme_pci_driver = { .name = "hme", .id_table = happymeal_pci_ids, .probe = happy_meal_pci_probe, - .remove = happy_meal_pci_remove, }; static int __init happy_meal_pci_init(void) From patchwork Sun Sep 18 23:26:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979619 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31266C6FA82 for ; Sun, 18 Sep 2022 23:26:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbiIRX0y (ORCPT ); Sun, 18 Sep 2022 19:26:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiIRX0m (ORCPT ); Sun, 18 Sep 2022 19:26:42 -0400 Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A6F61707B; Sun, 18 Sep 2022 16:26:39 -0700 (PDT) Received: by mail-qv1-xf2f.google.com with SMTP id ml1so20785365qvb.1; Sun, 18 Sep 2022 16:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=X8YgwES7TplqCHtmD/bT0wPe1Le0GpgV8HcbaL2Xf2c=; b=TuMahUO6YCoa0PcCUTFfEVN0UbSFNo7tJRaLy8z+V4F8pYr8y5f/TDhGsew4o9NMKM p2oxRM19oDIZBnJ3OZAowMyF8s6Mo48AB3o+J5cLFBC770t1V2wCUG+Fab2he7/2uE97 KQsfbYyc8aolhNg0wiVUACS3Yvtwmi4EKudUs72AUL67cy8MnSek4XfI8E4o8KyPtzcp a18EsBbJ8iTE1o2Zm7BDz7CJtaEJXAjl8UjOzsdBQNLU1MKwbZx7j9t2HvlzNV7BsH1E rJAUSxo1Whvw7gCF5RTxtDsxyNoGBMM93/wkerPTrupENi7ZXjWsmCX5tLHSiYl5aau4 1tRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=X8YgwES7TplqCHtmD/bT0wPe1Le0GpgV8HcbaL2Xf2c=; b=tDx4pO+h3B9hJW2uLFnDahFTUBaIsLpJnE/1cLcul+00G6TmwTiHup8wP8r08/Wd5o s2Qbv8oXSbESp3C8y9esz41W/dgPtDW0QooiCFbd3yArYCF2Ur/Sx43m6l7emp+iBAaW Hsu086HfzB5KhgxdJ+I/KPfgyQaF4xcjTyFXRnc6S/dBW9ak/IRQQ8wsrUUB2YrBJDVz cOPhqm/I06qWHyOQMKZG1aLLEuNrCxUFv3bUuClYDU/XXMebjeiDJrXA18DF/liC1gKo SEJtbr7NNvXrUhHEYDtal5kaJ2Xdcg1ijfJP3TbuwJnL1vbY3ot3aNa5qffSC0UONt3a 8NdQ== X-Gm-Message-State: ACrzQf3iTiv06gaq58yFrXuBciLNN0oLkjBVJq1Y5itAmWCx6rr9VS+O SHVd1xlINpI0PN2mQZMlK5c= X-Google-Smtp-Source: AMsMyM4sw3xSbYcbSOD8OEi2jhQj+hy74WHs7CodVWDQZwGr6XgVyDUDsBG9I6SmnTQxDR1SQcwd4A== X-Received: by 2002:a0c:aa9e:0:b0:4a0:4909:6742 with SMTP id f30-20020a0caa9e000000b004a049096742mr12989761qvb.100.1663543598088; Sun, 18 Sep 2022 16:26:38 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id hg20-20020a05622a611400b00304fe5247bfsm9140932qtb.36.2022.09.18.16.26.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:37 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 07/13] sumhme: Convert FOO((...)) to FOO(...) Date: Sun, 18 Sep 2022 19:26:20 -0400 Message-Id: <20220918232626.1601885-8-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org With the power of variadic macros, double parentheses are unnecessary. Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 272 +++++++++++++++--------------- 1 file changed, 136 insertions(+), 136 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index cde0d8062fd3..16b81beb3ffb 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -134,17 +134,17 @@ static __inline__ void tx_dump_log(void) #endif #ifdef HMEDEBUG -#define HMD(x) printk x +#define HMD printk #else -#define HMD(x) +#define HMD(...) #endif /* #define AUTO_SWITCH_DEBUG */ #ifdef AUTO_SWITCH_DEBUG -#define ASD(x) printk x +#define ASD printk #else -#define ASD(x) +#define ASD(...) #endif #define DEFAULT_IPG0 16 /* For lance-mode only */ @@ -320,7 +320,7 @@ static int happy_meal_bb_read(struct happy_meal *hp, int retval = 0; int i; - ASD(("happy_meal_bb_read: reg=%d ", reg)); + ASD("happy_meal_bb_read: reg=%d ", reg); /* Enable the MIF BitBang outputs. */ hme_write32(hp, tregs + TCVR_BBOENAB, 1); @@ -355,7 +355,7 @@ static int happy_meal_bb_read(struct happy_meal *hp, (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); - ASD(("value=%x\n", retval)); + ASD("value=%x\n", retval); return retval; } @@ -366,7 +366,7 @@ static void happy_meal_bb_write(struct happy_meal *hp, u32 tmp; int i; - ASD(("happy_meal_bb_write: reg=%d value=%x\n", reg, value)); + ASD("happy_meal_bb_write: reg=%d value=%x\n", reg, value); /* Enable the MIF BitBang outputs. */ hme_write32(hp, tregs + TCVR_BBOENAB, 1); @@ -410,14 +410,14 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, int tries = TCVR_READ_TRIES; int retval; - ASD(("happy_meal_tcvr_read: reg=0x%02x ", reg)); + ASD("happy_meal_tcvr_read: reg=0x%02x ", reg); if (hp->tcvr_type == none) { - ASD(("no transceiver, value=TCVR_FAILURE\n")); + ASD("no transceiver, value=TCVR_FAILURE\n"); return TCVR_FAILURE; } if (!(hp->happy_flags & HFLAG_FENABLE)) { - ASD(("doing bit bang\n")); + ASD("doing bit bang\n"); return happy_meal_bb_read(hp, tregs, reg); } @@ -430,7 +430,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, return TCVR_FAILURE; } retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; - ASD(("value=%04x\n", retval)); + ASD("value=%04x\n", retval); return retval; } @@ -442,7 +442,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, { int tries = TCVR_WRITE_TRIES; - ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value)); + ASD("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value); /* Welcome to Sun Microsystems, can I take your order please? */ if (!(hp->happy_flags & HFLAG_FENABLE)) { @@ -807,7 +807,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) { int tries = TX_RESET_TRIES; - HMD(("happy_meal_tx_reset: reset, ")); + HMD("happy_meal_tx_reset: reset, "); /* Would you like to try our SMCC Delux? */ hme_write32(hp, bregs + BMAC_TXSWRESET, 0); @@ -819,7 +819,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) printk(KERN_ERR "happy meal: Transceiver BigMac ATTACK!"); /* Take care. */ - HMD(("done\n")); + HMD("done\n"); } /* hp->happy_lock must be held */ @@ -827,7 +827,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) { int tries = RX_RESET_TRIES; - HMD(("happy_meal_rx_reset: reset, ")); + HMD("happy_meal_rx_reset: reset, "); /* We have a special on GNU/Viking hardware bugs today. */ hme_write32(hp, bregs + BMAC_RXSWRESET, 0); @@ -839,7 +839,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) printk(KERN_ERR "happy meal: Receiver BigMac ATTACK!"); /* Don't forget your vik_1137125_wa. Have a nice day. */ - HMD(("done\n")); + HMD("done\n"); } #define STOP_TRIES 16 @@ -849,7 +849,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) { int tries = STOP_TRIES; - HMD(("happy_meal_stop: reset, ")); + HMD("happy_meal_stop: reset, "); /* We're consolidating our STB products, it's your lucky day. */ hme_write32(hp, gregs + GREG_SWRESET, GREG_RESET_ALL); @@ -861,7 +861,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) printk(KERN_ERR "happy meal: Fry guys."); /* Remember: "Different name, same old buggy as shit hardware." */ - HMD(("done\n")); + HMD("done\n"); } /* hp->happy_lock must be held */ @@ -890,21 +890,21 @@ static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs) /* hp->happy_lock must be held */ static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) { - ASD(("happy_meal_poll_stop: ")); + ASD("happy_meal_poll_stop: "); /* If polling disabled or not polling already, nothing to do. */ if ((hp->happy_flags & (HFLAG_POLLENABLE | HFLAG_POLL)) != (HFLAG_POLLENABLE | HFLAG_POLL)) { - HMD(("not polling, return\n")); + HMD("not polling, return\n"); return; } /* Shut up the MIF. */ - ASD(("were polling, mif ints off, ")); + ASD("were polling, mif ints off, "); hme_write32(hp, tregs + TCVR_IMASK, 0xffff); /* Turn off polling. */ - ASD(("polling off, ")); + ASD("polling off, "); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PENABLE)); @@ -913,7 +913,7 @@ static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) /* Let the bits set. */ udelay(200); - ASD(("done\n")); + ASD("done\n"); } /* Only Sun can take such nice parts and fuck up the programming interface @@ -929,44 +929,44 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) int result, tries = TCVR_RESET_TRIES; tconfig = hme_read32(hp, tregs + TCVR_CFG); - ASD(("happy_meal_tcvr_reset: tcfg<%08lx> ", tconfig)); + ASD("happy_meal_tcvr_reset: tcfg<%08lx> ", tconfig); if (hp->tcvr_type == external) { - ASD(("external<")); + ASD("external<"); hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hp->tcvr_type = internal; hp->paddr = TCV_PADDR_ITX; - ASD(("ISOLATE,")); + ASD("ISOLATE,"); happy_meal_tcvr_write(hp, tregs, MII_BMCR, (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE)); result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); if (result == TCVR_FAILURE) { - ASD(("phyread_fail>\n")); + ASD("phyread_fail>\n"); return -1; } - ASD(("phyread_ok,PSELECT>")); + ASD("phyread_ok,PSELECT>"); hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hp->tcvr_type = external; hp->paddr = TCV_PADDR_ETX; } else { if (tconfig & TCV_CFG_MDIO1) { - ASD(("internal\n")); + ASD("phyread_fail>\n"); return -1; } - ASD(("phyread_ok,~PSELECT>")); + ASD("phyread_ok,~PSELECT>"); hme_write32(hp, tregs + TCVR_CFG, (tconfig & ~(TCV_CFG_PSELECT))); hp->tcvr_type = internal; hp->paddr = TCV_PADDR_ITX; } } - ASD(("BMCR_RESET ")); + ASD("BMCR_RESET "); happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET); while (--tries) { @@ -979,10 +979,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) udelay(20); } if (!tries) { - ASD(("BMCR RESET FAILED!\n")); + ASD("BMCR RESET FAILED!\n"); return -1; } - ASD(("RESET_OK\n")); + ASD("RESET_OK\n"); /* Get fresh copies of the PHY registers. */ hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); @@ -990,7 +990,7 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2); hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); - ASD(("UNISOLATE")); + ASD("UNISOLATE"); hp->sw_bmcr &= ~(BMCR_ISOLATE); happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -1004,10 +1004,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) udelay(20); } if (!tries) { - ASD((" FAILED!\n")); + ASD(" FAILED!\n"); return -1; } - ASD((" SUCCESS and CSCONFIG_DFBYPASS\n")); + ASD(" SUCCESS and CSCONFIG_DFBYPASS\n"); if (!is_lucent_phy(hp)) { result = happy_meal_tcvr_read(hp, tregs, DP83840_CSCONFIG); @@ -1025,60 +1025,60 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr { unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG); - ASD(("happy_meal_transceiver_check: tcfg=%08lx ", tconfig)); + ASD("happy_meal_transceiver_check: tcfg=%08lx ", tconfig); if (hp->happy_flags & HFLAG_POLL) { /* If we are polling, we must stop to get the transceiver type. */ - ASD((" ")); + ASD(" "); if (hp->tcvr_type == internal) { if (tconfig & TCV_CFG_MDIO1) { - ASD((" ")); + ASD(" "); happy_meal_poll_stop(hp, tregs); hp->paddr = TCV_PADDR_ETX; hp->tcvr_type = external; - ASD(("\n")); + ASD("\n"); tconfig &= ~(TCV_CFG_PENABLE); tconfig |= TCV_CFG_PSELECT; hme_write32(hp, tregs + TCVR_CFG, tconfig); } } else { if (hp->tcvr_type == external) { - ASD((" ")); + ASD(" "); if (!(hme_read32(hp, tregs + TCVR_STATUS) >> 16)) { - ASD((" ")); + ASD(" "); happy_meal_poll_stop(hp, tregs); hp->paddr = TCV_PADDR_ITX; hp->tcvr_type = internal; - ASD(("\n")); + ASD("\n"); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PSELECT)); } - ASD(("\n")); + ASD("\n"); } else { - ASD(("\n")); + ASD("\n"); } } } else { u32 reread = hme_read32(hp, tregs + TCVR_CFG); /* Else we can just work off of the MDIO bits. */ - ASD((" ")); + ASD(" "); if (reread & TCV_CFG_MDIO1) { hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hp->paddr = TCV_PADDR_ETX; hp->tcvr_type = external; - ASD(("\n")); + ASD("\n"); } else { if (reread & TCV_CFG_MDIO0) { hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hp->paddr = TCV_PADDR_ITX; hp->tcvr_type = internal; - ASD(("\n")); + ASD("\n"); } else { printk(KERN_ERR "happy meal: Transceiver and a coke please."); hp->tcvr_type = none; /* Grrr... */ - ASD(("\n")); + ASD("\n"); } } } @@ -1185,15 +1185,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("happy_meal_init_rings: counters to zero, "); 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, "); happy_meal_clean_rings(hp); /* Now get new skippy bufs for the receive ring. */ - HMD(("init rxring, ")); + HMD("init rxring, "); for (i = 0; i < RX_RING_SIZE; i++) { struct sk_buff *skb; u32 mapping; @@ -1220,11 +1220,11 @@ static void happy_meal_init_rings(struct happy_meal *hp) skb_reserve(skb, RX_OFFSET); } - HMD(("init txring, ")); + HMD("init txring, "); for (i = 0; i < TX_RING_SIZE; i++) hme_write_txd(hp, &hb->happy_meal_txd[i], 0, 0); - HMD(("done\n")); + HMD("done\n"); } /* hp->happy_lock must be held */ @@ -1272,15 +1272,15 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, */ #ifdef AUTO_SWITCH_DEBUG - ASD(("%s: Advertising [ ", hp->dev->name)); + ASD("%s: Advertising [ ", hp->dev->name); if (hp->sw_advertise & ADVERTISE_10HALF) - ASD(("10H ")); + ASD("10H "); if (hp->sw_advertise & ADVERTISE_10FULL) - ASD(("10F ")); + ASD("10F "); if (hp->sw_advertise & ADVERTISE_100HALF) - ASD(("100H ")); + ASD("100H "); if (hp->sw_advertise & ADVERTISE_100FULL) - ASD(("100F ")); + ASD("100F "); #endif /* Enable Auto-Negotiation, this is usually on already... */ @@ -1364,65 +1364,65 @@ static int happy_meal_init(struct happy_meal *hp) /* If auto-negotiation timer is running, kill it. */ del_timer(&hp->happy_timer); - HMD(("happy_meal_init: happy_flags[%08x] ", - hp->happy_flags)); + HMD("happy_meal_init: happy_flags[%08x] ", + hp->happy_flags); if (!(hp->happy_flags & HFLAG_INIT)) { - HMD(("set HFLAG_INIT, ")); + HMD("set HFLAG_INIT, "); hp->happy_flags |= HFLAG_INIT; happy_meal_get_counters(hp, bregs); } /* Stop polling. */ - HMD(("to happy_meal_poll_stop\n")); + HMD("to happy_meal_poll_stop\n"); happy_meal_poll_stop(hp, tregs); /* Stop transmitter and receiver. */ - HMD(("happy_meal_init: to happy_meal_stop\n")); + HMD("happy_meal_init: to happy_meal_stop\n"); happy_meal_stop(hp, gregs); /* Alloc and reset the tx/rx descriptor chains. */ - HMD(("happy_meal_init: to happy_meal_init_rings\n")); + HMD("happy_meal_init: to happy_meal_init_rings\n"); happy_meal_init_rings(hp); /* Shut up the MIF. */ - HMD(("happy_meal_init: Disable all MIF irqs (old[%08x]), ", - hme_read32(hp, tregs + TCVR_IMASK))); + HMD("happy_meal_init: Disable all MIF irqs (old[%08x]), ", + hme_read32(hp, tregs + TCVR_IMASK)); hme_write32(hp, tregs + TCVR_IMASK, 0xffff); /* See if we can enable the MIF frame on this card to speak to the DP83840. */ if (hp->happy_flags & HFLAG_FENABLE) { - HMD(("use frame old[%08x], ", - hme_read32(hp, tregs + TCVR_CFG))); + HMD("use frame old[%08x], ", + hme_read32(hp, tregs + TCVR_CFG)); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE)); } else { - HMD(("use bitbang old[%08x], ", - hme_read32(hp, tregs + TCVR_CFG))); + HMD("use bitbang old[%08x], ", + hme_read32(hp, tregs + TCVR_CFG)); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE); } /* Check the state of the transceiver. */ - HMD(("to happy_meal_transceiver_check\n")); + HMD("to happy_meal_transceiver_check\n"); happy_meal_transceiver_check(hp, tregs); /* Put the Big Mac into a sane state. */ - HMD(("happy_meal_init: ")); + HMD("happy_meal_init: "); switch(hp->tcvr_type) { case none: /* Cannot operate if we don't know the transceiver type! */ - HMD(("AAIEEE no transceiver type, EAGAIN")); + HMD("AAIEEE no transceiver type, EAGAIN"); return -EAGAIN; case internal: /* Using the MII buffers. */ - HMD(("internal, using MII, ")); + HMD("internal, using MII, "); hme_write32(hp, bregs + BMAC_XIFCFG, 0); break; case external: /* Not using the MII, disable it. */ - HMD(("external, disable MII, ")); + HMD("external, disable MII, "); hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB); break; } @@ -1431,18 +1431,18 @@ static int happy_meal_init(struct happy_meal *hp) return -EAGAIN; /* Reset the Happy Meal Big Mac transceiver and the receiver. */ - HMD(("tx/rx reset, ")); + HMD("tx/rx reset, "); happy_meal_tx_reset(hp, bregs); happy_meal_rx_reset(hp, bregs); /* Set jam size and inter-packet gaps to reasonable defaults. */ - HMD(("jsize/ipg1/ipg2, ")); + HMD("jsize/ipg1/ipg2, "); hme_write32(hp, bregs + BMAC_JSIZE, DEFAULT_JAMSIZE); hme_write32(hp, bregs + BMAC_IGAP1, DEFAULT_IPG1); hme_write32(hp, bregs + BMAC_IGAP2, DEFAULT_IPG2); /* Load up the MAC address and random seed. */ - HMD(("rseed/macaddr, ")); + HMD("rseed/macaddr, "); /* The docs recommend to use the 10LSB of our MAC here. */ hme_write32(hp, bregs + BMAC_RSEED, ((e[5] | e[4]<<8)&0x3ff)); @@ -1451,7 +1451,7 @@ static int happy_meal_init(struct happy_meal *hp) hme_write32(hp, bregs + BMAC_MACADDR1, ((e[2] << 8) | e[3])); hme_write32(hp, bregs + BMAC_MACADDR0, ((e[0] << 8) | e[1])); - HMD(("htable, ")); + HMD("htable, "); if ((hp->dev->flags & IFF_ALLMULTI) || (netdev_mc_count(hp->dev) > 64)) { hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); @@ -1481,9 +1481,9 @@ static int happy_meal_init(struct happy_meal *hp) } /* Set the RX and TX ring ptrs. */ - HMD(("ring ptrs rxr[%08x] txr[%08x]\n", - ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)), - ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0)))); + HMD("ring ptrs rxr[%08x] txr[%08x]\n", + ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)), + ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0))); hme_write32(hp, erxregs + ERX_RING, ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0))); hme_write32(hp, etxregs + ETX_RING, @@ -1501,8 +1501,8 @@ static int happy_meal_init(struct happy_meal *hp) | 0x4); /* Set the supported burst sizes. */ - HMD(("happy_meal_init: old[%08x] bursts<", - hme_read32(hp, gregs + GREG_CFG))); + HMD("happy_meal_init: old[%08x] bursts<", + hme_read32(hp, gregs + GREG_CFG)); #ifndef CONFIG_SPARC /* It is always PCI and can handle 64byte bursts. */ @@ -1531,34 +1531,34 @@ static int happy_meal_init(struct happy_meal *hp) } #endif - HMD(("64>")); + HMD("64>"); hme_write32(hp, gregs + GREG_CFG, gcfg); } else if (hp->happy_bursts & DMA_BURST32) { - HMD(("32>")); + HMD("32>"); hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST32); } else if (hp->happy_bursts & DMA_BURST16) { - HMD(("16>")); + HMD("16>"); hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST16); } else { - HMD(("XXX>")); + HMD("XXX>"); hme_write32(hp, gregs + GREG_CFG, 0); } #endif /* CONFIG_SPARC */ /* Turn off interrupts we do not want to hear. */ - HMD((", enable global interrupts, ")); + HMD(", enable global interrupts, "); hme_write32(hp, gregs + GREG_IMASK, (GREG_IMASK_GOTFRAME | GREG_IMASK_RCNTEXP | GREG_IMASK_SENTFRAME | GREG_IMASK_TXPERR)); /* Set the transmit ring buffer size. */ - HMD(("tx rsize=%d oreg[%08x], ", (int)TX_RING_SIZE, - hme_read32(hp, etxregs + ETX_RSIZE))); + HMD("tx rsize=%d oreg[%08x], ", (int)TX_RING_SIZE, + hme_read32(hp, etxregs + ETX_RSIZE)); hme_write32(hp, etxregs + ETX_RSIZE, (TX_RING_SIZE >> ETX_RSIZE_SHIFT) - 1); /* Enable transmitter DVMA. */ - HMD(("tx dma enable old[%08x], ", - hme_read32(hp, etxregs + ETX_CFG))); + HMD("tx dma enable old[%08x], ", + hme_read32(hp, etxregs + ETX_CFG)); hme_write32(hp, etxregs + ETX_CFG, hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE); @@ -1567,8 +1567,8 @@ static int happy_meal_init(struct happy_meal *hp) * properly. I cannot think of a sane way to provide complete * coverage for this hardware bug yet. */ - HMD(("erx regs bug old[%08x]\n", - hme_read32(hp, erxregs + ERX_CFG))); + HMD("erx regs bug old[%08x]\n", + hme_read32(hp, erxregs + ERX_CFG)); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); regtmp = hme_read32(hp, erxregs + ERX_CFG); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); @@ -1580,8 +1580,8 @@ static int happy_meal_init(struct happy_meal *hp) } /* Enable Big Mac hash table filter. */ - HMD(("happy_meal_init: enable hash rx_cfg_old[%08x], ", - hme_read32(hp, bregs + BMAC_RXCFG))); + HMD("happy_meal_init: enable hash rx_cfg_old[%08x], ", + hme_read32(hp, bregs + BMAC_RXCFG)); rxcfg = BIGMAC_RXCFG_HENABLE | BIGMAC_RXCFG_REJME; if (hp->dev->flags & IFF_PROMISC) rxcfg |= BIGMAC_RXCFG_PMISC; @@ -1591,7 +1591,7 @@ static int happy_meal_init(struct happy_meal *hp) udelay(10); /* Ok, configure the Big Mac transmitter. */ - HMD(("BIGMAC init, ")); + HMD("BIGMAC init, "); regtmp = 0; if (hp->happy_flags & HFLAG_FULL) regtmp |= BIGMAC_TXCFG_FULLDPLX; @@ -1615,14 +1615,14 @@ static int happy_meal_init(struct happy_meal *hp) if (hp->tcvr_type == external) regtmp |= BIGMAC_XCFG_MIIDISAB; - HMD(("XIF config old[%08x], ", - hme_read32(hp, bregs + BMAC_XIFCFG))); + HMD("XIF config old[%08x], ", + hme_read32(hp, bregs + BMAC_XIFCFG)); hme_write32(hp, bregs + BMAC_XIFCFG, regtmp); /* Start things up. */ - HMD(("tx old[%08x] and rx [%08x] ON!\n", - hme_read32(hp, bregs + BMAC_TXCFG), - hme_read32(hp, bregs + BMAC_RXCFG))); + HMD("tx old[%08x] and rx [%08x] ON!\n", + hme_read32(hp, bregs + BMAC_TXCFG), + hme_read32(hp, bregs + BMAC_RXCFG)); /* Set larger TX/RX size to allow for 802.1q */ hme_write32(hp, bregs + BMAC_TXMAX, ETH_FRAME_LEN + 8); @@ -1843,9 +1843,9 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) } #ifdef TXDEBUG -#define TXD(x) printk x +#define TXD printk #else -#define TXD(x) +#define TXD(...) #endif /* hp->happy_lock must be held */ @@ -1857,13 +1857,13 @@ static void happy_meal_tx(struct happy_meal *hp) int elem; elem = hp->tx_old; - TXD(("TX<")); + TXD("TX<"); while (elem != hp->tx_new) { struct sk_buff *skb; u32 flags, dma_addr, dma_len; int frag; - TXD(("[%d]", elem)); + TXD("[%d]", elem); this = &txbase[elem]; flags = hme_read_desc32(hp, &this->tx_flags); if (flags & TXFLAG_OWN) @@ -1899,7 +1899,7 @@ static void happy_meal_tx(struct happy_meal *hp) dev->stats.tx_packets++; } hp->tx_old = elem; - TXD((">")); + TXD(">"); if (netif_queue_stopped(dev) && TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1)) @@ -1907,9 +1907,9 @@ static void happy_meal_tx(struct happy_meal *hp) } #ifdef RXDEBUG -#define RXD(x) printk x +#define RXD printk #else -#define RXD(x) +#define RXD(...) #endif /* Originally I used to handle the allocation failure by just giving back just @@ -1928,7 +1928,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) int elem = hp->rx_new, drops = 0; u32 flags; - RXD(("RX<")); + RXD("RX<"); this = &rxbase[elem]; while (!((flags = hme_read_desc32(hp, &this->rx_flags)) & RXFLAG_OWN)) { struct sk_buff *skb; @@ -1936,11 +1936,11 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) u16 csum = flags & RXFLAG_CSUM; u32 dma_addr = hme_read_desc32(hp, &this->rx_addr); - RXD(("[%d ", elem)); + RXD("[%d ", elem); /* Check for errors. */ if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { - RXD(("ERR(%08x)]", flags)); + RXD("ERR(%08x)]", flags); dev->stats.rx_errors++; if (len < ETH_ZLEN) dev->stats.rx_length_errors++; @@ -2012,7 +2012,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) skb->csum = csum_unfold(~(__force __sum16)htons(csum)); skb->ip_summed = CHECKSUM_COMPLETE; - RXD(("len=%d csum=%4x]", len, csum)); + RXD("len=%d csum=%4x]", len, csum); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); @@ -2025,7 +2025,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) hp->rx_new = elem; if (drops) printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n", hp->dev->name); - RXD((">")); + RXD(">"); } static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) @@ -2034,32 +2034,32 @@ static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); - HMD(("happy_meal_interrupt: status=%08x ", happy_status)); + HMD("happy_meal_interrupt: status=%08x ", happy_status); spin_lock(&hp->happy_lock); if (happy_status & GREG_STAT_ERRORS) { - HMD(("ERRORS ")); + HMD("ERRORS "); if (happy_meal_is_not_so_happy(hp, /* un- */ happy_status)) goto out; } if (happy_status & GREG_STAT_MIFIRQ) { - HMD(("MIFIRQ ")); + HMD("MIFIRQ "); happy_meal_mif_interrupt(hp); } if (happy_status & GREG_STAT_TXALL) { - HMD(("TXALL ")); + HMD("TXALL "); happy_meal_tx(hp); } if (happy_status & GREG_STAT_RXTOHOST) { - HMD(("RXTOHOST ")); + HMD("RXTOHOST "); happy_meal_rx(hp, dev); } - HMD(("done\n")); + HMD("done\n"); out: spin_unlock(&hp->happy_lock); @@ -2077,7 +2077,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); - HMD(("quattro_interrupt: status=%08x ", happy_status)); + HMD("quattro_interrupt: status=%08x ", happy_status); if (!(happy_status & (GREG_STAT_ERRORS | GREG_STAT_MIFIRQ | @@ -2088,30 +2088,30 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) spin_lock(&hp->happy_lock); if (happy_status & GREG_STAT_ERRORS) { - HMD(("ERRORS ")); + HMD("ERRORS "); if (happy_meal_is_not_so_happy(hp, happy_status)) goto next; } if (happy_status & GREG_STAT_MIFIRQ) { - HMD(("MIFIRQ ")); + HMD("MIFIRQ "); happy_meal_mif_interrupt(hp); } if (happy_status & GREG_STAT_TXALL) { - HMD(("TXALL ")); + HMD("TXALL "); happy_meal_tx(hp); } if (happy_status & GREG_STAT_RXTOHOST) { - HMD(("RXTOHOST ")); + HMD("RXTOHOST "); happy_meal_rx(hp, dev); } next: spin_unlock(&hp->happy_lock); } - HMD(("done\n")); + HMD("done\n"); return IRQ_HANDLED; } @@ -2122,7 +2122,7 @@ static int happy_meal_open(struct net_device *dev) struct happy_meal *hp = netdev_priv(dev); int res; - HMD(("happy_meal_open: ")); + HMD("happy_meal_open: "); /* On SBUS Quattro QFE cards, all hme interrupts are concentrated * into a single source which we register handling at probe time. @@ -2131,7 +2131,7 @@ static int happy_meal_open(struct net_device *dev) res = request_irq(hp->irq, happy_meal_interrupt, IRQF_SHARED, dev->name, dev); if (res) { - HMD(("EAGAIN\n")); + HMD("EAGAIN\n"); printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n", hp->irq); @@ -2139,7 +2139,7 @@ static int happy_meal_open(struct net_device *dev) } } - HMD(("to happy_meal_init\n")); + HMD("to happy_meal_init\n"); spin_lock_irq(&hp->happy_lock); res = happy_meal_init(hp); @@ -2174,9 +2174,9 @@ static int happy_meal_close(struct net_device *dev) } #ifdef SXDEBUG -#define SXD(x) printk x +#define SXD printk #else -#define SXD(x) +#define SXD(...) #endif static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) @@ -2244,7 +2244,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, } entry = hp->tx_new; - SXD(("SX", len, entry)); + SXD("SX", len, entry); hp->tx_skbs[entry] = skb; if (skb_shinfo(skb)->nr_frags == 0) { From patchwork Sun Sep 18 23:26:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979618 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED44DC54EE9 for ; Sun, 18 Sep 2022 23:26:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229768AbiIRX0w (ORCPT ); Sun, 18 Sep 2022 19:26:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbiIRX0l (ORCPT ); Sun, 18 Sep 2022 19:26:41 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A9321707C; Sun, 18 Sep 2022 16:26:39 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id s13so20746206qvq.10; Sun, 18 Sep 2022 16:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=8N8HEycdLAoSNsPU4lmWCROhFmQPZjZr+OJRW3/rKd0=; b=K9q7paqQVbU9FYFCjsqXw5JEKel5oFfCe/cAO14DeKrFeNFaGDIaxSrPbFa9ppUU14 4u792xWpJlprz1y4TG2CloFYhNXcCg1LPgkzKADNAxBmS9fHT5NA4dkTOnf9XkJ/Xxjs eLHLo2OPDorUvao9s/r4laxP5FxNSoEWRODKPsOyBTQ7Ebn0Q5RIxq/trBu6WKO5Kt5q Mr9KhIA8FoKPYUQIyP9w5DrhjW3QijskZeDWxV6wUE+mX5YypNAKMCjIVg8msOTzJaT3 4+jH0eYZ+ARCoFVijJKFuNp2YSSA1tEeQn7C5jEd28MpsawWaTGi4/1jqKw6KXeGQn0x JgxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=8N8HEycdLAoSNsPU4lmWCROhFmQPZjZr+OJRW3/rKd0=; b=kol6MmNIgHbH5f0FjxwAO1UfACYvbmiOkZEOCOMpr9NOf+hdjO5mOUB4xJYfDOf6tu g+MDfFj8+cAPyscAsZKnCz6Jd5SQjEpjUti+2/ARtPy/JUaCBeLqjNxWvBEUo/UqW5F5 qgpcFJUPxmCi/Xr+6p0TsWxcWUfnmr+EHC7b1vmn/vZ/wGELR/uJTJXBFa1lpUEc1cDg Pyt22xgBZyFpedF9lS7XEhHIrxAX9WflEETnKL42LzIMlSI5R3gHNmu7hneq38gHvvBB lhr3N3KPUBJ0JIrQtlVj322pOx3QNxl/RL0C5UxArRH0Ym7CoFXR7QIPvNNuK3d12sQB H62g== X-Gm-Message-State: ACrzQf0aNNxPhXACYLaH1f0DAiFj4wi5LD0h5TTwyDsRuPTgEtXDQySO ZgulnBHU71wSten29vk3S8Q= X-Google-Smtp-Source: AMsMyM5sz+3JPn51EcZhPgX4aUtfLiBqg2O6Hjj2HytisO/DNPN4iS6e6bJkMU/xJVApqS50GsDvyg== X-Received: by 2002:a05:6214:508b:b0:4ac:bb3f:dcc3 with SMTP id kk11-20020a056214508b00b004acbb3fdcc3mr12347403qvb.8.1663543599330; Sun, 18 Sep 2022 16:26:39 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id s14-20020ac85ece000000b00339b8a5639csm9350216qtx.95.2022.09.18.16.26.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:38 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 08/13] sunhme: Clean up debug infrastructure Date: Sun, 18 Sep 2022 19:26:21 -0400 Message-Id: <20220918232626.1601885-9-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Remove all the single-use debug conditionals, and just collect the debug defines at the top of the file. HMD seems like it is used for general debug info, so just redefine it as pr_debug. Additionally, instead of using the default loglevel, use the debug loglevel for debugging. Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 72 ++++++++++++++----------------- 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 16b81beb3ffb..ae206d552c27 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -80,13 +80,37 @@ static struct quattro *qfe_sbus_list; static struct quattro *qfe_pci_list; #endif -#undef HMEDEBUG -#undef SXDEBUG -#undef RXDEBUG -#undef TXDEBUG -#undef TXLOGGING +#define HMD pr_debug -#ifdef TXLOGGING +/* "Auto Switch Debug" aka phy debug */ +#if 0 +#define ASD pr_debug +#else +#define ASD(...) +#endif + +/* Transmit debug */ +#if 0 +#define TXD pr_debug +#else +#define TXD(...) +#endif + +/* Skid buffer debug */ +#if 0 +#define SXD pr_debug +#else +#define SXD(...) +#endif + +/* Receive debug */ +#if 0 +#define RXD pr_debug +#else +#define RXD(...) +#endif + +#if 0 struct hme_tx_logent { unsigned int tstamp; int tx_new, tx_old; @@ -129,22 +153,8 @@ static __inline__ void tx_dump_log(void) } } #else -#define tx_add_log(hp, a, s) do { } while(0) -#define tx_dump_log() do { } while(0) -#endif - -#ifdef HMEDEBUG -#define HMD printk -#else -#define HMD(...) -#endif - -/* #define AUTO_SWITCH_DEBUG */ - -#ifdef AUTO_SWITCH_DEBUG -#define ASD printk -#else -#define ASD(...) +#define tx_add_log(hp, a, s) +#define tx_dump_log() #endif #define DEFAULT_IPG0 16 /* For lance-mode only */ @@ -1842,12 +1852,6 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) happy_meal_poll_stop(hp, tregs); } -#ifdef TXDEBUG -#define TXD printk -#else -#define TXD(...) -#endif - /* hp->happy_lock must be held */ static void happy_meal_tx(struct happy_meal *hp) { @@ -1906,12 +1910,6 @@ static void happy_meal_tx(struct happy_meal *hp) netif_wake_queue(dev); } -#ifdef RXDEBUG -#define RXD printk -#else -#define RXD(...) -#endif - /* Originally I used to handle the allocation failure by just giving back just * that one ring buffer to the happy meal. Problem is that usually when that * condition is triggered, the happy meal expects you to do something reasonable @@ -2173,12 +2171,6 @@ static int happy_meal_close(struct net_device *dev) return 0; } -#ifdef SXDEBUG -#define SXD printk -#else -#define SXD(...) -#endif - static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) { struct happy_meal *hp = netdev_priv(dev); From patchwork Sun Sep 18 23:26:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979620 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72612ECAAD8 for ; Sun, 18 Sep 2022 23:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229778AbiIRX04 (ORCPT ); Sun, 18 Sep 2022 19:26:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbiIRX0u (ORCPT ); Sun, 18 Sep 2022 19:26:50 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C21517589; Sun, 18 Sep 2022 16:26:41 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id j10so16825794qtv.4; Sun, 18 Sep 2022 16:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=xlCv0mUONRDaVOul0QWyJAalZFYqyg9KokoQ29OLnNg=; b=qeKW5qRHbceOekR8RWMwEuBF8+sE8MFm7B01So6BpyIn3q4aZEjkRlnLjOGhMGlAts r6Eg2xa3cdgM0I7xocTbUnl9VymYCbTP8lF/DAjFiEoz111kGpAU2vZIBepMd1YJW5AL I0ldeLZKnf2KjnDjsw0CKKpjHotavK4IgHL2O+NST7lo3693Fp3wxYt3I1jyoctu3wzG 2oO7yE/K4iW9IXJsXQDK3HOeZmraCd30yrL0Zf5KZeXcX36jh/4FEAEeIdYUtcWoaJ6V +PkebeoaYqnspZ8vubfrXcqzHEgTzyHD54eIZFlGu/Pa8oF6nibwYKl+SxNIef2yZ5Gt 4Mvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=xlCv0mUONRDaVOul0QWyJAalZFYqyg9KokoQ29OLnNg=; b=rmBME5evyIPdiS02Yx+L1rR11biZm2M769fu4d4GydVHuQO8u0DAw9YWtW9raoPo0J FQS0C91Ag8QrOqQxPs8kzxIStUBMYYysdYg5pgGTxppgsfeVZxLDQmjWntXega/CtgZf kzLat6XP5g/PL/oVN8xI+4llvCG/JIHfWsKnPYtGoUm08ik65tdWCac9jP9ZPWLqOLum JBrBSJsVr7MllUzJqW32DVSiXFCRySSZnH3ty8dWOAoLS5Cc54S+B5M+88z+YnJhXmnk tHT9itPu1cvi1Gq/0ciUDMKEaqRA0+Fn4A7OxqEjyogFTwKxly5PksnEF/q2X4lqG1Zr wwAQ== X-Gm-Message-State: ACrzQf0YVqkTG8IbQF6kcfJuh9INiGYKct8Ys9tvodojBtUezW7KwATo 1UgehmAFupSP6iAITXydEL8= X-Google-Smtp-Source: AMsMyM6KPq29vkt8d2Hj+Idj6/onrQSIRogEafu9F69BbppoxT7omQ8AYJK78hE5jmugxqVF8VgA7w== X-Received: by 2002:a05:622a:2cc:b0:35c:ba98:a026 with SMTP id a12-20020a05622a02cc00b0035cba98a026mr12943469qtx.160.1663543600492; Sun, 18 Sep 2022 16:26:40 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id f16-20020a05620a20d000b006b95b0a714esm10377230qka.17.2022.09.18.16.26.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:40 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 09/13] sunhme: Convert printk(KERN_FOO ...) to pr_foo(...) Date: Sun, 18 Sep 2022 19:26:22 -0400 Message-Id: <20220918232626.1601885-10-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This is a mostly-mechanical translation of the existing printks into pr_foos. In several places, I have pasted messages which were broken over several lines to allow for easier grepping. Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 152 +++++++++++++++--------------- 1 file changed, 78 insertions(+), 74 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index ae206d552c27..fab0c73e27ed 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -145,7 +145,7 @@ static __inline__ void tx_dump_log(void) this = txlog_cur_entry; for (i = 0; i < TX_LOG_LEN; i++) { - printk("TXLOG[%d]: j[%08x] tx[N(%d)O(%d)] action[%08x] stat[%08x]\n", i, + pr_err("TXLOG[%d]: j[%08x] tx[N(%d)O(%d)] action[%08x] stat[%08x]\n", i, tx_log[this].tstamp, tx_log[this].tx_new, tx_log[this].tx_old, tx_log[this].action, tx_log[this].status); @@ -436,7 +436,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries) udelay(20); if (!tries) { - printk(KERN_ERR "happy meal: Aieee, transceiver MIF read bolixed\n"); + pr_err("happy meal: Aieee, transceiver MIF read bolixed\n"); return TCVR_FAILURE; } retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; @@ -469,7 +469,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, /* Anything else? */ if (!tries) - printk(KERN_ERR "happy meal: Aieee, transceiver MIF write bolixed\n"); + pr_err("happy meal: Aieee, transceiver MIF write bolixed\n"); /* Fifty-two cents is your change, have a nice day. */ } @@ -647,8 +647,8 @@ static void happy_meal_timer(struct timer_list *t) /* Enter force mode. */ do_force_mode: hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); - printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful, trying force link mode\n", - hp->dev->name); + pr_notice("%s: Auto-Negotiation unsuccessful, trying force link mode\n", + hp->dev->name); hp->sw_bmcr = BMCR_SPEED100; happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -707,8 +707,8 @@ static void happy_meal_timer(struct timer_list *t) restart_timer = 0; } else { if (hp->timer_ticks >= 10) { - printk(KERN_NOTICE "%s: Auto negotiation successful, link still " - "not completely up.\n", hp->dev->name); + pr_notice("%s: Auto negotiation successful, link still not completely up.\n", + hp->dev->name); hp->timer_ticks = 0; restart_timer = 1; } else { @@ -763,14 +763,14 @@ static void happy_meal_timer(struct timer_list *t) */ /* Let the user know... */ - printk(KERN_NOTICE "%s: Link down, cable problem?\n", - hp->dev->name); + pr_notice("%s: Link down, cable problem?\n", + hp->dev->name); ret = happy_meal_init(hp); if (ret) { /* ho hum... */ - printk(KERN_ERR "%s: Error, cannot re-init the " - "Happy Meal.\n", hp->dev->name); + pr_err("%s: Error, cannot re-init the Happy Meal.\n", + hp->dev->name); } goto out; } @@ -792,7 +792,7 @@ static void happy_meal_timer(struct timer_list *t) case asleep: default: /* Can't happens.... */ - printk(KERN_ERR "%s: Aieee, link timer is asleep but we got one anyways!\n", + pr_err("%s: Aieee, link timer is asleep but we got one anyways!\n", hp->dev->name); restart_timer = 0; hp->timer_ticks = 0; @@ -826,7 +826,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) /* Lettuce, tomato, buggy hardware (no extra charge)? */ if (!tries) - printk(KERN_ERR "happy meal: Transceiver BigMac ATTACK!"); + pr_err("happy meal: Transceiver BigMac ATTACK!"); /* Take care. */ HMD("done\n"); @@ -846,7 +846,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) /* Will that be all? */ if (!tries) - printk(KERN_ERR "happy meal: Receiver BigMac ATTACK!"); + pr_err("happy meal: Receiver BigMac ATTACK!"); /* Don't forget your vik_1137125_wa. Have a nice day. */ HMD("done\n"); @@ -868,7 +868,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) /* Come back next week when we are "Sun Microelectronics". */ if (!tries) - printk(KERN_ERR "happy meal: Fry guys."); + pr_err("happy meal: Fry guys."); /* Remember: "Different name, same old buggy as shit hardware." */ HMD("done\n"); @@ -1086,7 +1086,7 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr hp->tcvr_type = internal; ASD("\n"); } else { - printk(KERN_ERR "happy meal: Transceiver and a coke please."); + pr_err("happy meal: Transceiver and a coke please."); hp->tcvr_type = none; /* Grrr... */ ASD("\n"); } @@ -1311,10 +1311,10 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, udelay(10); } if (!timeout) { - printk(KERN_ERR "%s: Happy Meal would not start auto negotiation " - "BMCR=0x%04x\n", hp->dev->name, hp->sw_bmcr); - printk(KERN_NOTICE "%s: Performing force link detection.\n", - hp->dev->name); + pr_err("%s: Happy Meal would not start auto negotiation BMCR=0x%04x\n", + hp->dev->name, hp->sw_bmcr); + pr_notice("%s: Performing force link detection.\n", + hp->dev->name); goto force_link; } else { hp->timer_state = arbwait; @@ -1583,8 +1583,8 @@ static int happy_meal_init(struct happy_meal *hp) regtmp = hme_read32(hp, erxregs + ERX_CFG); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); if (hme_read32(hp, erxregs + ERX_CFG) != ERX_CFG_DEFAULT(RX_OFFSET)) { - printk(KERN_ERR "happy meal: Eieee, rx config register gets greasy fries.\n"); - printk(KERN_ERR "happy meal: Trying to set %08x, reread gives %08x\n", + pr_err("happy meal: Eieee, rx config register gets greasy fries.\n"); + pr_err("happy meal: Trying to set %08x, reread gives %08x\n", ERX_CFG_DEFAULT(RX_OFFSET), regtmp); /* XXX Should return failure here... */ } @@ -1722,24 +1722,26 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) GREG_STAT_MIFIRQ | GREG_STAT_TXEACK | GREG_STAT_TXLERR | GREG_STAT_TXPERR | GREG_STAT_TXTERR | GREG_STAT_SLVERR | GREG_STAT_SLVPERR)) - printk(KERN_ERR "%s: Error interrupt for happy meal, status = %08x\n", + pr_err("%s: Error interrupt for happy meal, status = %08x\n", hp->dev->name, status); if (status & GREG_STAT_RFIFOVF) { /* Receive FIFO overflow is harmless and the hardware will take care of it, just some packets are lost. Who cares. */ - printk(KERN_DEBUG "%s: Happy Meal receive FIFO overflow.\n", hp->dev->name); + pr_debug("%s: Happy Meal receive FIFO overflow.\n", + hp->dev->name); } if (status & GREG_STAT_STSTERR) { /* BigMAC SQE link test failed. */ - printk(KERN_ERR "%s: Happy Meal BigMAC SQE test failed.\n", hp->dev->name); + pr_err("%s: Happy Meal BigMAC SQE test failed.\n", + hp->dev->name); reset = 1; } if (status & GREG_STAT_TFIFO_UND) { /* Transmit FIFO underrun, again DMA error likely. */ - printk(KERN_ERR "%s: Happy Meal transmitter FIFO underrun, DMA error.\n", + pr_err("%s: Happy Meal transmitter FIFO underrun, DMA error.\n", hp->dev->name); reset = 1; } @@ -1748,7 +1750,8 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Driver error, tried to transmit something larger * than ethernet max mtu. */ - printk(KERN_ERR "%s: Happy Meal MAX Packet size error.\n", hp->dev->name); + pr_err("%s: Happy Meal MAX Packet size error.\n", + hp->dev->name); reset = 1; } @@ -1758,14 +1761,13 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) * faster than the interrupt handler could keep up * with. */ - printk(KERN_INFO "%s: Happy Meal out of receive " - "descriptors, packet dropped.\n", - hp->dev->name); + pr_info("%s: Happy Meal out of receive descriptors, packet dropped.\n", + hp->dev->name); } if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) { /* All sorts of DMA receive errors. */ - printk(KERN_ERR "%s: Happy Meal rx DMA errors [ ", hp->dev->name); + pr_err("%s: Happy Meal rx DMA errors [ ", hp->dev->name); if (status & GREG_STAT_RXERR) printk("GenericError "); if (status & GREG_STAT_RXPERR) @@ -1780,20 +1782,20 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Driver bug, didn't set EOP bit in tx descriptor given * to the happy meal. */ - printk(KERN_ERR "%s: EOP not set in happy meal transmit descriptor!\n", + pr_err("%s: EOP not set in happy meal transmit descriptor!\n", hp->dev->name); reset = 1; } if (status & GREG_STAT_MIFIRQ) { /* MIF signalled an interrupt, were we polling it? */ - printk(KERN_ERR "%s: Happy Meal MIF interrupt.\n", hp->dev->name); + pr_err("%s: Happy Meal MIF interrupt.\n", hp->dev->name); } if (status & (GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) { /* All sorts of transmit DMA errors. */ - printk(KERN_ERR "%s: Happy Meal tx DMA errors [ ", hp->dev->name); + pr_err("%s: Happy Meal tx DMA errors [ ", hp->dev->name); if (status & GREG_STAT_TXEACK) printk("GenericError "); if (status & GREG_STAT_TXLERR) @@ -1810,14 +1812,14 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Bus or parity error when cpu accessed happy meal registers * or it's internal FIFO's. Should never see this. */ - printk(KERN_ERR "%s: Happy Meal register access SBUS slave (%s) error.\n", + pr_err("%s: Happy Meal register access SBUS slave (%s) error.\n", hp->dev->name, (status & GREG_STAT_SLVPERR) ? "parity" : "generic"); reset = 1; } if (reset) { - printk(KERN_NOTICE "%s: Resetting...\n", hp->dev->name); + pr_notice("%s: Resetting...\n", hp->dev->name); happy_meal_init(hp); return 1; } @@ -1829,22 +1831,25 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) { void __iomem *tregs = hp->tcvregs; - printk(KERN_INFO "%s: Link status change.\n", hp->dev->name); + pr_info("%s: Link status change.\n", hp->dev->name); hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); /* Use the fastest transmission protocol possible. */ if (hp->sw_lpa & LPA_100FULL) { - printk(KERN_INFO "%s: Switching to 100Mbps at full duplex.", hp->dev->name); + pr_info("%s: Switching to 100Mbps at full duplex.", + hp->dev->name); hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); } else if (hp->sw_lpa & LPA_100HALF) { - printk(KERN_INFO "%s: Switching to 100MBps at half duplex.", hp->dev->name); + pr_info("%s: Switching to 100MBps at half duplex.", + hp->dev->name); hp->sw_bmcr |= BMCR_SPEED100; } else if (hp->sw_lpa & LPA_10FULL) { - printk(KERN_INFO "%s: Switching to 10MBps at full duplex.", hp->dev->name); + pr_info("%s: Switching to 10MBps at full duplex.", + hp->dev->name); hp->sw_bmcr |= BMCR_FULLDPLX; } else { - printk(KERN_INFO "%s: Using 10Mbps at half duplex.", hp->dev->name); + pr_info("%s: Using 10Mbps at half duplex.", hp->dev->name); } happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -2022,7 +2027,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) } hp->rx_new = elem; if (drops) - printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n", hp->dev->name); + pr_info("%s: Memory squeeze, deferring packet.\n", + hp->dev->name); RXD(">"); } @@ -2130,7 +2136,7 @@ static int happy_meal_open(struct net_device *dev) dev->name, dev); if (res) { HMD("EAGAIN\n"); - printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n", + pr_err("happy_meal(SBUS): Can't order irq %d to go.\n", hp->irq); return -EAGAIN; @@ -2175,12 +2181,12 @@ static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) { struct happy_meal *hp = netdev_priv(dev); - printk (KERN_ERR "%s: transmit timed out, resetting\n", dev->name); + pr_err("%s: transmit timed out, resetting\n", dev->name); tx_dump_log(); - printk (KERN_ERR "%s: Happy Status %08x TX[%08x:%08x]\n", dev->name, - hme_read32(hp, hp->gregs + GREG_STAT), - hme_read32(hp, hp->etxregs + ETX_CFG), - hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); + pr_err("%s: Happy Status %08x TX[%08x:%08x]\n", dev->name, + hme_read32(hp, hp->gregs + GREG_STAT), + hme_read32(hp, hp->etxregs + ETX_CFG), + hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); spin_lock_irq(&hp->happy_lock); happy_meal_init(hp); @@ -2230,7 +2236,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, if (TX_BUFFS_AVAIL(hp) <= (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); spin_unlock_irq(&hp->happy_lock); - printk(KERN_ERR "%s: BUG! Tx Ring full when queue awake!\n", + pr_err("%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; } @@ -2529,8 +2535,8 @@ static int __init quattro_sbus_register_irqs(void) IRQF_SHARED, "Quattro", qp); if (err != 0) { - printk(KERN_ERR "Quattro HME: IRQ registration " - "error %d.\n", err); + pr_err("Quattro HME: IRQ registration error %d.\n", + err); return err; } } @@ -2638,7 +2644,7 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) SET_NETDEV_DEV(dev, &op->dev); if (hme_version_printed++ == 0) - printk(KERN_INFO "%s", version); + pr_info("%s", version); /* If user did not specify a MAC address specifically, use * the Quattro local-mac-address property... @@ -2681,35 +2687,35 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) hp->gregs = of_ioremap(&op->resource[0], 0, GREG_REG_SIZE, "HME Global Regs"); if (!hp->gregs) { - printk(KERN_ERR "happymeal: Cannot map global registers.\n"); + pr_err("happymeal: Cannot map global registers.\n"); goto err_out_free_netdev; } hp->etxregs = of_ioremap(&op->resource[1], 0, ETX_REG_SIZE, "HME TX Regs"); if (!hp->etxregs) { - printk(KERN_ERR "happymeal: Cannot map MAC TX registers.\n"); + pr_err("happymeal: Cannot map MAC TX registers.\n"); goto err_out_iounmap; } hp->erxregs = of_ioremap(&op->resource[2], 0, ERX_REG_SIZE, "HME RX Regs"); if (!hp->erxregs) { - printk(KERN_ERR "happymeal: Cannot map MAC RX registers.\n"); + pr_err("happymeal: Cannot map MAC RX registers.\n"); goto err_out_iounmap; } hp->bigmacregs = of_ioremap(&op->resource[3], 0, BMAC_REG_SIZE, "HME BIGMAC Regs"); if (!hp->bigmacregs) { - printk(KERN_ERR "happymeal: Cannot map BIGMAC registers.\n"); + pr_err("happymeal: Cannot map BIGMAC registers.\n"); goto err_out_iounmap; } hp->tcvregs = of_ioremap(&op->resource[4], 0, TCVR_REG_SIZE, "HME Tranceiver Regs"); if (!hp->tcvregs) { - printk(KERN_ERR "happymeal: Cannot map TCVR registers.\n"); + pr_err("happymeal: Cannot map TCVR registers.\n"); goto err_out_iounmap; } @@ -2776,19 +2782,18 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) err = register_netdev(hp->dev); if (err) { - printk(KERN_ERR "happymeal: Cannot register net device, " - "aborting.\n"); + pr_err("happymeal: Cannot register net device, aborting.\n"); goto err_out_free_coherent; } platform_set_drvdata(op, hp); if (qfe_slot != -1) - printk(KERN_INFO "%s: Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", - dev->name, qfe_slot); + pr_info("%s: Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", + dev->name, qfe_slot); else - printk(KERN_INFO "%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", - dev->name); + pr_info("%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", + dev->name); printk("%pM\n", dev->dev_addr); @@ -2978,7 +2983,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = -EINVAL; if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { - printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); + pr_err("happymeal(PCI): Cannot find proper PCI device base address.\n"); goto err_out_clear_quattro; } @@ -2986,15 +2991,14 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, pci_resource_len(pdev, 0), DRV_NAME); if (IS_ERR(hpreg_res)) { err = PTR_ERR(hpreg_res); - printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, " - "aborting.\n"); + pr_err("happymeal(PCI): Cannot obtain PCI resources, aborting.\n"); goto err_out_clear_quattro; } hpreg_base = pcim_iomap(pdev, 0, 0x8000); err = -ENOMEM; if (!hpreg_base) { - printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); + pr_err("happymeal(PCI): Unable to remap card memory.\n"); goto err_out_clear_quattro; } @@ -3101,8 +3105,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = devm_register_netdev(&pdev->dev, dev); if (err) { - printk(KERN_ERR "happymeal(PCI): Cannot register net device, " - "aborting.\n"); + pr_err("happymeal(PCI): Cannot register net device, aborting.\n"); goto err_out_clear_quattro; } @@ -3116,7 +3119,8 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, int i = simple_strtoul(dev->name + 3, NULL, 10); sprintf(prom_name, "-%d", i + 3); } - printk(KERN_INFO "%s%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", dev->name, prom_name); + pr_info("%s%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", + dev->name, prom_name); if (qpdev->vendor == PCI_VENDOR_ID_DEC && qpdev->device == PCI_DEVICE_ID_DEC_21153) printk("DEC 21153 PCI Bridge\n"); @@ -3126,11 +3130,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, } if (qfe_slot != -1) - printk(KERN_INFO "%s: Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", - dev->name, qfe_slot); + pr_info("%s: Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", + dev->name, qfe_slot); else - printk(KERN_INFO "%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", - dev->name); + pr_info("%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", + dev->name); printk("%pM\n", dev->dev_addr); From patchwork Sun Sep 18 23:26:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979621 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECE52ECAAD8 for ; Sun, 18 Sep 2022 23:27:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229807AbiIRX1A (ORCPT ); Sun, 18 Sep 2022 19:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbiIRX0w (ORCPT ); Sun, 18 Sep 2022 19:26:52 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B5711759E; Sun, 18 Sep 2022 16:26:43 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id g12so19251352qts.1; Sun, 18 Sep 2022 16:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=OXuwlaky2lqf8vOyWKQ2yiVvpJDM1++vRMr7F9fK1mE=; b=PNR+4yOa1XaXCP2yM8/Cw8BDJ8peWQCn3eujA++CKsylDN+zZB6c599SqdIwU5J9UW tWmRY294sMcvlb2VAFxUHKYRD171/tKBCQHxmQuHHV+PLTJcftjnbK3yvkcHr/A0CcMG thM/6fqm/9NDRNHmuB5EhtmBlCMMUFPCI8Ptc6VyZV5zwSfzehX9egVjV55NOzR26iaz N0vS0KWxDRpFHr2Dyx+/7sj/41MlEuLLks5JjsOBhTxPc7MK4s9QlIzVdAdn4B84UEHq 4bqJ7UGhWq+vZH2cUAFXHVTGaAEb14c3bJY1UIA9qNTzueRudVhmmjUCSxCLc7aIe5GK Pyew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=OXuwlaky2lqf8vOyWKQ2yiVvpJDM1++vRMr7F9fK1mE=; b=aYsJEq1OM4a1wCNL1BhkpEsi9QVbM6ULmFOhoPiELSlOJoDBscH5zjkVDSakwOoo4s pplA6u1/q+i8jPGERrwXOCQKpRGOgUZ92g8yNMhSr0iNThpLbIkf/sLJ587SZIZpeKUy 9P7lvPH/Z1KRb6dJaOaxnkvdpP4hBzTNNu5LDgKb7b+omy93nHr0E6v4gg/iABSUa4mo mG7vrfX+UjDzi4DJZxz7vjAaIATeu63vhK4MR3TDhZQgiCcQr2Ms2g58elsYTJKsqJ6l r3TIKUqMLnSDxB9j7wF/RBPAtG4OL0+Pbhks7Yud2qHv28Byz54dgYOE1+pmqrZHGKVb zoaA== X-Gm-Message-State: ACrzQf2zQYu7sIBzWce73k/t2ISW78WwVOlItRZRreUBYpsKgDpQRF+v lUiYiFyItuFptQd0vYydogo= X-Google-Smtp-Source: AMsMyM7Rq31WfxMvROrKXPSCZCN/ktn/TSmUe/KCNQwRvL5mFn1sfjITUDwZOlXB541+uPQzJNMsmA== X-Received: by 2002:ac8:5e0e:0:b0:35c:ceec:2526 with SMTP id h14-20020ac85e0e000000b0035cceec2526mr11224325qtx.496.1663543601726; Sun, 18 Sep 2022 16:26:41 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id n7-20020a372707000000b006b5bf5d45casm10844739qkn.27.2022.09.18.16.26.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:41 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 10/13] sunhme: Use (net)dev_foo wherever possible Date: Sun, 18 Sep 2022 19:26:23 -0400 Message-Id: <20220918232626.1601885-11-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Wherever possible, use the associated netdev (or device) when printing errors or other messages. This makes it immediately clear what device caused the error, and provides more information than just the device name. Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 174 +++++++++++++++--------------- 1 file changed, 85 insertions(+), 89 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index fab0c73e27ed..98c38e213bab 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -436,7 +436,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries) udelay(20); if (!tries) { - pr_err("happy meal: Aieee, transceiver MIF read bolixed\n"); + netdev_err(hp->dev, "Aieee, transceiver MIF read bolixed\n"); return TCVR_FAILURE; } retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; @@ -469,7 +469,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, /* Anything else? */ if (!tries) - pr_err("happy meal: Aieee, transceiver MIF write bolixed\n"); + netdev_err(hp->dev, "Aieee, transceiver MIF write bolixed\n"); /* Fifty-two cents is your change, have a nice day. */ } @@ -647,8 +647,8 @@ static void happy_meal_timer(struct timer_list *t) /* Enter force mode. */ do_force_mode: hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); - pr_notice("%s: Auto-Negotiation unsuccessful, trying force link mode\n", - hp->dev->name); + netdev_notice(hp->dev, + "Auto-Negotiation unsuccessful, trying force link mode\n"); hp->sw_bmcr = BMCR_SPEED100; happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -707,8 +707,8 @@ static void happy_meal_timer(struct timer_list *t) restart_timer = 0; } else { if (hp->timer_ticks >= 10) { - pr_notice("%s: Auto negotiation successful, link still not completely up.\n", - hp->dev->name); + netdev_notice(hp->dev, + "Auto negotiation successful, link still not completely up.\n"); hp->timer_ticks = 0; restart_timer = 1; } else { @@ -763,14 +763,14 @@ static void happy_meal_timer(struct timer_list *t) */ /* Let the user know... */ - pr_notice("%s: Link down, cable problem?\n", - hp->dev->name); + netdev_notice(hp->dev, + "Link down, cable problem?\n"); ret = happy_meal_init(hp); if (ret) { /* ho hum... */ - pr_err("%s: Error, cannot re-init the Happy Meal.\n", - hp->dev->name); + netdev_err(hp->dev, + "Error, cannot re-init the Happy Meal.\n"); } goto out; } @@ -792,8 +792,8 @@ static void happy_meal_timer(struct timer_list *t) case asleep: default: /* Can't happens.... */ - pr_err("%s: Aieee, link timer is asleep but we got one anyways!\n", - hp->dev->name); + netdev_err(hp->dev, + "Aieee, link timer is asleep but we got one anyways!\n"); restart_timer = 0; hp->timer_ticks = 0; hp->timer_state = asleep; /* foo on you */ @@ -826,7 +826,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) /* Lettuce, tomato, buggy hardware (no extra charge)? */ if (!tries) - pr_err("happy meal: Transceiver BigMac ATTACK!"); + netdev_err(hp->dev, "Transceiver BigMac ATTACK!"); /* Take care. */ HMD("done\n"); @@ -846,7 +846,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) /* Will that be all? */ if (!tries) - pr_err("happy meal: Receiver BigMac ATTACK!"); + netdev_err(hp->dev, "Receiver BigMac ATTACK!"); /* Don't forget your vik_1137125_wa. Have a nice day. */ HMD("done\n"); @@ -868,7 +868,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) /* Come back next week when we are "Sun Microelectronics". */ if (!tries) - pr_err("happy meal: Fry guys."); + netdev_err(hp->dev, "Fry guys."); /* Remember: "Different name, same old buggy as shit hardware." */ HMD("done\n"); @@ -1086,7 +1086,8 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr hp->tcvr_type = internal; ASD("\n"); } else { - pr_err("happy meal: Transceiver and a coke please."); + netdev_err(hp->dev, + "Transceiver and a coke please."); hp->tcvr_type = none; /* Grrr... */ ASD("\n"); } @@ -1282,7 +1283,7 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, */ #ifdef AUTO_SWITCH_DEBUG - ASD("%s: Advertising [ ", hp->dev->name); + ASD("%s: Advertising [ "); if (hp->sw_advertise & ADVERTISE_10HALF) ASD("10H "); if (hp->sw_advertise & ADVERTISE_10FULL) @@ -1311,10 +1312,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, udelay(10); } if (!timeout) { - pr_err("%s: Happy Meal would not start auto negotiation BMCR=0x%04x\n", - hp->dev->name, hp->sw_bmcr); - pr_notice("%s: Performing force link detection.\n", - hp->dev->name); + netdev_err(hp->dev, + "Happy Meal would not start auto negotiation BMCR=0x%04x\n", + hp->sw_bmcr); + netdev_notice(hp->dev, + "Performing force link detection.\n"); goto force_link; } else { hp->timer_state = arbwait; @@ -1583,9 +1585,11 @@ static int happy_meal_init(struct happy_meal *hp) regtmp = hme_read32(hp, erxregs + ERX_CFG); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); if (hme_read32(hp, erxregs + ERX_CFG) != ERX_CFG_DEFAULT(RX_OFFSET)) { - pr_err("happy meal: Eieee, rx config register gets greasy fries.\n"); - pr_err("happy meal: Trying to set %08x, reread gives %08x\n", - ERX_CFG_DEFAULT(RX_OFFSET), regtmp); + netdev_err(hp->dev, + "Eieee, rx config register gets greasy fries.\n"); + netdev_err(hp->dev, + "Trying to set %08x, reread gives %08x\n", + ERX_CFG_DEFAULT(RX_OFFSET), regtmp); /* XXX Should return failure here... */ } @@ -1722,27 +1726,26 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) GREG_STAT_MIFIRQ | GREG_STAT_TXEACK | GREG_STAT_TXLERR | GREG_STAT_TXPERR | GREG_STAT_TXTERR | GREG_STAT_SLVERR | GREG_STAT_SLVPERR)) - pr_err("%s: Error interrupt for happy meal, status = %08x\n", - hp->dev->name, status); + netdev_err(hp->dev, + "Error interrupt for happy meal, status = %08x\n", + status); if (status & GREG_STAT_RFIFOVF) { /* Receive FIFO overflow is harmless and the hardware will take care of it, just some packets are lost. Who cares. */ - pr_debug("%s: Happy Meal receive FIFO overflow.\n", - hp->dev->name); + netdev_dbg(hp->dev, "Happy Meal receive FIFO overflow.\n"); } if (status & GREG_STAT_STSTERR) { /* BigMAC SQE link test failed. */ - pr_err("%s: Happy Meal BigMAC SQE test failed.\n", - hp->dev->name); + netdev_err(hp->dev, "Happy Meal BigMAC SQE test failed.\n"); reset = 1; } if (status & GREG_STAT_TFIFO_UND) { /* Transmit FIFO underrun, again DMA error likely. */ - pr_err("%s: Happy Meal transmitter FIFO underrun, DMA error.\n", - hp->dev->name); + netdev_err(hp->dev, + "Happy Meal transmitter FIFO underrun, DMA error.\n"); reset = 1; } @@ -1750,8 +1753,7 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Driver error, tried to transmit something larger * than ethernet max mtu. */ - pr_err("%s: Happy Meal MAX Packet size error.\n", - hp->dev->name); + netdev_err(hp->dev, "Happy Meal MAX Packet size error.\n"); reset = 1; } @@ -1761,13 +1763,13 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) * faster than the interrupt handler could keep up * with. */ - pr_info("%s: Happy Meal out of receive descriptors, packet dropped.\n", - hp->dev->name); + netdev_info(hp->dev, + "Happy Meal out of receive descriptors, packet dropped.\n"); } if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) { /* All sorts of DMA receive errors. */ - pr_err("%s: Happy Meal rx DMA errors [ ", hp->dev->name); + netdev_err(hp->dev, "Happy Meal rx DMA errors [ "); if (status & GREG_STAT_RXERR) printk("GenericError "); if (status & GREG_STAT_RXPERR) @@ -1782,20 +1784,20 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Driver bug, didn't set EOP bit in tx descriptor given * to the happy meal. */ - pr_err("%s: EOP not set in happy meal transmit descriptor!\n", - hp->dev->name); + netdev_err(hp->dev, + "EOP not set in happy meal transmit descriptor!\n"); reset = 1; } if (status & GREG_STAT_MIFIRQ) { /* MIF signalled an interrupt, were we polling it? */ - pr_err("%s: Happy Meal MIF interrupt.\n", hp->dev->name); + netdev_err(hp->dev, "Happy Meal MIF interrupt.\n"); } if (status & (GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) { /* All sorts of transmit DMA errors. */ - pr_err("%s: Happy Meal tx DMA errors [ ", hp->dev->name); + netdev_err(hp->dev, "Happy Meal tx DMA errors [ "); if (status & GREG_STAT_TXEACK) printk("GenericError "); if (status & GREG_STAT_TXLERR) @@ -1812,14 +1814,14 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Bus or parity error when cpu accessed happy meal registers * or it's internal FIFO's. Should never see this. */ - pr_err("%s: Happy Meal register access SBUS slave (%s) error.\n", - hp->dev->name, - (status & GREG_STAT_SLVPERR) ? "parity" : "generic"); + netdev_err(hp->dev, + "Happy Meal register access SBUS slave (%s) error.\n", + (status & GREG_STAT_SLVPERR) ? "parity" : "generic"); reset = 1; } if (reset) { - pr_notice("%s: Resetting...\n", hp->dev->name); + netdev_notice(hp->dev, "Resetting...\n"); happy_meal_init(hp); return 1; } @@ -1831,25 +1833,22 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) { void __iomem *tregs = hp->tcvregs; - pr_info("%s: Link status change.\n", hp->dev->name); + netdev_info(hp->dev, "Link status change.\n"); hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); /* Use the fastest transmission protocol possible. */ if (hp->sw_lpa & LPA_100FULL) { - pr_info("%s: Switching to 100Mbps at full duplex.", - hp->dev->name); + netdev_info(hp->dev, "Switching to 100Mbps at full duplex."); hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); } else if (hp->sw_lpa & LPA_100HALF) { - pr_info("%s: Switching to 100MBps at half duplex.", - hp->dev->name); + netdev_info(hp->dev, "Switching to 100MBps at half duplex."); hp->sw_bmcr |= BMCR_SPEED100; } else if (hp->sw_lpa & LPA_10FULL) { - pr_info("%s: Switching to 10MBps at full duplex.", - hp->dev->name); + netdev_info(hp->dev, "Switching to 10MBps at full duplex."); hp->sw_bmcr |= BMCR_FULLDPLX; } else { - pr_info("%s: Using 10Mbps at half duplex.", hp->dev->name); + netdev_info(hp->dev, "Using 10Mbps at half duplex."); } happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -2027,8 +2026,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) } hp->rx_new = elem; if (drops) - pr_info("%s: Memory squeeze, deferring packet.\n", - hp->dev->name); + netdev_info(hp->dev, "Memory squeeze, deferring packet.\n"); RXD(">"); } @@ -2136,8 +2134,7 @@ static int happy_meal_open(struct net_device *dev) dev->name, dev); if (res) { HMD("EAGAIN\n"); - pr_err("happy_meal(SBUS): Can't order irq %d to go.\n", - hp->irq); + netdev_err(dev, "Can't order irq %d to go.\n", hp->irq); return -EAGAIN; } @@ -2181,12 +2178,12 @@ static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) { struct happy_meal *hp = netdev_priv(dev); - pr_err("%s: transmit timed out, resetting\n", dev->name); + netdev_err(dev, "transmit timed out, resetting\n"); tx_dump_log(); - pr_err("%s: Happy Status %08x TX[%08x:%08x]\n", dev->name, - hme_read32(hp, hp->gregs + GREG_STAT), - hme_read32(hp, hp->etxregs + ETX_CFG), - hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); + netdev_err(dev, "Happy Status %08x TX[%08x:%08x]\n", + hme_read32(hp, hp->gregs + GREG_STAT), + hme_read32(hp, hp->etxregs + ETX_CFG), + hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); spin_lock_irq(&hp->happy_lock); happy_meal_init(hp); @@ -2236,8 +2233,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, if (TX_BUFFS_AVAIL(hp) <= (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); spin_unlock_irq(&hp->happy_lock); - pr_err("%s: BUG! Tx Ring full when queue awake!\n", - dev->name); + netdev_err(dev, "BUG! Tx Ring full when queue awake!\n"); return NETDEV_TX_BUSY; } @@ -2535,8 +2531,9 @@ static int __init quattro_sbus_register_irqs(void) IRQF_SHARED, "Quattro", qp); if (err != 0) { - pr_err("Quattro HME: IRQ registration error %d.\n", - err); + dev_err(&op->dev, + "Quattro HME: IRQ registration error %d.\n", + err); return err; } } @@ -2643,9 +2640,6 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) goto err_out; SET_NETDEV_DEV(dev, &op->dev); - if (hme_version_printed++ == 0) - pr_info("%s", version); - /* If user did not specify a MAC address specifically, use * the Quattro local-mac-address property... */ @@ -2687,35 +2681,35 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) hp->gregs = of_ioremap(&op->resource[0], 0, GREG_REG_SIZE, "HME Global Regs"); if (!hp->gregs) { - pr_err("happymeal: Cannot map global registers.\n"); + dev_err(&op->dev, "Cannot map global registers.\n"); goto err_out_free_netdev; } hp->etxregs = of_ioremap(&op->resource[1], 0, ETX_REG_SIZE, "HME TX Regs"); if (!hp->etxregs) { - pr_err("happymeal: Cannot map MAC TX registers.\n"); + dev_err(&op->dev, "Cannot map MAC TX registers.\n"); goto err_out_iounmap; } hp->erxregs = of_ioremap(&op->resource[2], 0, ERX_REG_SIZE, "HME RX Regs"); if (!hp->erxregs) { - pr_err("happymeal: Cannot map MAC RX registers.\n"); + dev_err(&op->dev, "Cannot map MAC RX registers.\n"); goto err_out_iounmap; } hp->bigmacregs = of_ioremap(&op->resource[3], 0, BMAC_REG_SIZE, "HME BIGMAC Regs"); if (!hp->bigmacregs) { - pr_err("happymeal: Cannot map BIGMAC registers.\n"); + dev_err(&op->dev, "Cannot map BIGMAC registers.\n"); goto err_out_iounmap; } hp->tcvregs = of_ioremap(&op->resource[4], 0, TCVR_REG_SIZE, "HME Tranceiver Regs"); if (!hp->tcvregs) { - pr_err("happymeal: Cannot map TCVR registers.\n"); + dev_err(&op->dev, "Cannot map TCVR registers.\n"); goto err_out_iounmap; } @@ -2782,18 +2776,17 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) err = register_netdev(hp->dev); if (err) { - pr_err("happymeal: Cannot register net device, aborting.\n"); + dev_err(&op->dev, "Cannot register net device, aborting.\n"); goto err_out_free_coherent; } platform_set_drvdata(op, hp); if (qfe_slot != -1) - pr_info("%s: Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", - dev->name, qfe_slot); + netdev_info(dev, "Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", + qfe_slot); else - pr_info("%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", - dev->name); + netdev_info(dev, "HAPPY MEAL (SBUS) 10/100baseT Ethernet "); printk("%pM\n", dev->dev_addr); @@ -2983,7 +2976,8 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = -EINVAL; if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { - pr_err("happymeal(PCI): Cannot find proper PCI device base address.\n"); + dev_err(&pdev->dev, + "Cannot find proper PCI device base address.\n"); goto err_out_clear_quattro; } @@ -2991,14 +2985,14 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, pci_resource_len(pdev, 0), DRV_NAME); if (IS_ERR(hpreg_res)) { err = PTR_ERR(hpreg_res); - pr_err("happymeal(PCI): Cannot obtain PCI resources, aborting.\n"); + dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n"); goto err_out_clear_quattro; } hpreg_base = pcim_iomap(pdev, 0, 0x8000); err = -ENOMEM; if (!hpreg_base) { - pr_err("happymeal(PCI): Unable to remap card memory.\n"); + dev_err(&pdev->dev, "Unable to remap card memory.\n"); goto err_out_clear_quattro; } @@ -3105,7 +3099,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = devm_register_netdev(&pdev->dev, dev); if (err) { - pr_err("happymeal(PCI): Cannot register net device, aborting.\n"); + dev_err(&pdev->dev, "Cannot register net device, aborting.\n"); goto err_out_clear_quattro; } @@ -3119,8 +3113,9 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, int i = simple_strtoul(dev->name + 3, NULL, 10); sprintf(prom_name, "-%d", i + 3); } - pr_info("%s%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", - dev->name, prom_name); + netdev_info(dev, + "%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", + prom_name); if (qpdev->vendor == PCI_VENDOR_ID_DEC && qpdev->device == PCI_DEVICE_ID_DEC_21153) printk("DEC 21153 PCI Bridge\n"); @@ -3130,11 +3125,12 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, } if (qfe_slot != -1) - pr_info("%s: Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", - dev->name, qfe_slot); + netdev_info(dev, + "Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", + qfe_slot); else - pr_info("%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", - dev->name); + netdev_info(dev, + "HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet "); printk("%pM\n", dev->dev_addr); From patchwork Sun Sep 18 23:26:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979622 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED77FECAAD8 for ; Sun, 18 Sep 2022 23:27:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbiIRX1H (ORCPT ); Sun, 18 Sep 2022 19:27:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbiIRX0w (ORCPT ); Sun, 18 Sep 2022 19:26:52 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 675DB17AA5; Sun, 18 Sep 2022 16:26:44 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id g23so15103786qtu.2; Sun, 18 Sep 2022 16:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=VDl3IJS8W7F0EwnGIoeBAcDsJOYPTyHNC1/8mSeEVbA=; b=AmYZHyu0YlR+OyyfLvPdxh9CVjUzzvPNwTOj/1HiUeeZGiqQdZZXo0gy43eYLNvZld gYMSlbEEw5gOHCBAE0GikcvcOHwShEIpkv0u5SJQp51+eRMUXIpeZgs3seU4UXJjm5kH 6AtApYwpcAAcDUtmkK6esd09RLKlcYZ9ERVYjk5zkkS//49PStSi/ZLGBVspP5IDntmU s9aJT8A/wnlcI7FaYJCIThtO0cPCsevyGXYwt25Tk3P1fueg5OMFY3MVoZiDLlb1Brsl pD5/ZWl5jUb2l7xJ3KJBb7PiuO4derMItsW+TrIkdVv9v81cUpaD0RN+qzb/aPN5keiA tT+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=VDl3IJS8W7F0EwnGIoeBAcDsJOYPTyHNC1/8mSeEVbA=; b=fNCuA2Xurvq3uO3wAJV6YlmI4Y/00DPWFJq9Ksn6evZ3SVo/8HqGqcnwERvX9ma4ur LcwbVk28dCQLBVpur/XulEzGik8ksf14dfNR30i4LaREgqY35oktHe+Sq1FUACGau8lt 2buSRF1gD/QPegRUB06cJfllt+8PPEkgsmSzGMNsrU8rjR0tHcF1Z5+3AXM2qcR4prEn t9zNnhcpVKku7bkfROqFcDYWd1Sg4EWfbDY8wjkNOnJNJA8gaOejiWGJmi1nWi3M0tGc 8Aj6YcWPy6rxWLc64ExPMZIFlytZ0nbU2OkIpd312e7VVFAixU7gGe0Xwaq+R8KqjsFu MyjA== X-Gm-Message-State: ACrzQf3uQtfbQUm5OTUGdhmYFzUMcTR/PXmmiGed754nxnvD7acNBLuL tO/kU6TFRet0zeAVmgxsHAM= X-Google-Smtp-Source: AMsMyM7iGAY2QoG8ElLCYgFb4+by3Yn68P0SMUzvA6Eb7nHaq0it6KazUY7YQLCnWWHrrcqd48HoKQ== X-Received: by 2002:ac8:5c88:0:b0:35c:e18b:2be0 with SMTP id r8-20020ac85c88000000b0035ce18b2be0mr5287238qta.64.1663543602988; Sun, 18 Sep 2022 16:26:42 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id de20-20020a05620a371400b006bb49cfe147sm11056808qkb.84.2022.09.18.16.26.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:42 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 11/13] sunhme: Combine continued messages Date: Sun, 18 Sep 2022 19:26:24 -0400 Message-Id: <20220918232626.1601885-12-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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. Since (almost every) debug print included the name of the function, include it automatically. Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 278 ++++++++++++------------------ 1 file changed, 106 insertions(+), 172 deletions(-) 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 @@ -80,32 +80,33 @@ static struct quattro *qfe_sbus_list; static struct quattro *qfe_pci_list; #endif -#define HMD pr_debug +#define hme_debug(fmt, ...) pr_debug("%s: " fmt, __func__, ##__VA_ARGS__) +#define HMD hme_debug /* "Auto Switch Debug" aka phy debug */ -#if 0 -#define ASD pr_debug +#if 1 +#define ASD hme_debug #else #define ASD(...) #endif /* Transmit debug */ -#if 0 -#define TXD pr_debug +#if 1 +#define TXD hme_debug #else #define TXD(...) #endif /* Skid buffer debug */ -#if 0 -#define SXD pr_debug +#if 1 +#define SXD hme_debug #else #define SXD(...) #endif /* Receive debug */ -#if 0 -#define RXD pr_debug +#if 1 +#define RXD hme_debug #else #define RXD(...) #endif @@ -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); @@ -365,7 +365,7 @@ static int happy_meal_bb_read(struct happy_meal *hp, (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); - ASD("value=%x\n", retval); + ASD("reg=%d value=%x\n", reg, retval); return retval; } @@ -376,7 +376,7 @@ static void happy_meal_bb_write(struct happy_meal *hp, u32 tmp; int i; - ASD("happy_meal_bb_write: reg=%d value=%x\n", reg, value); + ASD("reg=%d value=%x\n", reg, value); /* Enable the MIF BitBang outputs. */ hme_write32(hp, tregs + TCVR_BBOENAB, 1); @@ -420,7 +420,6 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, int tries = TCVR_READ_TRIES; int retval; - ASD("happy_meal_tcvr_read: reg=0x%02x ", reg); if (hp->tcvr_type == none) { ASD("no transceiver, value=TCVR_FAILURE\n"); return TCVR_FAILURE; @@ -440,7 +439,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, return TCVR_FAILURE; } retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; - ASD("value=%04x\n", retval); + ASD("reg=0x%02x value=%04x\n", reg, retval); return retval; } @@ -452,7 +451,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, { int tries = TCVR_WRITE_TRIES; - ASD("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value); + ASD("reg=0x%02x value=%04x\n", reg, value); /* Welcome to Sun Microsystems, can I take your order please? */ if (!(hp->happy_flags & HFLAG_FENABLE)) { @@ -817,7 +816,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) { int tries = TX_RESET_TRIES; - HMD("happy_meal_tx_reset: reset, "); + HMD("reset...\n"); /* Would you like to try our SMCC Delux? */ hme_write32(hp, bregs + BMAC_TXSWRESET, 0); @@ -837,7 +836,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) { int tries = RX_RESET_TRIES; - HMD("happy_meal_rx_reset: reset, "); + HMD("reset...\n"); /* We have a special on GNU/Viking hardware bugs today. */ hme_write32(hp, bregs + BMAC_RXSWRESET, 0); @@ -846,7 +845,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) /* Will that be all? */ if (!tries) - netdev_err(hp->dev, "Receiver BigMac ATTACK!"); + netdev_err(hp->dev, "Receiver BigMac ATTACK!\n"); /* Don't forget your vik_1137125_wa. Have a nice day. */ HMD("done\n"); @@ -859,7 +858,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) { int tries = STOP_TRIES; - HMD("happy_meal_stop: reset, "); + HMD("reset...\n"); /* We're consolidating our STB products, it's your lucky day. */ hme_write32(hp, gregs + GREG_SWRESET, GREG_RESET_ALL); @@ -868,7 +867,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) /* Come back next week when we are "Sun Microelectronics". */ if (!tries) - netdev_err(hp->dev, "Fry guys."); + netdev_err(hp->dev, "Fry guys.\n"); /* Remember: "Different name, same old buggy as shit hardware." */ HMD("done\n"); @@ -900,21 +899,18 @@ static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs) /* hp->happy_lock must be held */ static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) { - ASD("happy_meal_poll_stop: "); - /* If polling disabled or not polling already, nothing to do. */ if ((hp->happy_flags & (HFLAG_POLLENABLE | HFLAG_POLL)) != (HFLAG_POLLENABLE | HFLAG_POLL)) { - HMD("not polling, return\n"); + ASD("not polling, return\n"); return; } /* Shut up the MIF. */ - ASD("were polling, mif ints off, "); + ASD("were polling, mif ints off, polling off\n"); hme_write32(hp, tregs + TCVR_IMASK, 0xffff); /* Turn off polling. */ - ASD("polling off, "); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PENABLE)); @@ -939,29 +935,25 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) int result, tries = TCVR_RESET_TRIES; tconfig = hme_read32(hp, tregs + TCVR_CFG); - ASD("happy_meal_tcvr_reset: tcfg<%08lx> ", tconfig); + ASD("tcfg=%08x\n", tconfig); if (hp->tcvr_type == external) { - ASD("external<"); hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hp->tcvr_type = internal; hp->paddr = TCV_PADDR_ITX; - ASD("ISOLATE,"); happy_meal_tcvr_write(hp, tregs, MII_BMCR, (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE)); result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); if (result == TCVR_FAILURE) { - ASD("phyread_fail>\n"); + ASD("phyread_fail\n"); return -1; } - ASD("phyread_ok,PSELECT>"); + ASD("external: ISOLATE, phyread_ok, PSELECT\n"); hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hp->tcvr_type = external; hp->paddr = TCV_PADDR_ETX; } else { if (tconfig & TCV_CFG_MDIO1) { - ASD("internal\n"); return -1; } - ASD("phyread_ok,~PSELECT>"); + ASD("internal: PSELECT, ISOLATE, phyread_ok, ~PSELECT\n"); hme_write32(hp, tregs + TCVR_CFG, (tconfig & ~(TCV_CFG_PSELECT))); hp->tcvr_type = internal; hp->paddr = TCV_PADDR_ITX; } } - ASD("BMCR_RESET "); + ASD("BMCR_RESET...\n"); happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET); while (--tries) { @@ -1000,7 +992,7 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2); hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); - ASD("UNISOLATE"); + ASD("UNISOLATE...\n"); hp->sw_bmcr &= ~(BMCR_ISOLATE); happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -1014,10 +1006,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) udelay(20); } if (!tries) { - ASD(" FAILED!\n"); + ASD("UNISOLATE FAILED!\n"); return -1; } - ASD(" SUCCESS and CSCONFIG_DFBYPASS\n"); + ASD("SUCCESS and CSCONFIG_DFBYPASS\n"); if (!is_lucent_phy(hp)) { result = happy_meal_tcvr_read(hp, tregs, DP83840_CSCONFIG); @@ -1035,61 +1027,55 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr { unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG); - ASD("happy_meal_transceiver_check: tcfg=%08lx ", tconfig); + ASD("tcfg=%08lx\n", tconfig); if (hp->happy_flags & HFLAG_POLL) { /* If we are polling, we must stop to get the transceiver type. */ - ASD(" "); if (hp->tcvr_type == internal) { if (tconfig & TCV_CFG_MDIO1) { - ASD(" "); happy_meal_poll_stop(hp, tregs); hp->paddr = TCV_PADDR_ETX; hp->tcvr_type = external; - ASD("\n"); tconfig &= ~(TCV_CFG_PENABLE); tconfig |= TCV_CFG_PSELECT; hme_write32(hp, tregs + TCVR_CFG, tconfig); + ASD("poll stop, internal->external\n"); } } else { if (hp->tcvr_type == external) { - ASD(" "); if (!(hme_read32(hp, tregs + TCVR_STATUS) >> 16)) { - ASD(" "); happy_meal_poll_stop(hp, tregs); hp->paddr = TCV_PADDR_ITX; hp->tcvr_type = internal; - ASD("\n"); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PSELECT)); + ASD("poll stop, external->internal\n"); } - ASD("\n"); } else { - ASD("\n"); + ASD("polling, none\n"); } } } else { u32 reread = hme_read32(hp, tregs + TCVR_CFG); /* Else we can just work off of the MDIO bits. */ - ASD(" "); if (reread & TCV_CFG_MDIO1) { hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hp->paddr = TCV_PADDR_ETX; hp->tcvr_type = external; - ASD("\n"); + ASD("not polling, external\n"); } else { if (reread & TCV_CFG_MDIO0) { hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hp->paddr = TCV_PADDR_ITX; hp->tcvr_type = internal; - ASD("\n"); + ASD("not polling, internal\n"); } else { netdev_err(hp->dev, "Transceiver and a coke please."); hp->tcvr_type = none; /* Grrr... */ - ASD("\n"); + ASD("not polling, none\n"); } } } @@ -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"); happy_meal_clean_rings(hp); /* Now get new skippy bufs for the receive ring. */ - HMD("init rxring, "); + HMD("init rxring\n"); for (i = 0; i < RX_RING_SIZE; i++) { struct sk_buff *skb; u32 mapping; @@ -1231,7 +1217,7 @@ static void happy_meal_init_rings(struct happy_meal *hp) skb_reserve(skb, RX_OFFSET); } - HMD("init txring, "); + HMD("init txring\n"); for (i = 0; i < TX_RING_SIZE; i++) hme_write_txd(hp, &hb->happy_meal_txd[i], 0, 0); @@ -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; @@ -1371,15 +1351,15 @@ static int happy_meal_init(struct happy_meal *hp) void __iomem *erxregs = hp->erxregs; void __iomem *bregs = hp->bigmacregs; void __iomem *tregs = hp->tcvregs; + const char *bursts; u32 regtmp, rxcfg; /* If auto-negotiation timer is running, kill it. */ del_timer(&hp->happy_timer); - HMD("happy_meal_init: happy_flags[%08x] ", - hp->happy_flags); + HMD("happy_flags[%08x]\n", hp->happy_flags); if (!(hp->happy_flags & HFLAG_INIT)) { - HMD("set HFLAG_INIT, "); + HMD("set HFLAG_INIT\n"); hp->happy_flags |= HFLAG_INIT; happy_meal_get_counters(hp, bregs); } @@ -1389,26 +1369,26 @@ static int happy_meal_init(struct happy_meal *hp) happy_meal_poll_stop(hp, tregs); /* Stop transmitter and receiver. */ - HMD("happy_meal_init: to happy_meal_stop\n"); + HMD("to happy_meal_stop\n"); happy_meal_stop(hp, gregs); /* Alloc and reset the tx/rx descriptor chains. */ - HMD("happy_meal_init: to happy_meal_init_rings\n"); + HMD("to happy_meal_init_rings\n"); happy_meal_init_rings(hp); /* Shut up the MIF. */ - HMD("happy_meal_init: Disable all MIF irqs (old[%08x]), ", + HMD("Disable all MIF irqs (old[%08x])\n", hme_read32(hp, tregs + TCVR_IMASK)); hme_write32(hp, tregs + TCVR_IMASK, 0xffff); /* See if we can enable the MIF frame on this card to speak to the DP83840. */ if (hp->happy_flags & HFLAG_FENABLE) { - HMD("use frame old[%08x], ", + HMD("use frame old[%08x]\n", hme_read32(hp, tregs + TCVR_CFG)); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE)); } else { - HMD("use bitbang old[%08x], ", + HMD("use bitbang old[%08x]\n", hme_read32(hp, tregs + TCVR_CFG)); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE); @@ -1419,22 +1399,21 @@ static int happy_meal_init(struct happy_meal *hp) happy_meal_transceiver_check(hp, tregs); /* Put the Big Mac into a sane state. */ - HMD("happy_meal_init: "); switch(hp->tcvr_type) { case none: /* Cannot operate if we don't know the transceiver type! */ - HMD("AAIEEE no transceiver type, EAGAIN"); + HMD("AAIEEE no transceiver type, EAGAIN\n"); return -EAGAIN; case internal: /* Using the MII buffers. */ - HMD("internal, using MII, "); + HMD("internal, using MII\n"); hme_write32(hp, bregs + BMAC_XIFCFG, 0); break; case external: /* Not using the MII, disable it. */ - HMD("external, disable MII, "); + HMD("external, disable MII\n"); hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB); break; } @@ -1443,18 +1422,16 @@ static int happy_meal_init(struct happy_meal *hp) return -EAGAIN; /* Reset the Happy Meal Big Mac transceiver and the receiver. */ - HMD("tx/rx reset, "); + HMD("tx/rx reset\n"); happy_meal_tx_reset(hp, bregs); happy_meal_rx_reset(hp, bregs); /* Set jam size and inter-packet gaps to reasonable defaults. */ - HMD("jsize/ipg1/ipg2, "); hme_write32(hp, bregs + BMAC_JSIZE, DEFAULT_JAMSIZE); hme_write32(hp, bregs + BMAC_IGAP1, DEFAULT_IPG1); hme_write32(hp, bregs + BMAC_IGAP2, DEFAULT_IPG2); /* Load up the MAC address and random seed. */ - HMD("rseed/macaddr, "); /* The docs recommend to use the 10LSB of our MAC here. */ hme_write32(hp, bregs + BMAC_RSEED, ((e[5] | e[4]<<8)&0x3ff)); @@ -1463,7 +1440,6 @@ static int happy_meal_init(struct happy_meal *hp) hme_write32(hp, bregs + BMAC_MACADDR1, ((e[2] << 8) | e[3])); hme_write32(hp, bregs + BMAC_MACADDR0, ((e[0] << 8) | e[1])); - HMD("htable, "); if ((hp->dev->flags & IFF_ALLMULTI) || (netdev_mc_count(hp->dev) > 64)) { hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); @@ -1513,9 +1489,6 @@ static int happy_meal_init(struct happy_meal *hp) | 0x4); /* Set the supported burst sizes. */ - HMD("happy_meal_init: old[%08x] bursts<", - hme_read32(hp, gregs + GREG_CFG)); - #ifndef CONFIG_SPARC /* It is always PCI and can handle 64byte bursts. */ hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST64); @@ -1543,34 +1516,35 @@ static int happy_meal_init(struct happy_meal *hp) } #endif - HMD("64>"); + bursts = "64"; hme_write32(hp, gregs + GREG_CFG, gcfg); } else if (hp->happy_bursts & DMA_BURST32) { - HMD("32>"); + bursts = "32"; hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST32); } else if (hp->happy_bursts & DMA_BURST16) { - HMD("16>"); + bursts = "16"; hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST16); } else { - HMD("XXX>"); + bursts = "XXX"; hme_write32(hp, gregs + GREG_CFG, 0); } #endif /* CONFIG_SPARC */ + HMD("old[%08x] bursts<%s>\n", + hme_read32(hp, gregs + GREG_CFG), bursts); + /* Turn off interrupts we do not want to hear. */ - HMD(", enable global interrupts, "); hme_write32(hp, gregs + GREG_IMASK, (GREG_IMASK_GOTFRAME | GREG_IMASK_RCNTEXP | GREG_IMASK_SENTFRAME | GREG_IMASK_TXPERR)); /* Set the transmit ring buffer size. */ - HMD("tx rsize=%d oreg[%08x], ", (int)TX_RING_SIZE, + HMD("tx rsize=%d oreg[%08x]\n", (int)TX_RING_SIZE, hme_read32(hp, etxregs + ETX_RSIZE)); hme_write32(hp, etxregs + ETX_RSIZE, (TX_RING_SIZE >> ETX_RSIZE_SHIFT) - 1); /* Enable transmitter DVMA. */ - HMD("tx dma enable old[%08x], ", - hme_read32(hp, etxregs + ETX_CFG)); + HMD("tx dma enable old[%08x]\n", hme_read32(hp, etxregs + ETX_CFG)); hme_write32(hp, etxregs + ETX_CFG, hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE); @@ -1594,7 +1568,7 @@ static int happy_meal_init(struct happy_meal *hp) } /* Enable Big Mac hash table filter. */ - HMD("happy_meal_init: enable hash rx_cfg_old[%08x], ", + HMD("enable hash rx_cfg_old[%08x]\n", hme_read32(hp, bregs + BMAC_RXCFG)); rxcfg = BIGMAC_RXCFG_HENABLE | BIGMAC_RXCFG_REJME; if (hp->dev->flags & IFF_PROMISC) @@ -1605,7 +1579,7 @@ static int happy_meal_init(struct happy_meal *hp) udelay(10); /* Ok, configure the Big Mac transmitter. */ - HMD("BIGMAC init, "); + HMD("BIGMAC init\n"); regtmp = 0; if (hp->happy_flags & HFLAG_FULL) regtmp |= BIGMAC_TXCFG_FULLDPLX; @@ -1629,8 +1603,7 @@ static int happy_meal_init(struct happy_meal *hp) if (hp->tcvr_type == external) regtmp |= BIGMAC_XCFG_MIIDISAB; - HMD("XIF config old[%08x], ", - hme_read32(hp, bregs + BMAC_XIFCFG)); + HMD("XIF config old[%08x]\n", hme_read32(hp, bregs + BMAC_XIFCFG)); hme_write32(hp, bregs + BMAC_XIFCFG, regtmp); /* Start things up. */ @@ -1769,14 +1742,10 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) { /* All sorts of DMA receive errors. */ - netdev_err(hp->dev, "Happy Meal rx DMA errors [ "); - if (status & GREG_STAT_RXERR) - printk("GenericError "); - if (status & GREG_STAT_RXPERR) - printk("ParityError "); - if (status & GREG_STAT_RXTERR) - printk("RxTagBotch "); - printk("]\n"); + netdev_err(hp->dev, "Happy Meal rx DMA errors [ %s%s%s]\n", + status & GREG_STAT_RXERR ? "GenericError " : "", + status & GREG_STAT_RXPERR ? "ParityError " : "", + status & GREG_STAT_RXTERR ? "RxTagBotch " : ""); reset = 1; } @@ -1797,16 +1766,11 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) if (status & (GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) { /* All sorts of transmit DMA errors. */ - netdev_err(hp->dev, "Happy Meal tx DMA errors [ "); - if (status & GREG_STAT_TXEACK) - printk("GenericError "); - if (status & GREG_STAT_TXLERR) - printk("LateError "); - if (status & GREG_STAT_TXPERR) - printk("ParityError "); - if (status & GREG_STAT_TXTERR) - printk("TagBotch "); - printk("]\n"); + netdev_err(hp->dev, "Happy Meal tx DMA errors [ %s%s%s%s]\n", + status & GREG_STAT_TXEACK ? "GenericError " : "", + status & GREG_STAT_TXLERR ? "LateError " : "", + status & GREG_STAT_TXPERR ? "ParityError " : "", + status & GREG_STAT_TXTERR ? "TagBotch " : ""); reset = 1; } @@ -1839,16 +1803,16 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) /* Use the fastest transmission protocol possible. */ if (hp->sw_lpa & LPA_100FULL) { - netdev_info(hp->dev, "Switching to 100Mbps at full duplex."); + netdev_info(hp->dev, "Switching to 100Mbps at full duplex.\n"); hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); } else if (hp->sw_lpa & LPA_100HALF) { - netdev_info(hp->dev, "Switching to 100MBps at half duplex."); + netdev_info(hp->dev, "Switching to 100MBps at half duplex.\n"); hp->sw_bmcr |= BMCR_SPEED100; } else if (hp->sw_lpa & LPA_10FULL) { - netdev_info(hp->dev, "Switching to 10MBps at full duplex."); + netdev_info(hp->dev, "Switching to 10MBps at full duplex.\n"); hp->sw_bmcr |= BMCR_FULLDPLX; } else { - netdev_info(hp->dev, "Using 10Mbps at half duplex."); + netdev_info(hp->dev, "Using 10Mbps at half duplex.\n"); } happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -1865,13 +1829,12 @@ static void happy_meal_tx(struct happy_meal *hp) int elem; elem = hp->tx_old; - TXD("TX<"); while (elem != hp->tx_new) { struct sk_buff *skb; u32 flags, dma_addr, dma_len; int frag; - TXD("[%d]", elem); + TXD("TX[%d]\n", elem); this = &txbase[elem]; flags = hme_read_desc32(hp, &this->tx_flags); if (flags & TXFLAG_OWN) @@ -1907,7 +1870,6 @@ static void happy_meal_tx(struct happy_meal *hp) dev->stats.tx_packets++; } hp->tx_old = elem; - TXD(">"); if (netif_queue_stopped(dev) && TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1)) @@ -1930,7 +1892,6 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) int elem = hp->rx_new, drops = 0; u32 flags; - RXD("RX<"); this = &rxbase[elem]; while (!((flags = hme_read_desc32(hp, &this->rx_flags)) & RXFLAG_OWN)) { struct sk_buff *skb; @@ -1938,11 +1899,9 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) u16 csum = flags & RXFLAG_CSUM; u32 dma_addr = hme_read_desc32(hp, &this->rx_addr); - RXD("[%d ", elem); - /* Check for errors. */ if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { - RXD("ERR(%08x)]", flags); + RXD("RX[%d ERR(%08x)]", elem, flags); dev->stats.rx_errors++; if (len < ETH_ZLEN) dev->stats.rx_length_errors++; @@ -2014,7 +1973,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) skb->csum = csum_unfold(~(__force __sum16)htons(csum)); skb->ip_summed = CHECKSUM_COMPLETE; - RXD("len=%d csum=%4x]", len, csum); + RXD("RX[%d len=%d csum=%4x]", elem, len, csum); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); @@ -2027,7 +1986,6 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) hp->rx_new = elem; if (drops) netdev_info(hp->dev, "Memory squeeze, deferring packet.\n"); - RXD(">"); } static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) @@ -2036,30 +1994,23 @@ static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); - HMD("happy_meal_interrupt: status=%08x ", happy_status); + HMD("status=%08x\n", happy_status); spin_lock(&hp->happy_lock); if (happy_status & GREG_STAT_ERRORS) { - HMD("ERRORS "); if (happy_meal_is_not_so_happy(hp, /* un- */ happy_status)) goto out; } - if (happy_status & GREG_STAT_MIFIRQ) { - HMD("MIFIRQ "); + if (happy_status & GREG_STAT_MIFIRQ) happy_meal_mif_interrupt(hp); - } - if (happy_status & GREG_STAT_TXALL) { - HMD("TXALL "); + if (happy_status & GREG_STAT_TXALL) happy_meal_tx(hp); - } - if (happy_status & GREG_STAT_RXTOHOST) { - HMD("RXTOHOST "); + if (happy_status & GREG_STAT_RXTOHOST) happy_meal_rx(hp, dev); - } HMD("done\n"); out: @@ -2079,7 +2030,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); - HMD("quattro_interrupt: status=%08x ", happy_status); + HMD("status=%08x\n", happy_status); if (!(happy_status & (GREG_STAT_ERRORS | GREG_STAT_MIFIRQ | @@ -2089,26 +2040,18 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) spin_lock(&hp->happy_lock); - if (happy_status & GREG_STAT_ERRORS) { - HMD("ERRORS "); + if (happy_status & GREG_STAT_ERRORS) if (happy_meal_is_not_so_happy(hp, happy_status)) goto next; - } - if (happy_status & GREG_STAT_MIFIRQ) { - HMD("MIFIRQ "); + if (happy_status & GREG_STAT_MIFIRQ) happy_meal_mif_interrupt(hp); - } - if (happy_status & GREG_STAT_TXALL) { - HMD("TXALL "); + if (happy_status & GREG_STAT_TXALL) happy_meal_tx(hp); - } - if (happy_status & GREG_STAT_RXTOHOST) { - HMD("RXTOHOST "); + if (happy_status & GREG_STAT_RXTOHOST) happy_meal_rx(hp, dev); - } next: spin_unlock(&hp->happy_lock); @@ -2124,8 +2067,6 @@ static int happy_meal_open(struct net_device *dev) struct happy_meal *hp = netdev_priv(dev); int res; - HMD("happy_meal_open: "); - /* On SBUS Quattro QFE cards, all hme interrupts are concentrated * into a single source which we register handling at probe time. */ @@ -2238,7 +2179,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, } entry = hp->tx_new; - SXD("SX", len, entry); + SXD("SX\n", skb->len, entry); hp->tx_skbs[entry] = skb; if (skb_shinfo(skb)->nr_frags == 0) { @@ -2783,12 +2724,12 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) platform_set_drvdata(op, hp); if (qfe_slot != -1) - netdev_info(dev, "Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", - qfe_slot); + netdev_info(dev, + "Quattro HME slot %d (SBUS) 10/100baseT Ethernet %pM\n", + qfe_slot, dev->dev_addr); else - netdev_info(dev, "HAPPY MEAL (SBUS) 10/100baseT Ethernet "); - - printk("%pM\n", dev->dev_addr); + netdev_info(dev, "HAPPY MEAL (SBUS) 10/100baseT Ethernet %pM\n", + dev->dev_addr); return 0; @@ -3114,25 +3055,18 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, sprintf(prom_name, "-%d", i + 3); } netdev_info(dev, - "%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", - prom_name); - if (qpdev->vendor == PCI_VENDOR_ID_DEC && - qpdev->device == PCI_DEVICE_ID_DEC_21153) - printk("DEC 21153 PCI Bridge\n"); - else - printk("unknown bridge %04x.%04x\n", - qpdev->vendor, qpdev->device); + "%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet bridge %04x.%04x\n", + prom_name, qpdev->vendor, qpdev->device); } if (qfe_slot != -1) netdev_info(dev, - "Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", - qfe_slot); + "Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet %pM\n", + qfe_slot, dev->dev_addr); else netdev_info(dev, - "HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet "); - - printk("%pM\n", dev->dev_addr); + "HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet %pM\n", + dev->dev_addr); return 0; From patchwork Sun Sep 18 23:26:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979623 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9CCEECAAD8 for ; Sun, 18 Sep 2022 23:28:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbiIRX2V (ORCPT ); Sun, 18 Sep 2022 19:28:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbiIRX06 (ORCPT ); Sun, 18 Sep 2022 19:26:58 -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 2B5D118357; Sun, 18 Sep 2022 16:26:45 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id h28so19531875qka.0; Sun, 18 Sep 2022 16:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=8pbxZjF/RhWmoIGCjzSwGdndkU6NZbU29iK5d8jcQ3o=; b=mghTESWIyiSWn6i6Ar8D4bD1U9cN+HCjkBocsOr0Lry5x0Ht72wndUAf7Lqgz0bAD8 dbbzrbzKI1x5qc1IiiGLYmruRzkaFip9MfeOvFi6YL33UdCMyclk8hq813zSiPqh/Rfm FSKSMpkdqJfgKjNqEu3a2kYPF9ZT08ivntyxK8VrZKe5a+rxx68LWNL91err894JA0OH 0zczpUjNPCdOfZwSElmgeA5ZUvFVPvuPGYgQw5GLjRlE9HqdaSSaNC/VqBD4CIkJzp2v IGskkvP84OGDCnf9AVcDjjR3bNbeAhM7UUSZwe09dak3Z0ZCDbiblE+VLZgFTIqHz791 i1JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=8pbxZjF/RhWmoIGCjzSwGdndkU6NZbU29iK5d8jcQ3o=; b=Js46C5EKy54iKa5qVwAtLhvityu3O7hDWE8SG91FttpU+0MI86ofrDKzHUJigPwKt3 X21KQ6p0KeQ6TYUyTT1acUCsvVLiDIkVJKCflmtAhssMLuuWSa0xxF/ziAWoEq6D1fAI A5NfA90lmqqA8VeY/JVbVmb8MCMEI9GqGLJC7yeHsbR0gYnB8d8oB9RyXxBJYKWwNOCS mKXJzXX6EU9JJ3lkxl12Qx1AS4BjC/ui3hn0YeuA7BwrTfYs1msetbjTLmDU0Av0eACX guj8UpcKvzMhH2QLOXSOSV88sN49X+1PQipE7wjWxxYuWlWoNeiubYna6jsFYu2UwQbJ BzwA== X-Gm-Message-State: ACrzQf3VLSf8W3FrJilOFuc7WBhtr7IXBIvvl9NywP4nRuYe1cdT+0cU A2Rv51ijJ6JUyw6zKluwuvk= X-Google-Smtp-Source: AMsMyM60vCWI9BHgGaq453Q0PU1I+UnThgkTfphJ5UEpyg0uXrcwYJcbMU1KCdKA6dyWnu7Mz2lDeQ== X-Received: by 2002:a05:620a:1283:b0:6ce:f08b:ead0 with SMTP id w3-20020a05620a128300b006cef08bead0mr4391568qki.669.1663543604316; Sun, 18 Sep 2022 16:26:44 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id c4-20020a05620a268400b006b633dc839esm11763677qkp.66.2022.09.18.16.26.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:43 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 12/13] sunhme: Use vdbg for spam-y prints Date: Sun, 18 Sep 2022 19:26:25 -0400 Message-Id: <20220918232626.1601885-13-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The SXD, TXD, and RXD macros are used only once (or twice). Just use the vdbg print, which seems to have been devised for these sorts of very verbose messages. Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 9965c9c872a6..8e4927589524 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -90,27 +90,6 @@ static struct quattro *qfe_pci_list; #define ASD(...) #endif -/* Transmit debug */ -#if 1 -#define TXD hme_debug -#else -#define TXD(...) -#endif - -/* Skid buffer debug */ -#if 1 -#define SXD hme_debug -#else -#define SXD(...) -#endif - -/* Receive debug */ -#if 1 -#define RXD hme_debug -#else -#define RXD(...) -#endif - #if 0 struct hme_tx_logent { unsigned int tstamp; @@ -1834,7 +1813,7 @@ static void happy_meal_tx(struct happy_meal *hp) u32 flags, dma_addr, dma_len; int frag; - TXD("TX[%d]\n", elem); + netdev_vdbg(hp->dev, "TX[%d]\n", elem); this = &txbase[elem]; flags = hme_read_desc32(hp, &this->tx_flags); if (flags & TXFLAG_OWN) @@ -1901,7 +1880,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) /* Check for errors. */ if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { - RXD("RX[%d ERR(%08x)]", elem, flags); + netdev_vdbg(dev, "RX[%d ERR(%08x)]", elem, flags); dev->stats.rx_errors++; if (len < ETH_ZLEN) dev->stats.rx_length_errors++; @@ -1973,7 +1952,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) skb->csum = csum_unfold(~(__force __sum16)htons(csum)); skb->ip_summed = CHECKSUM_COMPLETE; - RXD("RX[%d len=%d csum=%4x]", elem, len, csum); + netdev_vdbg(dev, "RX[%d len=%d csum=%4x]", elem, len, csum); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); @@ -2179,7 +2158,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, } entry = hp->tx_new; - SXD("SX\n", skb->len, entry); + netdev_vdbg(dev, "SX\n", skb->len, entry); hp->tx_skbs[entry] = skb; if (skb_shinfo(skb)->nr_frags == 0) { From patchwork Sun Sep 18 23:26:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12979624 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1D2DC54EE9 for ; Sun, 18 Sep 2022 23:28:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229901AbiIRX2j (ORCPT ); Sun, 18 Sep 2022 19:28:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbiIRX06 (ORCPT ); Sun, 18 Sep 2022 19:26:58 -0400 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 022B218361; Sun, 18 Sep 2022 16:26:46 -0700 (PDT) Received: by mail-qv1-xf29.google.com with SMTP id j8so9838469qvt.13; Sun, 18 Sep 2022 16:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=+WHyUg/3fPOf0tvuBkaVWxhr5RVI5uDGWpfIxZnn/5A=; b=D9OR9hB1I3e8PywGWEUW5fHz/j9AVs9Y8bD1XA/q4K+iSf0bY/l06DAZWQAf/eJFkY 7AtdNTe+6LOTMyySsWjHy/Q3uZPTv8Sqc8DCZ5IrPjryYIEHeeUFH4JUUQxAIioXSvlQ J6OAN343q4xczn7xIwgg0FxtADu6twiWwFxBIst47ogbFPIYU+3NhTkcoRhdGV/i9uMl 2qB3kPw/LX8uWg65FchiCCSNACFtJWu+G40fiENxDTh/lI3RHbf+uTOYzRy8yvkLuLXY ZTHCuDDq/mIO7OrAhLMfliHBZSJkN89b+6H5H19Yl30rLC7HgOpfqkYqBM9unRdr3Wby v7sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=+WHyUg/3fPOf0tvuBkaVWxhr5RVI5uDGWpfIxZnn/5A=; b=ONqWpcX0strTVML7VtzHhjtWI+HA/tU9f7+wcYiiOB3w7SDFi1BuoQc7/rbfVIIA4A GCkl8ZFm+R+hLUI1rn6yWs5lk36+7cXzw1SP4Wyt1AcNHW/xCRHmEqEfOnwfVWeYVN4y lJ7tnXuFYW1MXxX8FgoVyDEoZe/+QTe8QjPWZwLG3wBClf18td9cX5mBM4gcnKVXJKPA klDxFDdewnoDnkkkrRrW8WqPfSzOClG649VStgzTpmfAhNVhe7R7Emd2EZrFNoLLW+zO mrEh6ke6siYP2LRjkkf6/VlQBIMBwcJfHxYHZBsfroNhLdx91f7W7qzcct885jRtL7y/ lpKA== X-Gm-Message-State: ACrzQf1eh8ed1Z4oqXBWhMus0e/ECZqH2clPWpbieRwyPMhiP7VPd3Pl trTrhTzV1NhNf1cINAMu8ZY= X-Google-Smtp-Source: AMsMyM4MAqGyqAze9Cw5ZFpjl9sDST4Ovz9Y2TGOpIQy/y64eH9GpikgNZPe74ivPsu3/+5gN2Bfyg== X-Received: by 2002:ad4:5b8b:0:b0:4ad:2b21:3390 with SMTP id 11-20020ad45b8b000000b004ad2b213390mr5450789qvp.20.1663543605554; Sun, 18 Sep 2022 16:26:45 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id de42-20020a05620a372a00b006b945519488sm11637556qkb.88.2022.09.18.16.26.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 16:26:45 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list), Zheyu Ma , Nick Bowler , Rolf Eike Beer , Sean Anderson Subject: [PATCH net-next 13/13] sunhme: Add myself as a maintainer Date: Sun, 18 Sep 2022 19:26:26 -0400 Message-Id: <20220918232626.1601885-14-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220918232626.1601885-1-seanga2@gmail.com> References: <20220918232626.1601885-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org I have the hardware so at the very least I can test things. Signed-off-by: Sean Anderson --- MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 74036b51911d..381e1457f601 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19491,6 +19491,11 @@ L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/dlink/sundance.c +SUN HAPPY MEAL ETHERNET DRIVER +M: Sean Anderson +S: Maintained +F: drivers/net/ethernet/sun/sunhme.* + SUNPLUS ETHERNET DRIVER M: Wells Lu L: netdev@vger.kernel.org