linux-2.6-block.git
12 years ago[SCSI] ufs: Update MAINTAINERS
Vinayak Holikatti [Fri, 20 Apr 2012 08:41:50 +0000 (14:11 +0530)]
[SCSI] ufs: Update MAINTAINERS

Add myself and Santosh Y as maintainers for drivers/scsi/ufs/

Signed-off-by: Vinayak Holikatti <vinholikatti@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] ufs: Fix evaluation of UTP task completion code
Venkatraman S [Thu, 19 Apr 2012 06:16:22 +0000 (11:46 +0530)]
[SCSI] ufs: Fix evaluation of UTP task completion code

While interpreting the result of UTP task completion status,
by using boolean &&, the evaluation would fail when the
UPIU_TASK_MANAGEMENT_FUNC_SUCCEEDED was received.

Either UPIU_TASK_MANAGEMENT_FUNC_COMPL or
UPIU_TASK_MANAGEMENT_FUNC_SUCCEEDED should be
considered as a success result.

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Santosh Y <santoshsy@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: move the scsi_host_put to the right place
Tomas Henzl [Tue, 17 Apr 2012 13:24:48 +0000 (15:24 +0200)]
[SCSI] mpt2sas: move the scsi_host_put to the right place

When scsi_add_host fails the scsi_host_put should be called.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] fc class: fix scanning when devs are offline
Mike Christie [Mon, 16 Apr 2012 02:47:50 +0000 (21:47 -0500)]
[SCSI] fc class: fix scanning when devs are offline

When a rport is added back or the role is changed the fc class
will queue a scan and then call scsi_target_unblock. The problem
with this is if the devices are in the SDEV_OFFLINE state and
the scan is run before the scsi_target_unblock, then the scan
will see LUN0 as offline and the scan will fail. This patch moves
the unblock call to before the scan, so we know the device state
will be set correctly when the scan is run.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] st: fix memory leak with >1MB tape I/O
David Jeffery [Wed, 11 Apr 2012 16:14:25 +0000 (12:14 -0400)]
[SCSI] st: fix memory leak with >1MB tape I/O

There is a memory leak in the st driver when sending large enough reads or
writes using st's direct I/O path.  As part of mapping the application's
memory, a buffer to hold page pointers is allocated and the count of mapped
pages is stored in field do_dio.  A non-zero do_dio marks that direct I/O is
in use.

But do_dio is only 1 byte in size.  Mapping 256 4k pages overflows
do_dio and causes it to be set to 0, like direct I/O option was not
used.  When the I/O completes, the buffer to hold the page pointers is
not freed, and the page counts of the mapped pages are not reduced.
Every I/O of this size then leaks memory.

The size of do_dio needs to be increased to prevent it wrapping around.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] bfa: Update the MAINTAINERS file.
Krishna Gudipati [Tue, 10 Apr 2012 01:41:43 +0000 (18:41 -0700)]
[SCSI] bfa: Update the MAINTAINERS file.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] bfa: Fix bfa logging for Logical port state change notification
Krishna Gudipati [Tue, 10 Apr 2012 01:41:18 +0000 (18:41 -0700)]
[SCSI] bfa: Fix bfa logging for Logical port state change notification

Made changes to have the same logging level for Logical port
online and offline events, to display these events in pairs.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] bfa: sysfs model description fix.
Krishna Gudipati [Tue, 10 Apr 2012 01:40:43 +0000 (18:40 -0700)]
[SCSI] bfa: sysfs model description fix.

Make changes to remove unsupported model numbers from the sysfs
model description routine.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] bfa: Fix to defer vport delete handler invocation till firmware logo response.
Krishna Gudipati [Tue, 10 Apr 2012 01:40:01 +0000 (18:40 -0700)]
[SCSI] bfa: Fix to defer vport delete handler invocation till firmware logo response.

Made changes to avoid queuing the vport delete work to IM driver
work queue in the bfa_fcb_lport_delete() - since at this stage we
are not completely done with using the vport structure as we are
still waiting for the LOGO response from the fw in online state or
just doing some cleanup. Since queuing up the vport delete work at
this stage will result in the FC transport layer to clean up the vport
before we get the response from firmware.
Made changes to queue the port delete work to the IM driver work queue -
from the bfa_fcs_vport_free() function since at this state we are done
with using the vport data structure and the FCS state machine is completely
cleaned up.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] storvsc: Properly handle errors from the host
K. Y. Srinivasan [Thu, 5 Apr 2012 19:26:52 +0000 (12:26 -0700)]
[SCSI] storvsc: Properly handle errors from the host

