Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'firewire-updates-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394

Pull firewire updates from Takashi Sakamoto:
"Two changes for the 6.14 kernel.

The first change concerns the PCI driver for 1394 OHCI hardware.
Previously, it used legacy PCI suspend/resume callbacks, which have
now been replaced with callbacks defined in the Linux generic power
management framework. This original patch was posted in 2020 and has
been adapted with some modifications for the latest kernel. Note that
the driver still includes platform-specific operations for PowerPC,
and these operations have not been tested in the new implementation
yet. It would be helpful to share the results of suspending/resuming
on the platform.

The other one is a minor fix for the memory allocation in some KUnit
tests"

* tag 'firewire-updates-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
firewire: test: Fix potential null dereference in firewire kunit test
firewire: ohci: use generic power management

+15 -31
+2
drivers/firewire/device-attribute-test.c
··· 99 99 struct device *unit0_dev = (struct device *)&unit0.device; 100 100 static const int unit0_expected_ids[] = {0x00ffffff, 0x00ffffff, 0x0000a02d, 0x00010001}; 101 101 char *buf = kunit_kzalloc(test, PAGE_SIZE, GFP_KERNEL); 102 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buf); 102 103 int ids[4] = {0, 0, 0, 0}; 103 104 104 105 // Ensure associations for node and unit devices. ··· 181 180 struct device *unit0_dev = (struct device *)&unit0.device; 182 181 static const int unit0_expected_ids[] = {0x00012345, 0x00fedcba, 0x00abcdef, 0x00543210}; 183 182 char *buf = kunit_kzalloc(test, PAGE_SIZE, GFP_KERNEL); 183 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buf); 184 184 int ids[4] = {0, 0, 0, 0}; 185 185 186 186 // Ensure associations for node and unit devices.
+13 -31
drivers/firewire/ohci.c
··· 3301 3301 } 3302 3302 } 3303 3303 3304 - #ifdef CONFIG_PM 3305 - static void ohci_resume_iso_dma(struct fw_ohci *ohci) 3304 + static void __maybe_unused ohci_resume_iso_dma(struct fw_ohci *ohci) 3306 3305 { 3307 3306 int i; 3308 3307 struct iso_context *ctx; ··· 3318 3319 ohci_start_iso(&ctx->base, 0, ctx->sync, ctx->tags); 3319 3320 } 3320 3321 } 3321 - #endif 3322 3322 3323 3323 static int queue_iso_transmit(struct iso_context *ctx, 3324 3324 struct fw_iso_packet *packet, ··· 3886 3888 dev_notice(&dev->dev, "removing fw-ohci device\n"); 3887 3889 } 3888 3890 3889 - #ifdef CONFIG_PM 3890 - static int pci_suspend(struct pci_dev *dev, pm_message_t state) 3891 + static int __maybe_unused pci_suspend(struct device *dev) 3891 3892 { 3892 - struct fw_ohci *ohci = pci_get_drvdata(dev); 3893 - int err; 3893 + struct pci_dev *pdev = to_pci_dev(dev); 3894 + struct fw_ohci *ohci = pci_get_drvdata(pdev); 3894 3895 3895 3896 software_reset(ohci); 3896 - err = pci_save_state(dev); 3897 - if (err) { 3898 - ohci_err(ohci, "pci_save_state failed\n"); 3899 - return err; 3900 - } 3901 - err = pci_set_power_state(dev, pci_choose_state(dev, state)); 3902 - if (err) 3903 - ohci_err(ohci, "pci_set_power_state failed with %d\n", err); 3904 - pmac_ohci_off(dev); 3897 + pmac_ohci_off(pdev); 3905 3898 3906 3899 return 0; 3907 3900 } 3908 3901 3909 - static int pci_resume(struct pci_dev *dev) 3902 + 3903 + static int __maybe_unused pci_resume(struct device *dev) 3910 3904 { 3911 - struct fw_ohci *ohci = pci_get_drvdata(dev); 3905 + struct pci_dev *pdev = to_pci_dev(dev); 3906 + struct fw_ohci *ohci = pci_get_drvdata(pdev); 3912 3907 int err; 3913 3908 3914 - pmac_ohci_on(dev); 3915 - pci_set_power_state(dev, PCI_D0); 3916 - pci_restore_state(dev); 3917 - err = pci_enable_device(dev); 3918 - if (err) { 3919 - ohci_err(ohci, "pci_enable_device failed\n"); 3920 - return err; 3921 - } 3909 + pmac_ohci_on(pdev); 3922 3910 3923 3911 /* Some systems don't setup GUID register on resume from ram */ 3924 3912 if (!reg_read(ohci, OHCI1394_GUIDLo) && ··· 3921 3937 3922 3938 return 0; 3923 3939 } 3924 - #endif 3925 3940 3926 3941 static const struct pci_device_id pci_table[] = { 3927 3942 { PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_FIREWIRE_OHCI, ~0) }, ··· 3929 3946 3930 3947 MODULE_DEVICE_TABLE(pci, pci_table); 3931 3948 3949 + static SIMPLE_DEV_PM_OPS(pci_pm_ops, pci_suspend, pci_resume); 3950 + 3932 3951 static struct pci_driver fw_ohci_pci_driver = { 3933 3952 .name = ohci_driver_name, 3934 3953 .id_table = pci_table, 3935 3954 .probe = pci_probe, 3936 3955 .remove = pci_remove, 3937 - #ifdef CONFIG_PM 3938 - .resume = pci_resume, 3939 - .suspend = pci_suspend, 3940 - #endif 3956 + .driver.pm = &pci_pm_ops, 3941 3957 }; 3942 3958 3943 3959 static int __init fw_ohci_init(void)