Skip to content

Commit b130516

Browse files
committed
Merge branch 'bits/002-backports' into asahi-wip
2 parents 83de5b4 + b90e51e commit b130516

13 files changed

Lines changed: 1408 additions & 1687 deletions

File tree

arch/arm64/include/asm/cputype.h

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,27 @@
129129

130130
#define HISI_CPU_PART_TSV110 0xD01
131131

132-
#define APPLE_CPU_PART_M1_ICESTORM 0x022
133-
#define APPLE_CPU_PART_M1_FIRESTORM 0x023
134-
#define APPLE_CPU_PART_M1_ICESTORM_PRO 0x024
135-
#define APPLE_CPU_PART_M1_FIRESTORM_PRO 0x025
136-
#define APPLE_CPU_PART_M1_ICESTORM_MAX 0x028
137-
#define APPLE_CPU_PART_M1_FIRESTORM_MAX 0x029
138-
#define APPLE_CPU_PART_M2_BLIZZARD 0x032
139-
#define APPLE_CPU_PART_M2_AVALANCHE 0x033
140-
#define APPLE_CPU_PART_M2_BLIZZARD_PRO 0x034
141-
#define APPLE_CPU_PART_M2_AVALANCHE_PRO 0x035
142-
#define APPLE_CPU_PART_M2_BLIZZARD_MAX 0x038
143-
#define APPLE_CPU_PART_M2_AVALANCHE_MAX 0x039
132+
#define APPLE_CPU_PART_A7_CYCLONE 0x1
133+
#define APPLE_CPU_PART_A8_TYPHOON 0x2
134+
#define APPLE_CPU_PART_A8X_TYPHOON 0x3
135+
#define APPLE_CPU_PART_SAMSUNG_TWISTER 0x4 /* Used in Samsung A9 */
136+
#define APPLE_CPU_PART_TSMC_TWISTER 0x5 /* Used in TSMC A9 and A9X */
137+
#define APPLE_CPU_PART_A10_T2_HURRICANE_ZEPHYR 0x6
138+
#define APPLE_CPU_PART_A10X_HURRICANE_ZEPHYR 0x7
139+
#define APPLE_CPU_PART_A11_MONSOON 0x8
140+
#define APPLE_CPU_PART_A11_MISTRAL 0x9
141+
#define APPLE_CPU_PART_M1_ICESTORM 0x022
142+
#define APPLE_CPU_PART_M1_FIRESTORM 0x023
143+
#define APPLE_CPU_PART_M1_ICESTORM_PRO 0x024
144+
#define APPLE_CPU_PART_M1_FIRESTORM_PRO 0x025
145+
#define APPLE_CPU_PART_M1_ICESTORM_MAX 0x028
146+
#define APPLE_CPU_PART_M1_FIRESTORM_MAX 0x029
147+
#define APPLE_CPU_PART_M2_BLIZZARD 0x032
148+
#define APPLE_CPU_PART_M2_AVALANCHE 0x033
149+
#define APPLE_CPU_PART_M2_BLIZZARD_PRO 0x034
150+
#define APPLE_CPU_PART_M2_AVALANCHE_PRO 0x035
151+
#define APPLE_CPU_PART_M2_BLIZZARD_MAX 0x038
152+
#define APPLE_CPU_PART_M2_AVALANCHE_MAX 0x039
144153

145154
#define AMPERE_CPU_PART_AMPERE1 0xAC3
146155

@@ -199,6 +208,15 @@
199208
#define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL)
200209
#define MIDR_FUJITSU_A64FX MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_A64FX)
201210
#define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110)
211+
#define MIDR_APPLE_A7_CYCLONE MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_A7_CYCLONE)
212+
#define MIDR_APPLE_A8_TYPHOON MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_A8_TYPHOON)
213+
#define MIDR_APPLE_A8X_TYPHOON MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_A8X_TYPHOON)
214+
#define MIDR_APPLE_SAMSUNG_TWISTER MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_SAMSUNG_TWISTER)
215+
#define MIDR_APPLE_TSMC_TWISTER MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_TSMC_TWISTER)
216+
#define MIDR_APPLE_A10_T2_HURRICANE_ZEPHYR MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_A10_T2_HURRICANE_ZEPHYR)
217+
#define MIDR_APPLE_A10X_HURRICANE_ZEPHYR MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_A10X_HURRICANE_ZEPHYR)
218+
#define MIDR_APPLE_A11_MONSOON MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_A11_MONSOON)
219+
#define MIDR_APPLE_A11_MISTRAL MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_A11_MISTRAL)
202220
#define MIDR_APPLE_M1_ICESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM)
203221
#define MIDR_APPLE_M1_FIRESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM)
204222
#define MIDR_APPLE_M1_ICESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_PRO)

