Commit 947c2a83 authored by Linus Torvalds's avatar Linus Torvalds

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
parents c9d26d8d 99b2f159
...@@ -417,14 +417,6 @@ void *arch_dma_alloc(struct device *dev, size_t size, ...@@ -417,14 +417,6 @@ void *arch_dma_alloc(struct device *dev, size_t size,
map_uncached_pages(vaddr, size, paddr); map_uncached_pages(vaddr, size, paddr);
*dma_handle = (dma_addr_t) paddr; *dma_handle = (dma_addr_t) paddr;
#if 0
/* This probably isn't needed to support EISA cards.
** ISA cards will certainly only support 24-bit DMA addressing.
** Not clear if we can, want, or need to support ISA.
*/
if (!dev || *dev->coherent_dma_mask < 0xffffffff)
gfp |= GFP_DMA;
#endif
return (void *)vaddr; return (void *)vaddr;
} }
......
...@@ -337,7 +337,7 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop) ...@@ -337,7 +337,7 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
: "r19", "r20", "r21", "r22", "r1" ); : "r19", "r20", "r21", "r22", "r1" );
#else #else
{ {
unsigned long valh=(val>>32),vall=(val&0xffffffffl); unsigned long valh = (val >> 32), vall = (val & 0xffffffffl);
__asm__ __volatile__ ( __asm__ __volatile__ (
" mtsp %4, %%sr1\n" " mtsp %4, %%sr1\n"
" zdep %2, 29, 2, %%r19\n" " zdep %2, 29, 2, %%r19\n"
...@@ -473,7 +473,7 @@ void handle_unaligned(struct pt_regs *regs) ...@@ -473,7 +473,7 @@ void handle_unaligned(struct pt_regs *regs)
case OPCODE_LDWA_I: case OPCODE_LDWA_I:
case OPCODE_LDW_S: case OPCODE_LDW_S:
case OPCODE_LDWA_S: case OPCODE_LDWA_S:
ret = emulate_ldw(regs, R3(regs->iir),0); ret = emulate_ldw(regs, R3(regs->iir), 0);
break; break;
case OPCODE_STH: case OPCODE_STH:
...@@ -482,7 +482,7 @@ void handle_unaligned(struct pt_regs *regs) ...@@ -482,7 +482,7 @@ void handle_unaligned(struct pt_regs *regs)
case OPCODE_STW: case OPCODE_STW:
case OPCODE_STWA: case OPCODE_STWA:
ret = emulate_stw(regs, R2(regs->iir),0); ret = emulate_stw(regs, R2(regs->iir), 0);
break; break;
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
...@@ -490,12 +490,12 @@ void handle_unaligned(struct pt_regs *regs) ...@@ -490,12 +490,12 @@ void handle_unaligned(struct pt_regs *regs)
case OPCODE_LDDA_I: case OPCODE_LDDA_I:
case OPCODE_LDD_S: case OPCODE_LDD_S:
case OPCODE_LDDA_S: case OPCODE_LDDA_S:
ret = emulate_ldd(regs, R3(regs->iir),0); ret = emulate_ldd(regs, R3(regs->iir), 0);
break; break;
case OPCODE_STD: case OPCODE_STD:
case OPCODE_STDA: case OPCODE_STDA:
ret = emulate_std(regs, R2(regs->iir),0); ret = emulate_std(regs, R2(regs->iir), 0);
break; break;
#endif #endif
...@@ -503,24 +503,24 @@ void handle_unaligned(struct pt_regs *regs) ...@@ -503,24 +503,24 @@ void handle_unaligned(struct pt_regs *regs)
case OPCODE_FLDWS: case OPCODE_FLDWS:
case OPCODE_FLDWXR: case OPCODE_FLDWXR:
case OPCODE_FLDWSR: case OPCODE_FLDWSR:
ret = emulate_ldw(regs,FR3(regs->iir),1); ret = emulate_ldw(regs, FR3(regs->iir), 1);
break; break;
case OPCODE_FLDDX: case OPCODE_FLDDX:
case OPCODE_FLDDS: case OPCODE_FLDDS:
ret = emulate_ldd(regs,R3(regs->iir),1); ret = emulate_ldd(regs, R3(regs->iir), 1);
break; break;
case OPCODE_FSTWX: case OPCODE_FSTWX:
case OPCODE_FSTWS: case OPCODE_FSTWS:
case OPCODE_FSTWXR: case OPCODE_FSTWXR:
case OPCODE_FSTWSR: case OPCODE_FSTWSR:
ret = emulate_stw(regs,FR3(regs->iir),1); ret = emulate_stw(regs, FR3(regs->iir), 1);
break; break;
case OPCODE_FSTDX: case OPCODE_FSTDX:
case OPCODE_FSTDS: case OPCODE_FSTDS:
ret = emulate_std(regs,R3(regs->iir),1); ret = emulate_std(regs, R3(regs->iir), 1);
break; break;
case OPCODE_LDCD_I: case OPCODE_LDCD_I:
......
...@@ -19,9 +19,6 @@ void notrace set_fixmap(enum fixed_addresses idx, phys_addr_t phys) ...@@ -19,9 +19,6 @@ void notrace set_fixmap(enum fixed_addresses idx, phys_addr_t phys)
pmd_t *pmd = pmd_offset(pud, vaddr); pmd_t *pmd = pmd_offset(pud, vaddr);
pte_t *pte; pte_t *pte;
if (pmd_none(*pmd))
pte = pte_alloc_kernel(pmd, vaddr);
pte = pte_offset_kernel(pmd, vaddr); pte = pte_offset_kernel(pmd, vaddr);
set_pte_at(&init_mm, vaddr, pte, __mk_pte(phys, PAGE_KERNEL_RWX)); set_pte_at(&init_mm, vaddr, pte, __mk_pte(phys, PAGE_KERNEL_RWX));
flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE); flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE);
......
...@@ -669,6 +669,39 @@ static void __init gateway_init(void) ...@@ -669,6 +669,39 @@ static void __init gateway_init(void)
PAGE_SIZE, PAGE_GATEWAY, 1); PAGE_SIZE, PAGE_GATEWAY, 1);
} }
static void __init fixmap_init(void)
{
unsigned long addr = FIXMAP_START;
unsigned long end = FIXMAP_START + FIXMAP_SIZE;
pgd_t *pgd = pgd_offset_k(addr);
p4d_t *p4d = p4d_offset(pgd, addr);
pud_t *pud = pud_offset(p4d, addr);
pmd_t *pmd;
BUILD_BUG_ON(FIXMAP_SIZE > PMD_SIZE);
#if CONFIG_PGTABLE_LEVELS == 3
if (pud_none(*pud)) {
pmd = memblock_alloc(PAGE_SIZE << PMD_TABLE_ORDER,
PAGE_SIZE << PMD_TABLE_ORDER);
if (!pmd)
panic("fixmap: pmd allocation failed.\n");
pud_populate(NULL, pud, pmd);
}
#endif
pmd = pmd_offset(pud, addr);
do {
pte_t *pte = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
if (!pte)
panic("fixmap: pte allocation failed.\n");
pmd_populate_kernel(&init_mm, pmd, pte);
addr += PAGE_SIZE;
} while (addr < end);
}
static void __init parisc_bootmem_free(void) static void __init parisc_bootmem_free(void)
{ {
unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0, }; unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0, };
...@@ -683,6 +716,7 @@ void __init paging_init(void) ...@@ -683,6 +716,7 @@ void __init paging_init(void)
setup_bootmem(); setup_bootmem();
pagetable_init(); pagetable_init();
gateway_init(); gateway_init();
fixmap_init();
flush_cache_all_local(); /* start with known state */ flush_cache_all_local(); /* start with known state */
flush_tlb_all_local(NULL); flush_tlb_all_local(NULL);
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/dma.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <asm/superio.h> #include <asm/superio.h>
...@@ -226,9 +225,9 @@ static int parport_PS2_supported(struct parport *pb) ...@@ -226,9 +225,9 @@ static int parport_PS2_supported(struct parport *pb)
/* --- Initialisation code -------------------------------- */ /* --- Initialisation code -------------------------------- */
struct parport *parport_gsc_probe_port(unsigned long base, static struct parport *parport_gsc_probe_port(unsigned long base,
unsigned long base_hi, int irq, unsigned long base_hi, int irq,
int dma, struct parisc_device *padev) struct parisc_device *padev)
{ {
struct parport_gsc_private *priv; struct parport_gsc_private *priv;
struct parport_operations *ops; struct parport_operations *ops;
...@@ -250,12 +249,9 @@ struct parport *parport_gsc_probe_port(unsigned long base, ...@@ -250,12 +249,9 @@ struct parport *parport_gsc_probe_port(unsigned long base,
} }
priv->ctr = 0xc; priv->ctr = 0xc;
priv->ctr_writable = 0xff; priv->ctr_writable = 0xff;
priv->dma_buf = NULL;
priv->dma_handle = 0;
p->base = base; p->base = base;
p->base_hi = base_hi; p->base_hi = base_hi;
p->irq = irq; p->irq = irq;
p->dma = dma;
p->modes = PARPORT_MODE_PCSPP | PARPORT_MODE_SAFEININT; p->modes = PARPORT_MODE_PCSPP | PARPORT_MODE_SAFEININT;
p->ops = ops; p->ops = ops;
p->private_data = priv; p->private_data = priv;
...@@ -286,17 +282,9 @@ struct parport *parport_gsc_probe_port(unsigned long base, ...@@ -286,17 +282,9 @@ struct parport *parport_gsc_probe_port(unsigned long base,
if (p->irq == PARPORT_IRQ_AUTO) { if (p->irq == PARPORT_IRQ_AUTO) {
p->irq = PARPORT_IRQ_NONE; p->irq = PARPORT_IRQ_NONE;
} }
if (p->irq != PARPORT_IRQ_NONE) { if (p->irq != PARPORT_IRQ_NONE)
pr_cont(", irq %d", p->irq); pr_cont(", irq %d", p->irq);
if (p->dma == PARPORT_DMA_AUTO) {
p->dma = PARPORT_DMA_NONE;
}
}
if (p->dma == PARPORT_DMA_AUTO) /* To use DMA, giving the irq
is mandatory (see above) */
p->dma = PARPORT_DMA_NONE;
pr_cont(" ["); pr_cont(" [");
#define printmode(x) \ #define printmode(x) \
do { \ do { \
...@@ -321,7 +309,6 @@ do { \ ...@@ -321,7 +309,6 @@ do { \
pr_warn("%s: irq %d in use, resorting to polled operation\n", pr_warn("%s: irq %d in use, resorting to polled operation\n",
p->name, p->irq); p->name, p->irq);
p->irq = PARPORT_IRQ_NONE; p->irq = PARPORT_IRQ_NONE;
p->dma = PARPORT_DMA_NONE;
} }
} }
...@@ -369,8 +356,7 @@ static int __init parport_init_chip(struct parisc_device *dev) ...@@ -369,8 +356,7 @@ static int __init parport_init_chip(struct parisc_device *dev)
pr_info("%s: enhanced parport-modes not supported\n", __func__); pr_info("%s: enhanced parport-modes not supported\n", __func__);
} }
p = parport_gsc_probe_port(port, 0, dev->irq, p = parport_gsc_probe_port(port, 0, dev->irq, dev);
/* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, dev);
if (p) if (p)
parport_count++; parport_count++;
dev_set_drvdata(&dev->dev, p); dev_set_drvdata(&dev->dev, p);
...@@ -382,16 +368,10 @@ static void __exit parport_remove_chip(struct parisc_device *dev) ...@@ -382,16 +368,10 @@ static void __exit parport_remove_chip(struct parisc_device *dev)
{ {
struct parport *p = dev_get_drvdata(&dev->dev); struct parport *p = dev_get_drvdata(&dev->dev);
if (p) { if (p) {
struct parport_gsc_private *priv = p->private_data;
struct parport_operations *ops = p->ops; struct parport_operations *ops = p->ops;
parport_remove_port(p); parport_remove_port(p);
if (p->dma != PARPORT_DMA_NONE)
free_dma(p->dma);
if (p->irq != PARPORT_IRQ_NONE) if (p->irq != PARPORT_IRQ_NONE)
free_irq(p->irq, p); free_irq(p->irq, p);
if (priv->dma_buf)
dma_free_coherent(&priv->dev->dev, PAGE_SIZE,
priv->dma_buf, priv->dma_handle);
kfree (p->private_data); kfree (p->private_data);
parport_put_port(p); parport_put_port(p);
kfree (ops); /* hope no-one cached it */ kfree (ops); /* hope no-one cached it */
......
...@@ -63,8 +63,6 @@ struct parport_gsc_private { ...@@ -63,8 +63,6 @@ struct parport_gsc_private {
int writeIntrThreshold; int writeIntrThreshold;
/* buffer suitable for DMA, if DMA enabled */ /* buffer suitable for DMA, if DMA enabled */
char *dma_buf;
dma_addr_t dma_handle;
struct pci_dev *dev; struct pci_dev *dev;
}; };
...@@ -199,9 +197,4 @@ extern void parport_gsc_inc_use_count(void); ...@@ -199,9 +197,4 @@ extern void parport_gsc_inc_use_count(void);
extern void parport_gsc_dec_use_count(void); extern void parport_gsc_dec_use_count(void);
extern struct parport *parport_gsc_probe_port(unsigned long base,
unsigned long base_hi,
int irq, int dma,
struct parisc_device *padev);
#endif /* __DRIVERS_PARPORT_PARPORT_GSC_H */ #endif /* __DRIVERS_PARPORT_PARPORT_GSC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment