History

Merge tag 'for-5.19/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull more parisc architecture updates from Helge Deller: "A fix to prevent crash at bootup if CONFIG_SCHED_MC is enabled, and add auto-detection of primary graphics card for framebuffer driver" * tag 'for-5.19/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc/stifb: Keep track of hardware path of graphics card parisc/stifb: Implement fb_is_primary_device() parisc: fix a crash with multicore scheduler

Linus Torvalds committed 4 years ago

Commit 23df9ba2 parents 4ccbe91 b046f987 files · +38 −28Browse files

Unified · Split

7 files
  1. arch/parisc/include/asm/fb.h +4 −0
  2. arch/parisc/kernel/processor.c +0 −2
  3. arch/parisc/kernel/topology.c +1 −15
  4. drivers/video/console/sticon.c +4 −1
  5. drivers/video/console/sticore.c +24 −8
  6. drivers/video/fbdev/sticore.h +3 −0
  7. drivers/video/fbdev/stifb.c +2 −2
arch/parisc/include/asm/fb.h+4−0
@@ -12,9 +12,13 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, · 11 unmodified lines
1212 pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
1313 }
1414
15+#if defined(CONFIG_STI_CONSOLE) || defined(CONFIG_FB_STI)
16+int fb_is_primary_device(struct fb_info *info);
17+#else
1518 static inline int fb_is_primary_device(struct fb_info *info)
1619 {
1720 return 0;
1821 }
22+#endif
1923
2024 #endif /* _ASM_FB_H_ */
arch/parisc/kernel/processor.c+0−2
@@ -327,8 +327,6 @@ int init_per_cpu(int cpunum) · 326 unmodified lines
327327 set_firmware_width();
328328 ret = pdc_coproc_cfg(&coproc_cfg);
329329
330− store_cpu_topology(cpunum);
331−
332330 if(ret >= 0 && coproc_cfg.ccr_functional) {
333331 mtctl(coproc_cfg.ccr_functional, 10); /* 10 == Coprocessor Control Reg */
334332
arch/parisc/kernel/topology.c+1−15
@@ -20,8 +20,6 @@ · 19 unmodified lines
2020
2121 static DEFINE_PER_CPU(struct cpu, cpu_devices);
2222
23−static int dualcores_found;
24−
2523 /*
2624 * store_cpu_topology is called at boot when only one cpu is running
2725 * and with the mutex cpu_hotplug.lock locked, when several cpus have booted,
@@ -60,7 +58,6 @@ void store_cpu_topology(unsigned int cpuid) · 32 unmodified lines
6058 if (p->cpu_loc) {
6159 cpuid_topo->core_id++;
6260 cpuid_topo->package_id = cpu_topology[cpu].package_id;
63− dualcores_found = 1;
6461 continue;
6562 }
6663 }
@@ -80,22 +77,11 @@ void store_cpu_topology(unsigned int cpuid) · 13 unmodified lines
8077 cpu_topology[cpuid].package_id);
8178 }
8279
83−static struct sched_domain_topology_level parisc_mc_topology[] = {
84−#ifdef CONFIG_SCHED_MC
85− { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
86−#endif
87−
88− { cpu_cpu_mask, SD_INIT_NAME(DIE) },
89− { NULL, },
90−};
91−
9280 /*
9381 * init_cpu_topology is called at boot when only one cpu is running
9482 * which prevent simultaneous write access to cpu_topology array
9583 */
9684 void __init init_cpu_topology(void)
9785 {
98− /* Set scheduler topology descriptor */
99− if (dualcores_found)
100− set_sched_topology(parisc_mc_topology);
86+ reset_cpu_topology();
10187 }
drivers/video/console/sticon.c+4−1
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 #include <linux/slab.h>
4747 #include <linux/font.h>
4848 #include <linux/crc32.h>
49+#include <linux/fb.h>
4950
5051 #include <asm/io.h>
5152
@@ -392,7 +393,9 @@ static int __init sticonsole_init(void) · 340 unmodified lines
392393 for (i = 0; i < MAX_NR_CONSOLES; i++)
393394 font_data[i] = STI_DEF_FONT;
394395
395− pr_info("sticon: Initializing STI text console.\n");
396+ pr_info("sticon: Initializing STI text console on %s at [%s]\n",
397+ sticon_sti->sti_data->inq_outptr.dev_name,
398+ sticon_sti->pa_path);
396399 console_lock();
397400 err = do_take_over_console(&sti_con, 0, MAX_NR_CONSOLES - 1,
398401 PAGE0->mem_cons.cl_class != CL_DUPLEX);
drivers/video/console/sticore.c+24−8
@@ -30,10 +30,11 @@ · 29 unmodified lines
3030 #include <asm/pdc.h>
3131 #include <asm/cacheflush.h>
3232 #include <asm/grfioctl.h>
33+#include <asm/fb.h>
3334
3435 #include "../fbdev/sticore.h"
3536
36−#define STI_DRIVERVERSION "Version 0.9b"
37+#define STI_DRIVERVERSION "Version 0.9c"
3738
3839 static struct sti_struct *default_sti __read_mostly;
3940
@@ -502,7 +503,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) · 462 unmodified lines
502503 if (!fbfont)
503504 return NULL;
504505
505− pr_info("STI selected %ux%u framebuffer font %s for sticon\n",
506+ pr_info(" using %ux%u framebuffer font %s\n",
506507 fbfont->width, fbfont->height, fbfont->name);
507508
508509 bpc = ((fbfont->width+7)/8) * fbfont->height;
@@ -967,6 +968,7 @@ out_err: · 458 unmodified lines
967968
968969 static void sticore_check_for_default_sti(struct sti_struct *sti, char *path)
969970 {
971+ pr_info(" located at [%s]\n", sti->pa_path);
970972 if (strcmp (path, default_sti_path) == 0)
971973 default_sti = sti;
972974 }
@@ -978,7 +980,6 @@ static void sticore_check_for_default_sti(struct sti_struct *sti, char *path) · 5 unmodified lines
978980 */
979981 static int __init sticore_pa_init(struct parisc_device *dev)
980982 {
981− char pa_path[21];
982983 struct sti_struct *sti = NULL;
983984 int hpa = dev->hpa.start;
984985
@@ -991,8 +992,8 @@ static int __init sticore_pa_init(struct parisc_device *dev) · 6 unmodified lines
991992 if (!sti)
992993 return 1;
993994
994− print_pa_hwpath(dev, pa_path);
995− sticore_check_for_default_sti(sti, pa_path);
995+ print_pa_hwpath(dev, sti->pa_path);
996+ sticore_check_for_default_sti(sti, sti->pa_path);
996997 return 0;
997998 }
998999
@@ -1028,9 +1029,8 @@ static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent) · 29 unmodified lines
10281029
10291030 sti = sti_try_rom_generic(rom_base, fb_base, pd);
10301031 if (sti) {
1031− char pa_path[30];
1032− print_pci_hwpath(pd, pa_path);
1033− sticore_check_for_default_sti(sti, pa_path);
1032+ print_pci_hwpath(pd, sti->pa_path);
1033+ sticore_check_for_default_sti(sti, sti->pa_path);
10341034 }
10351035
10361036 if (!sti) {
@@ -1148,6 +1148,22 @@ int sti_call(const struct sti_struct *sti, unsigned long func, · 111 unmodified lines
11481148 return ret;
11491149 }
11501150
1151+/* check if given fb_info is the primary device */
1152+int fb_is_primary_device(struct fb_info *info)
1153+{
1154+ struct sti_struct *sti;
1155+
1156+ sti = sti_get_rom(0);
1157+
1158+ /* if no built-in graphics card found, allow any fb driver as default */
1159+ if (!sti)
1160+ return true;
1161+
1162+ /* return true if it's the default built-in framebuffer driver */
1163+ return (sti->info == info);
1164+}
1165+EXPORT_SYMBOL(fb_is_primary_device);
1166+
11511167 MODULE_AUTHOR("Philipp Rumpf, Helge Deller, Thomas Bogendoerfer");
11521168 MODULE_DESCRIPTION("Core STI driver for HP's NGLE series graphics cards in HP PARISC machines");
11531169 MODULE_LICENSE("GPL v2");
drivers/video/fbdev/sticore.h+3−0
@@ -370,6 +370,9 @@ struct sti_struct { · 369 unmodified lines
370370
371371 /* pointer to all internal data */
372372 struct sti_all_data *sti_data;
373+
374+ /* pa_path of this device */
375+ char pa_path[24];
373376 };
374377
375378
drivers/video/fbdev/stifb.c+2−2
@@ -1358,11 +1358,11 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 1357 unmodified lines
13581358 goto out_err3;
13591359 }
13601360
1361+ /* save for primary gfx device detection & unregister_framebuffer() */
1362+ sti->info = info;
13611363 if (register_framebuffer(&fb->info) < 0)
13621364 goto out_err4;
13631365
1364− sti->info = info; /* save for unregister_framebuffer() */
1365−
13661366 fb_info(&fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n",
13671367 fix->id,
13681368 var->xres,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t