Hyper-V cannot process some commands like ATA_12 and ATA_16. It also returns a
very generic error when this happens (SRB_STATUS_ERROR).  Most of the time we
treat SRB_STATUS_ERROR as DID_TARGET_FAILURE which causes error handler retry,
but in the case of pass through commands, they'll never succeed (and the error
handler will offline the device), so put a discriminating block in the command
completion routing and send the SRB_STATUS_ERROR upwards with DID_PASSTHROUGH
for commands we know should not be retried.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Get Port State and Speed of the Adapter
John Soni Jose [Wed, 4 Apr 2012 04:41:52 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Get Port State and Speed of the Adapter

Implement ISCSI_HOST_PARAM_PORT_STATE and ISCSI_HOST_PARAM_PORT_SPEED
to get the Adapter port state and port name

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: adding functionality to change network settings using iscsiadm
Mike Christie [Wed, 4 Apr 2012 04:41:51 +0000 (23:41 -0500)]
[SCSI] be2iscsi: adding functionality to change network settings using iscsiadm

This patch allows iscsiadm to set/ delete static IP and enable /disable
DHCP.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Adding bsg interface for be2iscsi
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:50 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Adding bsg interface for be2iscsi

Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Get Initiator Name for the iSCSI_Host
John Soni Jose [Wed, 4 Apr 2012 04:41:49 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Get Initiator Name for the iSCSI_Host

Implement the ISCSI_HOST_PARAM_INITIATOR_NAME for .get_host_param

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Return async handle of unknown opcode to free list.
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:48 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Return async handle of unknown opcode to free list.

The async handle corresponding to unknown Opcode was not freed
earlier. This code does the fix for that.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Check ASYNC PDU Handle corresponds to HDR/DATA Handle
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:47 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Check ASYNC PDU Handle corresponds to HDR/DATA Handle

For each ASYNC PDU received there is an HDR and DATA handle for it.
There will be only 1 HDR ASYNC Handle, but DATA Handle can be more
than 1 for each ASYNC PDU received. Checking if the ASYNC Handle
correspongs to HDR or DATA while returning the Handle to the free list.
hwi_free_async_msg just return the handles to the free list. No return
values are needed so changing the return type to void.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Bump the driver Version
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:46 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Bump the driver Version

Signed-off-by: Minh Tran <MinhDuc.Tran@Emulex.Com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Update external Branding to Emulex
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:45 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Update external Branding to Emulex

Change MODULE_AUTHOR, driver name and other external print strings from
Serverengines to Emulex.

Signed-off-by: Minh Tran <MinhDuc.Tran@Emulex.Com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Fix the function return values.
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:44 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Fix the function return values.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Code cleanup, removing the goto statement
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:43 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Code cleanup, removing the goto statement

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Fix double free of MCCQ info memory.
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:42 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Fix double free of MCCQ info memory.

In case of MCC_Q creation failed, the MCCQ info memory is freed
from be_mcc_queues_destroy and be_mcc_queues_create. This caused
kernel to panic because of double free.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Set num_cpu = 1 if pci_enable_msix fails
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:41 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Set num_cpu = 1 if pci_enable_msix fails

Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Fix typo function name mismatch
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:40 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Fix typo function name mismatch

Signed-off-by: Minh Tran <MinhDuc.Tran@Emulex.Com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Freeing of WRB and SGL Handle in cleanup task
Mike Christie [Wed, 18 Apr 2012 08:06:00 +0000 (03:06 -0500)]
[SCSI] be2iscsi: Freeing of WRB and SGL Handle in cleanup task

The WRB and SGL Handle allocated for Login task were not freed
back to the pool after the login process was done. This code
releases the WRB and SGL Handle after the login process.

v2:
- Fix up locking so bh calls are not done when not needed.
- Make beiscsi_cleanup_task static.

Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
[various fixes]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: WRB Initialization and Failure code path change
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:38 +0000 (23:41 -0500)]
[SCSI] be2iscsi: WRB Initialization and Failure code path change

Removing code duplication during the WRB_Handle and WRB
initialization.
Added memory allocation failure handling code during WRB
initialization.

Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Fix in ASYNC PDU stitching logic.
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:37 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Fix in ASYNC PDU stitching logic.

The buffer length passed for processing the ASYNC PDU
was not proper.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Fix in the Asynchronous Code Path
Jayamohan Kallickal [Wed, 4 Apr 2012 04:41:36 +0000 (23:41 -0500)]
[SCSI] be2iscsi: Fix in the Asynchronous Code Path

Set the ASYNC PDU Handle pBuffer for Data ring with the VA/PA
of the allocated memory for it.
To get the correct ASYNC PDY Handle iterate the list and compare
the PA set during initialization with the passed PHY Address.
The buffer_size and num_enteries are common for HDR and Data ring

Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] hpsa: use check_signature
Akinobu Mita [Wed, 4 Apr 2012 13:14:59 +0000 (22:14 +0900)]
[SCSI] hpsa: use check_signature

Use check_signature to find a signature in the mmio address.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] aacraid: add an iounmap call to aac_src_ioremap
Tomas Henzl [Thu, 29 Mar 2012 15:23:46 +0000 (17:23 +0200)]
[SCSI] aacraid: add an iounmap call to aac_src_ioremap

The patch 116046127d1a3bad2853d02781ad9fee33f05e5a "[SCSI] aacraid: Added
Sync.mode to support series 7/8/9 controllers" removed an iounmap call from
aac_src_ioremap. Before that, the iounmap has been called twice with the same
value (dev->base and dev->regs.src.bar0) and the iounmap complained about it
(iounmap: bad address ...).

The proper solution is a change the paremeter from bar0 to bar1.
Fix this by adding a an iounmap(dev->regs.src.bar1) call.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: Achim Leubner <achim_leubner@pmc-sierra.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] scsi_dh_alua: Optimize the STPG command
Moger, Babu [Tue, 27 Mar 2012 20:56:20 +0000 (20:56 +0000)]
[SCSI] scsi_dh_alua: Optimize the STPG command

This patch optimizes the set target port group(STPG) command. During our
testing, we found that it is not optimal to send stpg command every time
the path group switch happens. This patch uses PREF (preferred target port)
bit with combination of flags passed by multipath user level tool to
optimize this behaviour. If PREF bit is set then it issues a STPG command,
otherwise it will let implicit transfer take place.

By default there is no change in the behaviour. User tool needs to pass the
parameter to make this change take effect. Patch has been tested on NetApp
E series storage.

Signed-off-by: Babu Moger <babu.moger@netapp.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] scsi_dh_alua: Store the PREF bit from RTPG
Moger, Babu [Tue, 27 Mar 2012 20:56:08 +0000 (20:56 +0000)]
[SCSI] scsi_dh_alua: Store the PREF bit from RTPG

PREF bit indicates preferred target port group for accessing a logical
unit. This bit is used to optimize the STPG command handling.

Signed-off-by: Babu Moger <babu.moger@netapp.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] scsi_dh_alua: Inroduce the set_params interface scsi_dh_alua handler
Moger, Babu [Tue, 27 Mar 2012 20:55:49 +0000 (20:55 +0000)]
[SCSI] scsi_dh_alua: Inroduce the set_params interface scsi_dh_alua handler

Handler expects only one parameter to set the flag ALUA_OPTIMIZE_STPG.
This flag is used to optimize the STPG behaviour. There is no change in
behaviour by default.

For example, to set the flag pass the following parameters from multipath.conf
hardware_handler        "2 alua 1"

Signed-off-by: Babu Moger <babu.moger@netapp.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] be2iscsi: Remove unused OFFSET_IN_PAGE() macro
Roland Dreier [Thu, 1 Mar 2012 06:41:49 +0000 (22:41 -0800)]
[SCSI] be2iscsi: Remove unused OFFSET_IN_PAGE() macro

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Bump driver vesion to 13.100.00.00
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:40:28 +0000 (12:10 +0530)]
[SCSI] mpt2sas: Bump driver vesion to 13.100.00.00

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Fix for panic happening because of improper memory allocation
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:40:01 +0000 (12:10 +0530)]
[SCSI] mpt2sas: Fix for panic happening because of improper memory allocation

The ioc->pfacts member in the IOC structure is getting set to zero
following a call to _base_get_ioc_facts due to the memset in that routine.
So if the ioc->pfacts was read after a host reset, there would be a NULL
pointer dereference. The routine _base_get_ioc_facts is called from context
of host reset.  The problem in _base_get_ioc_facts  is the size of
Mpi2IOCFactsReply is 64, whereas the sizeof "struct mpt2sas_facts" is 60,
so there is a four byte overflow resulting from the memset.

