Olof Johansson [Mon, 17 May 2004 14:12:36 +0000 (07:12 -0700)]
[PATCH] ppc64: fix non-SMP build break
arch/ppc64/lib/locks.c was recently added by Paulus' lock rewrite. It's
always compiled, which breaks non-SMP builds. Below patch makes it depend
on CONFIG_SMP.
Russell King [Mon, 17 May 2004 23:28:23 +0000 (00:28 +0100)]
[ARM] Update atomic.h
This re-jigs atomic.h by providing atomic_add_return and
atomic_sub_return as other architectures do. This allows us to
implement the atomic ops that test the new value without having
to write the underlying atomic operation in various forms.
Ian Campbell [Mon, 17 May 2004 21:02:14 +0000 (22:02 +0100)]
[ARM] Fix use of page->count
Patch from: Ian Campbell
This changes the atomic_t in struct page named count into a private
member _count which breaks arch/arm/mm/init.c at line 80 which reads
page->count directly in show_mem().
The comments in the above changeset suggest that page_count(page) is
precisely equal to the old page->count semantics, even though the
semantics of _count are different, so I think the following is correct
David Brownell [Mon, 17 May 2004 08:33:22 +0000 (01:33 -0700)]
[PATCH] USB: ethernet/rndis gadget address params
This resolves a FIXME by adding module parameters that can
be used to provide stable (vs random) addresses, and gets
rid of a runtime error from obsolete module parameter usage
in the RNDIS code.
The stable ethernet addresses are nice to hosts, which will
normally want to save them away in config databases. For
example, without stable addresses Windows XP will end up
recording quite a lot of RNDIS devices.
David Brownell [Mon, 17 May 2004 08:32:03 +0000 (01:32 -0700)]
[PATCH] USB: RNDIS (and CDC) filter flag handling
This should fix the problem David Meggy found, where RNDIS was setting
the OID_GEN_CURRENT_PACKET_FILTER state incorrectly. It's the same
issue Andrew Morton noticed a while back, for that matter, but with
more than just a "now compiles on 64 bit" fix.
Basically the code needs to interpret 32 bits provided in the request
from the (Windows) host, rather than 8 bits of other memory that's got
some irrelevant value.
The fix is just to save the 32 bits. I did the same thing with the
CDC Ethernet filter, which should eventually be used the same way: to
limit what packets get sent to the host. Also defined a couple more
of the CDC requests.
David Brownell [Mon, 17 May 2004 04:13:32 +0000 (21:13 -0700)]
[PATCH] USB: fix MSEC_TO_JIFFIES in usb code
Here are some MSEC_TO_JIFFIES() fixes missed by whoever did it,
plus a minor fix to grab root_hub->serialize() during OHCI
suspend. (I forgot to cut/paste those lines from resume.)
(gdb) list *serial_open+0x38
0xc046a188 is in serial_open (drivers/usb/serial/usb-serial.c:465).
460
461 /* get the serial object associated with this tty pointer */
462 serial = usb_serial_get_by_index(tty->index);
463
464 /* set up our port structure making the tty driver remember our port object, and us it */
465 portNumber = tty->index - serial->minor;
466 port = serial->port[portNumber];
467 tty->driver_data = port;
468
469 port->tty = tty;
Jeff Garzik [Sun, 16 May 2004 21:41:56 +0000 (17:41 -0400)]
[libata] replace ATA_QCFLAG_ATAPI with inline helper
Detection of an ATAPI taskfile is possible using a simple test
on existing information, so there is no need to cache this value
in a separate flag (ATA_QCFLAG_ATAPI). Instead, create and use
a new helper function is_atapi_taskfile().
* SEEK(6), SEEK(10), and REZERO_UNIT are no-ops. Unconditionally
complete these commands with success.
* MODE SENSE caching page work:
* correct page length
* set bit, if read-ahead is disabled
* set bit, if writeback caching is enabled
(previously, this bit was never set, even if
writeback caching was enabled)
* add MODE SENSE r/w error recovery page
Jeff Garzik [Sun, 16 May 2004 18:19:19 +0000 (14:19 -0400)]
[libata] comments and constants
* note a nasty problem with shared interrupts that must be fixed
before we turn on certain code paths.
* add a few comments to the READ CAPACITY scsi simulator
* remove a FIXME comment from the TEST UNIT READY scsi simulator
* add constant for ATA command CHECK POWER MODE, and associated
"mandatory" power management feature set bit.
The SCSI T10 committee is working on a document describing a standard
method for translating ATA<->SCSI, since it being done quite often
these days. Some of the recommendations are reasonable, and we implement
two here:
* Mirror that ATA 'removeable media' bit into INQUIRY output.
* Change behavior of INQUIRY output field 'product revision' from
the libata software version number to the first 4 bytes of the
ATA device's firmware revision number.
Rather than cache the firmware revision in struct ata_device, as was/is
done with two other strings, I took the opportunity to eliminate the
caching of the two other strings, 'vendor' and 'product'. These strings
are now retrieved as needed from the IDENTIFY [PACKET] DEVICE info page,
since we cache its entire contents.
Retrieving a string from the identify-device page is done via the
helper function ata_dev_id_string(), which is now exported.
This patch winds up making struct ata_device 40 bytes smaller, and
the libata core gets a bit smaller as well.
Jeff Garzik [Sun, 16 May 2004 14:48:08 +0000 (10:48 -0400)]
[libata] remove redundant use of ATA_QCFLAG_SG in ATAPI packet translation
ata_scsi_translate() sets this flag for all ATA->SCSI translated
commands, so it need not be done in atapi_xlat(). The now-removed
use in atapi_xlat() was also inconsistent WRT PIO versus DMA.
Jeff Garzik [Sun, 16 May 2004 14:35:15 +0000 (10:35 -0400)]
[libata] DMADIR support
DMADIR bit is necessary for some PATA->SATA bridges. These
bridges require the OS driver to specify the data xfer direction,
for PACKET (a.k.a. scsi) commands.
A reliable DMADIR detection method hasn't yet been developed,
and ATAPI is still a WIP, so DMADIR is enabled with an ifdef for
now.
Russell King [Sun, 16 May 2004 13:08:21 +0000 (14:08 +0100)]
[SERIAL] Remove base_baud default from 8250_pci
Since all boards specify base_baud, the code to default base_baud to
the architecture-defined BASE_BAUD is redundant. Also, defaulting
to the architecture-defined BASE_BAUD is wrong since the UARTs on a
serial PCI card will be clocked at the same rate no matter what the
architecture of the host machine.
Russell King [Sun, 16 May 2004 15:37:30 +0000 (16:37 +0100)]
[ARM] Convert execve() to be a function rather than a SWI call.
This eliminates the last SWI user from the kernel - now all SWI calls
will only come from userspace. More importantly, this also allows us
to empty the kernel stack when starting userspace programs from
kernelspace, thereby ensuring that the user registers always appear
at the top of the kernel stack.
Russell King [Sun, 16 May 2004 15:12:49 +0000 (16:12 +0100)]
[ARM] Move a bunch of symbol exports from armksyms.c
This moves a bunch of EXPORT_SYMBOL() statements from armksyms.c
into the file which defines the function/variable such that the
exports are localised.
This also means we can get rid of the ugly __xxx_to_xxx__is_a_macro
in include/asm-arm/arch-*/memory.h
This patch makes the b44-after-bcm4400 scenario work for
me. What was happening is that the broadcom driver sets a "power off MAC"
bit, and we didn't remove that when initializing the chip.
Also added some (a bit ugly, I know ) logic to clear up the address
filter stuff, which is what recent broadcom drivers do...
Jeff Garzik [Sat, 15 May 2004 10:36:08 +0000 (06:36 -0400)]
[libata] minor stuff
* now that ATAPI is close to working, making ATAPI DMA interrupts
in ata_host_intr
* remove unnecessary space character in printk() output (oh, the horror)
This skips the GP-loading function prologue (two instructions: 8 bytes)
on BRSGP linkage correctly, fixing an oops on alpha while loading the
aic7xxx driver.
Catalin Marinas [Sat, 15 May 2004 16:26:45 +0000 (17:26 +0100)]
[ARM PATCH] 1883/1: Bit 4 in pmd should be 0 for the ARMv6 architecture
Patch from Catalin Marinas
Unlike the v5 architecture, the ARM1136 requires that BIT4 is 0 in
the first level page descriptor (ARM1136 TRM, page 6-39). It works
at the moment but it might break future v6 cores.
Jan Kara [Sat, 15 May 2004 09:20:21 +0000 (02:20 -0700)]
[PATCH] Quota fix 2
This fixes the problem with recursion into filesystem when inode of
quota file needs a page + some other allocation problems. I hope I got
the GFP mask setting right..
Jeff Garzik [Sat, 15 May 2004 09:09:25 +0000 (05:09 -0400)]
[libata] internal cleanups
Remove unused 'done_late' arg to ata_qc_complete(), which was never
useful in 2.4, and never used at all in 2.6.
This allows us to eliminate the same arg from ata_dma_complete(),
and also make it more correct by passing the command rather than
the ATA port structure as arg0.
- many Maxtor disks incorrectly claim CACHE FLUSH EXT command support,
fix it by checking both CACHE FLUSH EXT command and LBA48 support
(thanks to Eric D. Mudama for help in fixing this)
- write_cache() was called with 'drive->id->cfs_enable_2 & 0x3000' as 'int arg'
argument which was always truncated to zero due to 'u8 drive->wcache = arg'
assignment so write cache was indeed enabled but drive->wcache was zero
(thanks to Rene Herman for help in debugging this)
- flush cache in idedisk_start_power_step() only if ATA-6 CACHE FLUSH (EXT)
bits are present in disk's identify data (prevents sending unknown commands)
- set drive->wcache in idedisk_setup() not idedisk_attach() (no need to check
id->command_set_2 - we check id->cfs_enable_2 instead in write_cache() call)
Andi Kleen [Sat, 15 May 2004 03:41:14 +0000 (20:41 -0700)]
[PATCH] Handle empty nodes in sysfs on x86-64
This code is shared between i386 and x86-64, and x86-64 needs to check
for empty nodes here. Otherwise you can get oopses at boot in some
circumstances.
This handles empty nodes != 0; empty node zero are still broken in other
ways.
Andi Kleen [Sat, 15 May 2004 03:41:03 +0000 (20:41 -0700)]
[PATCH] x86-64: fix /dev/mem caching behaviour
This changes the /dev/mem caching behaviour on x86-64 to be compatible
with i386.
By default everything is set cached.
This actually makes WC MTRRs on AMD systems work, which would get
overriden by the UC PAT bits that were set earlier. This can make DVD
decoding with hardware support a lot faster.
It also supports O_SYNC now, like i386, although that is not really
safe, because it allows the user to create undefined cache attribute
conflicts that can corrupt caches in some circumstances. I kept it for
now. Better would to disallow it, until Terrence Ripperda's PAT
framework is getting merged, that can avoid these problems.
Actually it would be probably a good idea to add a printk here to catch
broken programs for i386 and x86-64, but that is for another patch.
Andi Kleen [Sat, 15 May 2004 03:40:53 +0000 (20:40 -0700)]
[PATCH] x86-64 updates
Various accumulated x86-64 patches and bug fixes.
It fixes one nasty bug that has been there since NX is used by
default in the kernel. With heavy AGP memory allocation it would
set NX on parts of the kernel mapping in some corner cases, which gave
endless crash loops. Thanks goes to some wizards in AMD debug labs
for getting a trace out of this.
Also various other fixes. This patches only changes x86-64 specific
files, i have some changes outside too that I am sending separately.
- Fix help test for CONFIG_NUMA
- Don't enable SMT nice on CMP
- Move HT and MWAIT checks up to generic code
- Update defconfig
- Remove duplicated includes (Arthur Othieno)
- Set up GSI entry for ACPI SCI correctly (from i386)
- Fix some comments
- Fix threadinfo printing in oopses
- Set task alignment to 16 bytes
- Handle NX bit for code pages correctly in change_page_attr()
- Use generic nops for non amd specific kernel
- Add __KERNEL__ checks in unistd.h (David Lee)
Andrew Morton [Sat, 15 May 2004 03:25:50 +0000 (20:25 -0700)]
[PATCH] Increase xfsbufd_centisecs when in laptop mode
From: Bart Samwel <bart@samwel.tk>
The attached patch is the outcome of a discussion with Nathan.
When laptop mode is active, there is no need for XFS to wake up xfsbufd (the
daemon that flushes buffers that are too old) too often. The default is once
every second, this patch makes laptop mode do it once every 30 seconds.
Andrew Morton [Sat, 15 May 2004 03:24:47 +0000 (20:24 -0700)]
[PATCH] Remove old sh-sci driver
From: Paul Mundt <lethal@linux-sh.org>
The old drivers/char sh-sci driver is no long used by anyone, both sh and
h8300 are using the drivers/serial version at this point, so we can get rid
of the old one entirely.
gcc 3.4 specific problem. This patch should fix it. Actually it would be
better to move all these EXPORT_SYMBOLs into lib/string.c, it is silly that
each arch has to duplicate all that.
Andrew Morton [Sat, 15 May 2004 03:24:25 +0000 (20:24 -0700)]
[PATCH] remove driver model code in mwave driver
From: Christoph Hellwig <hch@lst.de>
Someone blindly added sysfs support to the driver long time ago without
understanding the implications (and if they were understood the driver
would need half a rewrite for it). Herber Xu recently noticed the problems
this causes on unload, so let's if 0 out all that code and get the driver
working again.
Andrew Morton [Sat, 15 May 2004 03:24:15 +0000 (20:24 -0700)]
[PATCH] Make /proc/sysrq-trigger ignore sysrq_enabled
It's silly that writing to /proc/sysrq-trigger does nothing if you haven't
enabled /proc/sys/kernel/sysrq. So provide a new __handle_sysrq() which
ignores the sysrq_enabled check.
The patch also withdraws __handle_sysrq_nolock() from the kernel API. It had
no callers.
Andrew Morton [Sat, 15 May 2004 03:23:54 +0000 (20:23 -0700)]
[PATCH] fix aic7xxx_old.c for !PCI
From: Adrian Bunk <bunk@fs.tum.de>
drivers/scsi/aic7xxx_old.c: In function `aic7xxx_release':
drivers/scsi/aic7xxx_old.c:10971: warning: implicit declaration of function `pci_release_regions'
Andrew Morton [Sat, 15 May 2004 03:23:33 +0000 (20:23 -0700)]
[PATCH] fix cyclades compile with !PCI
From: Adrian Bunk <bunk@fs.tum.de>
drivers/char/cyclades.c: In function `cy_cleanup_module':
drivers/char/cyclades.c:5638: warning: implicit declaration of function `pci_release_regions'
This portion of code is sparc specific and nothing else in modpost.c uses
e_machine meaning cross-compiling for sparc on i386 (or any little endian
machine) is the only way to experience the bug.
Without it, e_machine has the wrong value and modpost then generates a lot
of "*** Warning: \"symbol\" [filename.ko] undefined" messages.
Andrew Morton [Sat, 15 May 2004 03:23:01 +0000 (20:23 -0700)]
[PATCH] implement print_modules()
From: Arjan van de Ven <arjanv@redhat.com>,
Rusty Russell <rusty@rustcorp.com.au>
The patch below resolves the "Not Yet Implemented" print_modules() thing.
This is a really useful feature for distros; it allows us to do statistical
analysis on which modules are present how often in oopses compared to how
often they are used normally. In addition it helps to spot candidates for
certain bugs without having to go back to the customer asking for this
information.