linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	lugovskoy@dev.rtsoft.ru
Subject: Re: [PATCH] usb: pci-quirks: do not access OHCI_FMINTERVAL register on ULI hw
Date: Wed, 28 May 2014 11:20:08 +0400	[thread overview]
Message-ID: <53858E28.5000403@dev.rtsoft.ru> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1405271055240.1372-100000@iolanthe.rowland.org>

27.05.2014 19:08, Alan Stern пишет:
> On Tue, 27 May 2014, Nikita Yushchenko wrote:
> 
>> This access causes hang on Freescale P2020DS board (that has OHCI
>> provided by ULI 1533 chip).
> 
> Which access, the read or the write?

things are a bit more complex.

If inserting printk's as below


--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -619,16 +619,23 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
        }

        /* software reset of the controller, preserving HcFmInterval */
+       printk("A1\n");
        fminterval = readl(base + OHCI_FMINTERVAL);
+       printk("A2\n");
        writel(OHCI_HCR, base + OHCI_CMDSTATUS);
+       printk("A3\n");

        /* reset requires max 10 us delay */
        for (cnt = 30; cnt > 0; --cnt) {        /* ... allow extra time */
+               printk("A4\n");
                if ((readl(base + OHCI_CMDSTATUS) & OHCI_HCR) == 0)
                        break;
+               printk("A5\n");
                udelay(1);
        }
+       printk("A6\n");
        writel(fminterval, base + OHCI_FMINTERVAL);
+       printk("A7\n");

        /* Now the controller is safely in SUSPEND and nothing can wake it up */
        iounmap(base);

attempt to boot (using arch/powerpc/configs/mpc85xx_smp_defconfig and deb
file built by "make p2020ds.dtb" from the same kernel tree) results in

...
A1
random: nonblocking pool is initialized
irq 26: nobody cared (try booting with the "irqpoll" option)
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.15.0-rc6-dirty #5
Call Trace:
[effe5ed0] [c000726c] show_stack+0x48/0x15c (unreliable)
[effe5f10] [c05eece4] dump_stack+0x78/0xa0
[effe5f20] [c0087acc] __report_bad_irq+0x38/0x100
[effe5f40] [c0088060] note_interrupt+0x224/0x280
[effe5f70] [c008563c] handle_irq_event_percpu+0xc8/0x178
[effe5fa0] [c0085730] handle_irq_event+0x44/0x74
[effe5fc0] [c0088f88] handle_fasteoi_irq+0xd4/0x1d0
[effe5fd0] [c0084d20] generic_handle_irq+0x30/0x50
[effe5fe0] [c00048d0] __do_irq+0x2c/0x70
[effe5ff0] [c000d9a0] call_do_irq+0x24/0x3c
[ef047d10] [c00049a0] do_IRQ+0x8c/0xf8
[ef047d30] [c000f598] ret_from_except+0x0/0x18
--- Exception: 501 at quirk_usb_early_handoff+0x794/0x85c
    LR = quirk_usb_early_handoff+0x788/0x85c
[ef047e30] [c02bd66c] pci_fixup_device+0xe0/0x19c
[ef047e60] [c07d4e1c] pci_apply_final_quirks+0x60/0x13c
[ef047e90] [c0002494] do_one_initcall+0x158/0x19c
[ef047f00] [c07ba928] kernel_init_freeable+0x130/0x1e4
[ef047f30] [c0002a78] kernel_init+0x14/0x10c
[ef047f40] [c000f014] ret_from_kernel_thread+0x5c/0x64
handlers:
[<c001cc78>] fsl_pci_pme_handle
Disabling IRQ #26
A2
A3
A4
A5
A4
A5
A4
A5
A4
A5
A4

and hang.

with my patch applied, board just boots ok and works.


> It looks like you haven't read ohci_shutdown() and ohci_run() in 
> drivers/usb/host/ohci-hcd.c.  They both access the fminterval register, 
> and this patch doesn't change them.
> 
> So I don't see why this patch should make any difference to the 
> system's operation.

I think problem is caused by access to OHCI regs from PCI quirks - before
driver was initialized. ULI1553 southbridge chip could be in strange state
at this point.

Nikita

  reply	other threads:[~2014-05-28  7:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27  4:56 [PATCH] usb: pci-quirks: do not access OHCI_FMINTERVAL register on ULI hw Nikita Yushchenko
2014-05-27 15:08 ` Alan Stern
2014-05-28  7:20   ` Nikita Yushchenko [this message]
2014-05-28 14:24     ` Alan Stern
2014-05-29  5:34       ` Nikita Yushchenko
2014-05-29 14:32         ` Nikita Yushchenko
2014-05-29 14:42           ` One Thousand Gnomes
2014-05-29 15:33             ` Nikita Yushchenko
2014-05-29 15:35               ` Nikita Yushchenko
2014-05-29 15:44               ` Alan Stern
2014-05-29 15:45                 ` Nikita Yushchenko
2014-05-29 17:16                   ` Alan Stern
2014-05-27 16:39 ` Sergei Shtylyov
2014-05-28  7:21   ` Nikita Yushchenko
2014-05-28 11:57     ` Sergei Shtylyov
2014-05-27 23:27 ` Greg Kroah-Hartman
2014-05-28  7:12   ` Nikita Yushchenko

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=53858E28.5000403@dev.rtsoft.ru \
    --to=nyushchenko@dev.rtsoft.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lugovskoy@dev.rtsoft.ru \
    --cc=mathias.nyman@intel.com \
    --cc=stern@rowland.harvard.edu \
    /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;
as well as URLs for NNTP newsgroup(s).