Also, there is memset in _base_get_port_facts using the incorrect structure,
it should be "struct mpt2sas_port_facts" instead of Mpi2PortFactsReply.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
CC: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Fix for hard drive going OFFLINE when hard reset issued and simultane...
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:39:26 +0000 (12:09 +0530)]
[SCSI] mpt2sas: Fix for hard drive going OFFLINE when hard reset issued and simultaneously another hard drive is hot unplugged

Following the host reset, the firmware discovery is reassigning another hard
drive in the topology to the same device handle as that device is getting hot
removed. Until the driver device removal routine is called, there will be two
hard drive with the matching device handle in the internal device link
list. In the device removal routine, a separate function which moves the
device from BLOCKED into OFFLINE state.  Since this routine is passed with the
device handle passed as input parameter, the routine will be traversing the
internal device link list searching for matching device handle. This results
in two devices with matching device handle, therefore both devices goes
OFFLINE.

To fix this issue,the input parameter is changed from device handle to SAS
address, therefore only the device that is hot unplugged will be placed in
OFFLINE state.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Set the phy identifier of the end device to the phy number of the...
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:38:40 +0000 (12:08 +0530)]
[SCSI] mpt2sas: Set the phy identifier of the end device to the phy number of the parent device it is linked to

The phy_identifier inside the routine _transport_set_identify()
is set to sas_device_page_zero->PhyNum. This returns the
phy number of the parent device this device is linked to.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas : While enabling phy, read the current port number from sas iounit...
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:38:11 +0000 (12:08 +0530)]
[SCSI] mpt2sas : While enabling phy, read the current port number from sas iounit page 0 instead of page 1

The port number is changing after disabling/enabling phys using the SysFS
interface This is because the firmware behavour changed where it would read
the the port number then set it to some different value even though Auto Port
Config is turned on.  With this change of behavour in FW, it is possible that
the expanders are moved from one port to another after disabling /enabling
phys. This is occuring because the port number in sas iounit page 1 is not
matching up to the current port in page 0. In order to fix this the driver is
modified to read the current port number from sas iounit page 0 instead of
page 1.  Also copy the port and phy flags over from page 0 to page 1.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Fix linux driver sparse errors
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:37:48 +0000 (12:07 +0530)]
[SCSI] mpt2sas: Fix linux driver sparse errors

Fix several endian issues found by runing sparse.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Fix security scan issues reported by source code analysis tool
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:37:17 +0000 (12:07 +0530)]
[SCSI] mpt2sas: Fix security scan issues reported by source code analysis tool

Modified the source code as per the findings reported by the source
code analysis tool. Source code for the following functionalities
has been touched. None of the driver functionalities has changed.

- SMP Passthrough IOCTL
- Debug messages for MPT Replies (i.e. bit 9 of Logging Level)
- Task Management using sysfs
- Device removal, i.e. when a target device (including any PD within a volume)
  is removed, and Volume Deletion.
- Trace Buffer

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Improvement were made to better protect the sas_device, raid_device...
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:36:50 +0000 (12:06 +0530)]
[SCSI] mpt2sas: Improvement were made to better protect the sas_device, raid_device, and expander_device lists

There were possible race conditions surrounding reading an object
from the link list while from another context in the driver was
removing it. The nature of this enhancement is to rearrange locking
so the link lists are better protected.

Change set:
(1) numerous routines were rearranged so spin locks are held through
the entire time a link list object is being read from or written to.
(2) added new routines for object deletion from link list.  Thus ensuring
lock was held during the deletion of the link list object, then and memory
for object freed outside the lock. The memory was freed outside the lock
so driver had access to device object info which was required for
notifying the scsi mid layer that a device was getting deleted.
(3) added the ioc->blocking_handles parameter.  This is a bitmask used
to identify which devices need blocking when there is device loss.  This was
introduced so that lock can be held for the entire time traversing the link
list objects, and the bitmask was set to indicate which device handles need
blocking. Oustide the lock the ioc->blocking_handles bitmask is traversed,
with the respective device handle the scsi mid layer is called for moving
devices into blocking state.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas : Perform Target Reset instead of HBA reset when a SATA_PASSTHROUGH...
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:35:11 +0000 (12:05 +0530)]
[SCSI] mpt2sas : Perform Target Reset instead of HBA reset when a SATA_PASSTHROUGH cmd timeout happens

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Added multisegment mode support for Linux BSG Driver
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:34:43 +0000 (12:04 +0530)]
[SCSI] mpt2sas: Added multisegment mode support for Linux BSG Driver

Added support for Block IO requests with multiple segments (vectors) in
the SMP handler of the SAS Transport Class. This is required by the
BSG driver. Multisegment support added for both, Request and Response.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: Removed redundant global mutex for IOCTLs
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:34:11 +0000 (12:04 +0530)]
[SCSI] mpt2sas: Removed redundant global mutex for IOCTLs

When the lock_kernel and unlock_kernel routines were removed in the
2.6.39 kernel, a global mutex was added on top of the existing mutex
which already existed. With this implementation, only one IOCTL
will be active at any time no matter how many ever controllers
are present. This causes poor performance.

Removed the global mutex so that the driver can work with the existing
semaphore that was already part of the existing code.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] mpt2sas: MPI next revision header update
nagalakshmi.nandigama@lsi.com [Tue, 20 Mar 2012 06:33:16 +0000 (12:03 +0530)]
[SCSI] mpt2sas: MPI next revision header update

Changeset in MPI headers:
1) Bumped MPI2_HEADER_VERSION_UNIT
2) Added 4K sectors supported bit to CapabilitiesFlags field of IOC Page 6.
3) Added UEFIVersion field to BIOS Page 1 and defined additional
    BiosOptions bits to control UEFI behavior.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] megaraid_sas: Version and Changelog update
adam radford [Tue, 20 Mar 2012 02:50:06 +0000 (19:50 -0700)]
[SCSI] megaraid_sas: Version and Changelog update

The following patch for megaraid_sas updates the driver version to
v00.00.06.15-rc1, and updates Documentation/scsi/ChangeLog.megaraid_sas.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] megaraid_sas: Add fpRead/WriteCapable, fpRead/WriteAcrossStripe checks
adam radford [Tue, 20 Mar 2012 02:50:00 +0000 (19:50 -0700)]
[SCSI] megaraid_sas: Add fpRead/WriteCapable, fpRead/WriteAcrossStripe checks

