linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing0307@gmail.com>
To: Chris Clayton <chris2553@googlemail.com>
Cc: Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>,
	linux-media@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	linux-pci@vger.kernel.org
Subject: Re: 3.8.0-rc4+ - Oops on removing WinTV-HVR-1400 expresscard TV Tuner
Date: Sun, 27 Jan 2013 20:18:35 +0800	[thread overview]
Message-ID: <51051B1B.3080105@gmail.com> (raw)
In-Reply-To: <51050D43.2050703@googlemail.com>

于 2013-01-27 19:19, Chris Clayton 写道:
> Hi Yijing
> 
> On 01/27/13 02:45, Yijing Wang wrote:
>> 于 2013-01-27 4:54, Chris Clayton 写道:
>>> Hi Martin,
>>>
>>> On 01/24/13 19:21, Martin Mokrejs wrote:
>>>> Hi Chris,
>>>>     try to include in kernel only acpiphp and omit pciehp. Don't use modules but include
>>>> them statically. And try, in addition, check whether "pcie_aspm=off" in grub.conf helped.
>>>>
>>>
>>> Thanks for the tip. I had the pciehp driver installed, but it was a module and not loaded. I didn't have acpiphp enabled at all. Building them both in statically, appears to have papered over the cracks of the oops :-)
>>
>> Not loaded pciehp driver? Remove the device from this slot without poweroff ?
>>
> 
> That's correct. When I first encountered the oops, I did not have the pciehp driver loaded and removing the device from the slot whilst the laptop was powered on resulted in the oops.

Hmm, that's unsafe and dangerous, because device now may be running.
There are two ways to trigger pci hot-add or hot-remove in linux, after loaded pciehp or acpiphp module
(the two modules only one can loaded into system at the same time). You can trigger hot-add/hot-remove by
sysfs interface under /sys/bus/pci/slots/[slot-name]/power or attention button on hardware (if your laptop supports that).

>>>
>>>>     The best would if you subscribe to linux-pci, and read my recent threads
>>>> about similar issues I had with express cards with Dell Vostro 3550. Further, there is
>>>> a lot of changes to PCI hotplug done by Yingahi Liu and Rafael Wysockij, just browse the
>>>> archives of linux-pci and see the pacthes and the discussion.
>>>
>>> Those discussions are way above my level of knowledge. I guess all this work will be merged into mainline in due course, so I'll watch for them in 3.9 or later. Unless, of course, there is a tree I could clone and help test the changes with my laptop and expresscard.
>>>
>>> Hotplug isn't working at all on my Fujitsu laptop, so I can only get the card recognised by rebooting with the card inserted (or by writing 1 to/sys/bus/pci/rescan). There seem to be a few reports on this in the kernel bugzilla, so I'll look through them and see what's being done.
>>
>> Hi Chris,
>>     What about use #modprobe pciehp pciehp_debug=1 pciehp_poll_mode=1 pciehp_poll_time=1 ?
>>
>> Can you resend the dmesg log and "lspci -vvv" info after hotplug device from your Fujitsu laptop with above module parameters?
>>
> 
> I wasn't sure whether or not the pciehp driver should be loaded on its own or with the acpiphp driver also loaded. So I built them both as modules and planned to try both, pciehp only and acpiphp only. However, I've found that acpiphp will not load (regardless of whether or not pciehp is already loaded). What I get is:
> 
> [chris:~]$ sudo modprobe acpiphp debug=1
> modprobe: ERROR: could not insert 'acpiphp': No such device
>

Currently, If your hardware support pciehp native hotplug, acpiphp driver will be rejected when loading it in system
(you can force loading it by add boot parameter pcie_aspm=off as Martin said).

