Skip to content

Commit 23df9ba

Browse files
committed
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
2 parents 4ccbe91 + b046f98 commit 23df9ba

File tree

7 files changed

+38
-28
lines changed

7 files changed

+38
-28
lines changed

arch/parisc/include/asm/fb.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ int init_per_cpu(int cpunum)
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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
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)
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)
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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
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)
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

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@
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)
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 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address,
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)
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)
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)
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,
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ struct sti_struct {
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,11 +1358,11 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
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,

0 commit comments

Comments
 (0)