All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: takasi-y@ops.dti.ne.jp
Cc: paul@codesourcery.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] SH: Improve the interrupt controller
Date: Sun, 14 Dec 2008 19:57:36 +0300	[thread overview]
Message-ID: <200812141957.37246.vladimir@codesourcery.com> (raw)
In-Reply-To: <200812141646.mBEGkdGR017687@smtp11.dti.ne.jp>

On Sunday 14 December 2008 19:46:39 takasi-y@ops.dti.ne.jp wrote:
> # a patch attached is not to be commit to repos, but for explanation.
> Hi,
> 
> > I have tested this only with SH4A and it's desirable to test
> > with 7751/R2D. However, I no longer sure I know which kernel
> > to use for that. Can anybody either provide me with instructions,
> > or test this patch with R2D for me?
> 
> It doesn't work at least here for me (for r2d).
> It stops with CPU load 100% (and I had to power my PC off...).

Bummer. Can you send me the kernel/rootfs combo you are using (either
link, or complete binary offlist) and I'll see what I've broken.

> BTW, I think your patch is not following to current sh_intc's design model.
> # please read to the end. this will be turned over later.
> 
> I think its design model is
>  - registering memory regions for each registers.
>  - read/write function doesn't check address
> But, you have add address check in read/write function.

It seems to me that read/write function does check address. Consider:

	static uint32_t sh_intc_read(void *opaque, target_phys_addr_t offset)
	{
	    ...
	    sh_intc_locate(desc, (unsigned long)offset, &valuep, 
			   &enum_ids, &first, &width, &mode);
            ...
	}

	static void sh_intc_locate(struct intc_desc *desc,
			   unsigned long address,
			   unsigned long **datap,
			   intc_enum **enums,
			   unsigned int *first,
			   unsigned int *width,
			   unsigned int *modep)
	{
	    ....
	    if (desc->mask_regs) {
                ...
	    	mode = sh_intc_mode(address, mr->set_reg, mr->clr_reg);
	        if (mode == INTC_MODE_NONE)
                    continue;
                ...
            }
            ...
        }
    }

So, read/write function do check addresses. On the other hand, each register
is registered separately. 

> 
> Mine(which I have forgotten to send..., only to move icr) is attached at the
>  end of this mail. This one is based on the recognition above.
> 
> It works, but I wonder if this model is valid or not on mmio system after #5849.
> Especially here is in question,
> +    cpu_register_physical_memory(P4ADDR(base), 2, io_memory);
> +    cpu_register_physical_memory(A7ADDR(base), 2, io_memory);
> 
> Paul(the author of #5849) said,
> > [1] It's actually the offset from the start of the first page of that region. 
> > In practice this difference doesn't matter, and makes the implementation a 
> > lot simpler.
> 
> I don't know why he thought it "doesn't matter", but from discussions on ML,
>  I guess the model he have is
>  - register one memory region for each modules.
>  - read/write function check address
>  - most of modules are aligned to page.

It is my understanding too. It seems that it's not hard to move sh_intc to this
model -- we just need to register entire region, as opposed to registering
memory for each register.

> In that case, your patch is nearer to the model.
> But, then, we should done with these,
>         cpu_register_physical_memory_offset(P4ADDR(address), 4,
>                                             desc->iomemtype, INTC_A7(address));
>         cpu_register_physical_memory_offset(A7ADDR(address), 4,
>                                             desc->iomemtype, INTC_A7(address));

Yes, both these, and sh_intc_register should not do piecewise registration if
we decide to change model.

- Volodya

  reply	other threads:[~2008-12-14 16:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 19:52 [Qemu-devel] SH: Improve the interrupt controller Vladimir Prus
2008-12-11 21:16 ` Jean-Christophe PLAGNIOL-VILLARD
2008-12-12  5:48   ` [Qemu-devel] " Vladimir Prus
2008-12-14 16:46 ` [Qemu-devel] " takasi-y
2008-12-14 16:57   ` Vladimir Prus [this message]
2009-01-26 13:32     ` Vladimir Prus
2009-01-26 23:51       ` Shin-ichiro KAWASAKI
2009-02-04 16:40       ` takasi-y
2009-02-08 18:57         ` takasi-y
2009-02-12 11:05           ` Vladimir Prus
2009-02-17 18:32             ` takasi-y
2009-02-19 19:57               ` Vladimir Prus
2009-03-13 17:50                 ` takasi-y
2009-03-13 18:32                   ` Vladimir Prus
2009-03-19 17:17                     ` takasi-y
2009-03-19 17:31                       ` Vladimir Prus
2009-02-20  3:06             ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-20  5:16               ` Vladimir Prus
2009-02-20  5:32                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-20  5:58                   ` Vladimir Prus
2009-02-20  5:59                     ` Jean-Christophe PLAGNIOL-VILLARD

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=200812141957.37246.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=takasi-y@ops.dti.ne.jp \
    /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.