dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

110176 Commits

Author SHA1 Message Date
Swen Schillig 9fb3cd86e4 [SCSI] zfcp: fix erp list usage without using locks
The zfcp_erp_thread was using the nolock version of the dbf function.
This resulted in a list access while other tasks could modifying the
list. The symptom was an erp thread running at 100% CPU and never
returning from the dbf function.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:56 -05:00
Swen Schillig e4e9ba5d93 [SCSI] zfcp: prevent fc_remote_port_delete calls for unregistered rport
In case of an adapter reopen all rports have to be deleted from the
environment. This should only happen for already registered rports
otherwise fc_remote_port_delete is called with a NULL pointer.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:55 -05:00
Swen Schillig b7f15f3c94 [SCSI] zfcp: fix deadlock caused by shared work queue tasks
Each adapter reopen trigger automatically a scan_port task which
is waiting for the ERP to be finished before further processing.
Since the initial device setup enqueues adapter, port and LUN which
are individual ERP actions, this process would start after
everything is done. Unfortunately the port_reopen requires another
scheduled work to be finished which is queued after the automatic
scan_port -> deadlock !

This fix creates an own work queue for ERP based nameserver requests.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:55 -05:00
Swen Schillig 5706938669 [SCSI] zfcp: put threshold data in hba trace
Now that we removed the long messages for the bit error threshold
data, put the data in the hba trace. This way, we get a short warning
for the threshold event from the hardware and have the data in the
trace for further analysis.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:55 -05:00
Christof Schmitt 0406289ed5 [SCSI] zfcp: Simplify zfcp data structures
Reduce the size of zfcp data structures by removing unused and
redundant members. scsi_lun is only the mangled version of the
fcp_lun. So, remove the redundant field and use the fcp_lun instead.

Since the queue lock and the pci_batch indicator are only used in the
request queue, move them from the common queue struct to the adapter
struct.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:54 -05:00
Swen Schillig a1b449de5d [SCSI] zfcp: Simplify get_adapter_by_busid
Call the helper function from cio instead looping through all zfcp
adapters.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:53 -05:00
Swen Schillig 7ba58c9cc1 [SCSI] zfcp: remove all typedefs and replace them with standards
Remove typedefs from zfcp, use already existing types instead.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:53 -05:00
Swen Schillig 5ab944f97e [SCSI] zfcp: attach and release SAN nameserver port on demand
Changing the zfcp behaviour from always having the nameserver port
open to an on-demand strategy.  This strategy reduces the use of
limited resources like port connections. The patch provides a common
infrastructure which could be used for all WKA ports in future.

Also reduce the number of nameserver lookups by changing the zfcp
behaviour of always querying the nameserver for the corresponding
destination ID of the remote port.  If the destination ID has changed
during the reopen process we will be informed and then trigger a
nameserver query on demand.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:53 -05:00
Swen Schillig 44cc76f2d1 [SCSI] zfcp: remove unused references, declarations and flags
- Remove unused references and declarations, including one instance
   of the FC ls_adisc struct that has been defined twice.
 - Also remove the flags COMMON_OPENING, COMMON_CLOSING,
   ADAPTER_REGISTERED and XPORT_OK that are only set and cleared, but
   not checked anywhere.
 - Remove the zfcp specific atomic_test_mask makro. Simply use
   atomic_read directly instead.
 - Remove the zfcp internal sg helper functions and switch the places
   where it is still used to call sg_virt directly.
 - With the update of the QDIO code, the QDIO data structures no
   longer use the volatile type qualifier. Now we can also remove the
   volatile qualifiers from the zfcp code.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:52 -05:00
Christof Schmitt ff3b24fa53 [SCSI] zfcp: Update message with input from review
Update the kernel messages in zfcp with input from the message review
and remove some messages that have been identified as redundant.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:52 -05:00
Stefan Raspl 2450d3e7b8 [SCSI] zfcp: add queue_full sysfs attribute
Adds a new sysfs attribute queue_full for adapters that records the number
of incidents where a requests could not be submitted due to insufficient
free space on the request queue.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:52 -05:00
James Bottomley 7ae628d9d2 [SCSI] scsi_dh: suppress comparison warning
On Mon, 2008-09-22 at 14:56 -0700, akpm@linux-foundation.org wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
>
> s390:
>
> drivers/scsi/device_handler/scsi_dh_emc.c: In function 'parse_sp_info_reply':
> drivers/scsi/device_handler/scsi_dh_emc.c:179: warning: comparison is always false due to limited range of data type
>
> because chars are unsigned, I assume.

