All of lore.kernel.org
 help / color / mirror / Atom feed
* Pcie Linux HotPlug Driver
@ 2013-05-27 10:43 Paulo Fortuna Carvalho
  2013-05-27 15:33 ` Bjorn Helgaas
  0 siblings, 1 reply; 14+ messages in thread
From: Paulo Fortuna Carvalho @ 2013-05-27 10:43 UTC (permalink / raw)
  To: linux-pci

I have an PCI Express ATCA card with an FPGA.
I have a device driver to communicate with the board.
Now we are trying to implement hot-plug using the PCIe Port Bus Driver Model.

Our driver has been modified in order to be compliant to a service
driver as described in the HowTo Documentation.

Using the file pcieport_if.h there were some structs that become
obsolete namely the pci_port_service_id.

1) How can we provide the board ids with the pci_port_service_id
struct removed?
I'm using the old method struct pci_device_id

2) How can we point to the old pci_dev pointer in our functions once
the arguments for probe(), remove() now are pcie_device struct? I'm using
the port item in the struct pcie_device.

3) After changes at insmod time my board appears in the /proc/devices
but my devices and sub-devices never appear in the /dev directory
making me wonder that something is missing in my class_create() and
device_create() function...

4) Are functions resume() and suspend() relevant for the hot-plug
process? At the moment these functions only return -ENOSYS

My Purpose: At the moment i'm only interest in modifying the Linux
Device Driver for the board using the PCIe HotPlug Port Bus Driver
Model (porting it to a Service Driver), detect the board and create
the devices and sub-devices in the /dev directory as it used to do.
I think there is only something missing but I dont know what.

NOTE: Some aditional information:
My _init() and _exit() functions are calling
pcie_port_service_register() and pcie_port_service_unregister(), respectively.

Thanks in Advance,
Paulo (University PhD Student)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-27 10:43 Pcie Linux HotPlug Driver Paulo Fortuna Carvalho
@ 2013-05-27 15:33 ` Bjorn Helgaas
  2013-05-27 16:45   ` Paulo Fortuna Carvalho
  0 siblings, 1 reply; 14+ messages in thread
From: Bjorn Helgaas @ 2013-05-27 15:33 UTC (permalink / raw)
  To: pricardofc; +Cc: linux-pci

On Mon, May 27, 2013 at 4:43 AM, Paulo Fortuna Carvalho
<pricardofc@ipfn.ist.utl.pt> wrote:
> I have an PCI Express ATCA card with an FPGA.
> I have a device driver to communicate with the board.
> Now we are trying to implement hot-plug using the PCIe Port Bus Driver Model.

Why do you want to use the "Port Bus Driver Model"?  That is only
intended for the ports in PCIe switches.  Does your card include a
switch with non-standard services?

If your driver is specifically for some new switch functionality, you
might want to make it a port service driver.  But if this is a PCIe
endpoint device, then you should make it a plain old PCI driver with
pci_register_driver().

Bjorn

> Our driver has been modified in order to be compliant to a service
> driver as described in the HowTo Documentation.
>
> Using the file pcieport_if.h there were some structs that become
> obsolete namely the pci_port_service_id.
>
> 1) How can we provide the board ids with the pci_port_service_id
> struct removed?
> I'm using the old method struct pci_device_id
>
> 2) How can we point to the old pci_dev pointer in our functions once
> the arguments for probe(), remove() now are pcie_device struct? I'm using
> the port item in the struct pcie_device.
>
> 3) After changes at insmod time my board appears in the /proc/devices
> but my devices and sub-devices never appear in the /dev directory
> making me wonder that something is missing in my class_create() and
> device_create() function...
>
> 4) Are functions resume() and suspend() relevant for the hot-plug
> process? At the moment these functions only return -ENOSYS
>
> My Purpose: At the moment i'm only interest in modifying the Linux
> Device Driver for the board using the PCIe HotPlug Port Bus Driver
> Model (porting it to a Service Driver), detect the board and create
> the devices and sub-devices in the /dev directory as it used to do.
> I think there is only something missing but I dont know what.
>
> NOTE: Some aditional information:
> My _init() and _exit() functions are calling
> pcie_port_service_register() and pcie_port_service_unregister(), respectively.
>
> Thanks in Advance,
> Paulo (University PhD Student)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-27 15:33 ` Bjorn Helgaas
@ 2013-05-27 16:45   ` Paulo Fortuna Carvalho
  2013-05-27 17:38     ` Yinghai Lu
  0 siblings, 1 reply; 14+ messages in thread
