Skip to content

Commit 947c2a8

Browse files
committed
Merge tag 'parisc-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc architecture fixes from Helge Deller: - early fixmap preallocation to fix boot failures on kernel >= 6.4 - remove DMA leftover code in parport_gsc - drop old comments and code style fixes * tag 'parisc-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: unaligned: Add required spaces after ',' parport: gsc: remove DMA leftover code parisc: pci-dma: remove unused and dead EISA code and comment parisc/mm: preallocate fixmap page tables at init
2 parents c9d26d8 + 99b2f15 commit 947c2a8

File tree

6 files changed

+47
-51
lines changed

6 files changed

+47
-51
lines changed

arch/parisc/kernel/pci-dma.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,6 @@ void *arch_dma_alloc(struct device *dev, size_t size,
417417
map_uncached_pages(vaddr, size, paddr);
418418
*dma_handle = (dma_addr_t) paddr;
419419

420-
#if 0
421-
/* This probably isn't needed to support EISA cards.
422-
** ISA cards will certainly only support 24-bit DMA addressing.
423-
** Not clear if we can, want, or need to support ISA.
424-
*/
425-
if (!dev || *dev->coherent_dma_mask < 0xffffffff)
426-
gfp |= GFP_DMA;
427-
#endif
428420
return (void *)vaddr;
429421
}
430422

arch/parisc/kernel/unaligned.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
337337
: "r19", "r20", "r21", "r22", "r1" );
338338
#else
339339
{
340-
unsigned long valh=(val>>32),vall=(val&0xffffffffl);
340+
unsigned long valh = (val >> 32), vall = (val & 0xffffffffl);
341341
__asm__ __volatile__ (
342342
" mtsp %4, %%sr1\n"
343343
" zdep %2, 29, 2, %%r19\n"
@@ -473,7 +473,7 @@ void handle_unaligned(struct pt_regs *regs)
473473
case OPCODE_LDWA_I:
474474
case OPCODE_LDW_S:
475475
case OPCODE_LDWA_S:
476-
ret = emulate_ldw(regs, R3(regs->iir),0);
476+
ret = emulate_ldw(regs, R3(regs->iir), 0);
477477
break;
478478

479479
case OPCODE_STH:
@@ -482,45 +482,45 @@ void handle_unaligned(struct pt_regs *regs)
482482

483483
case OPCODE_STW:
484484
case OPCODE_STWA:
485-
ret = emulate_stw(regs, R2(regs->iir),0);
485+
ret = emulate_stw(regs, R2(regs->iir), 0);
486486
break;
487487

488488
#ifdef CONFIG_64BIT
489489
case OPCODE_LDD_I:
490490
case OPCODE_LDDA_I:
491491
case OPCODE_LDD_S:
492492
case OPCODE_LDDA_S:
493-
ret = emulate_ldd(regs, R3(regs->iir),0);
493+
ret = emulate_ldd(regs, R3(regs->iir), 0);
494494
break;
495495

496496
case OPCODE_STD:
497497
case OPCODE_STDA:
498-
ret = emulate_std(regs, R2(regs->iir),0);
498+
ret = emulate_std(regs, R2(regs->iir), 0);
499499
break;
500500
#endif
501501

502502
case OPCODE_FLDWX:
503503
case OPCODE_FLDWS:
504504
case OPCODE_FLDWXR:
505505
case OPCODE_FLDWSR:
506-
ret = emulate_ldw(regs,FR3(regs->iir),1);
506+
ret = emulate_ldw(regs, FR3(regs->iir), 1);
507507
break;
508508

509509
case OPCODE_FLDDX:
510510
case OPCODE_FLDDS:
511-
ret = emulate_ldd(regs,R3(regs->iir),1);
511+
ret = emulate_ldd(regs, R3(regs->iir), 1);
512512
break;
513513

514514
case OPCODE_FSTWX:
515515
case OPCODE_FSTWS:
516516
case OPCODE_FSTWXR:
517517
case OPCODE_FSTWSR:
518-
ret = emulate_stw(regs,FR3(regs->iir),1);
518+
ret = emulate_stw(regs, FR3(regs->iir), 1);
519519
break;
520520

521521
case OPCODE_FSTDX:
522522
case OPCODE_FSTDS:
523-
ret = emulate_std(regs,R3(regs->iir),1);
523+
ret = emulate_std(regs, R3(regs->iir), 1);
524524
break;
525525

526526
case OPCODE_LDCD_I:

arch/parisc/mm/fixmap.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ void notrace set_fixmap(enum fixed_addresses idx, phys_addr_t phys)
1919
pmd_t *pmd = pmd_offset(pud, vaddr);
2020
pte_t *pte;
2121

22-
if (pmd_none(*pmd))
23-
pte = pte_alloc_kernel(pmd, vaddr);
24-
2522
pte = pte_offset_kernel(pmd, vaddr);
2623
set_pte_at(&init_mm, vaddr, pte, __mk_pte(phys, PAGE_KERNEL_RWX));
2724
flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE);

arch/parisc/mm/init.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,39 @@ static void __init gateway_init(void)
669669
PAGE_SIZE, PAGE_GATEWAY, 1);
670670
}
671671