Fix by making csdev->buffer explicitly an unsigned char and dropping
the < 0 test.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:51 -05:00
Yanqing_Liu@Dell.com 650849d71c [SCSI] scsi_dh: add Dell product information into rdac device handler
Add Dell Powervault storage arrays into device list of rdac device
handler.

Signed-off-by: Yanqing Liu <yanqing_liu@dell.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:51 -05:00
Adrian Bunk b78ded8915 [SCSI] qla2xxx: remove the unused SCSI_QLOGIC_FC_FIRMWARE option
This option was forgotten when the SCSI_QLOGIC_FC driver was removed.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 12:11:51 -05:00
Alexander Beregalov 4a3e1ea8b2 [SCSI] qla2xxx: fix printk format warnings
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:19 -05:00
Andrew Vasquez 36d1cdcffb [SCSI] qla2xxx: Update version number to 8.02.01-k8.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:19 -05:00
Ravi Anand 59d72d873c [SCSI] qla2xxx: Ignore payload reserved-bits during RSCN processing.
As the driver is only interested in bits 0-9 of the 1st
RSCN-payload word:

	rsvd[15:14]RscnEventQualifier[13:10]Fmt[9:8]Domain[7:0]
	Area[15:8]Alpa[7:0]

Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:19 -05:00
Andrew Vasquez 2d13693879 [SCSI] qla2xxx: Additional residual-count corrections during UNDERRUN handling.
Add additional tightening of residual-count handling (originally
from commit 6acf819002) where the
driver should discard any lower SCSI-status during
firmware/transport residual-count mismatches.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:18 -05:00
Bjorn Helgaas cc3ef7bc40 [SCSI] qla2xxx: Fix "occured" spelling errors.
Fix "occured" spelling errors.  Most of these are in comments, which
I wouldn't normally bother with, but a couple are in printks, which
irritate me more.  So I just fixed them all at the same time.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:18 -05:00
Andrew Vasquez 272976ca18 [SCSI] qla2xxx: Add NPIV-Config Table support.
To instatiate pre-configured vport entities defined within an
HBA's flash memory.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:18 -05:00
Andrew Vasquez c00d8994d9 [SCSI] qla2xxx: Add Flash Layout Table support.
The Flash Layout Table (FLT) present on many recent HBAs encodes
flash usage information, organizes data stored into separate
regions and presents the information uniformly to the driver.
Use this information rather than using specific hard-coded values
based on ISP type.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:17 -05:00
Andrew Vasquez 4b89258c73 [SCSI] qla2xxx: Change GFP_ATOMIC to GFP_KERNEL for non-atomic allocations.
Both call-sites are sleeping-capable.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:17 -05:00
Harish Zunjarrao 49fd462a1b [SCSI] qla2xxx: Add input/output byte-count statistics.
Currently Firmware does not have counters for input megabytes and
output megabytes, therefore driver counts these values depending
on the status of the scsi command and direction of the command.
The values are exported in the FC_HOST path.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:16 -05:00
Mike Christie ac26d41dee [SCSI] libiscsi: return error passed in during iscsi recovery
Due to patch building error on my side, we are still passing DID_BUS_BUSY
for commands that are running, when we want to return whatever the caller
of fail_all_commands wanted. This replaces the hardcoded error code with
the value that is passed in.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:16 -05:00
Pierre Ossman a7bbb57333 [SCSI] mmc_block: use generic helper to print capacities
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:15 -05:00
Andrew Vasquez a30c3f69e6 [SCSI] fc_transport: Add an API to allow an LLD to create vports
There's already a fc_vport_termintate() call exported by
the transport.  This patch adds a symmetric call to the API to allow
an NPIV-capable LLD to instantiate vports sans user intervention.

Additional comments/updates:

   Re: scsi_fc_transport.txt
     Add a function prototype for fc_vport_terminate similar to what's
     done for fc_vport_create

   Re: fc_vport_create
     I recommend we pass the channel number in fc_vport_create rather
     than fixing it at zero.

     Also, ids->vport_type should be set to FC_PORTTYPE_NPIV prior to
     calling fc_vport_create. The comment is also meaningless.

