devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: davem@davemloft.net, robh+dt@kernel.org, pawel.moll@arm.com,
	mark.rutland@arm.com, ijc+devicetree@hellion.org.uk,
	galak@codeaurora.org, f.fainelli@gmail.com,
	netdev@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] net: qualcomm: new Ethernet over SPI driver for QCA7000
Date: Tue, 29 Apr 2014 08:51:26 +0200	[thread overview]
Message-ID: <535F4BEE.4080300@i2se.com> (raw)
In-Reply-To: <5020765.3GuR21cUpi@wuerfel>

Hi,

Am 28.04.2014 22:09, schrieb Arnd Bergmann:
> On Monday 28 April 2014 19:54:57 Stefan Wahren wrote:
>> +/*   Dumps the contents of all SPI slave registers.        */
>> +static int
>> +qcaspi_regs_dump(struct seq_file *s, void *what)
>> +{
>> +	struct reg {
>> +		char *name;
>> +		u32 address;
>> +	};
>> +
>> +	static struct reg regs[] = {
>> +		{ "SPI_REG_BFR_SIZE", SPI_REG_BFR_SIZE },
>> +		{ "SPI_REG_WRBUF_SPC_AVA", SPI_REG_WRBUF_SPC_AVA },
>> +		{ "SPI_REG_RDBUF_BYTE_AVA", SPI_REG_RDBUF_BYTE_AVA },
>> +		{ "SPI_REG_SPI_CONFIG", SPI_REG_SPI_CONFIG },
>> +		{ "SPI_REG_SPI_STATUS", SPI_REG_SPI_STATUS },
>> +		{ "SPI_REG_INTR_CAUSE", SPI_REG_INTR_CAUSE },
>> +		{ "SPI_REG_INTR_ENABLE", SPI_REG_INTR_ENABLE },
>> +		{ "SPI_REG_RDBUF_WATERMARK", SPI_REG_RDBUF_WATERMARK },
>> +		{ "SPI_REG_WRBUF_WATERMARK", SPI_REG_WRBUF_WATERMARK },
>> +		{ "SPI_REG_SIGNATURE", SPI_REG_SIGNATURE },
>> +		{ "SPI_REG_ACTION_CTRL", SPI_REG_ACTION_CTRL }
>> +	};
>> +
>> +	struct qcaspi *qca = s->private;
>> +	int i;
>> +
>> +	for (i = 0; i < (sizeof(regs) / sizeof(struct reg)); i++) {
>> +		u16 value;
>> +
>> +		qcaspi_read_register(qca, regs[i].address, &value);
>> +		seq_printf(s, "%-25s(0x%04x): 0x%04x\n",
>> +			regs[i].name, regs[i].address, value);
>> +	}
>> +
>> +	return 0;
>> +}
> Shouldn't these just come through ethtool --register-dump ?

yes, that's right. But from my point of view this have 2 disadvantages:

- the interface to ethtool needs to be maintained (i'm not sure if i
have all debug information)
- the target platform needs ethtool

>
>> +static irqreturn_t
>> +qcaspi_intr_handler(int irq, void *data)
>> +{
>> +	struct qcaspi *qca = (struct qcaspi *) data;
>> +	qca->intr_req++;
>> +	if (qca->spi_thread &&
>> +		qca->spi_thread->state != TASK_RUNNING)
>> +		wake_up_process(qca->spi_thread);
>> +
>> +	return IRQ_HANDLED;
>> +}
> What is the advantage of using your own thread mechanism for receiving
> data instead of the normal NAPI method?
>
> 	Arnd
>

This mechanism comes from Qualcomm and was originally designed for
Kernel 2.6.35. I never
talked to them.  Currently i don't know how to port this driver to NAPI.
It sounds to me,
that's a lot of work and i need more knowledge.

Is there a porting guide for NAPI?

Does this mean the current state of the driver should better go to staging?

Kind regards,
Stefan

  reply	other threads:[~2014-04-29  6:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28 17:54 [PATCH RFC 0/2] add Qualcomm QCA7000 ethernet driver Stefan Wahren
2014-04-28 17:54 ` [PATCH RFC 1/2] Documentation: add Device tree bindings for QCA7000 Stefan Wahren
2014-04-28 19:57   ` Arnd Bergmann
2014-04-29  6:30     ` Stefan Wahren
2014-04-29  7:57       ` Arnd Bergmann
2014-04-29 22:36   ` Mark Rutland
2014-04-30  7:30     ` Stefan Wahren
2014-04-28 17:54 ` [PATCH RFC 2/2] net: qualcomm: new Ethernet over SPI driver " Stefan Wahren
2014-04-28 20:09   ` Arnd Bergmann
2014-04-29  6:51     ` Stefan Wahren [this message]
2014-04-29  8:14       ` Arnd Bergmann
2014-04-29 15:54         ` Stefan Wahren
2014-04-29 18:14           ` Arnd Bergmann
2014-04-30  8:09             ` Stefan Wahren
2014-04-30  9:32               ` Arnd Bergmann
2014-04-30 15:36             ` Stefan Wahren

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=535F4BEE.4080300@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@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).