All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Kurachkin Michail <Michail.Kurachkin@promwad.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Kuten Ivan <Ivan.Kuten@promwad.com>,
	"benavi@marvell.com" <benavi@marvell.com>,
	Palstsiuk Viktar <Viktar.Palstsiuk@promwad.com>
Subject: Re: TDM bus support in Linux Kernel [PATCH]
Date: Wed, 30 Jan 2013 14:43:29 +0100	[thread overview]
Message-ID: <2570275.zfck7HrlM6@linux-5eaq.site> (raw)
In-Reply-To: <F7F628C32E67B04DAECC5CA53521253E5FAB15CE@sv-exmb01-lo1.promwad.corp>

On Wednesday 30 January 2013 12:37:25 Kurachkin Michail wrote:
> Hi Greg,
> 
> I followed your recommendations and created a diff using Linux 3.8-rc5 sources. Please review it and give your comments.
> 
Part #5

+/**
+ * Reset SLIC
+ */
+static int slic_reset(struct si3226x_slic *slic)
+{
+	unsigned long timeout;
+
+	gpio_set_value(slic->reset_gpio, 0);
+
+	timeout = jiffies + MSEC(RESET_SLIC_PERIOD);
+
+	while(!(time_after(jiffies, timeout)))
+		schedule();

Ouch. We have a delay primitive.

+
+	gpio_set_value(slic->reset_gpio, 1);
+
+	return 0;
+}

+/**
+ * Receive voice data block from TDM voice channel controller.
+ * @param ch - voice channel attendant to transmit data in TDM frame
+ * @param data - pointer to read data received by DMA.
+                 Length data for read equal to value returned by get_tdm_voice_block_size()
+ *
+ * Context: can sleep
+ * @return 0 on success; negative errno on failure
+ */
+static int kirkwood_recv(struct tdm_voice_channel *ch, u8 *data)
+{
+	struct kirkwood_tdm_voice *onchip_ch = ch->private_data;
+
+	wait_event_interruptible(ch->rx_queue,
+	                         get_rx_latency(onchip_ch) > 1);

If you are waiting interruptably, you need to be able to handle an interruption.

+
+	memcpy(data, onchip_ch->rx_buf[atomic_read(&onchip_ch->read_rx_buf_num)],
+	       ch->buffer_len);
+
+	atomic_set(&onchip_ch->read_rx_buf_num,
+	           inc_next_dma_buf_num(atomic_read(&onchip_ch->read_rx_buf_num)));
+
+	return 0;
+}

  parent reply	other threads:[~2013-01-30 13:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 12:37 TDM bus support in Linux Kernel [PATCH] Kurachkin Michail
2013-01-30 12:59 ` Oliver Neukum
2013-02-04 13:08   ` Re[2]: " Michail Kurachkin
2013-02-05 15:34     ` Oliver Neukum
2013-02-13 17:08       ` Re[2]: " Michail Kurachkin
2013-02-14 12:46         ` Ivan Kuten
2013-01-30 13:03 ` Oliver Neukum
2013-01-30 13:28 ` Oliver Neukum
2013-01-30 13:35 ` Oliver Neukum
2013-01-30 13:43 ` Oliver Neukum [this message]
2013-01-30 15:57 ` Greg Kroah-Hartman
     [not found] ` <511044C9.9090809@gmail.com>
2013-02-04 23:49   ` Greg Kroah-Hartman

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=2570275.zfck7HrlM6@linux-5eaq.site \
    --to=oneukum@suse.de \
    --cc=Ivan.Kuten@promwad.com \
    --cc=Michail.Kurachkin@promwad.com \
    --cc=Viktar.Palstsiuk@promwad.com \
    --cc=benavi@marvell.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 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.