Added-by and
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:15 -05:00
James Bottomley 7404ad3b6d [SCSI] sd: use generic helper to print capacities in both binary and SI
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:15 -05:00
James Bottomley 3c9f3681d0 [SCSI] lib: add generic helper to print sizes rounded to the correct SI range
This patch adds the ability to print sizes in either units of 10^3 (SI)
or 2^10 (Binary) units.  It rounds up to three significant figures and
can be used for either memory or storage capacities.

Oh, and I'm fully aware that 64 bits is only 16EiB ... the Zetta and
Yotta units are added for future proofing against the day we have 128
bit computers ...

[fujita.tomonori@lab.ntt.co.jp: fix missed unsigned long long cast]
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:14 -05:00
FUJITA Tomonori 114f1ea408 [SCSI] scsi_dh: no need to initialize rq->cmd with blk_get_request
blk_get_request initializes rq->cmd (rq_init does) so the users don't
need to do that.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:14 -05:00
James Bottomley 6f4267e3bd [SCSI] Update the SCSI state model to allow blocking in the created state
Brian King <brking@linux.vnet.ibm.com> reported that fibre channel
devices can oops during scanning if their ports block (because the
device goes from CREATED -> BLOCK -> RUNNING rather than CREATED ->
BLOCK -> CREATED).

Fix this by adding a new state: CREATED_BLOCK which can only transition
back to CREATED and disallow the CREATED -> BLOCK transition.  Now both
the created and blocked states that the mid-layer recognises can include
CREATED_BLOCK.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:13 -05:00
James Bottomley 0f1d87a2ac [SCSI] add inline functions for recognising created and blocked states
The created and blocked states are very shortly going to correspond to
mixed sdev_state states.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:13 -05:00
James Smart 22447be7d1 [SCSI] scsi_netlink: Add transport and LLD recieve and event support
This patch adds scsi netlink recieve and event support for transport
and scsi LLDD's.  It is a reimplementation of the patch posted last
week by David Somayajulu.
http://marc.info/?l=linux-scsi&m=121745486221819&w=2

There are a few things done differently:

- Transport support is included

- Event delivery is included

- The vendor message is now its own unique message type, considered
  part of the generic "SCSI Transport".

- LLDD entry points are now registered rather than included in the
  scsi_host_template.

  Background: When I started to implement the event handler via template,
  I had to either: muck up scsi_add_host and scsi_remove_host;  or have
  the event handler search all possible shosts. Neither was acceptable.
  Moving to a registration solves this, and also limits the scope of
  the changes to something that could be backported to a distro without
  breaking an already-released-distro kabi. However, I admit it isn't
  as elegant, as the passing of the LLDD host template in the
  registration and the complexity around dynamic add/remove shows.

- The receive path was augmented to require a unique identifier for
  the LLDD before the message was allowed to be handed off to the
  driver. Given how quickly very fatal errors occur if there's msg
  mismatches (which I saw in testing my own tools :), I believe this
  to be a very good thing. The id plays off the vendor id scheme already
  introduced for the vendor unique event messages used by FC.
  Additionally, the id use as the basis of the registration/deregistration.

- Send assist functions, for both the transport and LLDDs are included.

[fujita.tomonori@lab.ntt.co.jp: fix missing cast]
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:13 -05:00
Nick Warne 557cc476c0 [SCSI] tmscsim: Fixup KERN_INFO in printk
Multiline kernel messages should contain a priority in every line,
besides, some log daemons represent a tabulator as "^I", fix both these
issues.

Signed-off-by: Nick Warne <nick@ukfsn.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:12 -05:00
Matthew Wilcox 3fd7f93883 [SCSI] qla2xxx: Remove semaphore.h
Now that qla2xxx has been converted to mutexes, it no longer needs the
semaphore include.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:12 -05:00
James Smart 315cb0ad12 [SCSI] scsi_host_lookup: error returns and NULL pointers
This patch cleans up the behavior of scsi_host_lookup().