The following patch for megaraid_sas fixes the fastpath code decision
logic to use fpRead/WriteCapable, fpRead/WriteAcrossStripe flags
instead of the old logic.  This fixes a bug where fastpath writes
could be sent to a read only LD.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] megaraid_sas: Optimize HostMSIxVectors setting
adam radford [Tue, 20 Mar 2012 02:49:53 +0000 (19:49 -0700)]
[SCSI] megaraid_sas: Optimize HostMSIxVectors setting

The following patch for megaraid_sas removes an incorrect comment and
optimizes the setting of HostMSIxVectors.  This was found during a
code review by Tomas Henzl @ RedHat.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years ago[SCSI] pm8001: fix endian issue with code optimization.
Santosh Nayak [Mon, 19 Mar 2012 15:56:27 +0000 (21:26 +0530)]
[SCSI] pm8001: fix endian issue with code optimization.

Data type of the 'tag' field of 'fw_flash_Update_resp' should be __le32.

Data type of 'pHeader' should be __le32.  Remove 2nd cast to 'piomb'.

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
12 years agoMerge branch 'for-3.4' of git://linux-nfs.org/~bfields/linux
Linus Torvalds [Thu, 19 Apr 2012 21:54:52 +0000 (14:54 -0700)]
Merge branch 'for-3.4' of git://linux-nfs.org/~bfields/linux

Pull nfsd bugfixes from J. Bruce Fields:
 "One bugfix, and one minor header fix from Jeff Layton while we're
  here"

* 'for-3.4' of git://linux-nfs.org/~bfields/linux:
  nfsd: include cld.h in the headers_install target
  nfsd: don't fail unchecked creates of non-special files

12 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Thu, 19 Apr 2012 19:08:11 +0000 (12:08 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "It's like a grab bag of one liners:

  - core: fix page flip error path, reorder object teardown.
  - usb: fix the drm_usb module license.
  - i915: VT switch on SNB with non-native modes fix, and a regression
    fix from 3.3.
  - radeon: missing unreserve on SI, AGP/VRAM setup fix (fixes radeon on
    IA64, but its a generic bug), an rn50 regression from 3.3, turn off
    MSIs on rv515 (it loses rearms every so often)."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  nouveau: Set special lane map for the right chipset
  drm/radeon: fix load detect on rn50 with hardcoded EDIDs.
  drm: Releasing FBs before releasing GEM objects during drm_release
  drm/nouveau/pm: don't read/write beyond end of stack buffer
  drivers: gpu: drm: gma500: mdfld_dsi_output.h: Remove not unneeded include of version.h
  radeon: fix r600/agp when vram is after AGP (v3)
  drm: fix page_flip error handling
  drm/radeon/kms: fix the regression of DVI connector check
  drm/usb: fix module license on drm/usb layer.
  drm/i915: Do not set "Enable Panel Fitter" on SNB pageflips
  drm/i915: Hold mode_config lock whilst changing mode for lastclose()
  drm/radeon/si: add missing radeon_bo_unreserve in si_rlc_init() v2
  drm/radeon: disable MSI on RV515
  drm/i915: don't clobber the special upscaling lvds timings

12 years agoMerge git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Thu, 19 Apr 2012 17:28:59 +0000 (10:28 -0700)]
Merge git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM updates from Marcelo Tosatti.

* git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: lock slots_lock around device assignment
  KVM: VMX: Fix kvm_set_shared_msr() called in preemptible context
  KVM: unmap pages from the iommu when slots are removed
  KVM: PMU emulation: GLOBAL_CTRL MSR should be enabled on reset

12 years agonouveau: Set special lane map for the right chipset
Henrik Rydberg [Thu, 12 Apr 2012 22:37:00 +0000 (00:37 +0200)]
nouveau: Set special lane map for the right chipset

The refactoring of the nv50 logic, introduced in 8663bc7c, modified the
test for the special lane map used on some Apple computers with Nvidia
chipsets. The tested MBA3,1 would still boot, but resume from suspend
stopped working. This patch restores the old test, which fixes the problem.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: fix load detect on rn50 with hardcoded EDIDs.
Dave Airlie [Thu, 19 Apr 2012 14:42:58 +0000 (15:42 +0100)]
drm/radeon: fix load detect on rn50 with hardcoded EDIDs.

When the force changes went in back in 3.3.0, we ended up returning
disconnected in the !force case, and the connected in when forced,
as it hit the hardcoded check.

Fix it so all exits go via the hardcoded check and stop spurious
modesets on platforms with hardcoded EDIDs.

Reported-by: Evan McNabb (Red Hat)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Releasing FBs before releasing GEM objects during drm_release
Prathyush [Sat, 14 Apr 2012 11:52:13 +0000 (17:22 +0530)]
drm: Releasing FBs before releasing GEM objects during drm_release

During DRM release, all the FBs and gem objects are released. If
a gem object is being used as a FB and set to a crtc, it must not
be freed before releasing the framebuffer first.

If FBs are released first, the crtc using the FB is disabled first
so now the GEM object can be freed safely. The CRTC will be enabled
again when the driver restores fbdev mode.

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/nouveau/pm: don't read/write beyond end of stack buffer
Jim Meyering [Tue, 17 Apr 2012 19:27:54 +0000 (21:27 +0200)]
drm/nouveau/pm: don't read/write beyond end of stack buffer

NUL-terminate after strncpy.

If the parameter "profile" has length 16 or more, then strncpy
leaves "string" with no NUL terminator, so the following search
for '\n' may read beyond the end of that 16-byte buffer.
If it finds a newline there, then it will also write beyond the
end of that stack buffer.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrivers: gpu: drm: gma500: mdfld_dsi_output.h: Remove not unneeded include of version.h
Marcos Paulo de Souza [Wed, 18 Apr 2012 04:30:02 +0000 (01:30 -0300)]
drivers: gpu: drm: gma500: mdfld_dsi_output.h: Remove not unneeded include of version.h

The output of "make versioncheck" points a incorrect include of
version.h in the drivers/gpu/drm/gma500/mdfld_dsi_output.h:

drivers/gpu/drm/gma500/mdfld_dsi_output.h: 32 linux/version.h not needed.

If we take a look in the file, we can agree to remove it.

Cc: David Airlie <airlied@linux.ie>
Cc: <dri-devel@lists.freedesktop.org>
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoradeon: fix r600/agp when vram is after AGP (v3)
Jerome Glisse [Tue, 17 Apr 2012 20:51:38 +0000 (16:51 -0400)]
radeon: fix r600/agp when vram is after AGP (v3)

If AGP is placed in the middle, the size_af is off-by-one, it results
in VRAM being placed at 0x7fffffff instead of 0x8000000.

v2: fix the vram_start setup.
v3: also fix r7xx & newer ASIC