arch/arm64/kernel/cpufeature.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,6 +3506,31 @@ void __init setup_boot_cpu_features(void)
35063506
setup_boot_cpu_capabilities();
35073507
}
35083508

3509+
static void __init bad_aarch32_el0_fixup(void)
3510+
{
3511+
static const struct midr_range bad_aarch32_el0[] = {
3512+
MIDR_ALL_VERSIONS(MIDR_APPLE_A10_T2_HURRICANE_ZEPHYR),
3513+
MIDR_ALL_VERSIONS(MIDR_APPLE_A10X_HURRICANE_ZEPHYR),
3514+
{}
3515+
};
3516+
3517+
/*
3518+
* The Apple A10 family can only execute 32-bit EL0 when in high
3519+
* p-states. Pretend it does not support 32-bit EL0.
3520+
*/
3521+
if (is_midr_in_range_list(read_cpuid_id(), bad_aarch32_el0)) {
3522+
struct arm64_ftr_reg *regp;
3523+
3524+
regp = get_arm64_ftr_reg(SYS_ID_AA64PFR0_EL1);
3525+
if (!regp)
3526+
return;
3527+
u64 val = (regp->sys_val & ~ID_AA64PFR0_EL1_EL0_MASK)
3528+
| ID_AA64PFR0_EL1_EL0_IMP;
3529+
3530+
update_cpu_ftr_reg(regp, val);
3531+
}
3532+
}
3533+
35093534
static void __init setup_system_capabilities(void)
35103535
{
35113536
/*
@@ -3539,6 +3564,8 @@ static void __init setup_system_capabilities(void)
35393564

35403565
void __init setup_system_features(void)
35413566
{
3567+
bad_aarch32_el0_fixup();
3568+
35423569
setup_system_capabilities();
35433570

35443571
kpti_install_ng_mappings();

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -575,30 +575,11 @@ unsigned int cpufreq_policy_transition_delay_us(struct cpufreq_policy *policy)
575575
return policy->transition_delay_us;
576576

577577
latency = policy->cpuinfo.transition_latency / NSEC_PER_USEC;
578-
if (latency) {
579-
unsigned int max_delay_us = 2 * MSEC_PER_SEC;
578+
if (latency)
579+
/* Give a 50% breathing room between updates */
580+
return latency + (latency >> 1);
580581

581-
/*
582-
* If the platform already has high transition_latency, use it
583-
* as-is.
584-
*/
585-
if (latency > max_delay_us)
586-
return latency;
587-
588-
/*
589-
* For platforms that can change the frequency very fast (< 2
590-
* us), the above formula gives a decent transition delay. But
591-
* for platforms where transition_latency is in milliseconds, it
592-
* ends up giving unrealistic values.
593-
*
594-
* Cap the default transition delay to 2 ms, which seems to be
595-
* a reasonable amount of time after which we should reevaluate
596-
* the frequency.
597-
*/
598-
return min(latency * LATENCY_MULTIPLIER, max_delay_us);
599-
}
600-
601-
return LATENCY_MULTIPLIER;
582+
return USEC_PER_MSEC;
602583
}
603584
EXPORT_SYMBOL_GPL(cpufreq_policy_transition_delay_us);
604585

drivers/gpu/drm/scheduler/sched_entity.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static void drm_sched_entity_wakeup(struct dma_fence *f,
380380
container_of(cb, struct drm_sched_entity, cb);
381381

382382
drm_sched_entity_clear_dep(f, cb);
383-
drm_sched_wakeup(entity->rq->sched, entity);
383+
drm_sched_wakeup(entity->rq->sched);
384384
}
385385

386386
/**
@@ -612,7 +612,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job)
612612
if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)
613613
drm_sched_rq_update_fifo(entity, submit_ts);
614614

615-
drm_sched_wakeup(entity->rq->sched, entity);
615+
drm_sched_wakeup(entity->rq->sched);
616616
}
617617
}
618618
EXPORT_SYMBOL(drm_sched_entity_push_job);

drivers/gpu/drm/scheduler/sched_main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,15 +1022,12 @@ EXPORT_SYMBOL(drm_sched_job_cleanup);
10221022
/**
10231023
* drm_sched_wakeup - Wake up the scheduler if it is ready to queue
10241024
* @sched: scheduler instance
1025-
* @entity: the scheduler entity
10261025
*
10271026
* Wake up the scheduler if we can queue jobs.
10281027
*/
1029-
void drm_sched_wakeup(struct drm_gpu_scheduler *sched,
1030-
struct drm_sched_entity *entity)
1028+
void drm_sched_wakeup(struct drm_gpu_scheduler *sched)
10311029
{
1032-
if (drm_sched_can_queue(sched, entity))
1033-
drm_sched_run_job_queue(sched);
1030+
drm_sched_run_job_queue(sched);
10341031
}
10351032

