mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Walleij <linus.ml.walleij@gmail.com>
To: David Vrabel <david.vrabel@csr.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Pierre Ossman <pierre@ossman.eu>,
	linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [PATCH 1/2] MMC Agressive clocking framework v5
Date: Thu, 23 Jul 2009 22:30:40 +0200	[thread overview]
Message-ID: <63386a3d0907231330h8695afdsdf7d642d3765b56c@mail.gmail.com> (raw)
In-Reply-To: <4A68709E.5060207@csr.com>

2009/7/23 David Vrabel <david.vrabel@csr.com>:
> Linus Walleij wrote:
>> 2009/7/22 David Vrabel <david.vrabel@csr.com>:

>>> 1. With some controllers (e.g., PXA270 I think) turning the clock on and
>>> off is slow.  This means if you're doing back-to-back commands you
>>> should leave the clock on for best performance.
>>
>> OK, when I've been testing this using the default workqueue and
>> schedule_work() covered these cases. Back-on-back commands
>> seemingly doesn't allow the timeout work to schedule, but I might be
>> overseeing the case of several CPU:s there though :-/
>
> Ok, with a configurable timeout your scheme is fine.  The timeout can be
> extended beyond 8 SDCLKs if this is beneficial.

Yep I have that in debugfs, but when I look at Adrians code I see he instead
added a disable delay field to the host struct so let's use his patch
instead then.

> I'm not sure what the best way to add this would be.  You could:
>
> 1. Have a special clock frequency to mean idle and fix up all existing
> controller drivers to interpret this as 400 kHz unless you know the
> controller handles SDIO interrupts with no SDCLK.
>
> or:
>
> 2. Add an additional controller method (set_bus_state?) and only provide
> this on controller drivers you're interested in.

As discussed with Adrian this is what his patch does (adding a new host->ops
function for enable/disable) so let's use his patch.

>>> 3. Regardless of point 1 above.  Using a workqueue item in this way
>>> seems overkill.  Consider using a timer and simply calling mod_timer()
>>> at the start of every command.  When the timer expires, idle the clock.
>>>  You will probably need a "command in progress" bit to ensure you don't
>>> idle the clock if the timer expires in the middle of a command.
>>
>> I would agree if I created a new workqueue, but the timeout of this
>> particular workqueue is unimportant and that's why I'm using the
>> global workqueue and just schedule_work(). This means no extra
>> overhead, no extra thread and basically does the exact same thing.
>
> You currently queue a work item and wake the workqueue every command.
> This is considerably more overhead (when doing back-to-back commands)
> than simply calling mod_timer().
>
> You also potentially delay for a considerable amount of time in the work
> item.

Yep that's the idea almost... But let's raise the timer debate again with
Adrian's patch instead :-)

Linus Walleij

      parent reply	other threads:[~2009-07-23 20:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-20 22:26 Linus Walleij
2009-07-21 20:28 ` Linus Walleij
2009-07-21 20:35   ` Marek Vasut
2009-07-21 22:44     ` Linus Walleij
2009-07-22  0:46 ` Madhusudhan
2009-07-22 12:11 ` David Vrabel
2009-07-22 22:33   ` Linus Walleij
2009-07-23 14:15     ` David Vrabel
2009-07-23 18:15       ` Adrian Hunter
2009-07-23 20:25         ` Linus Walleij
2009-07-24 22:03         ` Madhusudhan
2009-07-24 22:59           ` Andrew Morton
2009-07-25 11:35           ` Adrian Hunter
2009-07-23 20:30       ` Linus Walleij [this message]

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=63386a3d0907231330h8695afdsdf7d642d3765b56c@mail.gmail.com \
    --to=linus.ml.walleij@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david.vrabel@csr.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre@ossman.eu \
    /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®