All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <aar@pengutronix.de>
To: h.morris@cascoda.com
Cc: Harry Morris <harrymorris12@gmail.com>,
	linux-wpan@vger.kernel.org, stefan@osg.samsung.com,
	marcel@holtmann.org
Subject: Re: [PATCH v7 1/3] ieee802154: Add CA8210 IEEE 802.15.4 device driver
Date: Wed, 18 Jan 2017 10:27:07 +0100	[thread overview]
Message-ID: <2126830b-5721-ab9a-100f-ce607311a0ad@pengutronix.de> (raw)
In-Reply-To: <02d9d99c-5cb7-2bfe-6140-5eef3d93ccc6@cascoda.com>


Hi,

On 01/16/2017 12:47 PM, Harry Morris wrote:
> Hi Alex,
> 
> On 14/01/2017 17:13, Alexander Aring wrote:
>> Hi,
>>
>> On 01/10/2017 04:41 PM, Harry Morris wrote:
>>> <snip>
>>> +
>>> +    if (ca8210_spi_transfer(
>>> +
>>> +/**
>>> + * ca8210_xmit_async() - Asynchronously transmits a given socket buffer using
>>> + *                       the ca8210
>>> + * @hw:   ieee802154_hw of ca8210 to transmit from
>>> + * @skb:  Socket buffer to transmit
>>> + *
>>> + * Return: 0 or linux error code
>>> + */
>>> +static int ca8210_xmit_async(struct ieee802154_hw *hw, struct sk_buff *skb)
>>> +{
>>> +    struct ca8210_priv *priv = hw->priv;
>>> +    int status;
>>> +
>>> +    dev_dbg(&priv->spi->dev, "calling ca8210_xmit_async()\n");
>>> +
>>> +    priv->tx_skb = skb;
>>> +    priv->async_tx_pending = true;
>>> +    status = ca8210_skb_tx(skb, priv->nextmsduhandle, priv);
>>> +    queue_delayed_work(
>>> +        priv->async_tx_workqueue,
>>> +        &priv->async_tx_timeout_work,
>>> +        msecs_to_jiffies(CA8210_DATA_CNF_TIMEOUT)
>>> +    );
>>> +    return status;
>>> +}
>> I thought you fixed now to use spi_async here. Do not a context switch
>> here to a workqueue.
>> You need to run spi_async which is allowed in non sleeping context.
> So the workqueue here is for the /timeout/ work, not the actual transmission. I'm first calling ca8210_skb_tx which is calling spi_async further down, then using the workqueue to schedule a timeout if the MCPS-DATA.confirm is not received in a reasonable time. I'm aware that the stack will have its own timeout if xmit_complete is not called but this identifies the problem more specifically. I guess I can remove it if it seems like a bad idea.
> 

this should be provide by netdev watchdog callback -> such feature need
subsystem support.

- Alex

  parent reply	other threads:[~2017-01-18  9:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 15:41 [PATCH v7 0/3] ieee802154: Add support for Cascoda CA8210 Harry Morris
2017-01-10 15:41 ` [PATCH v7 1/3] ieee802154: Add CA8210 IEEE 802.15.4 device driver Harry Morris
2017-01-13 12:59   ` Stefan Schmidt
     [not found]   ` <84e02f0a-9b85-888e-be2a-d9d72fd7b7a0@pengutronix.de>
2017-01-16 11:47     ` Harry Morris
2017-01-17 10:08       ` Marcel Holtmann
2017-01-18  9:27       ` Alexander Aring [this message]
2017-01-10 15:41 ` [PATCH v7 2/3] ieee802154: Add device tree documentation for CA8210 Harry Morris
     [not found]   ` <20170110154122.6724-3-h.morris-viW/wkEPc65BDgjK7y7TUQ@public.gmane.org>
2017-01-13 12:47     ` Stefan Schmidt
2017-01-13 12:47       ` Stefan Schmidt
2017-01-10 15:41 ` [PATCH v7 3/3] ieee802154: Add entry in MAINTAINTERS for CA8210 driver Harry Morris

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=2126830b-5721-ab9a-100f-ce607311a0ad@pengutronix.de \
    --to=aar@pengutronix.de \
    --cc=h.morris@cascoda.com \
    --cc=harrymorris12@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=stefan@osg.samsung.com \
    /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.