10361033
/**

drivers/power/supply/power_supply_core.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,11 +1232,7 @@ EXPORT_SYMBOL_GPL(power_supply_set_property);
12321232
int power_supply_property_is_writeable(struct power_supply *psy,
12331233
enum power_supply_property psp)
12341234
{
1235-
if (atomic_read(&psy->use_cnt) <= 0 ||
1236-
!psy->desc->property_is_writeable)
1237-
return -ENODEV;
1238-
1239-
return psy->desc->property_is_writeable(psy, psp);
1235+
return psy->desc->property_is_writeable && psy->desc->property_is_writeable(psy, psp);
12401236
}
12411237
EXPORT_SYMBOL_GPL(power_supply_property_is_writeable);
12421238

drivers/tty/serial/samsung_tty.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ static void s3c24xx_serial_stop_rx(struct uart_port *port)
550550
case TYPE_APPLE_S5L:
551551
s3c24xx_clear_bit(port, APPLE_S5L_UCON_RXTHRESH_ENA, S3C2410_UCON);
552552
s3c24xx_clear_bit(port, APPLE_S5L_UCON_RXTO_ENA, S3C2410_UCON);
553+
s3c24xx_clear_bit(port, APPLE_S5L_UCON_RXTO_LEGACY_ENA, S3C2410_UCON);
553554
break;
554555
default:
555556
disable_irq_nosync(ourport->rx_irq);
@@ -968,9 +969,11 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id)
968969
u32 pend = rd_regl(port, S3C2410_UTRSTAT);
969970
irqreturn_t ret = IRQ_NONE;
970971

971-
if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO)) {
972+
if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO |
973+
APPLE_S5L_UTRSTAT_RXTO_LEGACY)) {
972974
wr_regl(port, S3C2410_UTRSTAT,
973-
APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO);
975+
APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO |
976+
APPLE_S5L_UTRSTAT_RXTO_LEGACY);
974977
ret = s3c24xx_serial_rx_irq(irq, id);
975978
}
976979
if (pend & APPLE_S5L_UTRSTAT_TXTHRESH) {
@@ -1195,7 +1198,8 @@ static void apple_s5l_serial_shutdown(struct uart_port *port)
11951198
ucon = rd_regl(port, S3C2410_UCON);
11961199
ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK |
11971200
APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
1198-
APPLE_S5L_UCON_RXTO_ENA_MSK);
1201+
APPLE_S5L_UCON_RXTO_ENA_MSK |
1202+
APPLE_S5L_UCON_RXTO_LEGACY_ENA_MSK);
11991203
wr_regl(port, S3C2410_UCON, ucon);
12001204

12011205
wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_ALL_FLAGS);
@@ -1292,6 +1296,7 @@ static int apple_s5l_serial_startup(struct uart_port *port)
12921296
/* Enable Rx Interrupt */
12931297
s3c24xx_set_bit(port, APPLE_S5L_UCON_RXTHRESH_ENA, S3C2410_UCON);
12941298
s3c24xx_set_bit(port, APPLE_S5L_UCON_RXTO_ENA, S3C2410_UCON);
1299+
s3c24xx_set_bit(port, APPLE_S5L_UCON_RXTO_LEGACY_ENA, S3C2410_UCON);
12951300

12961301
return ret;
12971302
}
@@ -2148,13 +2153,15 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
21482153

21492154
ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK |
21502155
APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
2151-
APPLE_S5L_UCON_RXTO_ENA_MSK);
2156+
APPLE_S5L_UCON_RXTO_ENA_MSK |
2157+
APPLE_S5L_UCON_RXTO_LEGACY_ENA_MSK);
21522158

21532159
if (ourport->tx_enabled)
21542160
ucon |= APPLE_S5L_UCON_TXTHRESH_ENA_MSK;
21552161
if (ourport->rx_enabled)
21562162
ucon |= APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
2157-
APPLE_S5L_UCON_RXTO_ENA_MSK;
2163+
APPLE_S5L_UCON_RXTO_ENA_MSK |
2164+
APPLE_S5L_UCON_RXTO_LEGACY_ENA_MSK;
21582165

21592166
wr_regl(port, S3C2410_UCON, ucon);
21602167

