From: Mark Einon <mark.einon@gmail.com>
To: ZHAO Gang <gamerh2o@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH v3 4/5] staging: et131x: remove spinlock adapter->lock
Date: Thu, 21 Nov 2013 21:19:53 +0000 [thread overview]
Message-ID: <20131121211953.GE10691@einon.net> (raw)
In-Reply-To: <14d763851982be40b32c297eba792f29d1bbd546.1384933520.git.gamerh2o@gmail.com>
On Wed, Nov 20, 2013 at 03:57:15PM +0800, ZHAO Gang wrote:
> adapter->lock is only used in et131x_multicast(), which is eventually
> called by network stack function __dev_set_rx_mode(). __dev_set_rx_mode()
> is always called by (net_device *)dev->addr_list_lock hold, to protect from
> concurrent access. So adapter->lock is redundant.
>
> Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
> ---
> drivers/staging/et131x/et131x.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
> index 6254a6b..66530b1 100644
> --- a/drivers/staging/et131x/et131x.c
> +++ b/drivers/staging/et131x/et131x.c
> @@ -486,8 +486,6 @@ struct et131x_adapter {
> u8 eeprom_data[2];
>
> /* Spinlocks */
> - spinlock_t lock;
> -
> spinlock_t tcb_send_qlock;
> spinlock_t tcb_ready_qlock;
> spinlock_t send_hw_lock;
> @@ -3867,7 +3865,6 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev,
> adapter->netdev = netdev;
>
> /* Initialize spinlocks here */
> - spin_lock_init(&adapter->lock);
> spin_lock_init(&adapter->tcb_send_qlock);
> spin_lock_init(&adapter->tcb_ready_qlock);
> spin_lock_init(&adapter->send_hw_lock);
> @@ -4429,8 +4426,6 @@ static void et131x_multicast(struct net_device *netdev)
> struct netdev_hw_addr *ha;
> int i;
>
> - spin_lock_irqsave(&adapter->lock, flags);
> -
> /* Before we modify the platform-independent filter flags, store them
> * locally. This allows us to determine if anything's changed and if
> * we even need to bother the hardware
> @@ -4484,7 +4479,6 @@ static void et131x_multicast(struct net_device *netdev)
> /* Call the device's filter function */
> et131x_set_packet_filter(adapter);
> }
> - spin_unlock_irqrestore(&adapter->lock, flags);
> }
>
> /* et131x_tx - The handler to tx a packet on the device
> --
> 1.8.3.1
>
next prev parent reply other threads:[~2013-11-21 21:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 7:53 [PATCH v3 0/5] staging: et131x: patches for et131x driver ZHAO Gang
2013-11-20 7:54 ` [PATCH v3 1/5] staging: et131x: clean up code ZHAO Gang
2013-11-21 21:18 ` Mark Einon
2013-11-20 7:55 ` [PATCH v3 2/5] staging: et131x: drop packet when error occurs in et131x_tx ZHAO Gang
2013-11-21 21:19 ` Mark Einon
2013-11-22 8:57 ` Dan Carpenter
2013-11-22 9:17 ` Denis Kirjanov
2013-11-22 11:47 ` ZHAO Gang
2013-11-22 11:56 ` Denis Kirjanov
2013-11-22 12:26 ` ZHAO Gang
2013-11-20 7:56 ` [PATCH v3 3/5] staging: et131x: stop read when hit max delay in et131x_phy_mii_read ZHAO Gang
2013-11-21 21:19 ` Mark Einon
2013-11-20 7:57 ` [PATCH v3 4/5] staging: et131x: remove spinlock adapter->lock ZHAO Gang
2013-11-21 21:19 ` Mark Einon [this message]
2013-11-20 7:58 ` [PATCH v3 5/5] staging: et131x: update TODO list ZHAO Gang
2013-11-21 21:20 ` Mark Einon
2013-11-21 21:18 ` [PATCH v3 0/5] staging: et131x: patches for et131x driver Mark Einon
2013-11-22 2:12 ` ZHAO Gang
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=20131121211953.GE10691@einon.net \
--to=mark.einon@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gamerh2o@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@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