Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/geert/linux-m68k

Pull m68k updates from Geert Uytterhoeven:
 "Summary:
   - Kill harmless warning messages when running a multi-platform kernel
     on Atari
   - Correct virt/phys mixups that didn't actually hurt due to identity
     mappings"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  m68k/atari: ARAnyM - Always use physical addresses in NatFeat calls
  m68k: Ignore disabled HSYNC interrupt on Atari for irqs_disabled()
  • Loading branch information
Linus Torvalds committed Sep 3, 2013
2 parents 7e75224 + 5549005 commit ea98af1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
14 changes: 7 additions & 7 deletions arch/m68k/emu/natfeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
#include <asm/machdep.h>
#include <asm/natfeat.h>

extern long nf_get_id2(const char *feature_name);
extern long nf_get_id_phys(unsigned long feature_name);

asm("\n"
" .global nf_get_id2,nf_call\n"
"nf_get_id2:\n"
" .global nf_get_id_phys,nf_call\n"
"nf_get_id_phys:\n"
" .short 0x7300\n"
" rts\n"
"nf_call:\n"
Expand All @@ -31,7 +31,7 @@ asm("\n"
"1: moveq.l #0,%d0\n"
" rts\n"
" .section __ex_table,\"a\"\n"
" .long nf_get_id2,1b\n"
" .long nf_get_id_phys,1b\n"
" .long nf_call,1b\n"
" .previous");
EXPORT_SYMBOL_GPL(nf_call);
Expand All @@ -46,7 +46,7 @@ long nf_get_id(const char *feature_name)
if (n >= sizeof(name_copy))
return 0;

return nf_get_id2(name_copy);
return nf_get_id_phys(virt_to_phys(name_copy));
}
EXPORT_SYMBOL_GPL(nf_get_id);

Expand All @@ -58,7 +58,7 @@ void nfprint(const char *fmt, ...)

va_start(ap, fmt);
n = vsnprintf(buf, 256, fmt, ap);
nf_call(nf_get_id("NF_STDERR"), buf);
nf_call(nf_get_id("NF_STDERR"), virt_to_phys(buf));
va_end(ap);
}

Expand All @@ -83,7 +83,7 @@ void nf_init(void)
id = nf_get_id("NF_NAME");
if (!id)
return;
nf_call(id, buf, 256);
nf_call(id, virt_to_phys(buf), 256);
buf[255] = 0;

pr_info("NatFeats found (%s, %lu.%lu)\n", buf, version >> 16,
Expand Down
4 changes: 2 additions & 2 deletions arch/m68k/emu/nfblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ static inline s32 nfhd_read_write(u32 major, u32 minor, u32 rwflag, u32 recno,
static inline s32 nfhd_get_capacity(u32 major, u32 minor, u32 *blocks,
u32 *blocksize)
{
return nf_call(nfhd_id + NFHD_GET_CAPACITY, major, minor, blocks,
blocksize);
return nf_call(nfhd_id + NFHD_GET_CAPACITY, major, minor,
virt_to_phys(blocks), virt_to_phys(blocksize));
}

static LIST_HEAD(nfhd_list);
Expand Down
8 changes: 5 additions & 3 deletions arch/m68k/emu/nfcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/uaccess.h>
#include <linux/io.h>

#include <asm/natfeat.h>

Expand All @@ -25,17 +26,18 @@ static struct tty_driver *nfcon_tty_driver;
static void nfputs(const char *str, unsigned int count)
{
char buf[68];
unsigned long phys = virt_to_phys(buf);

buf[64] = 0;
while (count > 64) {
memcpy(buf, str, 64);
nf_call(stderr_id, buf);
nf_call(stderr_id, phys);
str += 64;
count -= 64;
}
memcpy(buf, str, count);
buf[count] = 0;
nf_call(stderr_id, buf);
nf_call(stderr_id, phys);
}

static void nfcon_write(struct console *con, const char *str,
Expand Down Expand Up @@ -79,7 +81,7 @@ static int nfcon_tty_put_char(struct tty_struct *tty, unsigned char ch)
{
char temp[2] = { ch, 0 };

nf_call(stderr_id, temp);
nf_call(stderr_id, virt_to_phys(temp));
return 1;
}

Expand Down
7 changes: 4 additions & 3 deletions arch/m68k/emu/nfeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ static struct net_device * __init nfeth_probe(int unit)
char mac[ETH_ALEN], host_ip[32], local_ip[32];
int err;

if (!nf_call(nfEtherID + XIF_GET_MAC, unit, mac, ETH_ALEN))
if (!nf_call(nfEtherID + XIF_GET_MAC, unit, virt_to_phys(mac),
ETH_ALEN))
return NULL;

dev = alloc_etherdev(sizeof(struct nfeth_private));
Expand All @@ -217,9 +218,9 @@ static struct net_device * __init nfeth_probe(int unit)
}

nf_call(nfEtherID + XIF_GET_IPHOST, unit,
host_ip, sizeof(host_ip));
virt_to_phys(host_ip), sizeof(host_ip));
nf_call(nfEtherID + XIF_GET_IPATARI, unit,
local_ip, sizeof(local_ip));
virt_to_phys(local_ip), sizeof(local_ip));

netdev_info(dev, KBUILD_MODNAME " addr:%s (%s) HWaddr:%pM\n", host_ip,
local_ip, mac);
Expand Down
4 changes: 4 additions & 0 deletions arch/m68k/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ static inline void arch_local_irq_restore(unsigned long flags)

static inline bool arch_irqs_disabled_flags(unsigned long flags)
{
if (MACH_IS_ATARI) {
/* Ignore HSYNC = ipl 2 on Atari */
return (flags & ~(ALLOWINT | 0x200)) != 0;
}
return (flags & ~ALLOWINT) != 0;
}

Expand Down

0 comments on commit ea98af1

Please sign in to comment.