mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: David Cohen <david.a.cohen@linux.intel.com>
Cc: matthew.garrett@nebula.com, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, eric.ernst@linux.intel.com,
	Kuppuswamy Sathyanarayanan 
	<sathyanarayanan.kuppuswamy@linux.intel.com>
Subject: Re: [PATCH 3/3] ipc: Added support for IPC interrupt mode
Date: Thu, 14 Nov 2013 13:48:42 +0000	[thread overview]
Message-ID: <20131114134842.7225c7f8@alan.etchedpixels.co.uk> (raw)
In-Reply-To: <1384373671-12814-4-git-send-email-david.a.cohen@linux.intel.com>

O> +	prompt "IPC access mode"
> +	depends on INTEL_SCU_IPC
> +	default INTEL_SCU_IPC_INTR_MODE
> +	---help---
> +	Select the desired access mode for IPC call.

This seems to depend at runtime on the platform so ifdefs seem
inappropriate.

>  static inline void ipc_command(u32 cmd) /* Send ipc command */
>  {
> +#ifdef CONFIG_INTEL_SCU_IPC_INTR_MODE
> +	INIT_COMPLETION(ipcdev.cmd_complete);
> +	writel(cmd | IPC_IOC, ipcdev.ipc_base);
> +#else
>  	writel(cmd, ipcdev.ipc_base);
> +#endif
>  }

If this is platform specific then add an IRQ to your platform data and
check for it then set an irq field in your scu objects and check at
runtime. If it depends upon the command and/or user then pass irq as a
parameter.

>  
>  /*
> @@ -194,6 +203,37 @@ static inline int busy_loop(void) /* Wait till scu status is busy */
>  	return 0;
>  }
>  
> +#ifdef CONFIG_INTEL_SCU_IPC_INTR_MODE
> +/* Wait till ipc ioc interrupt is received or timeout in 3 HZ */
> +static inline int ipc_wait_for_interrupt(void)
> +{
> +	int status;
> +	int ret = 0;
> +
> +	if (!wait_for_completion_timeout(&ipcdev.cmd_complete, 3 * HZ)) {
> +		ret = -ETIMEDOUT;
> +		goto end;
> +	}
> +
> +	status = ipc_read_status();
> +
> +	if ((status >> 1) & 1)
> +		ret = -EIO;
> +
> +end:
> +	return ret;

What happens on a timeout if the command then completes. Will it not
potentially produce a bogus completion on the next command just being
issued in some cases. Also it should probably be logged ?


So I think

1. Pass the informatio upon whether IRQ mode should be used in the
platform information and remove all the ifdeffery
2. Log timeouts
3. Explain what happens on a timeout that allows you to issue further
commands without a race - eg do you need to do any kind of reset or will
the next command issue stall sufficiently etc ?

Alan

  reply	other threads:[~2013-11-14 13:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 20:14 [PATCH 0/3] Enable more Intel Mid platforms on IPC driver David Cohen
2013-11-13 20:14 ` [PATCH 1/3] ipc: Added platform data structure David Cohen
2013-11-14 13:42   ` One Thousand Gnomes
2013-11-13 20:14 ` [PATCH 2/3] ipc: Enabled ipc support for additional intel platforms David Cohen
2013-11-14 13:43   ` One Thousand Gnomes
2013-11-14 17:31     ` David Cohen
2013-11-14 21:01       ` One Thousand Gnomes
2013-11-13 20:14 ` [PATCH 3/3] ipc: Added support for IPC interrupt mode David Cohen
2013-11-14 13:48   ` One Thousand Gnomes [this message]
2013-11-14 17:36     ` David Cohen
2013-11-14 21:00       ` One Thousand Gnomes
2013-11-14 21:31         ` David Cohen
2013-11-14 22:15 ` [PATCH v2 0/4] Enable more Intel Mid platforms on IPC driver David Cohen
2013-11-14 22:15   ` [PATCH v2 1/4] ipc: Added platform data structure David Cohen
2013-11-14 22:15   ` [PATCH v2 2/4] ipc: Enabled ipc support for additional intel platforms David Cohen
2013-11-14 22:15   ` [PATCH v2 3/4] ipc: Handle error conditions in ipc command David Cohen
2013-11-14 22:15   ` [PATCH v2 4/4] ipc: Added support for IPC interrupt mode David Cohen
2013-11-16  0:21     ` [PATCH v2.1] " David Cohen
2013-11-21  1:45       ` [PATCH v2.2] " Kuppuswamy Sathyanarayanan
2013-11-21  1:47         ` Matthew Garrett
2013-11-21  1:48           ` sathyanarayanan kuppuswamy
2013-11-20 23:51   ` [PATCH v2 0/4] Enable more Intel Mid platforms on IPC driver Matthew Garrett

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=20131114134842.7225c7f8@alan.etchedpixels.co.uk \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=david.a.cohen@linux.intel.com \
    --cc=eric.ernst@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.garrett@nebula.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.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 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®