All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mitsyanko <i.mitsyanko@samsung.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: e.voevodin@samsung.com, qemu-devel@nongnu.org,
	"Peter A. G. Crosthwaite" <peter.crosthwaite@petalogix.com>,
	kyungmin.park@samsung.com, d.solodkiy@samsung.com,
	edgar.iglesias@gmail.com, m.kozlov@samsung.com,
	john.williams@petalogix.com
Subject: Re: [Qemu-devel] [PATCH v5 2/4] exynos4210: Added SD host controller model
Date: Tue, 17 Jul 2012 16:55:02 +0400	[thread overview]
Message-ID: <500560A6.9000500@samsung.com> (raw)
In-Reply-To: <CAFEAcA8XQ9eTrsXHRAj4sxeD+63q=AstpqEXssHd8G2A=G61vA@mail.gmail.com>

On 07/16/2012 09:13 PM, Peter Maydell wrote:
> On 5 July 2012 05:04, Peter A. G. Crosthwaite
> <peter.crosthwaite@petalogix.com> wrote:
>> From: Igor Mitsyanko <i.mitsyanko@samsung.com>
>>
>> Custom Exynos4210 SD/MMC host controller, based on SD association standard host
>> controller ver. 2.00.
>>
>> Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
>> ---
>> changed from v4 (Igor):
>> set irq on SLOTINT status instead of interrupt registers status; instead;
> The IRQ handling code still looks really weird. I would expect
> that the code would be:
>    [code which updates various kinds of irq related state]
>    sdhci_update_irq();
>
> where sdhci_update_irq() calls qemu_set_irq() based on the state.
>
> At the moment it looks as if you're using slotint as a cached value
> of the expression
> "((s->norintsts & s->norintsigen) || (s->errintsts & s->errintsigen) ||
>   ((s->norintsts & SDHC_NIS_INSERT) && (s->wakcon & SDHC_WKUP_ON_INS)) ||
>   ((s->norintsts & SDHC_NIS_REMOVE) && (s->wakcon & SDHC_WKUP_ON_RMV)))"
>
> [can these two ever have different values?] and also attempting to
> shortcut by manually updating slotint in codepaths which change only
> parts of the state which this expression is testing. Why not just do
> things the simple and straightforward way and get rid of slotint
> completely?
>
> -- PMM
>

Linux seems to ignore SLOTINT status register, probably because it only 
supports single slot configuration while SLOTINT really required for 
multislot controllers only, so I think we can remove it completely and 
simply return 0 on reads. Same for status of WAKCON register, nobody 
cares about controller's wakeup functionality. Then update irq function 
could be simplified to

  "qemu_set_irq(s->irq, (s->norintsts & s->norintsigen) || (s->errintsts 
& s->errintsigen))"

I think thats how it was done originally. I'll send incremental patch to 
Peter off-list, if he and everyone else agree to handle interrupts this way.

  reply	other threads:[~2012-07-17 12:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-05  4:03 [Qemu-devel] [PATCH v5 0/4] Standard SD host controller model Peter A. G. Crosthwaite
2012-07-05  4:03 ` [Qemu-devel] [PATCH v5 1/4] hw: introduce standard SD host controller Peter A. G. Crosthwaite
2012-07-05  4:04 ` [Qemu-devel] [PATCH v5 2/4] exynos4210: Added SD host controller model Peter A. G. Crosthwaite
2012-07-16 17:13   ` Peter Maydell
2012-07-17 12:55     ` Igor Mitsyanko [this message]
2012-07-17 13:37       ` Peter Maydell
2012-07-17 14:58         ` Igor Mitsyanko
2012-07-17 15:04           ` Peter Maydell
2012-07-18  7:13             ` Peter Crosthwaite
2012-07-05  4:04 ` [Qemu-devel] [PATCH v5 3/4] vl.c: allow for repeated -sd arguments Peter A. G. Crosthwaite
2012-07-16 17:28   ` Peter Maydell
2012-07-05  4:04 ` [Qemu-devel] [PATCH v5 4/4] xilinx_zynq: Added SD controllers Peter A. G. Crosthwaite
2012-07-16 17:28   ` Peter Maydell

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=500560A6.9000500@samsung.com \
    --to=i.mitsyanko@samsung.com \
    --cc=d.solodkiy@samsung.com \
    --cc=e.voevodin@samsung.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=john.williams@petalogix.com \
    --cc=kyungmin.park@samsung.com \
    --cc=m.kozlov@samsung.com \
    --cc=peter.crosthwaite@petalogix.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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.