TencentOS-kernel/drivers
Vladimir Oltean 5cbd1cbcea dpaa_eth: fix usage as DSA master, try 3
[ Upstream commit 5d14c304bfc14b4fd052dc83d5224376b48f52f0 ]

The dpaa-eth driver probes on compatible string for the MAC node, and
the fman/mac.c driver allocates a dpaa-ethernet platform device that
triggers the probing of the dpaa-eth net device driver.

All of this is fine, but the problem is that the struct device of the
dpaa_eth net_device is 2 parents away from the MAC which can be
referenced via of_node. So of_find_net_device_by_node can't find it, and
DSA switches won't be able to probe on top of FMan ports.

It would be a bit silly to modify a core function
(of_find_net_device_by_node) to look for dev->parent->parent->of_node
just for one driver. We're just 1 step away from implementing full
recursion.

Actually there have already been at least 2 previous attempts to make
this work:
- Commit a1a50c8e4c24 ("fsl/man: Inherit parent device and of_node")
- One or more of the patches in "[v3,0/6] adapt DPAA drivers for DSA":
  https://patchwork.ozlabs.org/project/netdev/cover/1508178970-28945-1-git-send-email-madalin.bucur@nxp.com/
  (I couldn't really figure out which one was supposed to solve the
  problem and how).

Point being, it looks like this is still pretty much a problem today.
On T1040, the /sys/class/net/eth0 symlink currently points to

../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/net/eth0

which pretty much illustrates the problem. The closest of_node we've got
is the "fsl,fman-memac" at /soc@ffe000000/fman@400000/ethernet@e6000,
which is what we'd like to be able to reference from DSA as host port.

For of_find_net_device_by_node to find the eth0 port, we would need the
parent of the eth0 net_device to not be the "dpaa-ethernet" platform
device, but to point 1 level higher, aka the "fsl,fman-memac" node
directly. The new sysfs path would look like this:

../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0

And this is exactly what SET_NETDEV_DEV does. It sets the parent of the
net_device. The new parent has an of_node associated with it, and
of_dev_node_match already checks for the of_node of the device or of its
parent.