From: Paulo Fortuna Carvalho @ 2013-05-27 16:45 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci

My card includes a PCIe Switch.
My coordinators told me that a solution for hotplug (remove/insert
board without shutting down the system) could be the PCIe Port Bus
Driver Model using also pciehp.ko already installed in Linux System.

Paulo.


> Why do you want to use the "Port Bus Driver Model"?  That is only
> intended for the ports in PCIe switches.  Does your card include a
> switch with non-standard services?

> If your driver is specifically for some new switch functionality, you
> might want to make it a port service driver.  But if this is a PCIe
> endpoint device, then you should make it a plain old PCI driver with
> pci_register_driver().

> Bjorn






>> Our driver has been modified in order to be compliant to a service
>> driver as described in the HowTo Documentation.
>>
>> Using the file pcieport_if.h there were some structs that become
>> obsolete namely the pci_port_service_id.
>>
>> 1) How can we provide the board ids with the pci_port_service_id
>> struct removed?
>> I'm using the old method struct pci_device_id
>>
>> 2) How can we point to the old pci_dev pointer in our functions once
>> the arguments for probe(), remove() now are pcie_device struct? I'm using
>> the port item in the struct pcie_device.
>>
>> 3) After changes at insmod time my board appears in the /proc/devices
>> but my devices and sub-devices never appear in the /dev directory
>> making me wonder that something is missing in my class_create() and
>> device_create() function...
>>
>> 4) Are functions resume() and suspend() relevant for the hot-plug
>> process? At the moment these functions only return -ENOSYS
>>
>> My Purpose: At the moment i'm only interest in modifying the Linux
>> Device Driver for the board using the PCIe HotPlug Port Bus Driver
>> Model (porting it to a Service Driver), detect the board and create
>> the devices and sub-devices in the /dev directory as it used to do.
>> I think there is only something missing but I dont know what.
>>
>> NOTE: Some aditional information:
>> My _init() and _exit() functions are calling
>> pcie_port_service_register() and pcie_port_service_unregister(),
>> respectively.
>>
>> Thanks in Advance,
>> Paulo (University PhD Student)
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-27 16:45   ` Paulo Fortuna Carvalho
@ 2013-05-27 17:38     ` Yinghai Lu
  2013-05-28 12:05       ` Paulo Fortuna Carvalho
  0 siblings, 1 reply; 14+ messages in thread
From: Yinghai Lu @ 2013-05-27 17:38 UTC (permalink / raw)
  To: pricardofc; +Cc: Bjorn Helgaas, linux-pci

On Mon, May 27, 2013 at 9:45 AM, Paulo Fortuna Carvalho
<pricardofc@ipfn.ist.utl.pt> wrote:
> My card includes a PCIe Switch.
> My coordinators told me that a solution for hotplug (remove/insert
> board without shutting down the system) could be the PCIe Port Bus
> Driver Model using also pciehp.ko already installed in Linux System.

can you post
lspci -vvxxx
lspci -tv
with and without your card/fpga working?

If your card have a pcie switch, then you can make your down port has
pcie slot cap that support pciehp.

Yinghai

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-27 17:38     ` Yinghai Lu
@ 2013-05-28 12:05       ` Paulo Fortuna Carvalho
  2013-05-28 17:01         ` Bjorn Helgaas
  0 siblings, 1 reply; 14+ messages in thread
From: Paulo Fortuna Carvalho @ 2013-05-28 12:05 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Bjorn Helgaas, linux-pci

