linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: netdev <netdev@vger.kernel.org>, SH-Linux <linux-sh@vger.kernel.org>
Subject: Re: [PATCH v2 4/5] net: sh_eth: add support for set_ringparam/get_ringparam
Date: Mon, 14 May 2012 06:13:50 +0000	[thread overview]
Message-ID: <4FB0A29E.1070709@renesas.com> (raw)
In-Reply-To: <1336750030.2874.65.camel@bwh-desktop.uk.solarflarecom.com>

2012/05/12 0:27, Ben Hutchings wrote:
> On Fri, 2012-05-11 at 17:38 +0900, Shimoda, Yoshihiro wrote:
>> This patch supports the ethtool's set_ringparam() and get_ringparam().
> [...]
>> +static int sh_eth_set_ringparam(struct net_device *ndev,
>> +				struct ethtool_ringparam *ring)
>> +{
< snip >
>> +	if (netif_running(ndev)) {
>> +		/* Disable interrupts by clearing the interrupt mask. */
>> +		sh_eth_write(ndev, 0x0000, EESIPR);
>> +		/* Stop the chip's Tx and Rx processes. */
>> +		sh_eth_write(ndev, 0, EDTRR);
>> +		sh_eth_write(ndev, 0, EDRRR);
> 
> You'll also need to call netif_tx_disable() and synchronize_irq().

Thank you for the point. I will fix it.

>> +	sh_eth_ring_init(ndev);
>> +	sh_eth_dev_init(ndev);
> 
> And what if either of these fails?

Oh, I should have added error handling.
I checked this driver, and I found that the driver should change
the value of the pointer to NULL. So, I will submit such a patch first.

>> +	if (netif_running(ndev)) {
>> +		sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR);
>> +		/* Setting the Rx mode will start the Rx process. */
>> +		sh_eth_write(ndev, EDRRR_R, EDRRR);
> 
> You'll need to call netif_wake_queue().

I will fix it.

>> +	}
>> +
>> +	return 0;
>> +}
> [...]
> 
> Ben.
> 

Best regards,
Yoshihiro Shimoda

      reply	other threads:[~2012-05-14  6:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11  8:38 [PATCH v2 4/5] net: sh_eth: add support for set_ringparam/get_ringparam Shimoda, Yoshihiro
2012-05-11 15:27 ` Ben Hutchings
2012-05-14  6:13   ` Shimoda, Yoshihiro [this message]

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=4FB0A29E.1070709@renesas.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=bhutchings@solarflare.com \
    --cc=linux-sh@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).