@@ -2541,7 +2548,7 @@ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
25412548
.name = "Apple S5L UART",
25422549
.type = TYPE_APPLE_S5L,
25432550
.port_type = PORT_8250,
2544-
.iotype = UPIO_MEM,
2551+
.iotype = UPIO_MEM32,
25452552
.fifosize = 16,
25462553
.rx_fifomask = S3C2410_UFSTAT_RXMASK,
25472554
.rx_fifoshift = S3C2410_UFSTAT_RXSHIFT,
@@ -2827,6 +2834,9 @@ OF_EARLYCON_DECLARE(gs101, "google,gs101-uart", gs101_early_console_setup);
28272834
static int __init apple_s5l_early_console_setup(struct earlycon_device *device,
28282835
const char *opt)
28292836
{
2837+
/* Apple A7-A11 requires MMIO32 register accesses. */
2838+
device->port.iotype = UPIO_MEM32;
2839+
28302840
/* Close enough to S3C2410 for earlycon... */
28312841
device->port.private_data = &s3c2410_early_console_data;
28322842

include/drm/gpu_scheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
574574

575575
void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched);
576576
void drm_sched_job_cleanup(struct drm_sched_job *job);
577-
void drm_sched_wakeup(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity);
577+
void drm_sched_wakeup(struct drm_gpu_scheduler *sched);
578578
bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched);
579579
void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched);
580580
void drm_sched_wqueue_start(struct drm_gpu_scheduler *sched);

include/linux/cpufreq.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,6 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div,
577577
#define CPUFREQ_POLICY_POWERSAVE (1)
578578
#define CPUFREQ_POLICY_PERFORMANCE (2)
579579

580-
/*
581-
* The polling frequency depends on the capability of the processor. Default
582-
* polling frequency is 1000 times the transition latency of the processor.
583-
*/
584-
#define LATENCY_MULTIPLIER (1000)
585-
586580
struct cpufreq_governor {
587581
char name[CPUFREQ_NAME_LEN];
588582
int (*init)(struct cpufreq_policy *policy);

include/linux/serial_s3c.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,24 +246,28 @@
246246
S5PV210_UFCON_TXTRIG4 | \
247247
S5PV210_UFCON_RXTRIG4)
248248

249-
#define APPLE_S5L_UCON_RXTO_ENA 9
250-
#define APPLE_S5L_UCON_RXTHRESH_ENA 12
251-
#define APPLE_S5L_UCON_TXTHRESH_ENA 13
252-
#define APPLE_S5L_UCON_RXTO_ENA_MSK (1 << APPLE_S5L_UCON_RXTO_ENA)
253-
#define APPLE_S5L_UCON_RXTHRESH_ENA_MSK (1 << APPLE_S5L_UCON_RXTHRESH_ENA)
254-
#define APPLE_S5L_UCON_TXTHRESH_ENA_MSK (1 << APPLE_S5L_UCON_TXTHRESH_ENA)
249+
#define APPLE_S5L_UCON_RXTO_ENA 9
250+
#define APPLE_S5L_UCON_RXTO_LEGACY_ENA 11
251+
#define APPLE_S5L_UCON_RXTHRESH_ENA 12
252+
#define APPLE_S5L_UCON_TXTHRESH_ENA 13
253+
#define APPLE_S5L_UCON_RXTO_ENA_MSK BIT(APPLE_S5L_UCON_RXTO_ENA)
254+
#define APPLE_S5L_UCON_RXTO_LEGACY_ENA_MSK BIT(APPLE_S5L_UCON_RXTO_LEGACY_ENA)
255+
#define APPLE_S5L_UCON_RXTHRESH_ENA_MSK BIT(APPLE_S5L_UCON_RXTHRESH_ENA)
256+
#define APPLE_S5L_UCON_TXTHRESH_ENA_MSK BIT(APPLE_S5L_UCON_TXTHRESH_ENA)
255257

256258
#define APPLE_S5L_UCON_DEFAULT (S3C2410_UCON_TXIRQMODE | \
257259
S3C2410_UCON_RXIRQMODE | \
258260
S3C2410_UCON_RXFIFO_TOI)
259261
#define APPLE_S5L_UCON_MASK (APPLE_S5L_UCON_RXTO_ENA_MSK | \
262+
APPLE_S5L_UCON_RXTO_LEGACY_ENA_MSK | \
260263
APPLE_S5L_UCON_RXTHRESH_ENA_MSK | \
261264
APPLE_S5L_UCON_TXTHRESH_ENA_MSK)
262265

263-
#define APPLE_S5L_UTRSTAT_RXTHRESH (1<<4)
264-
#define APPLE_S5L_UTRSTAT_TXTHRESH (1<<5)
265-
#define APPLE_S5L_UTRSTAT_RXTO (1<<9)
266-
#define APPLE_S5L_UTRSTAT_ALL_FLAGS (0x3f0)
266+
#define APPLE_S5L_UTRSTAT_RXTO_LEGACY BIT(3)
267+
#define APPLE_S5L_UTRSTAT_RXTHRESH BIT(4)
268+
#define APPLE_S5L_UTRSTAT_TXTHRESH BIT(5)
269+
#define APPLE_S5L_UTRSTAT_RXTO BIT(9)
270+
#define APPLE_S5L_UTRSTAT_ALL_FLAGS (0x3f8)
267271

268272
#ifndef __ASSEMBLY__
269273

0 commit comments

Comments
 (0)