netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Justin Lai <justinlai0215@realtek.com>
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
Date: Tue, 22 Aug 2023 19:59:00 +0200	[thread overview]
Message-ID: <aa7e5c75-e337-4150-bba5-a139ab4fc02f@lunn.ch> (raw)
In-Reply-To: <20230822031805.4752-2-justinlai0215@realtek.com>

> +	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

  parent reply	other threads:[~2023-08-22 17:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  3:18 [PATCH net-next v6 0/2] Add Realtek automotive PCIe driver Justin Lai
2023-08-22  3:18 ` [PATCH net-next v6 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code Justin Lai
2023-08-22 17:37   ` Jakub Kicinski
2023-08-23 14:20     ` Justin Lai
2023-08-22 17:51   ` Andrew Lunn
2023-08-23 14:25     ` Justin Lai
2023-08-22 17:59   ` Andrew Lunn [this message]
2023-08-23 14:28     ` Justin Lai
2023-08-22  3:18 ` [PATCH net-next v6 2/2] MAINTAINERS: Add the rtase ethernet driver entry Justin Lai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa7e5c75-e337-4150-bba5-a139ab4fc02f@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --cc=justinlai0215@realtek.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).