Fixes: a1a50c8e4c24 ("fsl/man: Inherit parent device and of_node")
Fixes: c6e26ea8c893 ("dpaa_eth: change device used")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16 16:28:22 +08:00
..
accessibility Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
acpi ACPI: EC: PM: Avoid flushing EC work when EC GPE is inactive 2021-03-16 16:28:06 +08:00
amba Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
android Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ata libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set 2021-03-16 16:26:16 +08:00
atm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
auxdisplay Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
base component: Silence bind error on -EPROBE_DEFER 2021-03-16 16:28:10 +08:00
bcma Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
block virtio-blk: handle block_device_operations callbacks after hot unplug 2021-03-16 16:27:46 +08:00
bluetooth Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bus bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads 2021-03-16 16:25:52 +08:00
cdrom Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
char tpm: ibmvtpm: retry on H_CLOSED in tpm_ibmvtpm_send() 2021-03-16 16:26:58 +08:00
clk clk: Unlink clock if failed to prepare or enable 2021-03-16 16:28:03 +08:00
clocksource Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
connector Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
counter counter: 104-quad-8: Add lock guards - generic interface 2021-03-16 16:27:07 +08:00
cpufreq cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once 2021-03-16 16:27:50 +08:00
cpuidle Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
crypto crypto: caam - fix the address of the last entry of S/G 2021-03-16 16:27:19 +08:00
dax device-dax: don't leak kernel memory to user space after unloading kmem 2021-03-16 16:28:19 +08:00
dca Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
devfreq PM / devfreq: Add missing locking while setting suspend_freq 2021-03-16 16:27:31 +08:00
dio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dma dmaengine: owl: Use correct lock in owl_dma_get_pchan() 2021-03-16 16:28:16 +08:00
dma-buf dma-buf: Fix SET_NAME ioctl uapi 2021-03-16 16:27:16 +08:00
edac Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
eisa Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
extcon Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
firewire Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
firmware tpm: check event log version before reading final events 2021-03-16 16:28:21 +08:00
fpga fpga: dfl: pci: fix return value of cci_pci_sriov_configure 2021-03-16 16:27:02 +08:00
fsi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
gnss Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
gpio gpio: pca953x: Fix pca953x_gpio_set_config 2021-03-16 16:27:45 +08:00
gpu drm/i915: Propagate error from completed fences 2021-03-16 16:28:17 +08:00
greybus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hid HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock 2021-03-16 16:28:11 +08:00
hsi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hv Drivers: hv: vmbus: Fix Suspend-to-Idle for Generation-2 VM 2021-03-16 16:27:20 +08:00
hwmon hwmon: (da9052) Synchronize access with mfd 2021-03-16 16:27:57 +08:00
hwspinlock Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hwtracing Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
i2c i2c: mux: demux-pinctrl: Fix an error handling path in 'i2c_demux_pinctrl_probe()' 2021-03-16 16:28:07 +08:00
i3c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ide Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
idle Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
iio iio: adc: stm32-dfsdm: fix device used to request dma 2021-03-16 16:28:21 +08:00
infiniband RDMA/iw_cxgb4: Fix incorrect function parameters 2021-03-16 16:27:57 +08:00
input Input: i8042 - add Acer Aspire 5738z to nomux list 2021-03-16 16:26:15 +08:00
interconnect Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
iommu iommu/amd: Call domain_flush_complete() in update_domain() 2021-03-16 16:28:12 +08:00
ipack ipack: tpci200: fix error return code in tpci200_register() 2021-03-16 16:28:19 +08:00
irqchip irqchip/mbigen: Free msi_desc on device teardown 2021-03-16 16:26:29 +08:00
isdn Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
leds leds: core: Fix warning message when init_data 2021-03-16 16:26:37 +08:00
lightnvm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
macintosh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mailbox Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mcb Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
md dm multipath: use updated MPATHF_QUEUE_IO on mapping for bio-based mpath 2021-03-16 16:27:21 +08:00
media media: fdp1: Fix R-Car M3-N naming in debug message 2021-03-16 16:28:17 +08:00
memory Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
memstick Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
message Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mfd mfd: intel-lpss: Use devm_ioremap_uc for MMIO 2021-03-16 16:27:29 +08:00
misc mei: release me_cl object reference 2021-03-16 16:28:19 +08:00
mmc mmc: block: Fix request completion in the CQE timeout path 2021-03-16 16:27:54 +08:00
mtd mtd: Fix mtd not registered due to nvmem name collision 2021-03-16 16:28:08 +08:00
mux Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
net dpaa_eth: fix usage as DSA master, try 3 2021-03-16 16:28:22 +08:00
nfc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ntb Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nubus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nvdimm libnvdimm: Out of bounds read in __nd_ioctl() 2021-03-16 16:26:40 +08:00
nvme nvme: fix possible hang when ns scanning fails during error recovery 2021-03-16 16:27:31 +08:00
nvmem Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
of of: overlay: kmemleak in dup_and_fixup_symbol_prop() 2021-03-16 16:26:30 +08:00
opp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
oprofile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
parisc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
parport Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci PCI: Move Apex Edge TPU class quirk to fix BAR assignment 2021-03-16 16:27:10 +08:00
pcmcia Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
perf Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
phy phy: uniphier-usb3ss: Add Pro5 support 2021-03-16 16:26:34 +08:00
pinctrl pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler 2021-03-16 16:27:52 +08:00
platform platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA 2021-03-16 16:28:12 +08:00
pnp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
power power: supply: axp288_fuel_gauge: Broaden vendor check for Intel Compute Sticks. 2021-03-16 16:26:40 +08:00
powercap Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pps Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ps3 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ptp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pwm pwm: bcm2835: Dynamically allocate base 2021-03-16 16:26:47 +08:00
rapidio rapidio: fix an error in get_user_pages_fast() error handling 2021-03-16 16:28:19 +08:00
ras Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
regulator Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
remoteproc remoteproc: qcom_q6v5_mss: fix a bug in q6v5_probe() 2021-03-16 16:27:26 +08:00
reset Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rpmsg Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rtc rtc: 88pm860x: fix possible race condition 2021-03-16 16:26:33 +08:00
s390 s390/ism: fix error return code in ism_probe() 2021-03-16 16:27:57 +08:00
sbus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
scsi scsi: qla2xxx: Do not log message when reading port speed via sysfs 2021-03-16 16:28:15 +08:00
sfi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
siox Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
slimbus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
soc drivers: soc: xilinx: fix firmware driver Kconfig dependency 2021-03-16 16:27:07 +08:00
soundwire Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
spi spi: spi-fsl-dspi: Replace interruptible wait queue with a simple completion 2021-03-16 16:25:59 +08:00
spmi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ssb Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
staging staging: greybus: Fix uninitialized scalar variable 2021-03-16 16:28:18 +08:00
target scsi: target: Put lun_ref at end of tmr processing 2021-03-16 16:28:15 +08:00
tc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tee Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
thermal Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
thunderbolt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tty tty: serial: add missing spin_lock_init for SiFive serial console 2021-03-16 16:28:19 +08:00
uio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
usb USB: core: Fix misleading driver bug report 2021-03-16 16:28:11 +08:00
vfio vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn() 2021-03-16 16:27:23 +08:00
vhost vhost/vsock: fix packet delivery order to monitoring devices 2021-03-16 16:28:09 +08:00
video fbmem: Adjust indentation in fb_prepare_logo and fb_blank 2021-03-16 16:26:41 +08:00
virt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
virtio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
visorbus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vlynq Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vme Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
w1 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
watchdog watchdog: reset last_hw_keepalive time at start 2021-03-16 16:26:44 +08:00
xen xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status 2021-03-16 16:27:14 +08:00
zorro Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00