Re: mmc: tmio: why enable/disable SDIO irq on every transaction with IOMOD?

2016-12-01 Thread Wolfram Sang
Hi,

> Is Arnd Hannemann, the author, around these days by any chance?

According to git history, he is sending a patch occasionally, but all
his SH involvement was from 2010. I don't know him.

> We don't have it yet.  A question we have is that where should we
> enable / disable the IOMOD?

I think unconditionally in probe. I will send an RFC with some
explanations in a minute.

Thanks,

   Wolfram



signature.asc
Description: PGP signature


Re: mmc: tmio: why enable/disable SDIO irq on every transaction with IOMOD?

2016-12-01 Thread Yasushi SHOJI
Hi Wolfram,

On Thu, 01 Dec 2016 19:46:22 +0900,
Wolfram Sang wrote:
> 
> > > So my question is that "What is the reason behind to disable IRQ with
> > > SDIO_MODE?  Is there any situation which masking with SDIO_INFO1_MASK
> > > is not enough?
> 
> The code was introduced with 845ecd20239c28 ("mmc: tmio_mmc: implement
> SDIO IRQ support") which was in 2010. I don't have that old datasheets
> to check if the SCLKDIVEN restriction was already present in the SDHI
> cores which were available back then.

Is Arnd Hannemann, the author, around these days by any chance?

Or does anyone on the list have a shareable old datasheet?  The one we
have is the one for R-Mobile A1 and has CONFIDENTIAL on it.

> My assumption is that it was not, or it was overlooked. So, it might be
> just for completeness that not only the individual IRQs have been
> disabled but also the big master switch (IOMOD) was turned off.
> 
> My further assumption is that it is very likely good enough to disable
> the individual IRQs. If we can't guarantee the conditions to set IOMOD,
> it seems okay to me to just leave it.

Yes that's what we think and what we see with our test code, which is
just the original without IOMOD removed.

> Do you have a patch which works for you?

We don't have it yet.  A question we have is that where should we
enable / disable the IOMOD?

Do we have to keep it disabled while the controller is in non-SDIO?
The spec says that we don't get SDIO irq while in non-SDIO mode.  But
should we trust?

Or, should we disable it when we switch back to non-SDIO mode and
enable when we detect SDIO?

Please enlighten us this area.  We'll submit the proper fix once we
know how we should do it.

Thanks,
-- 
yashi


Re: mmc: tmio: why enable/disable SDIO irq on every transaction with IOMOD?

2016-12-01 Thread Wolfram Sang
Hi,

thanks for the report and thanks to Ulf for forwarding. Adding
renesas-soc list, too.

> > So my question is that "What is the reason behind to disable IRQ with
> > SDIO_MODE?  Is there any situation which masking with SDIO_INFO1_MASK
> > is not enough?

This code predates the time since I took over maintainership of the
driver, so I had to dig in git history.

The code was introduced with 845ecd20239c28 ("mmc: tmio_mmc: implement
SDIO IRQ support") which was in 2010. I don't have that old datasheets
to check if the SCLKDIVEN restriction was already present in the SDHI
cores which were available back then.

My assumption is that it was not, or it was overlooked. So, it might be
just for completeness that not only the individual IRQs have been
disabled but also the big master switch (IOMOD) was turned off.

My further assumption is that it is very likely good enough to disable
the individual IRQs. If we can't guarantee the conditions to set IOMOD,
it seems okay to me to just leave it.

Do you have a patch which works for you?

Regards,

   Wolfram



signature.asc
Description: PGP signature