All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Mike Sinkovsky <msink@permonline.ru>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 2/2] Ethernet driver for the WIZnet W5100 chip
Date: Mon, 2 Apr 2012 12:21:38 +0100	[thread overview]
Message-ID: <20120402105722.GC3172@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4F797402.1050109@permonline.ru>

[-- Attachment #1: Type: text/plain, Size: 2656 bytes --]

On Mon, Apr 02, 2012 at 03:40:18PM +0600, Mike Sinkovsky wrote:
> 01.04.2012 3:23, Mark Brown wrote:
> >On Fri, Mar 30, 2012 at 01:00:06PM +0600, Mike Sinkovsky wrote:

> >>+config WIZNET_W5100
> >>+	tristate "WIZnet W5100 Ethernet support"
> >>+	depends on ARM || BLACKFIN

> >What are the architecture dependencies here?

> Original driver from chip manufacturer was written for ARM, and now
> we use it on Blackfin.
> Completely untested on other arch's, but should work. Maybe.

Remove the dependency then.  If there's an issue people can fix it.

> >>+static irqreturn_t w5100_interrupt(int irq, void *ndev_instance)
> >>+{
> >>+	struct net_device *ndev = ndev_instance;
> >>+	struct w5100_priv *priv = netdev_priv(ndev);
> >>+
> >>+	int ir = w5100_read(priv, W5100_S0_IR);
> >>+	w5100_write(priv, W5100_S0_IR, ir);
> >>+
> >>+	if (ir&  S0_IR_RECV) {
> >>+		if (napi_schedule_prep(&priv->napi)) {
> >>+			w5100_write(priv, W5100_IMR, 0);
> >>+			mmiowb();
> >>+			__napi_schedule(&priv->napi);
> >>+		}
> >>+	}
> >>+
> >>+	if (ir&  S0_IR_SENDOK) {
> >>+		if (unlikely(netif_queue_stopped(ndev)))
> >>+			netif_wake_queue(ndev);
> >>+	}
> >>+
> >>+	return IRQ_HANDLED;

> >This unconditionally acknowledges the interrupt even if one wasn't
> >reported by the device.

> Hm? Don't get you.
> W5100_S0_IR register is R/W1C - writing back clears it.
> Or what do you mean?

If you read back and no interrupts are flagged (all bits in the IRQ
status register clear) you'll still return IRQ_HANDLED.

> >This is rather an abuse of the resource API and will run into trouble on
> >device tree based systems.  You should use platform data for non-DT
> >systems.

> Ok, will move it to struct wiznet_platform_data.
> But here is downside - this gpio is optional, and if board doesn't
> have it - it must be initialized as negative value, not just
> omitted.

Sure, this is all totally standard to the Linux GPIO framework.
Realistically treating 0 as an invalid GPIO should be fine.

> >>+		if (request_irq(priv->link_irq, w5100_detect_link,
> >>+				IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
> >>+				link_name, priv->ndev)<  0)

> >Suggest using request_any_context_irq() to increase the range of
> >supported interrupt controllers.

> Could it be anything but hard irq?

It could be a threaded IRQ (if the interrupt controller can't be
accessed from hard IRQ context).

> >>+	platform_set_drvdata(pdev, NULL);
> >>+	dev_info(&pdev->dev, "probe failed (%d)\n", err);

> >This will be done for you by the driver core.

> You mean platform_set_drvdata() and dev_info()? Maybe.
> I'm sure platform_driver will not do free_netdev() for me.

The error logging.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-04-02 11:21 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19  9:23 [PATCH v2] ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-03-20 18:08 ` Ben Hutchings
2012-03-21  6:20   ` Mike Sinkovsky
2012-03-22 16:57     ` Ben Hutchings
2012-03-21 14:49 ` Florian Fainelli
2012-03-22  6:58   ` Mike Sinkovsky
2012-03-24 11:02 ` [PATCH v3] Ethernet " Mike Sinkovsky
2012-03-24 15:53   ` Joe Perches
2012-03-24 16:10   ` Eric Dumazet
2012-03-26  9:05     ` Mike Sinkovsky
2012-03-26  9:07 ` [PATCH v4] " Mike Sinkovsky
2012-03-28  2:35   ` David Miller
2012-03-28  5:52     ` Mike Sinkovsky
2012-03-28  6:22       ` David Miller
2012-03-30  7:00   ` [PATCH v5 1/2] " Mike Sinkovsky
2012-03-31 21:45     ` Mark Brown
2012-03-30  7:00   ` [PATCH v5 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-03-30  9:23     ` Eric Dumazet
2012-03-31  9:40       ` Francois Romieu
2012-03-31  9:46         ` Francois Romieu
2012-03-31  9:52       ` Mike Sinkovsky
2012-03-31 10:24         ` Eric Dumazet
2012-03-31 21:23     ` Mark Brown
2012-04-02  9:40       ` Mike Sinkovsky
2012-04-02 11:21         ` Mark Brown [this message]
2012-04-03 10:58   ` [PATCH v6 0/2] Ethernet drivers for WIZnet chips Mike Sinkovsky
2012-04-03 11:39     ` Eric Dumazet
2012-04-03 12:15       ` Mike Sinkovsky
2012-04-03 12:29         ` Eric Dumazet
2012-04-04  5:58           ` Mike Sinkovsky
2012-04-04  6:17             ` Eric Dumazet
2012-04-04  7:25               ` Mike Sinkovsky
2012-04-04  7:23     ` [PATCH v7 " Mike Sinkovsky
2012-04-04 11:57       ` [PATCH v8 " Mike Sinkovsky
2012-04-05  1:15         ` David Miller
2012-04-05  1:15           ` David Miller
2012-04-05  5:36           ` Mike Sinkovsky
2012-04-04 11:57       ` [PATCH v8 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-04 11:57       ` [PATCH v8 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-04-04 12:08       ` [PATCH v8 0/2] Ethernet drivers for WIZnet chips Mike Sinkovsky
2012-04-05  5:33         ` [PATCH v9 " Mike Sinkovsky
2012-04-05  5:47           ` David Miller
2012-04-05  5:33         ` [PATCH v9 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-05  5:33         ` [PATCH v9 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-04-04 12:08       ` [PATCH v8 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-04 12:08       ` [PATCH v8 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-04-04  7:23     ` [PATCH v7 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-04  7:23     ` [PATCH v7 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-04-03 10:58   ` [PATCH v6 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-03 13:36     ` Mark Brown
2012-04-04  6:18       ` Mike Sinkovsky
2012-04-04 10:01         ` Mark Brown
2012-04-04 11:00           ` Mike Sinkovsky
2012-04-03 10:58   ` [PATCH v6 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky

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=20120402105722.GC3172@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msink@permonline.ru \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.