From mboxrd@z Thu Jan 1 00:00:00 1970 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 43740EE49A0 for ; Wed, 23 Aug 2023 14:28:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236414AbjHWO2p convert rfc822-to-8bit (ORCPT ); Wed, 23 Aug 2023 10:28:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233339AbjHWO2o (ORCPT ); Wed, 23 Aug 2023 10:28:44 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 87133E5F; Wed, 23 Aug 2023 07:28:42 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 37NERwIsA030051, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 37NERwIsA030051 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 23 Aug 2023 22:27:58 +0800 Received: from RTEXMBS02.realtek.com.tw (172.21.6.95) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Wed, 23 Aug 2023 22:28:21 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS02.realtek.com.tw (172.21.6.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 23 Aug 2023 22:28:20 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d]) by RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d%5]) with mapi id 15.01.2375.007; Wed, 23 Aug 2023 22:28:20 +0800 From: Justin Lai To: Andrew Lunn CC: "kuba@kernel.org" , "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "jiri@resnulli.us" Subject: RE: [PATCH net-next v6 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code Thread-Topic: [PATCH net-next v6 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code Thread-Index: AQHZ1KdKxMskTPV/qUeQjEQ9njC6tK/2FT0AgAHdc4A= Date: Wed, 23 Aug 2023 14:28:20 +0000 Message-ID: <5ae1444b03f64e7287fc7abb6cd56063@realtek.com> References: <20230822031805.4752-1-justinlai0215@realtek.com> <20230822031805.4752-2-justinlai0215@realtek.com> In-Reply-To: Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.210.185] x-kse-serverinfo: RTEXMBS02.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > + do { > > + status = RTL_R32(tp, ivec->isr_addr); > > + > > + handled = 1; > > + RTL_W32(tp, ivec->imr_addr, 0x0); > > + RTL_W32(tp, ivec->isr_addr, (status & ~FOVW)); > > + > > + if ((status & ivec->imr)) { > > + if (likely(napi_schedule_prep(&ivec->napi))) > > + __napi_schedule(&ivec->napi); > > + } > > + } while (false); > > Remember i said that if you do something which no other network driver does, > it is probably wrong. How many drivers have a do {} while (false); loop? > > Please spend a few days just reading other drivers, and compare your code > with those drivers. Try to find all the things your driver does which no other > driver has. That code is probably wrong and you should fix it. > > Andrew > Thank you for your suggestions, I will read other drivers and modify some problems of this driver.