> and at the end of the dmesg output I see:
> 
> [   68.199789] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
> [   68.199970] acpiphp_glue: Total 0 slots
> 
> The pciehp driver loads OK. I've attached pciehp-only which shows the dmesg and lscpi output that you asked for.
> 
> As I said before, the only way that I can get the card detected with rebooting the laptop is to write 1 to /sys/bus/pci/rescan. In the hope that it might help (e.g. it shows details of the expresscard I'm using), I've also attached the output from dmesg and lspci after a rescan.

In this case, i guess your slot maybe always power on, once you insert your pcie card, and use rescan intercace, you can find them.

I checked the WinTV-HVR-1400 expressed card device's parent port device, as bellow.
I found the powerctrl in slot cap is clear. So I doubt the hardware support pci hotplug.

Chris, Can you try to add and remove device by /sys/bus/pci/slots/3/power? (use #modprobe pciehp pciehp_debug=1)


00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5) (prog-if 00 [Normal decode])

	Bus: primary=00, secondary=02, subordinate=06, sec-latency=0

	Capabilities: [40] Express (v2) Root Port (Slot+), MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
			ExtTag- RBE+ FLReset-
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 128 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
		LnkCap:	Port #4, Speed 5GT/s, Width x1, ASPM L0s L1, Latency L0 <512ns, L1 <16us
			ClockPM- Surprise- LLActRep+ BwNot-
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive+ BWMgmt+ ABWMgmt-
		SltCap:	AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+
			Slot #3, PowerLimit 10.000W; Interlock- NoCompl+
		SltCtl:	Enable: AttnBtn- PwrFlt- MRL- PresDet+ CmdCplt- HPIrq- LinkChg-
			Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
		SltSta:	Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
			Changed: MRL- PresDet- LinkState+

> 
> Please let me know if I can provide any additional diagnostics.
> 




  reply	other threads:[~2013-01-27 12:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 17:02 3.8.0-rc4+ - Oops on removing WinTV-HVR-1400 expresscard TV Tuner Chris Clayton
2013-01-24 19:21 ` Martin Mokrejs
2013-01-26 20:54   ` Chris Clayton
2013-01-26 21:14     ` Martin Mokrejs
2013-01-27  9:57       ` Chris Clayton
2013-01-27  2:45     ` Yijing Wang
2013-01-27 11:19       ` Chris Clayton
2013-01-27 12:18         ` Yijing Wang [this message]
2013-01-27 13:37           ` Chris Clayton
2013-01-27 14:26             ` Martin Mokrejs
2013-01-27 15:34               ` Chris Clayton
2013-01-27 16:41                 ` Martin Mokrejs
2013-01-27 22:53                   ` Chris Clayton
2013-01-27 23:21                     ` Martin Mokrejs
2013-01-28  2:40                     ` Yijing Wang
2013-01-28 10:12                       ` Chris Clayton
2013-01-28 10:56                         ` Martin Mokrejs
2013-01-28 11:01                           ` Chris Clayton
2013-01-28 11:15                             ` Yijing Wang
2013-01-28 10:58                         ` Yijing Wang
2013-01-28 11:23                         ` Chris Clayton
2013-01-28 12:12                           ` Martin Mokrejs
2013-01-28 12:26                             ` Yijing Wang
2013-01-28 19:11                             ` Chris Clayton
2013-01-28 21:02                               ` Martin Mokrejs
2013-01-31 12:09                                 ` Chris Clayton
2013-01-31 13:05                                   ` Martin Mokrejs
2013-03-06 23:45                                   ` Bjorn Helgaas
2013-03-07 16:28                                     ` Chris Clayton
2013-03-07 17:30                                       ` Bjorn Helgaas
2013-03-07 20:21                                         ` Chris Clayton
2013-03-08  0:39                                           ` Bjorn Helgaas
2013-03-08 10:44                                             ` Chris Clayton
2013-03-08 22:57                                               ` Bjorn Helgaas
2013-03-09  9:20                                                 ` Chris Clayton
2013-03-12 22:20                                                   ` Bjorn Helgaas
2013-03-15 22:48                                                     ` Bjorn Helgaas
2013-03-19 15:46                                                       ` Chris Clayton
2013-04-01 17:28                                                         ` Bjorn Helgaas
2013-07-09  9:35                                                           ` Chris Clayton
2013-07-09 20:19                                                             ` Bjorn Helgaas

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=51051B1B.3080105@gmail.com \
    --to=wangyijing0307@gmail.com \
    --cc=chris2553@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mmokrejs@fold.natur.cuni.cz \
    /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).