672+
static void __init fixmap_init(void)
673+
{
674+
unsigned long addr = FIXMAP_START;
675+
unsigned long end = FIXMAP_START + FIXMAP_SIZE;
676+
pgd_t *pgd = pgd_offset_k(addr);
677+
p4d_t *p4d = p4d_offset(pgd, addr);
678+
pud_t *pud = pud_offset(p4d, addr);
679+
pmd_t *pmd;
680+
681+
BUILD_BUG_ON(FIXMAP_SIZE > PMD_SIZE);
682+
683+
#if CONFIG_PGTABLE_LEVELS == 3
684+
if (pud_none(*pud)) {
685+
pmd = memblock_alloc(PAGE_SIZE << PMD_TABLE_ORDER,
686+
PAGE_SIZE << PMD_TABLE_ORDER);
687+
if (!pmd)
688+
panic("fixmap: pmd allocation failed.\n");
689+
pud_populate(NULL, pud, pmd);
690+
}
691+
#endif
692+
693+
pmd = pmd_offset(pud, addr);
694+
do {
695+
pte_t *pte = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
696+
if (!pte)
697+
panic("fixmap: pte allocation failed.\n");
698+
699+
pmd_populate_kernel(&init_mm, pmd, pte);
700+
701+
addr += PAGE_SIZE;
702+
} while (addr < end);
703+
}
704+
672705
static void __init parisc_bootmem_free(void)
673706
{
674707
unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0, };
@@ -683,6 +716,7 @@ void __init paging_init(void)
683716
setup_bootmem();
684717
pagetable_init();
685718
gateway_init();
719+
fixmap_init();
686720
flush_cache_all_local(); /* start with known state */
687721
flush_tlb_all_local(NULL);
688722

drivers/parport/parport_gsc.c

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <linux/sysctl.h>
2929

3030
#include <asm/io.h>
31-
#include <asm/dma.h>
3231
#include <linux/uaccess.h>
3332
#include <asm/superio.h>
3433

@@ -226,9 +225,9 @@ static int parport_PS2_supported(struct parport *pb)
226225

227226
/* --- Initialisation code -------------------------------- */
228227

229-
struct parport *parport_gsc_probe_port(unsigned long base,
228+
static struct parport *parport_gsc_probe_port(unsigned long base,
230229
unsigned long base_hi, int irq,
231-
int dma, struct parisc_device *padev)
230+
struct parisc_device *padev)
232231
{
233232
struct parport_gsc_private *priv;
234233
struct parport_operations *ops;
@@ -250,12 +249,9 @@ struct parport *parport_gsc_probe_port(unsigned long base,
250249
}
251250
priv->ctr = 0xc;
252251
priv->ctr_writable = 0xff;
253-
priv->dma_buf = NULL;
254-
priv->dma_handle = 0;
255252
p->base = base;
256253
p->base_hi = base_hi;
257254
p->irq = irq;
258-
p->dma = dma;
259255
p->modes = PARPORT_MODE_PCSPP | PARPORT_MODE_SAFEININT;
260256
p->ops = ops;
261257
p->private_data = priv;
@@ -286,17 +282,9 @@ struct parport *parport_gsc_probe_port(unsigned long base,
286282
if (p->irq == PARPORT_IRQ_AUTO) {
287283
p->irq = PARPORT_IRQ_NONE;
288284
}
289-
if (p->irq != PARPORT_IRQ_NONE) {
285+
if (p->irq != PARPORT_IRQ_NONE)
290286
pr_cont(", irq %d", p->irq);
291287

292-
if (p->dma == PARPORT_DMA_AUTO) {
293-
p->dma = PARPORT_DMA_NONE;
294-
}
295-
}
296-
if (p->dma == PARPORT_DMA_AUTO) /* To use DMA, giving the irq
297-
is mandatory (see above) */
298-
p->dma = PARPORT_DMA_NONE;
299-
300288
pr_cont(" [");
301289
#define printmode(x) \
302290
do { \
@@ -321,7 +309,6 @@ do { \
321309
pr_warn("%s: irq %d in use, resorting to polled operation\n",
322310
p->name, p->irq);
323311
p->irq = PARPORT_IRQ_NONE;
324-
p->dma = PARPORT_DMA_NONE;
325312
}
326313
}
327314

@@ -369,8 +356,7 @@ static int __init parport_init_chip(struct parisc_device *dev)
369356
pr_info("%s: enhanced parport-modes not supported\n", __func__);
370357
}
371358

372-
p = parport_gsc_probe_port(port, 0, dev->irq,
373-
/* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, dev);
359+
p = parport_gsc_probe_port(port, 0, dev->irq, dev);
374360
if (p)
375361
parport_count++;
376362
dev_set_drvdata(&dev->dev, p);
@@ -382,16 +368,10 @@ static void __exit parport_remove_chip(struct parisc_device *dev)
382368
{
383369
struct parport *p = dev_get_drvdata(&dev->dev);
384370
if (p) {
385-
struct parport_gsc_private *priv = p->private_data;
386371
struct parport_operations *ops = p->ops;
387372
parport_remove_port(p);
388-
if (p->dma != PARPORT_DMA_NONE)
389-
free_dma(p->dma);
390373
if (p->irq != PARPORT_IRQ_NONE)
391374
free_irq(p->irq, p);
392-
if (priv->dma_buf)
393-
dma_free_coherent(&priv->dev->dev, PAGE_SIZE,
394-
priv->dma_buf, priv->dma_handle);
395375
kfree (p->private_data);
396376
parport_put_port(p);
397377
kfree (ops); /* hope no-one cached it */

drivers/parport/parport_gsc.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ struct parport_gsc_private {
6363
int writeIntrThreshold;
6464

6565
/* buffer suitable for DMA, if DMA enabled */
66-
char *dma_buf;
67-
dma_addr_t dma_handle;
6866
struct pci_dev *dev;
6967
};
7068

@@ -199,9 +197,4 @@ extern void parport_gsc_inc_use_count(void);
199197

200198
extern void parport_gsc_dec_use_count(void);
201199

202-
extern struct parport *parport_gsc_probe_port(unsigned long base,
203-
unsigned long base_hi,
204-
int irq, int dma,
205-
struct parisc_device *padev);
206-
207200
#endif /* __DRIVERS_PARPORT_PARPORT_GSC_H */

0 commit comments

Comments
 (0)