Skip to content

Commit

Permalink
core/pci-dt-slots: Fix devfn lookup
Browse files Browse the repository at this point in the history
We only want to use the device part of the bdfn when looking up the
switch down port. The required bit twiddling happens inside
find_devfn() and the masking here is broken since:

	a) Keeps the fn part of the bdfn, and
	b) Masks off part of the device number.

This breaks looking up the slot information in some cases.

Fixes: 6878b80 ("pci-dt-slot: Big ol' cleanup")
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed Apr 30, 2018
1 parent 0a6a2ff commit 3a0c57d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/pci-dt-slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static struct dt_node *find_node_for_dev(struct phb *phb,
return NULL;

/* find this down port */
return find_devfn(sw_up, pd->bdfn & 0x1f);
return find_devfn(sw_up, pd->bdfn);

default:
PCIDBG(phb, pd->bdfn,
Expand Down

0 comments on commit 3a0c57d

Please sign in to comment.