2011-04-12 15:15:51

by Cyril Hrubis

[permalink] [raw]
Subject: zaurus: mmcblk0: error -110

Hi!
When I insert the mmc card to zaurus, it gets properly detected and prints some
info into console. Mounting reading/writing files works fine.

However when the card is removed (doesn't need to be mounted before), the
removal is most likely not detected, so when I insert it again, no info is
printed into console and moreover when I try to mount it zaurus goes into
infinite loop printing:

Buffer I/O error on device mmcblk0p1, logical block 9
mmcblk0: error -110 sending status command
mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
end_request: I/O error, dev mmcblk0, sector 257
Buffer I/O error on device mmcblk0p1, logical block 10
mmcblk0: error -110 sending status command
mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
end_request: I/O error, dev mmcblk0, sector 258
Buffer I/O error on device mmcblk0p1, logical block 11
mmcblk0: error -110 sending status command
mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
end_request: I/O error, dev mmcblk0, sector 259
Buffer I/O error on device mmcblk0p1, logical block 12
mmcblk0: error -110 sending status command
mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
...

Related part of the .config:

#
# OTG and related infrastructure
#
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_USB_ULPI is not set
# CONFIG_NOP_USB_XCEIV is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_UNSAFE_RESUME=y
# CONFIG_MMC_CLKGATE is not set

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_PXA=y

--
metan


2011-04-12 15:18:11

by Eric Miao

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi Cyril,

Which model do you have? And check the corresponding board file if
card detect GPIO handling is doing right.

- eric

On Tue, Apr 12, 2011 at 11:15 PM, Cyril Hrubis <[email protected]> wrote:
> Hi!
> When I insert the mmc card to zaurus, it gets properly detected and prints some
> info into console. Mounting reading/writing files works fine.
>
> However when the card is removed (doesn't need to be mounted before), the
> removal is most likely not detected, so when I insert it again, no info is
> printed into console and moreover when I try to mount it zaurus goes into
> infinite loop printing:
>
> Buffer I/O error on device mmcblk0p1, logical block 9
> mmcblk0: error -110 sending status command
> mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
> end_request: I/O error, dev mmcblk0, sector 257
> Buffer I/O error on device mmcblk0p1, logical block 10
> mmcblk0: error -110 sending status command
> mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
> end_request: I/O error, dev mmcblk0, sector 258
> Buffer I/O error on device mmcblk0p1, logical block 11
> mmcblk0: error -110 sending status command
> mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
> end_request: I/O error, dev mmcblk0, sector 259
> Buffer I/O error on device mmcblk0p1, logical block 12
> mmcblk0: error -110 sending status command
> mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
> ...
>
> Related part of the .config:
>
> #
> # OTG and related infrastructure
> #
> # CONFIG_USB_GPIO_VBUS is not set
> # CONFIG_USB_ULPI is not set
> # CONFIG_NOP_USB_XCEIV is not set
> CONFIG_MMC=y
> # CONFIG_MMC_DEBUG is not set
> CONFIG_MMC_UNSAFE_RESUME=y
> # CONFIG_MMC_CLKGATE is not set
>
> #
> # MMC/SD/SDIO Card Drivers
> #
> CONFIG_MMC_BLOCK=y
> CONFIG_MMC_BLOCK_MINORS=8
> CONFIG_MMC_BLOCK_BOUNCE=y
> # CONFIG_SDIO_UART is not set
> # CONFIG_MMC_TEST is not set
>
> #
> # MMC/SD/SDIO Host Controller Drivers
> #
> CONFIG_MMC_PXA=y
>
> --
> metan
>

2011-04-12 15:23:15

by Cyril Hrubis

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi!
> Which model do you have? And check the corresponding board file if
> card detect GPIO handling is doing right.

I've got spitz (SL-3200).

So I suppose the board file is arch/arm/mach-pxa/spitz.c, I'll have a look.

--
metan

2011-04-12 15:52:21

by Cyril Hrubis

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi!
> > Which model do you have? And check the corresponding board file if
> > card detect GPIO handling is doing right.
>
> I've got spitz (SL-3200).
>
> So I suppose the board file is arch/arm/mach-pxa/spitz.c, I'll have a look.

Hmm, besides cleanup by Marek Vasut there were no changes in the code. And it
seems that it was just cleanup in spitz_card_pwr_ctrl().

--
metan

2011-04-12 18:04:17

by Pavel Machek

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

On Tue 2011-04-12 17:52:17, Cyril Hrubis wrote:
> Hi!
> > > Which model do you have? And check the corresponding board file if
> > > card detect GPIO handling is doing right.
> >
> > I've got spitz (SL-3200).
> >
> > So I suppose the board file is arch/arm/mach-pxa/spitz.c, I'll have a look.
>
> Hmm, besides cleanup by Marek Vasut there were no changes in the code. And it
> seems that it was just cleanup in spitz_card_pwr_ctrl().

With vanilla 2.6.38, I observe similar problem. MMC removal is not
detected; I get "error -110 whilst initalising SD card" on reinsert.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2011-04-12 19:19:56

by Chris Ball

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi,

(Adding linux-mmc@.)

On Tue, Apr 12 2011, Cyril Hrubis wrote:
> Hi!
> When I insert the mmc card to zaurus, it gets properly detected and prints some
> info into console. Mounting reading/writing files works fine.
>
> However when the card is removed (doesn't need to be mounted before), the
> removal is most likely not detected, so when I insert it again, no info is
> printed into console and moreover when I try to mount it zaurus goes into
> infinite loop printing:
>
> Buffer I/O error on device mmcblk0p1, logical block 9
> mmcblk0: error -110 sending status command
> mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
> end_request: I/O error, dev mmcblk0, sector 257
> Buffer I/O error on device mmcblk0p1, logical block 10
> ...
>
> Related part of the .config:
>
> #
> # OTG and related infrastructure
> #
> # CONFIG_USB_GPIO_VBUS is not set
> # CONFIG_USB_ULPI is not set
> # CONFIG_NOP_USB_XCEIV is not set
> CONFIG_MMC=y
> # CONFIG_MMC_DEBUG is not set
> CONFIG_MMC_UNSAFE_RESUME=y

Your symptoms match the bug that was fixed by:

bad3babace2ee4d ("mmc: fix CONFIG_MMC_UNSAFE_RESUME regression")

but this fix made it into 2.6.38, so if you're using 2.6.38 final then
you shouldn't be seeing this. Could you confirm that you have this
patch?

If so, could you try building a kernel with CONFIG_MMC_UNSAFE_RESUME=n
and see if you still have the same problem?

- Chris.
--
Chris Ball <[email protected]> <http://printf.net/>
One Laptop Per Child

2011-04-12 19:39:47

by Cyril Hrubis

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi!
> > When I insert the mmc card to zaurus, it gets properly detected and prints some
> > info into console. Mounting reading/writing files works fine.
> >
> > However when the card is removed (doesn't need to be mounted before), the
> > removal is most likely not detected, so when I insert it again, no info is
> > printed into console and moreover when I try to mount it zaurus goes into
> > infinite loop printing:
> >
> > Buffer I/O error on device mmcblk0p1, logical block 9
> > mmcblk0: error -110 sending status command
> > mmcblk0: error -110 sending read/write command, response 0xb00, card status 0xb00
> > end_request: I/O error, dev mmcblk0, sector 257
> > Buffer I/O error on device mmcblk0p1, logical block 10
> > ...
> >
> > Related part of the .config:
> >
> > #
> > # OTG and related infrastructure
> > #
> > # CONFIG_USB_GPIO_VBUS is not set
> > # CONFIG_USB_ULPI is not set
> > # CONFIG_NOP_USB_XCEIV is not set
> > CONFIG_MMC=y
> > # CONFIG_MMC_DEBUG is not set
> > CONFIG_MMC_UNSAFE_RESUME=y
>
> Your symptoms match the bug that was fixed by:
>
> bad3babace2ee4d ("mmc: fix CONFIG_MMC_UNSAFE_RESUME regression")
>
> but this fix made it into 2.6.38, so if you're using 2.6.38 final then
> you shouldn't be seeing this. Could you confirm that you have this
> patch?

It seems that the pxa tree I have is still based on 2.6.38-rc8.

And yes, turning CONFIG_MMC_UNSAFE_RESUME off seems to fix that problem.

I'll try to update the kernel tree and try again with CONFIG_MMC_UNSAFE_RESUME
enabled.

--
metan

2011-04-12 19:42:50

by Chris Ball

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi,

On Tue, Apr 12 2011, Cyril Hrubis wrote:
>> Your symptoms match the bug that was fixed by:
>>
>> bad3babace2ee4d ("mmc: fix CONFIG_MMC_UNSAFE_RESUME regression")
>>
>> but this fix made it into 2.6.38, so if you're using 2.6.38 final then
>> you shouldn't be seeing this. Could you confirm that you have this
>> patch?
>
> It seems that the pxa tree I have is still based on 2.6.38-rc8.
>
> And yes, turning CONFIG_MMC_UNSAFE_RESUME off seems to fix that problem.
>
> I'll try to update the kernel tree and try again with CONFIG_MMC_UNSAFE_RESUME
> enabled.

Okay, great. It was introduced in 2.6.38-rc1 and fixed in 2.6.38 final.

- Chris.
--
Chris Ball <[email protected]> <http://printf.net/>
One Laptop Per Child

2011-04-12 20:54:24

by Cyril Hrubis

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi!
> >> Your symptoms match the bug that was fixed by:
> >>
> >> bad3babace2ee4d ("mmc: fix CONFIG_MMC_UNSAFE_RESUME regression")
> >>
> >> but this fix made it into 2.6.38, so if you're using 2.6.38 final then
> >> you shouldn't be seeing this. Could you confirm that you have this
> >> patch?
> >
> > It seems that the pxa tree I have is still based on 2.6.38-rc8.
> >
> > And yes, turning CONFIG_MMC_UNSAFE_RESUME off seems to fix that problem.
> >
> > I'll try to update the kernel tree and try again with CONFIG_MMC_UNSAFE_RESUME
> > enabled.
>
> Okay, great. It was introduced in 2.6.38-rc1 and fixed in 2.6.38 final.
>

Tried 2.6.39-rc3 both with and without CONFIG_MMC_UNSAFE_RESUME and the
insert/remove detection works but both with and without unsafe resume, if the
card is removed for more than second or two it fails to recognize the card
after insertion failing with:

mmc0: error -95 whilst initialising SD card

--
metan

2011-04-12 21:16:32

by Chris Ball

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi,

On Tue, Apr 12 2011, Cyril Hrubis wrote:
> Tried 2.6.39-rc3 both with and without CONFIG_MMC_UNSAFE_RESUME and the
> insert/remove detection works but both with and without unsafe resume, if the
> card is removed for more than second or two it fails to recognize the card
> after insertion failing with:
>
> mmc0: error -95 whilst initialising SD card

That's interesting. Would you mind trying to bisect? (Knowing whether
2.6.38 final does it, for example, would be very helpful.)

There aren't many -EOPNOTSUPP returns in the stack. I see:

card/block.c: mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq
card/core.c: mmc_erase
core/sd_ops.c: mmc_app_cmd

Mind doing some instrumentation to figure out which it is?

Thanks,

- Chris.
--
Chris Ball <[email protected]> <http://printf.net/>
One Laptop Per Child

2011-04-12 21:34:42

by Chris Ball

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi,

On Tue, Apr 12 2011, Chris Ball wrote:
> There aren't many -EOPNOTSUPP returns in the stack. I see:
>
> card/block.c: mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq
> card/core.c: mmc_erase
> core/sd_ops.c: mmc_app_cmd
>
> Mind doing some instrumentation to figure out which it is?

Actually, this probably isn't necessary -- mmc_app_cmd() is the only call
involved in the setup path, via mmc_sd_init_card() -> mmc_app_send_scr().

So, a better question: was mmc_app_send_scr() succeeding on your previous
kernels? There hasn't been much change in this area lately.

Thanks,

- Chris.
--
Chris Ball <[email protected]> <http://printf.net/>
One Laptop Per Child

2011-04-12 22:43:37

by Cyril Hrubis

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi!
> > Tried 2.6.39-rc3 both with and without CONFIG_MMC_UNSAFE_RESUME and the
> > insert/remove detection works but both with and without unsafe resume, if the
> > card is removed for more than second or two it fails to recognize the card
> > after insertion failing with:
> >
> > mmc0: error -95 whilst initialising SD card
>
> That's interesting. Would you mind trying to bisect? (Knowing whether
> 2.6.38 final does it, for example, would be very helpful.)

It may need one or two tries on 2.6.38 but it's there too.

> There aren't many -EOPNOTSUPP returns in the stack. I see:
>
> card/block.c: mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq
> card/core.c: mmc_erase
> core/sd_ops.c: mmc_app_cmd
>
> Mind doing some instrumentation to figure out which it is?

Fails in the mmc_app_cmd.

--
metan

2011-04-12 22:48:45

by Chris Ball

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi,

On Tue, Apr 12 2011, Cyril Hrubis wrote:
>> > mmc0: error -95 whilst initialising SD card
>>
>> That's interesting. Would you mind trying to bisect? (Knowing whether
>> 2.6.38 final does it, for example, would be very helpful.)
>
> It may need one or two tries on 2.6.38 but it's there too.
>
>> There aren't many -EOPNOTSUPP returns in the stack. I see:
>>
>> card/block.c: mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq
>> card/core.c: mmc_erase
>> core/sd_ops.c: mmc_app_cmd
>>
>> Mind doing some instrumentation to figure out which it is?
>
> Fails in the mmc_app_cmd.

Okay. mmc_app_cmd() hasn't changed for years, so I'm afraid I don't
have any strong leads for you -- further bisection (you're pretty
sure this is a regression?) would be very useful.

Thanks,

- Chris.
--
Chris Ball <[email protected]> <http://printf.net/>
One Laptop Per Child

2011-04-13 17:10:59

by Marek Vasut

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

On Tuesday, April 12, 2011 08:04:14 PM Pavel Machek wrote:
> On Tue 2011-04-12 17:52:17, Cyril Hrubis wrote:
> > Hi!
> >
> > > > Which model do you have? And check the corresponding board file if
> > > > card detect GPIO handling is doing right.
> > >
> > > I've got spitz (SL-3200).
> > >
> > > So I suppose the board file is arch/arm/mach-pxa/spitz.c, I'll have a
> > > look.
> >
> > Hmm, besides cleanup by Marek Vasut there were no changes in the code.
> > And it seems that it was just cleanup in spitz_card_pwr_ctrl().
>
> With vanilla 2.6.38, I observe similar problem. MMC removal is not
> detected; I get "error -110 whilst initalising SD card" on reinsert.
> Pavel

I don't observe this problem with my tree (.38-rc8+). I'll have to check
properly though. (On SL-C1000)

Cyril, can you bisect between .37 and .38? I suspect some change in mmc subsys.

Cheers

2011-04-13 17:12:22

by Marek Vasut

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

On Wednesday, April 13, 2011 07:10:53 PM Marek Vasut wrote:
> On Tuesday, April 12, 2011 08:04:14 PM Pavel Machek wrote:
> > On Tue 2011-04-12 17:52:17, Cyril Hrubis wrote:
> > > Hi!
> > >
> > > > > Which model do you have? And check the corresponding board file if
> > > > > card detect GPIO handling is doing right.
> > > >
> > > > I've got spitz (SL-3200).
> > > >
> > > > So I suppose the board file is arch/arm/mach-pxa/spitz.c, I'll have a
> > > > look.
> > >
> > > Hmm, besides cleanup by Marek Vasut there were no changes in the code.
> > > And it seems that it was just cleanup in spitz_card_pwr_ctrl().
> >
> > With vanilla 2.6.38, I observe similar problem. MMC removal is not
> > detected; I get "error -110 whilst initalising SD card" on reinsert.
> >
> > Pavel
>
> I don't observe this problem with my tree (.38-rc8+). I'll have to check
> properly though. (On SL-C1000)
>
> Cyril, can you bisect between .37 and .38? I suspect some change in mmc
> subsys.
>
> Cheers

I see it was solved, ignore this ;-)

2011-04-15 21:33:17

by Cyril Hrubis

[permalink] [raw]
Subject: Re: zaurus: mmcblk0: error -110

Hi!
> >> > mmc0: error -95 whilst initialising SD card
> >>
> >> That's interesting. Would you mind trying to bisect? (Knowing whether
> >> 2.6.38 final does it, for example, would be very helpful.)
> >
> > It may need one or two tries on 2.6.38 but it's there too.
> >
> >> There aren't many -EOPNOTSUPP returns in the stack. I see:
> >>
> >> card/block.c: mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq
> >> card/core.c: mmc_erase
> >> core/sd_ops.c: mmc_app_cmd
> >>
> >> Mind doing some instrumentation to figure out which it is?
> >
> > Fails in the mmc_app_cmd.
>
> Okay. mmc_app_cmd() hasn't changed for years, so I'm afraid I don't
> have any strong leads for you -- further bisection (you're pretty
> sure this is a regression?) would be very useful.

Well, I was using some old kernel there and updated to the 2.6.38 recently so
only clue I do have is that it was working on like 2 years old kernel.

And bisection is quite complicated, as number of kernel images simply doesn't
boot there. :(

I will look on this next week (hopefully) thanks anyway for your help so far.

--
metan