mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
pci-v6.14-fixes-1
-----BEGIN PGP SIGNATURE----- iQJIBAABCgAyFiEEgMe7l+5h9hnxdsnuWYigwDrT+vwFAmedLCsUHGJoZWxnYWFz QGdvb2dsZS5jb20ACgkQWYigwDrT+vzvKQ/+Mkdsm6NF8E9wOSJLnPwrh5Ixh4vh z9t1wpdkPfB7kvtNso5rqwCLg4wqoADiOY1D4QkS3ZcQ+ocQ/3QXJ9LRJPfR/bFY yQF/GyODIkteQgnIjISV5jt3tEE7dwxpFkGlAR9exxRH9t2GcSu+yspwZ+/0EEa1 MnnHBT+2WRkKdYDLorZR8fwu7xYdN88IysgdhXVOqeSRDsOdvJs0EKPoK44d1Vna hEJoY7UhgwUsEpP/TBSlO0jkg8aH1IyMYg+TbNCLGSNBwYaHkAOb24LaaybOeBF7 rbSyWxfEOpPif69Pxfryzq3OpEXYxwqMecASM7kXKPKDsxHNdJ4Huda0SI+zvM5g TBY3ZRtmlISJ13Ug4W/xjkmmAUL3MuryZYa4pZf227uqO9fBRvOXzvHwbbF02Zld e2tpfpGI26h2p0Z3yELSvd3au5PVdLpCZhUyT61AgBhzwAHuaBFsvo/FW6jcMZuW CEws/mXE4qVM9OtIGnyeZ7i74GWAlu7kL2klX5lHvsI5h8lpdpu/ycbZurewyhzR tHAyqVqcIiT87z2S0UCP+UVMydUgioQpzjQ4Ms2kEnH0Vs3fbMjJjnyd+kr5gKXl ziUQXwfdF3D8dZHMiZ/7KcA2hbCFfWRkLKeyGPBj3toRXnpnevHDvqWkoLVjhRER Qqz2UIGQCfqDlFw= =TqfZ -----END PGP SIGNATURE----- Merge tag 'pci-v6.14-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull pci fix from Bjorn Helgaas: - Save the original INTX_DISABLE bit at the first pcim_intx() call and restore that at devres cleanup instead of restoring the opposite of the most recent enable/disable pcim_intx() argument, which was wrong when a driver called pcim_intx() multiple times or with the already enabled state (Takashi Iwai) * tag 'pci-v6.14-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: PCI: Restore original INTX_DISABLE bit by pcim_intx()
This commit is contained in:
commit
0c0746f9dc
|
@ -419,19 +419,12 @@ static void pcim_intx_restore(struct device *dev, void *data)
|
|||
pci_intx(pdev, res->orig_intx);
|
||||
}
|
||||
|
||||
static struct pcim_intx_devres *get_or_create_intx_devres(struct device *dev)
|
||||
static void save_orig_intx(struct pci_dev *pdev, struct pcim_intx_devres *res)
|
||||
{
|
||||
struct pcim_intx_devres *res;
|
||||
u16 pci_command;
|
||||
|
||||
res = devres_find(dev, pcim_intx_restore, NULL, NULL);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
res = devres_alloc(pcim_intx_restore, sizeof(*res), GFP_KERNEL);
|
||||
if (res)
|
||||
devres_add(dev, res);
|
||||
|
||||
return res;
|
||||
pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
|
||||
res->orig_intx = !(pci_command & PCI_COMMAND_INTX_DISABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -447,12 +440,23 @@ static struct pcim_intx_devres *get_or_create_intx_devres(struct device *dev)
|
|||
int pcim_intx(struct pci_dev *pdev, int enable)
|
||||
{
|
||||
struct pcim_intx_devres *res;
|
||||
struct device *dev = &pdev->dev;
|
||||
|
||||
res = get_or_create_intx_devres(&pdev->dev);
|
||||
if (!res)
|
||||
return -ENOMEM;
|
||||
/*
|
||||
* pcim_intx() must only restore the INTx value that existed before the
|
||||
* driver was loaded, i.e., before it called pcim_intx() for the
|
||||
* first time.
|
||||
*/
|
||||
res = devres_find(dev, pcim_intx_restore, NULL, NULL);
|
||||
if (!res) {
|
||||
res = devres_alloc(pcim_intx_restore, sizeof(*res), GFP_KERNEL);
|
||||
if (!res)
|
||||
return -ENOMEM;
|
||||
|
||||
save_orig_intx(pdev, res);
|
||||
devres_add(dev, res);
|
||||
}
|
||||
|
||||
res->orig_intx = !enable;
|
||||
pci_intx(pdev, enable);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user