Re: [PATCH v6 07/11] PCI: Replace pci_dev::driver usage that gets the driver name

2021-10-04 Thread Ido Schimmel
On Mon, Oct 04, 2021 at 02:59:31PM +0200, Uwe Kleine-König wrote:
> struct pci_dev::driver holds (apart from a constant offset) the same
> data as struct pci_dev::dev->driver. With the goal to remove struct
> pci_dev::driver to get rid of data duplication replace getting the
> driver name by dev_driver_string() which implicitly makes use of struct
> pci_dev::dev->driver.
> 
> Acked-by: Simon Horman  (for NFP)
> Signed-off-by: Uwe Kleine-König 

For mlxsw:

Reviewed-by: Ido Schimmel 
Tested-by: Ido Schimmel 

Tested with the kexec flow that I mentioned last time. Works fine now.

Thanks


Re: [PATCH v5 07/11] PCI: Replace pci_dev::driver usage that gets the driver name

2021-09-29 Thread Ido Schimmel
On Wed, Sep 29, 2021 at 10:53:02AM +0200, Uwe Kleine-König wrote:
> struct pci_dev::driver holds (apart from a constant offset) the same
> data as struct pci_dev::dev->driver. With the goal to remove struct
> pci_dev::driver to get rid of data duplication replace getting the
> driver name by dev_driver_string() which implicitly makes use of struct
> pci_dev::dev->driver.
> 
> Signed-off-by: Uwe Kleine-König 

For mlxsw:

Reviewed-by: Ido Schimmel 
Tested-by: Ido Schimmel 

Thanks


Re: [PATCH v5 07/11] PCI: Replace pci_dev::driver usage that gets the driver name

2021-09-29 Thread Ido Schimmel
On Wed, Sep 29, 2021 at 05:44:51PM +0300, Ido Schimmel wrote:
> On Wed, Sep 29, 2021 at 10:53:02AM +0200, Uwe Kleine-König wrote:
> > struct pci_dev::driver holds (apart from a constant offset) the same
> > data as struct pci_dev::dev->driver. With the goal to remove struct
> > pci_dev::driver to get rid of data duplication replace getting the
> > driver name by dev_driver_string() which implicitly makes use of struct
> > pci_dev::dev->driver.
> > 
> > Signed-off-by: Uwe Kleine-König 
> 
> For mlxsw:
> 
> Reviewed-by: Ido Schimmel 
> Tested-by: Ido Schimmel 
> 
> Thanks

Actually, I found out that after loading and executing another kernel
(or the same one) via kexec I get this splat [1].

[1]
 BUG: unable to handle page fault for address: ffc8 
 #PF: supervisor read access in kernel mode   
 #PF: error_code(0x) - not-present page
 PGD 6e40c067 P4D 6e40c067 PUD 6e40e067 PMD 0 
 Oops:  [#1] SMP
 CPU: 0 PID: 786 Comm: kexec Not tainted 5.15.0-rc2-custom-45114-g6b0effa5a61f 
#112
 Hardware name: Mellanox Technologies Ltd. MSN3700/VMOD0005, BIOS 5.11 
01/06/2019  

 RIP: 0010:pci_device_shutdown+0x16/0x40
 Code: 01 00 31 d2 4c 89 e7 89 c6 e8 36 ce 01 00 41 89 c5 eb bb 90 55 48 8d af 
40 ff ff ff 53 48 8b 47 68 48 89 fb 48 83 f8 78 74 0e <48> 8b 40 c8 48 85 c0 74 
05 48 89 ef ff d0 80 3d 35 81 b7 01 00 74   
  
 RSP: 0018:95fec0d37db8 EFLAGS: 00010297
 RAX:  RBX: 8d70c0f1f0c0 RCX: 0004
 RDX: 8d7115a03a00 RSI: 0206 RDI: 8d70c0f1f0c0  
 RBP: 8d70c0f1f000 R08: 0002 R09: 0502
 R10:  R11: 0006 R12: 8d70c0f1f0c0  
   
 R13: 8d70c0f1f140 R14: fee1dead R15:   
   
 FS:  7fd3089e0b80() GS:8d7237c0() knlGS:
 CS:  0010 DS:  ES:  CR0: 80050033 
 CR2: ffc8 CR3: 000155abb001 CR4: 003706f0
 DR0:  DR1:  DR2: 
 DR3:  DR6: fffe0ff0 DR7: 0400
 Call Trace:
  device_shutdown+0x12e/0x180 
  kernel_kexec+0x52/0xb0
  __do_sys_reboot+0x1c0/0x210 
  do_syscall_64+0x35/0x80
  entry_SYSCALL_64_after_hwframe+0x44/0xae
 RIP: 0033:0x7fd308afd557
 Code: 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 89 
fa be 69 19 12 28 bf ad de e1 fe b8 a9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 
c3 48 8b 15 f1 a8 0c 00 f7 d8 64 89 02 b8
 RSP: 002b:7fff7d01e0a8 EFLAGS: 0246 ORIG_RAX: 00a9
 RAX: ffda RBX: 5606db11d380 RCX: 7fd308afd557
 RDX: 45584543 RSI: 28121969 RDI: fee1dead
 RBP:  R08: 0007 R09: 7fd308bc8a60
 R10: 0021 R11: 0246 R12: 0003
 R13: 7fff7d01e1f0 R14: 5606db11d8c0 R15: 
 Modules linked in:
 CR2: ffc8
 ---[ end trace 0cb0bc633a6fde3e ]---

Where:

(gdb) l *(pci_device_shutdown+0x16)
0x8156abf6 is in pci_device_shutdown (drivers/pci/pci-driver.c:496).
491 struct pci_dev *pci_dev = to_pci_dev(dev);
492 struct pci_driver *drv = to_pci_driver(pci_dev->dev.driver);
493
494 pm_runtime_resume(dev);
495
496 if (drv && drv->shutdown)
497 drv->shutdown(pci_dev);
498
499 /*
500  * If this is a kexec reboot, turn off Bus Master bit on the


Re: [PATCH v2 5/6] PCI: Adapt all code locations to not use struct pci_dev::driver directly

2021-08-03 Thread Ido Schimmel
On Tue, Aug 03, 2021 at 12:01:49PM +0200, Uwe Kleine-König wrote:
> This prepares removing the driver member of struct pci_dev which holds the
> same information than struct pci_dev::dev->driver.
> 
> Signed-off-by: Uwe Kleine-König 
> ---
>  arch/powerpc/include/asm/ppc-pci.h|  3 +-
>  arch/powerpc/kernel/eeh_driver.c  | 12 ---
>  arch/x86/events/intel/uncore.c|  2 +-
>  arch/x86/kernel/probe_roms.c  |  2 +-
>  drivers/bcma/host_pci.c   |  6 ++--
>  drivers/crypto/hisilicon/qm.c |  2 +-
>  drivers/crypto/qat/qat_common/adf_aer.c   |  2 +-
>  drivers/message/fusion/mptbase.c  |  4 +--
>  drivers/misc/cxl/guest.c  | 21 +--
>  drivers/misc/cxl/pci.c| 25 +++--
>  .../ethernet/hisilicon/hns3/hns3_ethtool.c|  2 +-
>  .../ethernet/marvell/prestera/prestera_pci.c  |  2 +-
>  drivers/net/ethernet/mellanox/mlxsw/pci.c |  2 +-
>  .../ethernet/netronome/nfp/nfp_net_ethtool.c  |  2 +-
>  drivers/pci/iov.c | 23 +++-
>  drivers/pci/pci-driver.c  | 28 ---
>  drivers/pci/pci.c | 10 +++---
>  drivers/pci/pcie/err.c| 35 ++-
>  drivers/pci/xen-pcifront.c|  3 +-
>  drivers/ssb/pcihost_wrapper.c |  7 ++--
>  drivers/usb/host/xhci-pci.c   |  3 +-
>  21 files changed, 112 insertions(+), 84 deletions(-)

For mlxsw:

Tested-by: Ido Schimmel