Reported-by: russiane39 on #radeon
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: fix page_flip error handling
Joonyoung Shim [Wed, 18 Apr 2012 04:47:02 +0000 (13:47 +0900)]
drm: fix page_flip error handling

Free event and restore event_space only when page_flip->flags has
DRM_MODE_PAGE_FLIP_EVENT if page_flip() is failed.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoMerge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel...
Dave Airlie [Thu, 19 Apr 2012 13:13:52 +0000 (14:13 +0100)]
Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes

* 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: Do not set "Enable Panel Fitter" on SNB pageflips
  drm/i915: Hold mode_config lock whilst changing mode for lastclose()
  drm/i915: don't clobber the special upscaling lvds timings

12 years agodrm/radeon/kms: fix the regression of DVI connector check
Takashi Iwai [Wed, 18 Apr 2012 13:21:07 +0000 (15:21 +0200)]
drm/radeon/kms: fix the regression of DVI connector check

The check of the encoder type in the commit [e00e8b5e: drm/radeon/kms:
fix analog load detection on DVI-I connectors] is obviously wrong, and
it's the culprit of the regression on my workstation with DVI-analog
connection resulting in the blank output.

Fixed the typo now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/usb: fix module license on drm/usb layer.
Dave Airlie [Thu, 19 Apr 2012 08:33:32 +0000 (09:33 +0100)]
drm/usb: fix module license on drm/usb layer.

Allows this module to load correctly with certain debugging options on.

Reported on irc by scientes
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomemcg: fix Bad page state after replace_page_cache
Hugh Dickins [Thu, 19 Apr 2012 06:34:46 +0000 (23:34 -0700)]
memcg: fix Bad page state after replace_page_cache