The original implementation attempted to use the dual role of
either returning a pointer value, or a negative error code.
User's needed to use IS_ERR() to check the result. Additionally,
the IS_ERR() macro never checks for when a NULL pointer was
returned, so a NULL pointer actually passes with a success case.
Note: scsi_host_get(), used by scsi_host_lookup(), can return
a NULL pointer.

Talk about a mudhole for the unitiated to step into....

This patch converts scsi_host_lookup() to return either NULL
or a valid pointer. The consumers were updated for the change.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:12 -05:00
Jesse Brandeburg 6f92a6a7dd e1000e: update version from k4 to k6
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 18:28:13 -07:00
Thomas Gleixner 717d438d1f e1000e: debug contention on NVM SWFLAG
This patch adds a mutex to the e1000e driver that would help
catch any collisions of two e1000e threads accessing hardware
at the same time.

description and patch updated by Jesse

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 18:28:13 -07:00
Jesse Brandeburg 4fa7553a07 e1000e: drop stats lock
the stats lock is left over from e1000, e1000e no longer
has the adjust tbi stats function that required the addition
of the stats lock to begin with.

adding a mutex to acquire_swflag helped catch this one too.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 18:28:12 -07:00
Jesse Brandeburg 23033fad5b e1000e: remove phy read from inside spinlock
thanks to tglx, we're finding some interesting reentrancy issues.
this patch removes the phy read from inside a spinlock, paving
the way for removing the spinlock completely.  The phy read was
only feeding a statistic that wasn't used.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 18:28:12 -07:00
Jesse Brandeburg a8f88ff5a5 e1000e: do not ever sleep in interrupt context
e1000e was apparently calling two functions that attempted to reserve
the SWFLAG bit for exclusive (to hardware and firmware) access to
the PHY and NVM (aka eeprom).  These accesses could possibly call
msleep to wait for the resource which is not allowed from interrupt
context.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 18:28:12 -07:00
Jesse Brandeburg 37f40239f4 e1000e: reset swflag after resetting hardware
in the process of debugging things, noticed that the swflag is not reset
by the driver after reset, and the swflag is probably not reset unless
management firmware clears it after 100ms.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 18:28:12 -07:00
Andy Whitcroft 6babc32c41 mm: handle initialising compound pages at orders greater than MAX_ORDER
When we initialise a compound page we initialise the page flags and head
page pointer for all base pages spanned by that page.  When we initialise
a gigantic page (a page of order greater than or equal to MAX_ORDER) we
have to initialise more than MAX_ORDER_NR_PAGES pages.  Currently we
assume that all elements of the mem_map in this page are contigious in
memory.  However this is only guarenteed out to MAX_ORDER_NR_PAGES pages,
and with SPARSEMEM enabled they will not be contigious.  This leads us to
walk off the end of the first section and scribble on everything which
follows, BAD.

When we reach a MAX_ORDER_NR_PAGES boundary we much locate the next
section of the mem_map.  As gigantic pages can only be maximally aligned
we know this will occur at exact multiple of MAX_ORDER_NR_PAGES pages from
the start of the page.

This is a bug fix for the gigantic page support in hugetlbfs.

