Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964862AbbGZBht (ORCPT ); Sat, 25 Jul 2015 21:37:49 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:50671 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755078AbbGZBhr (ORCPT ); Sat, 25 Jul 2015 21:37:47 -0400 Date: Sun, 26 Jul 2015 11:37:20 +1000 (AEST) From: Finn Thain To: Michael Ellerman cc: "Christian T. Steigies" , Michael Schmitz , Linux/m68k , Arnd Bergmann , Greg Kroah-Hartman , Linux Kernel Development , Andreas Schwab , Geert Uytterhoeven , linuxppc-dev Subject: Re: [RFC v4 03/25] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c In-Reply-To: <1437786020.19730.2.camel@ellerman.id.au> Message-ID: References: <20150712102527.356151908@telegraphics.com.au> <20150712102528.107134628@telegraphics.com.au> <87d1zwc4dj.fsf@igel.home> <55AF1364.3080701@gmail.com> <20150723092114.GA10989@guido.earth.sol> <20150724190749.GA7529@guido.earth.sol> <1437786020.19730.2.camel@ellerman.id.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2184 Lines: 87 On Sat, 25 Jul 2015, Michael Ellerman wrote: > On Sat, 2015-07-25 at 10:35 +1000, Finn Thain wrote: > > > > ... These are rudimentary tests but combined with my own testing on > > m68k, ppc32 and x86, coverage is quite good. Some testing on ppc64 is > > still lacking though. Here's some code I wrote some time ago to help me test these patches, maybe it will help others (though independent results may be more valuable...) -- -- 8< -- -- #!/bin/sh set -e -u -x temp=`mktemp /root/nvram.XXXX` test -f "$temp" cat /proc/version if ! test -e /dev/nvram ; then mknod /dev/nvram c 10 144 fi ls -l /dev/nvram if test -c /dev/nvram ; then cp /dev/nvram "$temp" hexdump -C "$temp" cp /dev/zero /dev/nvram || true hexdump -C /dev/nvram cp "$temp" /dev/nvram hexdump -C /dev/nvram fi -- -- 8< -- -- #include #include #include #if defined(__powerpc__) #include #elif defined(__i386__) || defined(__mc68020__) #include #endif int main(void) { int result, i; FILE *f; f = fopen("/dev/nvram", "r+"); if (!f) { perror("fopen"); return 1; } #if defined(__powerpc__) result = ioctl(fileno(f), IOC_NVRAM_SYNC); fprintf(stderr, "ioctl IOC_NVRAM_SYNC: result %d, errno %m\n", result); for (i = 0; i <= 8; ++i) { int arg = i; result = ioctl(fileno(f), IOC_NVRAM_GET_OFFSET, (long)&arg); fprintf(stderr, "ioctl IOC_NVRAM_GET_OFFSET: i %d, result %d, offset %d, errno %m\n", i, result, arg); } #elif defined(__i386__) || defined(__mc68020__) result = ioctl(fileno(f), NVRAM_INIT); fprintf(stderr, "ioctl NVRAM_INIT: result %d, errno %m\n", result); result = ioctl(fileno(f), NVRAM_SETCKS); fprintf(stderr, "ioctl NVRAM_SETCKS: result %d, errno %m\n", result); #endif return 0; } -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/