My 9ce70c0240d0 "memcg: fix deadlock by inverting lrucare nesting" put a
nasty little bug into v3.3's version of mem_cgroup_replace_page_cache(),
sometimes used for FUSE.  Replacing __mem_cgroup_commit_charge_lrucare()
by __mem_cgroup_commit_charge(), I used the "pc" pointer set up earlier:
but it's for oldpage, and needs now to be for newpage.  Once oldpage was
freed, its PageCgroupUsed bit (cleared above but set again here) caused
"Bad page state" messages - and perhaps worse, being missed from newpage.
(I didn't find this by using FUSE, but in reusing the function for tmpfs.)

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: stable@vger.kernel.org [v3.3 only]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Thu, 19 Apr 2012 03:16:02 +0000 (20:16 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/linux-security

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  security: fix compile error in commoncap.c

12 years agoKVM: lock slots_lock around device assignment
Alex Williamson [Wed, 18 Apr 2012 03:46:44 +0000 (21:46 -0600)]
KVM: lock slots_lock around device assignment

As pointed out by Jason Baron, when assigning a device to a guest
we first set the iommu domain pointer, which enables mapping
and unmapping of memory slots to the iommu.  This leaves a window
where this path is enabled, but we haven't synchronized the iommu
mappings to the existing memory slots.  Thus a slot being removed
at that point could send us down unexpected code paths removing
non-existent pinnings and iommu mappings.  Take the slots_lock
around creating the iommu domain and initial mappings as well as
around iommu teardown to avoid this race.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agosecurity: fix compile error in commoncap.c
Jonghwan Choi [Wed, 18 Apr 2012 21:23:04 +0000 (17:23 -0400)]
security: fix compile error in commoncap.c

Add missing "personality.h"
security/commoncap.c: In function 'cap_bprm_set_creds':
security/commoncap.c:510: error: 'PER_CLEAR_ON_SETID' undeclared (first use in this function)
security/commoncap.c:510: error: (Each undeclared identifier is reported only once
security/commoncap.c:510: error: for each function it appears in.)

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
12 years agoKVM: VMX: Fix kvm_set_shared_msr() called in preemptible context
Avi Kivity [Wed, 18 Apr 2012 12:03:04 +0000 (15:03 +0300)]
KVM: VMX: Fix kvm_set_shared_msr() called in preemptible context

kvm_set_shared_msr() may not be called in preemptible context,
but vmx_set_msr() does so:

  BUG: using smp_processor_id() in preemptible [00000000] code: qemu-kvm/22713
  caller is kvm_set_shared_msr+0x32/0xa0 [kvm]
  Pid: 22713, comm: qemu-kvm Not tainted 3.4.0-rc3+ #39
  Call Trace:
   [<ffffffff8131fa82>] debug_smp_processor_id+0xe2/0x100
   [<ffffffffa0328ae2>] kvm_set_shared_msr+0x32/0xa0 [kvm]
   [<ffffffffa03a103b>] vmx_set_msr+0x28b/0x2d0 [kvm_intel]
   ...

Making kvm_set_shared_msr() work in preemptible is cleaner, but
it's used in the fast path.  Making two variants is overkill, so
this patch just disables preemption around the call.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
Linus Torvalds [Thu, 19 Apr 2012 00:29:05 +0000 (17:29 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mszeredi/fuse

Pull fuse updates from Miklos Szeredi.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: use flexible array in fuse.h
  fuse: allow nanosecond granularity
  fuse: O_DIRECT support for files
  fuse: fix nlink after unlink

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Thu, 19 Apr 2012 00:27:50 +0000 (17:27 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/s390/linux

Pull s390 updates from Martin Schwidefsky:
 "A couple of bug fixes, one of them is a TLB flush fix.  Included as
  well is one small coding style patch and a patch to update the default
  configuration."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  [S390] Fix compile error in swab.h
  [S390] Fix stfle() lowcore protection problem
  [S390] cpum_cf: get rid of compile warnings
  [S390] irq: simple coding style change
  [S390] update default configuration
  [S390] fix tlb flushing for page table pages
  [S390] kernel: Use local_irq_save() for memcpy_real()
  [S390] s390/char/vmur.c: fix memory leak
  [S390] drivers/s390/block/dasd_eckd.c: add missing dasd_sfree_request

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Wed, 18 Apr 2012 20:23:44 +0000 (13:23 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/linux-security

Pull security subsystem fixes from James Morris.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  fcaps: clear the same personality flags as suid when fcaps are used
  mpi: Avoid using freed pointer in mpi_lshift_limbs()
  Smack: move label list initialization

12 years agoxz: Enable BCJ filters on SPARC and 32-bit x86
Lasse Collin [Wed, 18 Apr 2012 16:55:44 +0000 (19:55 +0300)]
xz: Enable BCJ filters on SPARC and 32-bit x86

The BCJ filters were meant to be enabled already on these
archs, but the xz_wrap.sh script was buggy. Enabling the
filters should give smaller kernel images.

xz_wrap.sh will now use $SRCARCH instead of $ARCH to detect
the architecture. That way it doesn't need to care about the
subarchs (like i386 vs. x86_64) since the BCJ filters don't
care either.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Wed, 18 Apr 2012 19:58:29 +0000 (12:58 -0700)]
Merge tag 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

Pull libara fixes from Jeff Garzik:

 - Notable regression fix.  Forbid dynamic runtime power management by
   default, due to issues with suspend/resume and hotplug.

   To re-enable, use sysfs.

 - make ata_print_id atomic, due to ref from multiple contexts

 - sata_mv warning fix

 - ata_piix new PCI ID

* tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: forbid port runtime pm by default, fixing regression
  libata: make ata_print_id atomic
  sata_mv: silence an uninitialized variable warning
  ata_piix: IDE-mode SATA patch for Intel DH89xxCC DeviceIDs

12 years agolibata: forbid port runtime pm by default, fixing regression
Lin Ming [Wed, 18 Apr 2012 01:29:47 +0000 (09:29 +0800)]
libata: forbid port runtime pm by default, fixing regression

Forbid port runtime pm by default because it has known hotplug issue.
User can allow it by, for example

echo auto > /sys/devices/pci0000:00/0000:00:1f.2/ata2/power/control

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
12 years agoRevert "ACPI: Make ACPI interrupt threaded"
Thomas Gleixner [Wed, 18 Apr 2012 10:29:32 +0000 (12:29 +0200)]
Revert "ACPI: Make ACPI interrupt threaded"

This reverts commit 6fe0d0628245fdcd6fad8b837c81e8f7ebc3364d.

Paul bisected this regression.

The conversion was done blindly and is wrong, as it does not provide a
primary handler to disable the level type irq on the device level.
Neither does it set the IRQF_ONESHOT flag which handles that at the irq
line level.  This can't be done as the interrupt might be shared, though
we might extend the core to force it.

So an interrupt on this line will wake up the thread, but immediately
unmask the irq after that.  Due to the interrupt being level type the
hardware interrupt is raised over and over and prevents the irq thread
from handling it.  Fail.

request_irq() unfortunately does not refuse such a request and the patch
was obviously never tested with real interrupts.

Bisected-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodrm/i915: Do not set "Enable Panel Fitter" on SNB pageflips
Chris Wilson [Tue, 17 Apr 2012 19:37:00 +0000 (20:37 +0100)]
drm/i915: Do not set "Enable Panel Fitter" on SNB pageflips

Not only do the pageflip work without it at non-native modes (i.e. with
the panel fitter enabled), it also causes normal (non-pageflipped)
modesets to fail.

Reported-by: Adam Jackson <ajax@redhat.com>
Tested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Wanted-by-for-fixes: Dave Airlie <airlied@gmail.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agofcaps: clear the same personality flags as suid when fcaps are used
Eric Paris [Tue, 17 Apr 2012 20:26:54 +0000 (16:26 -0400)]
fcaps: clear the same personality flags as suid when fcaps are used

If a process increases permissions using fcaps all of the dangerous
personality flags which are cleared for suid apps should also be cleared.
Thus programs given priviledge with fcaps will continue to have address space
randomization enabled even if the parent tried to disable it to make it
easier to attack.

Signed-off-by: Eric Paris <eparis@redhat.com>
Reviewed-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
12 years agompi: Avoid using freed pointer in mpi_lshift_limbs()
Jesper Juhl [Mon, 6 Feb 2012 09:07:04 +0000 (20:07 +1100)]
mpi: Avoid using freed pointer in mpi_lshift_limbs()

At the start of the function we assign 'a->d' to 'ap'. Then we use the
RESIZE_IF_NEEDED macro on 'a' - this may free 'a->d' and replace it
with newly allocaetd storage. In that case, we'll be operating on
freed memory further down in the function when we index into 'ap[]'.
Since we don't actually need 'ap' until after the use of the
RESIZE_IF_NEEDED macro we can just delay the assignment to it until
after we've potentially resized, thus avoiding the issue.

While I was there anyway I also changed the integer variable 'n' to be
const. It might as well be since we only assign to it once and use it
as a constant, and then the compiler will tell us if we ever assign to
it in the future.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
12 years agoSmack: move label list initialization
Casey Schaufler [Wed, 18 Apr 2012 01:55:46 +0000 (18:55 -0700)]
Smack: move label list initialization

A kernel with Smack enabled will fail if tmpfs has xattr support.

Move the initialization of predefined Smack label
list entries to the LSM initialization from the
smackfs setup. This became an issue when tmpfs
acquired xattr support, but was never correct.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
12 years agoMerge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
Linus Torvalds [Tue, 17 Apr 2012 20:30:34 +0000 (13:30 -0700)]
Merge tag 'ext4_for_linus' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 regression fixes from Ted Ts'o:
 "This fixes a scalability problem reported by Andi Kleen and Tim Chen;
  they were quite secretive about the precise nature of their workload,
  but they later admitted that it only showed up when they were using a
  large sparse file, so the amount of data I/O that was needed was close
  to zero.

  I'm not sure how realistic this is and it's only a regression if you
  consider changes made since 2.6.39 to be a "regression" vis-a-vis the
  policy regarding post-merge window bug fixes, but Linus agreed it was
  worth fixing, so I'm including it in this pull request.

  This also fixes the journalled quota mount options, which I
  accidentally broke while I was cleaning up the mount option handling."

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix handling of journalled quota options
  ext4: address scalability issue by removing extent cache statistics

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Tue, 17 Apr 2012 20:21:50 +0000 (13:21 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs

Pull vfs fixes from Al Viro:
 "A bunch of endianness fixes and a couple of nfsd error value fixes.

  Speaking of endianness stuff, I'm rather tempted to slap

ccflags-y += -D__CHECK_ENDIAN__

  in fs/Makefile, if not making it default for the entire tree; nfsd
  regressions I've caught make one hell of a pile and we'd obviously
  benefit from having that kind of stuff caught earlier..."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  lockd: fix the endianness bug
  ocfs2: ->e_leaf_clusters endianness breakage
  ocfs2: ->rl_count endianness breakage
  ocfs: ->rl_used breakage on big-endian
  ocfs2: ->l_next_free_req breakage on big-endian
  btrfs: btrfs_root_readonly() broken on big-endian
  ext4: fix endianness breakage in ext4_split_extent_at()
  nfsd: fix compose_entry_fh() failure exits
  nfsd: fix error value on allocation failure in nfsd4_decode_test_stateid()
  nfsd: fix endianness breakage in TEST_STATEID handling
  nfsd: fix error values returned by nfsd4_lockt() when nfsd_open() fails
  nfsd: fix b0rken error value for setattr on read-only mount

12 years agoMerge git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Tue, 17 Apr 2012 16:19:29 +0000 (09:19 -0700)]
Merge git://git.samba.org/sfrench/cifs-2.6

Pull CIFS fixes from Steve French.

* git://git.samba.org/sfrench/cifs-2.6:
  Fix number parsing in cifs_parse_mount_options
  Cleanup handling of NULL value passed for a mount option

12 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 17 Apr 2012 01:35:21 +0000 (18:35 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar.

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: Handle failures of parsing immediate operands in the instruction decoder
  perf archive: Correct cutting of symbolic link
  perf tools: Ignore auto-generated bison/flex files
  perf tools: Fix parsers' rules to dependencies
  perf tools: fix NO_GTK2 Makefile config error
  perf session: Skip event correctly for unknown id/machine

12 years agoMerge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Linus Torvalds [Tue, 17 Apr 2012 01:34:12 +0000 (18:34 -0700)]
Merge tag 'for_linus' of git://git./linux/kernel/git/mst/vhost

Pull virtio fixes from Michael S. Tsirkin:
 "Here are some virtio fixes for 3.4: a test build fix, a patch by Ren
  fixing naming for systems with a massive number of virtio blk devices,
  and balloon fixes for powerpc by David Gibson.

  There was some discussion about Ren's patch for virtio disc naming:
  some people wanted to move the legacy name mangling function to the
  block core.  But there's no concensus on that yet, and we can always
  deduplicate later.  Added comments in the hope that this will stop
  people from copying this legacy naming scheme into future drivers."

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio_balloon: fix handling of PAGE_SIZE != 4k
  virtio_balloon: Fix endian bug
  virtio_blk: helper function to format disk names
  tools/virtio: fix up vhost/test module build

12 years agoPCI: Retry BARs restoration for Type 0 headers only
Rafael J. Wysocki [Mon, 16 Apr 2012 21:07:50 +0000 (23:07 +0200)]
PCI: Retry BARs restoration for Type 0 headers only

Some shortcomings introduced into pci_restore_state() by commit
26f41062f28d ("PCI: check for pci bar restore completion and retry")
have been fixed by recent commit ebfc5b802fa76 ("PCI: Fix regression in
pci_restore_state(), v3"), but that commit treats all PCI devices as
those with Type 0 configuration headers.

That is not entirely correct, because Type 1 and Type 2 headers have
different layouts.  In particular, the area occupied by BARs in Type 0
config headers contains the secondary status register in Type 1 ones and
it doesn't make sense to retry the restoration of that register even if
the value read back from it after a write is not the same as the written
one (it very well may be different).

For this reason, make pci_restore_state() only retry the restoration
of BARs for Type 0 config headers.  This effectively makes it behave
as before commit 26f41062f28d for all header types except for Type 0.

Tested-by: Mikko Vinni <mmvinni@yahoo.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDocumentation: maintainer change
Randy Dunlap [Tue, 17 Apr 2012 02:21:39 +0000 (19:21 -0700)]
Documentation: maintainer change

I'm dropping off as Documentation/ maintainer.
Rob Landley has agreed to take it over.  Thanks, Rob.

I'll still be around reviewing patches and testing.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Rob Landley <rob@landley.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoia64: fix futex_atomic_cmpxchg_inatomic()
Luck, Tony [Mon, 16 Apr 2012 23:28:01 +0000 (16:28 -0700)]
ia64: fix futex_atomic_cmpxchg_inatomic()

Michel Lespinasse cleaned up the futex calling conventions in commit
37a9d912b24f ("futex: Sanitize cmpxchg_futex_value_locked API").

But the ia64 implementation was subtly broken.  Gcc does not know that
register "r8" will be updated by the fault handler if the cmpxchg
instruction takes an exception.  So it feels safe in letting the
initialization of r8 slide to after the cmpxchg.  Result: we always
return 0 whether the user address faulted or not.

Fix by moving the initialization of r8 into the __asm__ code so gcc
won't move it.

Reported-by: <emeric.maschino@gmail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42757
Tested-by: <emeric.maschino@gmail.com>
Acked-by: Michel Lespinasse <walken@google.com>
Cc: stable@vger.kernel.org # v2.6.39+
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoext4: fix handling of journalled quota options
Theodore Ts'o [Mon, 16 Apr 2012 22:55:26 +0000 (18:55 -0400)]
ext4: fix handling of journalled quota options

Commit 26092bf5 broke handling of journalled quota mount options by
trying to parse argument of every mount option as a number.  Fix this
by dealing with the quota options before we call match_int().

Thanks to Jan Kara for discovering this regression.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
12 years agocheckpatch: revert --strict test for net/ and drivers/net block comment style
Joe Perches [Mon, 16 Apr 2012 19:35:11 +0000 (13:35 -0600)]
checkpatch: revert --strict test for net/ and drivers/net block comment style

Revert the --strict test for the old preferred block
comment style in drivers/net and net/

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agonfsd: include cld.h in the headers_install target
Jeff Layton [Mon, 16 Apr 2012 16:07:02 +0000 (12:07 -0400)]
nfsd: include cld.h in the headers_install target

The cld.h file contains the definition of the upcall format to talk
with nfsdcld. When I added the file though, I neglected to add it
to the headers-y target, so make headers_install wasn't installing it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
12 years agodrm/i915: Hold mode_config lock whilst changing mode for lastclose()
Chris Wilson [Mon, 16 Apr 2012 14:16:42 +0000 (15:16 +0100)]
drm/i915: Hold mode_config lock whilst changing mode for lastclose()

Upon lastclose(), we switch back to the fbcon configuration. This
requires taking the mode_config lock in order to serialise the change
with output probing elsewhere.

Reported-by: Oleksij Rempel <bug-track@fisher-privat.net>
References: https://bugs.freedesktop.org/show_bug.cgi?id=48652
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agoext4: address scalability issue by removing extent cache statistics
Theodore Ts'o [Mon, 16 Apr 2012 16:16:20 +0000 (12:16 -0400)]
ext4: address scalability issue by removing extent cache statistics

Andi Kleen and Tim Chen have reported that under certain circumstances
the extent cache statistics are causing scalability problems due to
cache line bounces.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
12 years agodrm/radeon/si: add missing radeon_bo_unreserve in si_rlc_init() v2
Alex Deucher [Fri, 13 Apr 2012 14:26:36 +0000 (10:26 -0400)]
drm/radeon/si: add missing radeon_bo_unreserve in si_rlc_init() v2

Forget to unreserve after pinning.  This can lead to problems in
soft reset and resume.

v2: rework patch as per Michel's suggestion.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: disable MSI on RV515
Dave Airlie [Fri, 13 Apr 2012 10:14:50 +0000 (11:14 +0100)]
drm/radeon: disable MSI on RV515

My rv515 card is very flaky with msi enabled. Every so often it loses a rearm
and never comes back, manually banging the rearm brings it back.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/i915: don't clobber the special upscaling lvds timings
Daniel Vetter [Sun, 15 Apr 2012 17:53:19 +0000 (19:53 +0200)]
drm/i915: don't clobber the special upscaling lvds timings

This regression has been introduced in

commit ca9bfa7eed20ea34e862804e62aae10eb159edbb
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sat Jan 28 14:49:20 2012 +0100

    drm/i915: fixup interlaced vertical timings confusion, part 1

Unfortunately that commit failed to take into account that the lvds
code does some special adjustements to the crtc timings for upscaling
an centering.

Fix this by explicitly computing crtc timings in the lvds mode fixup
function and setting a special flag in mode->private_flags if the crtc
timings have been adjusted.

v2: Add a comment to explain the new mode driver private flag,
suggested by Eugeni Dodonov.

v3: Kill the confusing and now redundant set_crtcinfo call in
intel_fixed_panel_mode, noticed by Chris Wilson.

Reported-and-Tested-by: Hans de Bruin <jmdebruin@xmsnet.nl>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43071
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agox86: Handle failures of parsing immediate operands in the instruction decoder
Masami Hiramatsu [Fri, 13 Apr 2012 03:24:27 +0000 (12:24 +0900)]
x86: Handle failures of parsing immediate operands in the instruction decoder

This can happen if the instruction is much longer than the maximum length,
or if insn->opnd_bytes is manually changed.

This patch also fixes warnings from -Wswitch-default flag.

Reported-by: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Cc: Linux-mm <linux-mm@kvack.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Anton Arapov <anton@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: yrl.pp-manager.tt@hitachi.com
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120413032427.32577.42602.stgit@localhost.localdomain
Signed-off-by: Ingo Molnar <mingo@kernel.org>
12 years agoLinux 3.4-rc3 v3.4-rc3
Linus Torvalds [Mon, 16 Apr 2012 01:28:29 +0000 (18:28 -0700)]
Linux 3.4-rc3

12 years agoMerge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
Linus Torvalds [Mon, 16 Apr 2012 00:35:19 +0000 (17:35 -0700)]
Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm

Pull ARM fixes from Russell King:
 "Nothing too disasterous, the biggest thing being the removal of the
  regulator support for vcore in the AMBA driver; only one SoC was using
  this and it got broken during the last merge window, which then
  started causing problems for other people.  Mutual agreement was
  reached for it to be removed."

* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
  ARM: 7386/1: jump_label: fixup for rename to static_key
  ARM: 7384/1: ThumbEE: Disable userspace TEEHBR access for !CONFIG_ARM_THUMBEE
  ARM: 7382/1: mm: truncate memory banks to fit in 4GB space for classic MMU
  ARM: 7359/2: smp_twd: Only wait for reprogramming on active cpus
  ARM: 7383/1: nommu: populate vectors page from paging_init
  ARM: 7381/1: nommu: fix typo in mm/Kconfig
  ARM: 7380/1: DT: do not add a zero-sized memory property
  ARM: 7379/1: DT: fix atags_to_fdt() second call site
  ARM: 7366/3: amba: Remove AMBA level regulator support
  ARM: 7377/1: vic: re-read status register before dispatching each IRQ handler
  ARM: 7368/1: fault.c: correct how the tsk->[maj|min]_flt gets incremented

12 years agox86-32: fix up strncpy_from_user() sign error
Linus Torvalds [Mon, 16 Apr 2012 00:23:00 +0000 (17:23 -0700)]
x86-32: fix up strncpy_from_user() sign error

The 'max' range needs to be unsigned, since the size of the user address
space is bigger than 2GB.

We know that 'count' is positive in 'long' (that is checked in the
caller), so we will truncate 'max' down to something that fits in a
signed long, but before we actually do that, that comparison needs to be
done in unsigned.

Bug introduced in commit 92ae03f2ef99 ("x86: merge 32/64-bit versions of
'strncpy_from_user()' and speed it up").  On x86-64 you can't trigger
this, since the user address space is much smaller than 63 bits, and on
x86-32 it works in practice, since you would seldom hit the strncpy
limits anyway.

I had actually tested the corner-cases, I had only tested them on
x86-64.  Besides, I had only worried about the case of a pointer *close*
to the end of the address space, rather than really far away from it ;)

This also changes the "we hit the user-specified maximum" to return
'res', for the trivial reason that gcc seems to generate better code
that way.  'res' and 'count' are the same in that case, so it really
doesn't matter which one we return.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoARM: 7386/1: jump_label: fixup for rename to static_key
Rabin Vincent [Sat, 14 Apr 2012 20:51:32 +0000 (21:51 +0100)]
ARM: 7386/1: jump_label: fixup for rename to static_key

c5905afb0 ("static keys: Introduce 'struct static_key'...") renamed
struct jump_label_key to struct static_key.  Fixup ARM for this to
eliminate these build warnings:

  include/linux/jump_label.h:113:2:
  warning: passing argument 1 of 'arch_static_branch' from incompatible pointer type
  include/asm/jump_label.h:17:82:
  note: expected 'struct jump_label_key *' but argument is of type 'struct static_key *'

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7384/1: ThumbEE: Disable userspace TEEHBR access for !CONFIG_ARM_THUMBEE
Jonathan Austin [Thu, 12 Apr 2012 16:45:25 +0000 (17:45 +0100)]
ARM: 7384/1: ThumbEE: Disable userspace TEEHBR access for !CONFIG_ARM_THUMBEE

Currently when ThumbEE is not enabled (!CONFIG_ARM_THUMBEE) the ThumbEE
register states are not saved/restored at context switch. The default state
of the ThumbEE Ctrl register (TEECR) allows userspace accesses to the
ThumbEE Base Handler register (TEEHBR). This can cause unexpected behaviour
when people use ThumbEE on !CONFIG_ARM_THUMBEE kernels, as well as allowing
covert communication - eg between userspace tasks running inside chroot
jails.

This patch sets up TEECR in order to prevent user-space access to TEEHBR
when !CONFIG_ARM_THUMBEE. In this case, tasks are sent SIGILL if they try to
access TEEHBR.

Cc: stable@vger.kernel.org
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>