Credit to Mel Gorman for spotting the issue.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Jon Tollefson <kniht@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 15:53:13 -07:00
Nick Piggin 4b19de6d1c mm: tiny-shmem nommu fix
The previous patch db203d53d4 ("mm:
tiny-shmem fix lock ordering: mmap_sem vs i_mutex") to fix the lock
ordering in tiny-shmem breaks shared anonymous and IPC memory on NOMMU
architectures because it was using the expanding truncate to signal ramfs
to allocate a physically contiguous RAM backing the inode (otherwise it is
unusable for "memory mapping" it to userspace).

However do_truncate is what caused the lock ordering error, due to it
taking i_mutex.  In this case, we can actually just call ramfs directly to
allocate memory for the mapping, rather than go via truncate.

Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 15:53:13 -07:00
Gerald Schaefer 6c1b7f680d memory hotplug: missing zone->lock in test_pages_isolated()
__test_page_isolated_in_pageblock() in mm/page_isolation.c has a comment
saying that the caller must hold zone->lock. But the only caller of that
function, test_pages_isolated(), does not hold zone->lock and the lock is
also not acquired anywhere before. This patch adds the missing zone->lock
to test_pages_isolated().

We reproducibly run into BUG_ON(!PageBuddy(page)) in __offline_isolated_pages()
during memory hotplug stress test, see trace below. This patch fixes that
problem, it would be good if we could have it in 2.6.27.

kernel BUG at /home/autobuild/BUILD/linux-2.6.26-20080909/mm/page_alloc.c:4561!
illegal operation: 0001 [#1] PREEMPT SMP
Modules linked in: dm_multipath sunrpc bonding qeth_l3 dm_mod qeth ccwgroup vmur
CPU: 1 Not tainted 2.6.26-29.x.20080909-s390default #1
Process memory_loop_all (pid: 10025, task: 2f444028, ksp: 2b10dd28)
Krnl PSW : 040c0000 801727ea (__offline_isolated_pages+0x18e/0x1c4)
 R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:0 CC:0 PM:0
Krnl GPRS: 00000000 7e27fc00 00000000 7e27fc00
 00000000 00000400 00014000 7e27fc01
 00606f00 7e27fc00 00013fe0 2b10dd28
 00000005 80172662 801727b2 2b10dd28
Krnl Code: 801727de: 5810900c l %r1,12(%r9)
 801727e2: a7f4ffb3 brc 15,80172748
 801727e6: a7f40001 brc 15,801727e8
 >801727ea: a7f4ffbc brc 15,80172762
 801727ee: a7f40001 brc 15,801727f0
 801727f2: a7f4ffaf brc 15,80172750
 801727f6: 0707 bcr 0,%r7
 801727f8: 0017 unknown
Call Trace:
([<0000000000172772>] __offline_isolated_pages+0x116/0x1c4)
 [<00000000001953a2>] offline_isolated_pages_cb+0x22/0x34
 [<000000000013164c>] walk_memory_resource+0xcc/0x11c
 [<000000000019520e>] offline_pages+0x36a/0x498
 [<00000000001004d6>] remove_memory+0x36/0x44
 [<000000000028fb06>] memory_block_change_state+0x112/0x150
 [<000000000028ffb8>] store_mem_state+0x90/0xe4
 [<0000000000289c00>] sysdev_store+0x34/0x40
 [<00000000001ee048>] sysfs_write_file+0xd0/0x178
 [<000000000019b1a8>] vfs_write+0x74/0x118
 [<000000000019b9ae>] sys_write+0x46/0x7c
 [<000000000011160e>] sysc_do_restart+0x12/0x16
 [<0000000077f3e8ca>] 0x77f3e8ca

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 15:53:13 -07:00
Dan Carpenter aa94fbd5cc fix error-path NULL deref in alloc_posix_timer()
Found by static checker (http://repo.or.cz/w/smatch.git).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 15:53:13 -07:00
Pascal Terjan c0c9209ddd braille_console: only register notifiers when the braille console is used
Only register the braille driver VT and keyboard notifiers when the
braille console is used.  Avoids eating insert or backspace keys.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=11242

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 15:53:13 -07:00
Nick Piggin 16dbc6c961 inotify: fix lock ordering wrt do_page_fault's mmap_sem
Fix inotify lock order reversal with mmap_sem due to holding locks over
copy_to_user.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Reported-by: "Daniel J Blueman" <daniel.blueman@gmail.com>
Tested-by: "Daniel J Blueman" <daniel.blueman@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 15:53:13 -07:00
David Winn 08650869e0 fbcon: fix monochrome color value calculation
Commit 22af89aa0c ("fbcon: replace mono_col
macro with static inline") changed the order of operations for computing
monochrome color values.  This generates 0xffff000f instead of 0x0000000f
for a 4 bit monochrome color, leading to image corruption if it is passed
to cfb_imageblit or other similar functions.  Fix it up.

Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: <stable@kernel.org>		[2.6.26.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-02 15:53:13 -07:00
Linus Torvalds 550ac95879 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: snd-powermac: HP detection for 1st iMac G3 SL
  ALSA: snd-powermac: mixers for PowerMac G4 AGP
  ASoC: Set correct name for WM8753 rec mixer output
2008-10-02 07:54:32 -07:00
Takashi Iwai 591d8a25c7 Merge branch 'asoc-fixes' into for-linus 2008-10-02 12:50:50 +02:00