[-- Attachment #1: Type: text/plain, Size: 706 bytes --]

Hello Yinghai,
Here goes, in attached .zip file the commands output that you suggested.
Regards,
Paulo




2013/5/27, Yinghai Lu <yinghai@kernel.org>:
> On Mon, May 27, 2013 at 9:45 AM, Paulo Fortuna Carvalho
> <pricardofc@ipfn.ist.utl.pt> wrote:
>> My card includes a PCIe Switch.
>> My coordinators told me that a solution for hotplug (remove/insert
>> board without shutting down the system) could be the PCIe Port Bus
>> Driver Model using also pciehp.ko already installed in Linux System.
>
> can you post
> lspci -vvxxx
> lspci -tv
> with and without your card/fpga working?
>
> If your card have a pcie switch, then you can make your down port has
> pcie slot cap that support pciehp.
>
> Yinghai
>

[-- Attachment #2: files.zip --]
[-- Type: application/zip, Size: 43814 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-28 12:05       ` Paulo Fortuna Carvalho
@ 2013-05-28 17:01         ` Bjorn Helgaas
  2013-05-28 18:14           ` Yinghai Lu
  0 siblings, 1 reply; 14+ messages in thread
From: Bjorn Helgaas @ 2013-05-28 17:01 UTC (permalink / raw)
  To: Paulo Ricardo Carvalho; +Cc: Yinghai Lu, linux-pci

On Tue, May 28, 2013 at 6:05 AM, Paulo Fortuna Carvalho
<pricardofc@ipfn.ist.utl.pt> wrote:
> Hello Yinghai,
> Here goes, in attached .zip file the commands output that you suggested.

It looks like the part you're interested in is this:

    00:03.0 bridge to [bus 03-1a] (Intel root port)
    03:00.0 bridge to [bus 04-1a] (PLX 8733 upstream port)
    04:08.0 bridge to [bus 05-1a] (PLX 8733 downstream port)
    05:00.0 bridge to [bus 06-1a] (PLX 8696 upstream port)
    06:07.0 bridge to [bus 0a] (PLX 8696 downstream port)
    0a:00.0 endpoint (PLD Applications 6114)
    06:0e.0 bridge to [bus 11] (PLX 8696 downstream port)
    11:00.0 endpoint (PLD Applications 6014)

I assume everything except the root port is on your ATCA card, and you
want to hotplug the card as a whole.

This would be handled by the hotplug controller in the 00:03.0 root
port, using pciehp.

Your first step should be to verify that hotplugging the card works
without your ATCA drivers in the system.  When you hot-add the card,
you should see messages in dmesg about the hot-add event and
enumerating all the PCI devices on the card.  lspci at this point
should show your devices, and they should appear in sysfs, but of
course you can't use them because your ATCA drivers aren't loaded.

You should also be able to remove the card (you can request the
removal using the sysfs remove interface or buttons on your ATCA
chassis if they exist) and you should see notes in dmesg about the
devices being removed, and they should disappear from lspci output and
from sysfs.

Your ATCA drivers should be normal PCI device drivers (not port
drivers), and they shouldn't need to do anything special to deal with
hotplug.  From the point of view of your driver, there *is* no
hot-plug.  Your .probe() method will be called after the PCI core
enumerates and configures all the devices, just like it would be if
the card were present at boot-time.  Your .remove() method is called
before the device is powered-off, just like it would be at system
shutdown time.

If you're still having trouble, please collect a complete dmesg log
showing the problem.

Bjorn

> 2013/5/27, Yinghai Lu <yinghai@kernel.org>:
>> On Mon, May 27, 2013 at 9:45 AM, Paulo Fortuna Carvalho
>> <pricardofc@ipfn.ist.utl.pt> wrote:
>>> My card includes a PCIe Switch.
>>> My coordinators told me that a solution for hotplug (remove/insert
>>> board without shutting down the system) could be the PCIe Port Bus
>>> Driver Model using also pciehp.ko already installed in Linux System.
>>
>> can you post
>> lspci -vvxxx
>> lspci -tv
>> with and without your card/fpga working?
>>
>> If your card have a pcie switch, then you can make your down port has
>> pcie slot cap that support pciehp.
>>
>> Yinghai
>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-28 17:01         ` Bjorn Helgaas
@ 2013-05-28 18:14           ` Yinghai Lu
  2013-05-28 19:06             ` Bjorn Helgaas
  0 siblings, 1 reply; 14+ messages in thread
From: Yinghai Lu @ 2013-05-28 18:14 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Paulo Ricardo Carvalho, linux-pci

On Tue, May 28, 2013 at 10:01 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Tue, May 28, 2013 at 6:05 AM, Paulo Fortuna Carvalho
> <pricardofc@ipfn.ist.utl.pt> wrote:
>> Hello Yinghai,
>> Here goes, in attached .zip file the commands output that you suggested.
>
> It looks like the part you're interested in is this:
>
>     00:03.0 bridge to [bus 03-1a] (Intel root port)
>     03:00.0 bridge to [bus 04-1a] (PLX 8733 upstream port)
>     04:08.0 bridge to [bus 05-1a] (PLX 8733 downstream port)
>     05:00.0 bridge to [bus 06-1a] (PLX 8696 upstream port)
>     06:07.0 bridge to [bus 0a] (PLX 8696 downstream port)
>     0a:00.0 endpoint (PLD Applications 6114)
>     06:0e.0 bridge to [bus 11] (PLX 8696 downstream port)
>     11:00.0 endpoint (PLD Applications 6014)
>
> I assume everything except the root port is on your ATCA card, and you
> want to hotplug the card as a whole.
>
> This would be handled by the hotplug controller in the 00:03.0 root
> port, using pciehp.

that should not work. as pciehp will not be loaded for 00:03.0 with
following slot cap
        SltCap:    AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surpise-
            Slot #  2, PowerLimit 25.000000; Interlock- NoCompl-

but 04:08.0, 06:04.0, 06:0c.0, 06:08.0 and 06:10.0 do have
        SltCap:    AttnBtn+ PwrCtrl+ MRL+ AttnInd+ PwrInd+ HotPlug+ Surpise-
            Slot #  4, PowerLimit 25.000000; Interlock- NoCompl-

problem is
1. pciehp is not loaded for them.
2. fpga are on 06:07.0 and 06:0e.0.

If 04:08.0 pciehp could be loaded, the could use that hotplug to make
fpga working

Yinghai

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-28 18:14           ` Yinghai Lu
@ 2013-05-28 19:06             ` Bjorn Helgaas
  0 siblings, 0 replies; 14+ messages in thread
From: Bjorn Helgaas @ 2013-05-28 19:06 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Paulo Ricardo Carvalho, linux-pci

On Tue, May 28, 2013 at 12:14 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Tue, May 28, 2013 at 10:01 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On Tue, May 28, 2013 at 6:05 AM, Paulo Fortuna Carvalho
>> <pricardofc@ipfn.ist.utl.pt> wrote:
>>> Hello Yinghai,
>>> Here goes, in attached .zip file the commands output that you suggested.
>>
>> It looks like the part you're interested in is this:
>>
>>     00:03.0 bridge to [bus 03-1a] (Intel root port)
>>     03:00.0 bridge to [bus 04-1a] (PLX 8733 upstream port)
>>     04:08.0 bridge to [bus 05-1a] (PLX 8733 downstream port)
>>     05:00.0 bridge to [bus 06-1a] (PLX 8696 upstream port)
>>     06:07.0 bridge to [bus 0a] (PLX 8696 downstream port)
>>     0a:00.0 endpoint (PLD Applications 6114)
>>     06:0e.0 bridge to [bus 11] (PLX 8696 downstream port)
>>     11:00.0 endpoint (PLD Applications 6014)
>>
>> I assume everything except the root port is on your ATCA card, and you
>> want to hotplug the card as a whole.
>>
>> This would be handled by the hotplug controller in the 00:03.0 root
>> port, using pciehp.
>
> that should not work. as pciehp will not be loaded for 00:03.0 with
> following slot cap
>         SltCap:    AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surpise-
>             Slot #  2, PowerLimit 25.000000; Interlock- NoCompl-

Yep, true.

> but 04:08.0, 06:04.0, 06:0c.0, 06:08.0 and 06:10.0 do have
>         SltCap:    AttnBtn+ PwrCtrl+ MRL+ AttnInd+ PwrInd+ HotPlug+ Surpise-
>             Slot #  4, PowerLimit 25.000000; Interlock- NoCompl-
>
> problem is
> 1. pciehp is not loaded for them.
> 2. fpga are on 06:07.0 and 06:0e.0.
>
> If 04:08.0 pciehp could be loaded, the could use that hotplug to make
> fpga working

Oh, maybe the devices on the ATCA card start at 05:00.0, not at
03:00.0?  If that's the case, then yes, getting pciehp to claim the
hotplug service on 04:08.0 would be the right thing.  Maybe you just
don't have pciehp enabled, Paulo?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-31  8:24       ` Paulo Fortuna Carvalho
@ 2013-05-31 19:12         ` Bjorn Helgaas
  0 siblings, 0 replies; 14+ messages in thread
From: Bjorn Helgaas @ 2013-05-31 19:12 UTC (permalink / raw)
  To: Paulo Ricardo Carvalho; +Cc: Yinghai Lu, linux-pci

On Fri, May 31, 2013 at 2:24 AM, Paulo Fortuna Carvalho
<pricardofc@ipfn.ist.utl.pt> wrote:
> Hello,
> From the point of view of pciehp.ko module yes everything is correct.
> Now im trying to automatize the remove and insertion of device driver
> modules by putting hotplug scripts in the system specyfied
> directories.

The driver should be automatically loaded via udev if you have
everything set up correctly.  I don't know all the details of udev,
but I don't think the driver is normally unloaded automatically when
you remove the device.

Let us know if you have problems.

Bjorn

> 2013/5/30, Bjorn Helgaas <bhelgaas@google.com>:
>> On Thu, May 30, 2013 at 2:49 AM, Paulo Fortuna Carvalho
>> <pricardofc@ipfn.ist.utl.pt> wrote:
>>> Hello Yinghai,
>>> Im sending you the boot.log file in attach with the grub.conf changed
>>> to add debug ignore_loglevel.
>>> Also I could manage to load pciehp.ko (not fakephp.ko) module at boot
>>> time.
>>
>> The log of interest would be the *dmesg* log, i.e., the output of the
>> "dmesg" command.
>>
>> Is there any remaining problem, or is everything working as you expect?
>>
>>> 2013/5/29, Yinghai Lu <yinghai@kernel.org>:
>>>> On Wed, May 29, 2013 at 10:30 AM, Paulo Fortuna Carvalho
>>>> <pricardofc@ipfn.ist.utl.pt> wrote:
>>>>> Hello Yinghai and Bjorn,
>>>>> Issue solved.
>>>>> You were correct. The module fakephp.ko was not loaded.
>>>>
>>>> No, you should not use fackephp.ko. As it was removed already
>>>> in recent kernel.
>>>> It is replaced by pci slot driver.
>>>>
>>>> In your case you should pciehp.ko
>>>>
>>>> Please post boot log with "debug ignore_loglevel"
>>>>
>>>>
>>>>> Now everything works ok and device driver need not to be changed.
>>>>> As you said is a normal PCI Device Driver.
>>>>>
>>>>> Now I want that that when ATCA card is without energy ( 11:00.0 DPIO
>>>>> module: PLD APPLICATIONS Device 6014 (rev ff) )
>>>>>
>>>>> the command:
>>>>> echo 0 > /sys/bus/pci/slots/0000*/power is automatically executed.
>>>>>
>>>>> At the moment i'm doing it manually and after that my atca card driver
>>>>> is removed.
>>>>>
>>>>> And when i give energy to the ATCA card i have to manually perform pci
>>>>> bus re-enumeration
>>>>> with command:
>>>>> echo 1 > /sys/bus/pci/rescan
>>>>>
>>>>> and the ATCA card driver is automatically inserted. How can
>>>>> re-enumeration be done automatically?
>>>>
>>>> If you can enable pciehp.ko for 04:08.0, then you can use
>>>> echo 0 > /sys/bus/pci/slots/48/power
>>>> echo 1 > /sys/bus/pci/slots/48/power
>>>>
>>>> that should probe devices and load driver automatically.
>>>>
>>>> Yinghai
>>>>
>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-30 16:47     ` Bjorn Helgaas
@ 2013-05-31  8:24       ` Paulo Fortuna Carvalho
  2013-05-31 19:12         ` Bjorn Helgaas
  0 siblings, 1 reply; 14+ messages in thread
From: Paulo Fortuna Carvalho @ 2013-05-31  8:24 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Yinghai Lu, linux-pci

Hello,
>From the point of view of pciehp.ko module yes everything is correct.
Now im trying to automatize the remove and insertion of device driver
modules by putting hotplug scripts in the system specyfied
directories.
Thanks for all your precious help,
Paulo.


2013/5/30, Bjorn Helgaas <bhelgaas@google.com>:
> On Thu, May 30, 2013 at 2:49 AM, Paulo Fortuna Carvalho
> <pricardofc@ipfn.ist.utl.pt> wrote:
>> Hello Yinghai,
>> Im sending you the boot.log file in attach with the grub.conf changed
>> to add debug ignore_loglevel.
>> Also I could manage to load pciehp.ko (not fakephp.ko) module at boot
>> time.
>
> The log of interest would be the *dmesg* log, i.e., the output of the
> "dmesg" command.
>
> Is there any remaining problem, or is everything working as you expect?
>
>> 2013/5/29, Yinghai Lu <yinghai@kernel.org>:
>>> On Wed, May 29, 2013 at 10:30 AM, Paulo Fortuna Carvalho
>>> <pricardofc@ipfn.ist.utl.pt> wrote:
>>>> Hello Yinghai and Bjorn,
>>>> Issue solved.
>>>> You were correct. The module fakephp.ko was not loaded.
>>>
>>> No, you should not use fackephp.ko. As it was removed already
>>> in recent kernel.
>>> It is replaced by pci slot driver.
>>>
>>> In your case you should pciehp.ko
>>>
>>> Please post boot log with "debug ignore_loglevel"
>>>
>>>
>>>> Now everything works ok and device driver need not to be changed.
>>>> As you said is a normal PCI Device Driver.
>>>>
>>>> Now I want that that when ATCA card is without energy ( 11:00.0 DPIO
>>>> module: PLD APPLICATIONS Device 6014 (rev ff) )
>>>>
>>>> the command:
>>>> echo 0 > /sys/bus/pci/slots/0000*/power is automatically executed.
>>>>
>>>> At the moment i'm doing it manually and after that my atca card driver
>>>> is removed.
>>>>
>>>> And when i give energy to the ATCA card i have to manually perform pci
>>>> bus re-enumeration
>>>> with command:
>>>> echo 1 > /sys/bus/pci/rescan
>>>>
>>>> and the ATCA card driver is automatically inserted. How can
>>>> re-enumeration be done automatically?
>>>
>>> If you can enable pciehp.ko for 04:08.0, then you can use
>>> echo 0 > /sys/bus/pci/slots/48/power
>>> echo 1 > /sys/bus/pci/slots/48/power
>>>
>>> that should probe devices and load driver automatically.
>>>
>>> Yinghai
>>>
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-30  8:49   ` Paulo Fortuna Carvalho
@ 2013-05-30 16:47     ` Bjorn Helgaas
  2013-05-31  8:24       ` Paulo Fortuna Carvalho
  0 siblings, 1 reply; 14+ messages in thread
From: Bjorn Helgaas @ 2013-05-30 16:47 UTC (permalink / raw)
  To: Paulo Ricardo Carvalho; +Cc: Yinghai Lu, linux-pci

On Thu, May 30, 2013 at 2:49 AM, Paulo Fortuna Carvalho
<pricardofc@ipfn.ist.utl.pt> wrote:
> Hello Yinghai,
> Im sending you the boot.log file in attach with the grub.conf changed
> to add debug ignore_loglevel.
> Also I could manage to load pciehp.ko (not fakephp.ko) module at boot time.

The log of interest would be the *dmesg* log, i.e., the output of the
"dmesg" command.

Is there any remaining problem, or is everything working as you expect?

> 2013/5/29, Yinghai Lu <yinghai@kernel.org>:
>> On Wed, May 29, 2013 at 10:30 AM, Paulo Fortuna Carvalho
>> <pricardofc@ipfn.ist.utl.pt> wrote:
>>> Hello Yinghai and Bjorn,
>>> Issue solved.
>>> You were correct. The module fakephp.ko was not loaded.
>>
>> No, you should not use fackephp.ko. As it was removed already
>> in recent kernel.
>> It is replaced by pci slot driver.
>>
>> In your case you should pciehp.ko
>>
>> Please post boot log with "debug ignore_loglevel"
>>
>>
>>> Now everything works ok and device driver need not to be changed.
>>> As you said is a normal PCI Device Driver.
>>>
>>> Now I want that that when ATCA card is without energy ( 11:00.0 DPIO
>>> module: PLD APPLICATIONS Device 6014 (rev ff) )
>>>
>>> the command:
>>> echo 0 > /sys/bus/pci/slots/0000*/power is automatically executed.
>>>
>>> At the moment i'm doing it manually and after that my atca card driver
>>> is removed.
>>>
>>> And when i give energy to the ATCA card i have to manually perform pci
>>> bus re-enumeration
>>> with command:
>>> echo 1 > /sys/bus/pci/rescan
>>>
>>> and the ATCA card driver is automatically inserted. How can
>>> re-enumeration be done automatically?
>>
>> If you can enable pciehp.ko for 04:08.0, then you can use
>> echo 0 > /sys/bus/pci/slots/48/power
>> echo 1 > /sys/bus/pci/slots/48/power
>>
>> that should probe devices and load driver automatically.
>>
>> Yinghai
>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-29 17:47 ` Yinghai Lu
@ 2013-05-30  8:49   ` Paulo Fortuna Carvalho
  2013-05-30 16:47     ` Bjorn Helgaas
  0 siblings, 1 reply; 14+ messages in thread
From: Paulo Fortuna Carvalho @ 2013-05-30  8:49 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Bjorn Helgaas, linux-pci

[-- Attachment #1: Type: text/plain, Size: 1557 bytes --]

Hello Yinghai,
Im sending you the boot.log file in attach with the grub.conf changed
to add debug ignore_loglevel.
Also I could manage to load pciehp.ko (not fakephp.ko) module at boot time.
Paulo.



2013/5/29, Yinghai Lu <yinghai@kernel.org>:
> On Wed, May 29, 2013 at 10:30 AM, Paulo Fortuna Carvalho
> <pricardofc@ipfn.ist.utl.pt> wrote:
>> Hello Yinghai and Bjorn,
>> Issue solved.
>> You were correct. The module fakephp.ko was not loaded.
>
> No, you should not use fackephp.ko. As it was removed already
> in recent kernel.
> It is replaced by pci slot driver.
>
> In your case you should pciehp.ko
>
> Please post boot log with "debug ignore_loglevel"
>
>
>> Now everything works ok and device driver need not to be changed.
>> As you said is a normal PCI Device Driver.
>>
>> Now I want that that when ATCA card is without energy ( 11:00.0 DPIO
>> module: PLD APPLICATIONS Device 6014 (rev ff) )
>>
>> the command:
>> echo 0 > /sys/bus/pci/slots/0000*/power is automatically executed.
>>
>> At the moment i'm doing it manually and after that my atca card driver
>> is removed.
>>
>> And when i give energy to the ATCA card i have to manually perform pci
>> bus re-enumeration
>> with command:
>> echo 1 > /sys/bus/pci/rescan
>>
>> and the ATCA card driver is automatically inserted. How can
>> re-enumeration be done automatically?
>
> If you can enable pciehp.ko for 04:08.0, then you can use
> echo 0 > /sys/bus/pci/slots/48/power
> echo 1 > /sys/bus/pci/slots/48/power
>
> that should probe devices and load driver automatically.
>
> Yinghai
>

[-- Attachment #2: boot.log --]
[-- Type: application/octet-stream, Size: 4584 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
  2013-05-29 17:30 Paulo Fortuna Carvalho
@ 2013-05-29 17:47 ` Yinghai Lu
  2013-05-30  8:49   ` Paulo Fortuna Carvalho
  0 siblings, 1 reply; 14+ messages in thread
From: Yinghai Lu @ 2013-05-29 17:47 UTC (permalink / raw)
  To: Paulo Ricardo Carvalho; +Cc: Bjorn Helgaas, linux-pci

On Wed, May 29, 2013 at 10:30 AM, Paulo Fortuna Carvalho
<pricardofc@ipfn.ist.utl.pt> wrote:
> Hello Yinghai and Bjorn,
> Issue solved.
> You were correct. The module fakephp.ko was not loaded.

No, you should not use fackephp.ko. As it was removed already
in recent kernel.
It is replaced by pci slot driver.

In your case you should pciehp.ko

Please post boot log with "debug ignore_loglevel"


> Now everything works ok and device driver need not to be changed.
> As you said is a normal PCI Device Driver.
>
> Now I want that that when ATCA card is without energy ( 11:00.0 DPIO
> module: PLD APPLICATIONS Device 6014 (rev ff) )
>
> the command:
> echo 0 > /sys/bus/pci/slots/0000*/power is automatically executed.
>
> At the moment i'm doing it manually and after that my atca card driver
> is removed.
>
> And when i give energy to the ATCA card i have to manually perform pci
> bus re-enumeration
> with command:
> echo 1 > /sys/bus/pci/rescan
>
> and the ATCA card driver is automatically inserted. How can
> re-enumeration be done automatically?

If you can enable pciehp.ko for 04:08.0, then you can use
echo 0 > /sys/bus/pci/slots/48/power
echo 1 > /sys/bus/pci/slots/48/power

that should probe devices and load driver automatically.

Yinghai

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Pcie Linux HotPlug Driver
@ 2013-05-29 17:30 Paulo Fortuna Carvalho
  2013-05-29 17:47 ` Yinghai Lu
  0 siblings, 1 reply; 14+ messages in thread
From: Paulo Fortuna Carvalho @ 2013-05-29 17:30 UTC (permalink / raw)
  To: Bjorn Helgaas, Yinghai Lu; +Cc: linux-pci

Hello Yinghai and Bjorn,
Issue solved.
You were correct. The module fakephp.ko was not loaded.
Now everything works ok and device driver need not to be changed.
As you said is a normal PCI Device Driver.

Now I want that that when ATCA card is without energy ( 11:00.0 DPIO
module: PLD APPLICATIONS Device 6014 (rev ff) )

the command:
echo 0 > /sys/bus/pci/slots/0000*/power is automatically executed.

At the moment i'm doing it manually and after that my atca card driver
is removed.

And when i give energy to the ATCA card i have to manually perform pci
bus re-enumeration
with command:
echo 1 > /sys/bus/pci/rescan

and the ATCA card driver is automatically inserted. How can
re-enumeration be done automatically?

Paulo.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-05-31 19:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-27 10:43 Pcie Linux HotPlug Driver Paulo Fortuna Carvalho
2013-05-27 15:33 ` Bjorn Helgaas
2013-05-27 16:45   ` Paulo Fortuna Carvalho
2013-05-27 17:38     ` Yinghai Lu
2013-05-28 12:05       ` Paulo Fortuna Carvalho
2013-05-28 17:01         ` Bjorn Helgaas
2013-05-28 18:14           ` Yinghai Lu
2013-05-28 19:06             ` Bjorn Helgaas
2013-05-29 17:30 Paulo Fortuna Carvalho
2013-05-29 17:47 ` Yinghai Lu
2013-05-30  8:49   ` Paulo Fortuna Carvalho
2013-05-30 16:47     ` Bjorn Helgaas
2013-05-31  8:24       ` Paulo Fortuna Carvalho
2013-05-31 19:12         ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.