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 'chrome-platform-firmware-for-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux

Pull chrome platform firmware updates from Tzung-Bi Shih:

- Do not double register "simple-framebuffer" platform device if
Generic System Framebuffers (sysfb) already did that

- Fix a missing of unregistering platform driver in error handling path

* tag 'chrome-platform-firmware-for-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
firmware: google: Unregister driver_info on failure
firmware: coreboot: Don't register a pdev if screen_info data is present
firmware: sysfb: Add a sysfb_handles_screen_info() helper function

+44 -2
+14
drivers/firmware/google/framebuffer-coreboot.c
··· 15 15 #include <linux/module.h> 16 16 #include <linux/platform_data/simplefb.h> 17 17 #include <linux/platform_device.h> 18 + #include <linux/sysfb.h> 18 19 19 20 #include "coreboot_table.h" 20 21 ··· 36 35 .stride = fb->bytes_per_line, 37 36 .format = NULL, 38 37 }; 38 + 39 + /* 40 + * On coreboot systems, the advertised LB_TAG_FRAMEBUFFER entry 41 + * in the coreboot table should only be used if the payload did 42 + * not pass a framebuffer information to the Linux kernel. 43 + * 44 + * If the global screen_info data has been filled, the Generic 45 + * System Framebuffers (sysfb) will already register a platform 46 + * device and pass that screen_info as platform_data to a driver 47 + * that can scan-out using the system provided framebuffer. 48 + */ 49 + if (sysfb_handles_screen_info()) 50 + return -ENODEV; 39 51 40 52 if (!fb->physical_address) 41 53 return -ENODEV;
+4 -2
drivers/firmware/google/gsmi.c
··· 918 918 gsmi_dev.pdev = platform_device_register_full(&gsmi_dev_info); 919 919 if (IS_ERR(gsmi_dev.pdev)) { 920 920 printk(KERN_ERR "gsmi: unable to register platform device\n"); 921 - return PTR_ERR(gsmi_dev.pdev); 921 + ret = PTR_ERR(gsmi_dev.pdev); 922 + goto out_unregister; 922 923 } 923 924 924 925 /* SMI access needs to be serialized */ ··· 1057 1056 gsmi_buf_free(gsmi_dev.name_buf); 1058 1057 kmem_cache_destroy(gsmi_dev.mem_pool); 1059 1058 platform_device_unregister(gsmi_dev.pdev); 1060 - pr_info("gsmi: failed to load: %d\n", ret); 1059 + out_unregister: 1061 1060 #ifdef CONFIG_PM 1062 1061 platform_driver_unregister(&gsmi_driver_info); 1063 1062 #endif 1063 + pr_info("gsmi: failed to load: %d\n", ret); 1064 1064 return ret; 1065 1065 } 1066 1066
+19
drivers/firmware/sysfb.c
··· 79 79 } 80 80 EXPORT_SYMBOL_GPL(sysfb_disable); 81 81 82 + /** 83 + * sysfb_handles_screen_info() - reports if sysfb handles the global screen_info 84 + * 85 + * Callers can use sysfb_handles_screen_info() to determine whether the Generic 86 + * System Framebuffers (sysfb) can handle the global screen_info data structure 87 + * or not. Drivers might need this information to know if they have to setup the 88 + * system framebuffer, or if they have to delegate this action to sysfb instead. 89 + * 90 + * Returns: 91 + * True if sysfb handles the global screen_info data structure. 92 + */ 93 + bool sysfb_handles_screen_info(void) 94 + { 95 + const struct screen_info *si = &screen_info; 96 + 97 + return !!screen_info_video_type(si); 98 + } 99 + EXPORT_SYMBOL_GPL(sysfb_handles_screen_info); 100 + 82 101 #if defined(CONFIG_PCI) 83 102 static bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev) 84 103 {
+7
include/linux/sysfb.h
··· 60 60 61 61 void sysfb_disable(struct device *dev); 62 62 63 + bool sysfb_handles_screen_info(void); 64 + 63 65 #else /* CONFIG_SYSFB */ 64 66 65 67 static inline void sysfb_disable(struct device *dev) 66 68 { 69 + } 70 + 71 + static inline bool sysfb_handles_screen_info(void) 72 + { 73 + return false; 67 74 } 68 75 69 76 #endif /* CONFIG_SYSFB */