From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qc0-f171.google.com ([209.85.216.171]:49657 "EHLO mail-qc0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751819AbbALRlw (ORCPT ); Mon, 12 Jan 2015 12:41:52 -0500 Received: by mail-qc0-f171.google.com with SMTP id r5so19229647qcx.2 for ; Mon, 12 Jan 2015 09:41:51 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Bjorn Helgaas Date: Mon, 12 Jan 2015 11:41:31 -0600 Message-ID: Subject: Re: Hot add a PCIe device driver upon hotplug event To: Paulo Fortuna Carvalho Cc: "linux-pci@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-pci-owner@vger.kernel.org List-ID: On Mon, Jan 12, 2015 at 11:26 AM, Paulo Fortuna Carvalho wrote: > Hello Helgas, > I cannot see that line in dmesg. I think that something else is missing... > Do you know what may cause that not appearing in dmesg? Hotplug Surprise? Can you just collect the entire dmesg log, so I can see what controller is involved and what is happening? Surprise hotplug should work. Are you inserting an ExpressCard, or is it some other form factor? Exactly what hardware are you adding, and what are you adding it to? Bjorn > 2015-01-12 16:58 GMT, Bjorn Helgaas : >> On Mon, Jan 12, 2015 at 5:42 AM, Paulo Fortuna Carvalho >> wrote: >>> Hello, >>> I want to automatically load/unload a PCIe device driver when a card >>> is inserted/removed from the system. I can see in the system logger >>> with dmesg that the interrupt event is captured and acknowledged by >>> the pciehp hotplug service driver. >>> What I want to do next is that the operating system load/unload the >>> corresponding PCIe device driver for that card. >> >> When pciehp receives the interrupt, it should enumerate the device, >> and you should see a line in dmesg similar to this (of course, it will >> have different bus/device/function and different vendor/device IDs): >> >> pci 0000:00:16.0: [8086:9c3a] type 00 class 0x078000 >> >> The PCI core should then add the device using device_add(), and part >> of that is to emit a uevent, which can be read by user-space. >> Generally udev would handle the event and load the appropriate driver. >> I don't know the details of how the user-space side works. >> >> Bjorn >>