Patch "PCI: rpaphp: Correctly match ibm, my-drc-index to drc-name when using drc-info" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    PCI: rpaphp: Correctly match ibm, my-drc-index to drc-name when using drc-info

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pci-rpaphp-correctly-match-ibm-my-drc-index-to-drc-n.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 917f2ac04dfd576d8b24ddaa8e743bc6a04518a1
Author: Tyrel Datwyler <tyreld@xxxxxxxxxxxxx>
Date:   Sun Nov 10 23:21:36 2019 -0600

    PCI: rpaphp: Correctly match ibm, my-drc-index to drc-name when using drc-info
    
    [ Upstream commit 4f9f2d3d7a434b7f882b72550194c9278f4a3925 ]
    
    The newer ibm,drc-info property is a condensed description of the old
    ibm,drc-* properties (ie. names, types, indexes, and power-domains).
    When matching a drc-index to a drc-name we need to verify that the
    index is within the start and last drc-index range and map it to a
    drc-name using the drc-name-prefix and logical index.
    
    Fix the mapping by checking that the index is within the range of the
    current drc-info entry, and build the name from the drc-name-prefix
    concatenated with the starting drc-name-suffix value and the sequential
    index obtained by subtracting ibm,my-drc-index from this entries
    drc-start-index.
    
    Signed-off-by: Tyrel Datwyler <tyreld@xxxxxxxxxxxxx>
    Acked-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/1573449697-5448-10-git-send-email-tyreld@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 7d74fe875225..a306cad70470 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -248,9 +248,10 @@ static int rpaphp_check_drc_props_v2(struct device_node *dn, char *drc_name,
 		/* Should now know end of current entry */
 
 		/* Found it */
-		if (my_index <= drc.last_drc_index) {
+		if (my_index >= drc.drc_index_start && my_index <= drc.last_drc_index) {
+			int index = my_index - drc.drc_index_start;
 			sprintf(cell_drc_name, "%s%d", drc.drc_name_prefix,
-				my_index);
+				drc.drc_name_suffix_start + index);
 			break;
 		}
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux