mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Hayim Shaul <hayim@iportent.com>
Cc: Jeff Garzik <jeff@garzik.org>,
	netdev@vger.kernel.org, edward_peng@dlink.com.tw,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.18-rc6 1/2] dllink driver: porting v1.19 to linux 2.6.18-rc6
Date: Thu, 07 Sep 2006 11:19:55 +0200	[thread overview]
Message-ID: <1157620795.14882.16.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <1157620189.2904.16.camel@localhost.localdomain>

> @@ -335,8 +374,9 @@
>  #endif
>  	/* Read eeprom */
>  	for (i = 0; i < 128; i++) {
> -		((u16 *) sromdata)[i] = le16_to_cpu (read_eeprom (ioaddr, i));
> +		((u16 *) sromdata)[i] = cpu_to_le16 (read_eeprom (ioaddr, i));
>  	}
> +	psrom->crc = le32_to_cpu(psrom->crc);

this looks wrong, the data comes from the hw as le, so le*_to_cpu()
sounds the right direction

> @@ -401,7 +441,7 @@
>  	int i;
>  	u16 macctrl;
>  	
> -	i = request_irq (dev->irq, &rio_interrupt, IRQF_SHARED, dev->name, dev);
> +	i = request_irq (dev->irq, &rio_interrupt, SA_SHIRQ, dev->name, dev);
>  	if (i)
>  		return i;

this is backing out a fix/conversion to the new API. Bad.


>  	
> @@ -434,9 +474,12 @@
>  	writeb (0x30, ioaddr + RxDMABurstThresh);
>  	writeb (0x30, ioaddr + RxDMAUrgentThresh);
>  	writel (0x0007ffff, ioaddr + RmonStatMask);
> +
>  	/* clear statistics */
>  	clear_stats (dev);
>  
> +	atomic_set(&np->tx_desc_lock, 0);

I'm quite scared by this naming; it suggests home-brew locking

>  	dev->trans_start = jiffies;
> +	tasklet_enable(&np->tx_tasklet);
> +	writew(DEFAULT_INTR, ioaddr + IntEnable);
> +	return;

this looks like a PCI posting bug


> -rio_free_tx (struct net_device *dev, int irq) 
> +rio_free_tx (struct net_device *dev) 
>  {
>  	struct netdev_private *np = netdev_priv(dev);
>  	int entry = np->old_tx % TX_RING_SIZE;
> -	int tx_use = 0;
>  	unsigned long flag = 0;
> +	int irq = in_interrupt();

eeeeep

> +
> +	if (atomic_read(&np->tx_desc_lock))
> +		return;
> +	atomic_inc(&np->tx_desc_lock);

and yes.. it is broken self made locking....
there is a nice race between the _read and the _inc here.


>  	
>  	if (irq)
>  		spin_lock(&np->tx_lock);
>  	else
>  		spin_lock_irqsave(&np->tx_lock, flag);

double eeeep

this is wrong to do with in_interrupt() as gating factor!
Always doing the irqsave() is fine btw




  reply	other threads:[~2006-09-07  9:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-07  9:09 Hayim Shaul
2006-09-07  9:19 ` Arjan van de Ven [this message]
2006-09-07 10:52   ` Francois Romieu
2006-09-10 11:10   ` Hayim Shaul
2006-09-21 13:29   ` Florian Weimer
2007-09-13  4:00 ` Jeff Garzik

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=1157620795.14882.16.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=edward_peng@dlink.com.tw \
    --cc=hayim@iportent.com \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®