GitHub/moto-9609/android_kernel_motorola_exynos9610.git
9 years agoqla2xxx: Add udev notification to save fw dump for ISP27XX
Himanshu Madhani [Thu, 9 Apr 2015 19:00:01 +0000 (15:00 -0400)]
qla2xxx: Add udev notification to save fw dump for ISP27XX

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoqla2xxx: Add message for sucessful FW dump collected for ISP27XX.
Himanshu Madhani [Thu, 9 Apr 2015 19:00:00 +0000 (15:00 -0400)]
qla2xxx: Add message for sucessful FW dump collected for ISP27XX.

o Added message indicating firmware dump was sucessfully collected
  for ISP27XX.
o Improve logging to help debug firmware dump process for ISP27XX.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoqla2xxx: Add support to load firmware from file for ISP 26XX/27XX.
Sawan Chandak [Thu, 9 Apr 2015 18:59:59 +0000 (14:59 -0400)]
qla2xxx: Add support to load firmware from file for ISP 26XX/27XX.

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoqla2xxx: Fix beacon blink for ISP27XX.
Nigel Kirkland [Thu, 9 Apr 2015 18:59:58 +0000 (14:59 -0400)]
qla2xxx: Fix beacon blink for ISP27XX.

Signed-off-by: Nigel Kirkland <nigel.kirkland@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoqla2xxx: Increase the wait time for firmware to be ready for P3P.
Chad Dupuis [Thu, 9 Apr 2015 18:59:57 +0000 (14:59 -0400)]
qla2xxx: Increase the wait time for firmware to be ready for P3P.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoqla2xxx: Fix crash due to wrong casting of reg for ISP27XX.
Himanshu Madhani [Thu, 9 Apr 2015 18:59:56 +0000 (14:59 -0400)]
qla2xxx: Fix crash due to wrong casting of reg for ISP27XX.

[Bart: additional sparse warning caused by this patch]
[jejb: fix sparse warning]
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoqla2xxx: Fix warnings reported by static checker.
Himanshu Madhani [Thu, 9 Apr 2015 18:59:55 +0000 (14:59 -0400)]
qla2xxx: Fix warnings reported by static checker.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Update version to 10.5.0.0 for upstream patch set
James Smart [Tue, 7 Apr 2015 19:07:29 +0000 (15:07 -0400)]
lpfc: Update version to 10.5.0.0 for upstream patch set

Update version  to 10.5.0.0 for upstream patch set

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Update copyright to 2015
James Smart [Tue, 7 Apr 2015 19:07:28 +0000 (15:07 -0400)]
lpfc: Update copyright to 2015

Update copyright to 2015

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix for lun discovery issue with saturn adapter.
James Smart [Tue, 7 Apr 2015 19:07:27 +0000 (15:07 -0400)]
lpfc: Fix for lun discovery issue with saturn adapter.

FCP_CMD payload was not always properly initialized on SLI-3 devices.

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix crash in device reset handler.
James Smart [Tue, 7 Apr 2015 19:07:26 +0000 (15:07 -0400)]
lpfc: Fix crash in device reset handler.

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix OS crash when running loopback test in applications
James Smart [Tue, 7 Apr 2015 19:07:25 +0000 (15:07 -0400)]
lpfc: Fix OS crash when running loopback test in applications

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix internal loopback failure.
James Smart [Tue, 7 Apr 2015 19:07:23 +0000 (15:07 -0400)]
lpfc: Fix internal loopback failure.

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix premature release of rpi bit in bitmask
James Smart [Tue, 7 Apr 2015 19:07:22 +0000 (15:07 -0400)]
lpfc: Fix premature release of rpi bit in bitmask

Currently, the driver plays off the fact that older sli4 adapters have a
different rpi access pattern that allowed for the rpi reference to be
released earlier in the teardown sequence, allowing the driver to recycle
the rpi value sooner. Newer sli4 adapters have a different access pattern that
requires us to wait for a later mailbox completion. This changes the put
call location on the newer sli4 adapters.

Symptoms of the error are "0110 ELS" and the "0372 iotag" errors.

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Initiator sends wrong BBCredit value for either FLOGI or FLOGI_ACC
James Smart [Tue, 7 Apr 2015 19:07:21 +0000 (15:07 -0400)]
lpfc: Initiator sends wrong BBCredit value for either FLOGI or FLOGI_ACC

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix null ndlp dereference in target_reset_handler
James Smart [Tue, 7 Apr 2015 19:07:20 +0000 (15:07 -0400)]
lpfc: Fix null ndlp dereference in target_reset_handler

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix FDMI Fabric support in driver for Brocade
James Smart [Tue, 7 Apr 2015 19:07:19 +0000 (15:07 -0400)]
lpfc: Fix FDMI Fabric support in driver for Brocade

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
James Smart [Tue, 7 Apr 2015 19:07:18 +0000 (15:07 -0400)]
lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Parse the new 20G, 25G and 40G link speeds in the lpfc driver
James Smart [Tue, 7 Apr 2015 19:07:17 +0000 (15:07 -0400)]
lpfc: Parse the new 20G, 25G and 40G link speeds in the lpfc driver

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Add support for reporting option_rom_version on newer adapters
James Smart [Tue, 7 Apr 2015 19:07:16 +0000 (15:07 -0400)]
lpfc: Add support for reporting option_rom_version on newer adapters

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix setting of EQ (interrupt) delay Multiplier
James Smart [Tue, 7 Apr 2015 19:07:15 +0000 (15:07 -0400)]
lpfc: Fix setting of EQ (interrupt) delay Multiplier

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix host reset escalation killing all IOs.
James Smart [Tue, 7 Apr 2015 19:07:13 +0000 (15:07 -0400)]
lpfc: Fix host reset escalation killing all IOs.

Fix host reset escalation killing all IOs.

SLI-3 adapters will use a new host template. The template differs
from SLI-4 adapters in that it does not have an eh_host_reset_handler.

Lpfc has traditionally never had a host_reset. The host reset
handler was added when we ran into a stuck hardware condition on a
SLI-4 adapter. The host_reset will reset and reinit the pci function,
clearing the hardware condition.

Unfortunately, the host reset handler uses attach/detach code paths,
which makes scsi_add_host() and scsi_remove_host() calls. Meaning, a
host_reset will completely remove the scsi_host from the system. As a
new call to scsi_add_host() is made, the shost# changes, which results
in completely new scsi_devices and device names. All the older scsi
devices on the old shost# are now orphaned and unrecoverable.

We realize we need to re-implement the host_reset_handler so the scsi_host
stays registered across the host_reset, but that will be a rather
lengthy effort. In the short term, we had an immediate need to restore
the SLI-3 devices to their working behavior, with the easiest path being
to remove their host_reset handler.

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Linux lpfc driver doesn't re-establish the link after a cable pull on LPe12002
James Smart [Tue, 7 Apr 2015 19:07:12 +0000 (15:07 -0400)]
lpfc: Linux lpfc driver doesn't re-establish the link after a cable pull on LPe12002

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix to handle PLOGI when already logged in
James Smart [Tue, 7 Apr 2015 19:07:11 +0000 (15:07 -0400)]
lpfc: Fix to handle PLOGI when already logged in

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Add new mbx cmd recognition
James Smart [Tue, 7 Apr 2015 19:07:10 +0000 (15:07 -0400)]
lpfc: Add new mbx cmd recognition

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Add Lancer Temperature Event support to the lpfc driver
James Smart [Tue, 7 Apr 2015 19:07:09 +0000 (15:07 -0400)]
lpfc: Add Lancer Temperature Event support to the lpfc driver

This will detect and send an async event if overtemp is detected

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agolpfc: Fix the iteration count to match the 30 sec comment in the routine lpfc_pci_fun...
James Smart [Tue, 7 Apr 2015 19:07:08 +0000 (15:07 -0400)]
lpfc: Fix the iteration count to match the 30 sec comment in the routine lpfc_pci_function_reset

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoscsi_transport_fc: Add support for 25Gbit speed
James Smart [Thu, 2 Apr 2015 19:50:52 +0000 (15:50 -0400)]
scsi_transport_fc: Add support for 25Gbit speed

Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: remove loop from aha1542_outb
Ondrej Zary [Fri, 6 Feb 2015 22:11:57 +0000 (23:11 +0100)]
aha1542: remove loop from aha1542_outb

The loop in aha1542_outb with double-check is no longer needed, remove it.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Fix bus reset
Ondrej Zary [Fri, 6 Feb 2015 22:11:56 +0000 (23:11 +0100)]
aha1542: Fix bus reset

Bus reset always fails because aha1542_reset waits for the controller to assert
the INIT bit (Mailbox Initialization Required) which it never does. This bit is
asserted only after host reset.

Remove the requirement for INIT bit (we really need only the IDLE bit).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: rework locking
Ondrej Zary [Fri, 6 Feb 2015 22:11:55 +0000 (23:11 +0100)]
aha1542: rework locking

Remove aha1542_lock and use host_lock instead.
Remove interrupt and queuecommand function wrappers.
Remove locking from lowlevel _out and _in functions, they now can
onle be called (at runtime) with host_lock being held.
Remove ssleep(4) in aha1542_reset as we can't sleep while holding a spinlock.
It's useless anyway as wait_mask will wait until the controller is idle and
kernel waits for 10 seconds (HOST_RESET_SETTLE_TIME) after that.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Don't reduce functionality with DEBUG enabled
Ondrej Zary [Fri, 6 Feb 2015 22:11:54 +0000 (23:11 +0100)]
aha1542: Don't reduce functionality with DEBUG enabled

Enabling DEBUG disables write commands and devices with ID > 1.
Remove this "feature" to allow real debugging.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Use print_hex_dump_bytes in debug code
Ondrej Zary [Fri, 6 Feb 2015 22:11:53 +0000 (23:11 +0100)]
aha1542: Use print_hex_dump_bytes in debug code

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: remove DEB macro and simplify debug code
Ondrej Zary [Fri, 6 Feb 2015 22:11:52 +0000 (23:11 +0100)]
aha1542: remove DEB macro and simplify debug code

Remove DEB macro and join ifdef DEBUG blocks

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Use shost_printk instead of printk
Ondrej Zary [Fri, 6 Feb 2015 22:11:51 +0000 (23:11 +0100)]
aha1542: Use shost_printk instead of printk

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Change aha1542_set_bus_times parameters
Ondrej Zary [Fri, 6 Feb 2015 22:11:50 +0000 (23:11 +0100)]
aha1542: Change aha1542_set_bus_times parameters

Pass struct Scsi_Host *sh and dma parameters instead of index to
aha1542_set_bus_times.
This is required for printk conversion.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Pass struct Scsi_Host * to functions
Ondrej Zary [Fri, 6 Feb 2015 22:11:49 +0000 (23:11 +0100)]
aha1542: Pass struct Scsi_Host * to functions

Pass struct Scsi_Host * to functions instead of base address.
This reduces the number of parameters and is also required for printk
conversion.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: cleanup includes
Ondrej Zary [Fri, 6 Feb 2015 22:11:48 +0000 (23:11 +0100)]
aha1542: cleanup includes

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: remove useless changelog
Ondrej Zary [Fri, 6 Feb 2015 22:11:47 +0000 (23:11 +0100)]
aha1542: remove useless changelog

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: fix include guard and remove useless changelog
Ondrej Zary [Fri, 6 Feb 2015 22:11:46 +0000 (23:11 +0100)]
aha1542: fix include guard and remove useless changelog

Fix include guard in header file and remove useless changelog

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Always name Scsi_Host variables sh
Ondrej Zary [Fri, 6 Feb 2015 22:11:45 +0000 (23:11 +0100)]
aha1542: Always name Scsi_Host variables sh

Make Scsi_Host variable names consistent - use sh everywhere.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1524: Use struct scsi_cmnd
Ondrej Zary [Fri, 6 Feb 2015 22:11:44 +0000 (23:11 +0100)]
aha1524: Use struct scsi_cmnd

Use struct scsi_cmnd instead of Scsi_Cmnd and also rename the variables
to get rid of SC prefix

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: clean up cmd variables
Ondrej Zary [Fri, 6 Feb 2015 22:11:43 +0000 (23:11 +0100)]
aha1542: clean up cmd variables

Make sure that there's no variable named cmd

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Simplify aha1542_biosparam
Ondrej Zary [Fri, 6 Feb 2015 22:11:42 +0000 (23:11 +0100)]
aha1542: Simplify aha1542_biosparam

Simplify aha1542_biosparam, use sector_div, remove unused BIOS_TRANSLATION_1632.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: rework configuration parameters
Ondrej Zary [Fri, 6 Feb 2015 22:11:41 +0000 (23:11 +0100)]
aha1542: rework configuration parameters

Remove __setup and introduce separate io, bus_on, bus_off and dma_speed
module parameters.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: rework hw_init
Ondrej Zary [Fri, 6 Feb 2015 22:11:40 +0000 (23:11 +0100)]
aha1542: rework hw_init

Cleanup hw_init, use goto for error handling.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Call wait_mask from aha1542_out
Ondrej Zary [Fri, 6 Feb 2015 22:11:39 +0000 (23:11 +0100)]
aha1542: Call wait_mask from aha1542_out

aha1542_out call is always followed by wait_mask.
Move the call into aha1542_out to simplify code.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: split out code from aha1542_hw_init
Ondrej Zary [Fri, 6 Feb 2015 22:11:38 +0000 (23:11 +0100)]
aha1542: split out code from aha1542_hw_init

Split out bus times related block of aha1542_hw_init into separate function
aha1542_set_bus_times.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Merge aha1542_host_reset and aha1542_bus_reset
Ondrej Zary [Fri, 6 Feb 2015 22:11:37 +0000 (23:11 +0100)]
aha1542: Merge aha1542_host_reset and aha1542_bus_reset

aha1542_host_reset and aha1542_bus_reset are almost same, merge them
into aha1542_reset

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Remove aha1542_restart
Ondrej Zary [Fri, 6 Feb 2015 22:11:36 +0000 (23:11 +0100)]
aha1542: Remove aha1542_restart

aha1542_restart does nothing (except useless printk), remove it

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: remove useless code from aha1542_test_port
Ondrej Zary [Fri, 6 Feb 2015 22:11:35 +0000 (23:11 +0100)]
aha1542: remove useless code from aha1542_test_port

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Remove unneeded gotos
Ondrej Zary [Fri, 6 Feb 2015 22:11:34 +0000 (23:11 +0100)]
aha1542: Remove unneeded gotos

Remove gotos that are no longer needed.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Split aha1542_out
Ondrej Zary [Fri, 6 Feb 2015 22:11:33 +0000 (23:11 +0100)]
aha1542: Split aha1542_out

aha1542_out are in fact two separate functions.
Split them into aha1542_out and aha1542_outb to simplify the code.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Unify aha1542_in and aha1542_in1
Ondrej Zary [Fri, 6 Feb 2015 22:11:32 +0000 (23:11 +0100)]
aha1542: Unify aha1542_in and aha1542_in1

Unify aha1542_in and aha1542_in1 functions, they differ only in timeout
and printk.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Remove WAIT and WAITd macros
Ondrej Zary [Fri, 6 Feb 2015 22:11:31 +0000 (23:11 +0100)]
aha1542: Remove WAIT and WAITd macros

Convert the ugly WAIT and WAITd macros into wait_mask function.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Use BIT() macro
Ondrej Zary [Fri, 6 Feb 2015 22:11:30 +0000 (23:11 +0100)]
aha1542: Use BIT() macro

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: remove empty aha1542_stat
Ondrej Zary [Fri, 6 Feb 2015 22:11:29 +0000 (23:11 +0100)]
aha1542: remove empty aha1542_stat

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Reorder functions to remove forward declarations
Ondrej Zary [Fri, 6 Feb 2015 22:11:28 +0000 (23:11 +0100)]
aha1542: Reorder functions to remove forward declarations

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Use u8 instead of unchar
Ondrej Zary [Fri, 6 Feb 2015 22:11:27 +0000 (23:11 +0100)]
aha1542: Use u8 instead of unchar

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Convert aha1542_intr_reset to function
Ondrej Zary [Fri, 6 Feb 2015 22:11:26 +0000 (23:11 +0100)]
aha1542: Convert aha1542_intr_reset to function

Convert aha1542_intr_reset macro to inline function

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Remove HOSTDATA macro
Ondrej Zary [Fri, 6 Feb 2015 22:11:25 +0000 (23:11 +0100)]
aha1542: Remove HOSTDATA macro

Remove HOSTDATA macro and use shost_priv instead

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Remove SCSI_BUF_PA, SCSI_SG_PA, AHA1542_SCATTER and AHA1542_CMDLUN
Ondrej Zary [Fri, 6 Feb 2015 22:11:24 +0000 (23:11 +0100)]
aha1542: Remove SCSI_BUF_PA, SCSI_SG_PA, AHA1542_SCATTER and AHA1542_CMDLUN

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: remove dead code
Ondrej Zary [Fri, 6 Feb 2015 22:11:23 +0000 (23:11 +0100)]
aha1542: remove dead code

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaha1542: Stop using scsi_module.c
Ondrej Zary [Fri, 6 Feb 2015 22:11:22 +0000 (23:11 +0100)]
aha1542: Stop using scsi_module.c

Convert aha1542 to use scsi_add_host instead of scsi_module.c
Use pnp_driver and isa_driver to manage cards.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: driver version change
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:32 +0000 (10:41 -0400)]
aacraid: driver version change

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: AIF raw device remove support
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:31 +0000 (10:41 -0400)]
aacraid: AIF raw device remove support

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: performance improvement changes
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:30 +0000 (10:41 -0400)]
aacraid: performance improvement changes

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: IOCTL fix
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:29 +0000 (10:41 -0400)]
aacraid: IOCTL fix

After getting the platform shutdown command "VM_CloseAll" response from the
firmware, driver was getting configuration IOCTL request from the upper layers
and it sends down to firmware. This causes firmware assert issue.

This patch fixes the firmware assert issue. During the shutdown, if driver
gets commands from the upper layer, driver sends error code to the upper
layers.

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: IOP RESET command handling changes
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:28 +0000 (10:41 -0400)]
aacraid: IOP RESET command handling changes

This patch fixes the IOP_RESET issue. Sending IOP_RESET command need to wait
for only 10 sec instead of 5 minutes in case of firmware does not response
IOP_RESET command.  Disable interrupt before setup interrupt routine to
prevent spurious interrupts.

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: 240 simple volume support
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:27 +0000 (10:41 -0400)]
aacraid: 240 simple volume support

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: vpd page code 0x83 support
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:26 +0000 (10:41 -0400)]
aacraid: vpd page code 0x83 support

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: MSI-x support
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:25 +0000 (10:41 -0400)]
aacraid: MSI-x support

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: 4KB sector support
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:24 +0000 (10:41 -0400)]
aacraid: 4KB sector support

Also fix up a name truncation problem

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: IOCTL pass-through command fix
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:23 +0000 (10:41 -0400)]
aacraid: IOCTL pass-through command fix

The Linux aacriad driver fails to detect the case of SG list count=0 on IOCTL
pass-through command and cause intermittent fault.  The result is the Linux
aacriad driver send down IOCTL pass-through command with one not initialized
SG list to firmware when receiving SG list count =0 on pass-through command.

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaacraid: AIF support for SES device add/remove
Mahesh Rajashekhara [Thu, 26 Mar 2015 14:41:22 +0000 (10:41 -0400)]
aacraid: AIF support for SES device add/remove

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoipr: Driver version 2.6.1
Brian King [Thu, 26 Mar 2015 16:24:00 +0000 (11:24 -0500)]
ipr: Driver version 2.6.1

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoipr: AF DASD raw mode implementation in ipr driver
Wen Xiong [Thu, 26 Mar 2015 16:23:58 +0000 (11:23 -0500)]
ipr: AF DASD raw mode implementation in ipr driver

This patch implements raw mode support for AF DASD in ipr driver
which allows for tools to send commands directly to physical
devices which are members of RAID arrays when enabled in the firmware.

[jejb: fix up whitespace]
Signed-off-by: Wen Xiong<wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Daniel Kreling <kreling@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoipr: Re-enable write same
Brian King [Thu, 26 Mar 2015 16:23:56 +0000 (11:23 -0500)]
ipr: Re-enable write same

Re-enable write same support for ipr RAID adapters.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Daniel Kreling <kreling@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoipr: Fix possible error path oops during initialization
Brian King [Thu, 26 Mar 2015 16:23:55 +0000 (11:23 -0500)]
ipr: Fix possible error path oops during initialization

Fixes a possible oops during adapter initialization in some
memory allocation failure error paths scenarios.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Daniel Kreling <kreling@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoipr: Reset in task context
Brian King [Thu, 26 Mar 2015 16:23:52 +0000 (11:23 -0500)]
ipr: Reset in task context

The pci_set_pcie_reset_state has changed semantics to not be callable
from interrupt context, so change ipr's usage of the API to comply with
this change by ensuring this occurs from a workqueue.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Daniel Kreling <kreling@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoipr: Reboot speed improvements
Brian King [Thu, 26 Mar 2015 16:23:50 +0000 (11:23 -0500)]
ipr: Reboot speed improvements

Currently when performing a reboot with an ipr adapter,
the adapter gets shutdown completely, flushing all write
cache, as well as performing a full hardware reset of the card
during the shutdown phase of the old kernel. This ensures
the adapter is in a fully quiesced state across the reboot.

There are scenarios, however, such as when performing
kexec, where this full adapter shutdown is not required
and not desired, since it can make the reboot process take
noticeably longer.

This patch adds a module parameter to allow for skipping the
full shutdown during reboot. Rather than performing a full
adapter shutdown and reset, we simply cancel any outstanding
error buffers, place the adapter into a state where it has no
memory of any DMA addresses from the old kernel, then disable
the device. This significantly speeds up kexec boot, particularly
in configurations with multiple ipr adapters.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Daniel Kreling <kreling@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoscsi: storvsc: Set the tablesize based on the information given by the host
K. Y. Srinivasan [Fri, 27 Mar 2015 07:27:20 +0000 (00:27 -0700)]
scsi: storvsc: Set the tablesize based on the information given by the host

Set the tablesize based on the information given by the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Tested-by: Long Li <longli@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoscsi: storvsc: Don't assume that the scatterlist is not chained
K. Y. Srinivasan [Fri, 27 Mar 2015 07:27:19 +0000 (00:27 -0700)]
scsi: storvsc: Don't assume that the scatterlist is not chained

The current code assumes that the scatterlists presented are not chained.
Fix the code to not make this assumption.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoscsi: storvsc: Fix a bug in copy_from_bounce_buffer()
K. Y. Srinivasan [Fri, 27 Mar 2015 07:27:18 +0000 (00:27 -0700)]
scsi: storvsc: Fix a bug in copy_from_bounce_buffer()

We may exit this function without properly freeing up the maapings
we may have acquired. Fix the bug.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoscsi: storvsc: Retrieve information about the capability of the target
K. Y. Srinivasan [Fri, 27 Mar 2015 07:27:17 +0000 (00:27 -0700)]
scsi: storvsc: Retrieve information about the capability of the target

The storage protocol informs the guest of the I/O capabilities of the storage
stack. Retrieve this information and use it in the guest.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoscsi: storvsc: Always send on the selected outgoing channel
K. Y. Srinivasan [Fri, 27 Mar 2015 07:27:16 +0000 (00:27 -0700)]
scsi: storvsc: Always send on the selected outgoing channel

The current code always sent packets without data on the primary channel.
Properly distribute sending of packets with no data amongst all available
channels. I would like to thank Long Li for noticing this problem.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoscsi: storvsc: Size the queue depth based on the ringbuffer size
K. Y. Srinivasan [Fri, 27 Mar 2015 07:27:15 +0000 (00:27 -0700)]
scsi: storvsc: Size the queue depth based on the ringbuffer size

Size the queue depth based on the ringbuffer size. Also accommodate for the
fact that we could have multiple channels (ringbuffers) per adaptor.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoscsi: storvsc: Increase the ring buffer size
K. Y. Srinivasan [Fri, 27 Mar 2015 07:27:14 +0000 (00:27 -0700)]
scsi: storvsc: Increase the ring buffer size

Increase the default ring buffer size as this can significantly
improve performance especially on high latency storage back-ends.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
9 years agoaic7xxx: replace kmalloc/memset by kzalloc
Michael Opdenacker [Fri, 27 Mar 2015 00:51:46 +0000 (17:51 -0700)]
aic7xxx: replace kmalloc/memset by kzalloc

This replaces kmalloc + memset by a call to kzalloc

This also fixes one checkpatch.pl issue in the process.

This improvement was suggested by "make coccicheck"

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9 years agoscsi: proper state checking and module refcount handling in scsi_device_get
Christoph Hellwig [Mon, 2 Feb 2015 13:01:26 +0000 (14:01 +0100)]
scsi: proper state checking and module refcount handling in scsi_device_get

This effectively reverts commits 85b6c7 ("[SCSI] sd: fix cache flushing on
module removal (and individual device removal)" and dc4515ea ("scsi: always
increment reference count").

We now never call scsi_device_get from the shutdown path, and the fact
that we started grabbing reference there in commit 85b6c7 turned out
turned out to create more problems than it solves, and required
workarounds for workarounds for workarounds. Move back to properly checking
the device state and carefully handle module refcounting.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9 years agosd: don't grab a device references from driver methods
Christoph Hellwig [Mon, 2 Feb 2015 13:01:25 +0000 (14:01 +0100)]
sd: don't grab a device references from driver methods

The device model already takes care of races between ->remove and
->shutdown vs its other methods, and we now take care about locking
them out for ->rescan as well.

This is a partial revert of commit 39b7f1 ("[SCSI] sd: Fix refcounting").

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9 years agoscsi: serialize ->rescan against ->remove
Christoph Hellwig [Mon, 2 Feb 2015 13:01:24 +0000 (14:01 +0100)]
scsi: serialize ->rescan against ->remove

Lock the device embedded in the scsi_device to protect against
concurrent calls to ->remove.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9 years agoncr5380: Harmonize jiffies conversion with msecs_to_jiffies
Nicholas Mc Guire [Wed, 4 Feb 2015 18:30:20 +0000 (13:30 -0500)]
ncr5380: Harmonize jiffies conversion with msecs_to_jiffies

Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var).
In addition some timing constants that assumed HZ 100 were adjusted
to HZ independent settings based on review comments from Michael Schmitz
<schmitzmic@gmail.com> and review of the original drivers in 1.0.31 and
2.2.16.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9 years agog_NCR5380: Kill compiler warning if builtin
Geert Uytterhoeven [Sat, 3 Jan 2015 22:00:16 +0000 (23:00 +0100)]
g_NCR5380: Kill compiler warning if builtin

If CONFIG_SCSI_GENERIC_NCR5380=y:

drivers/scsi/g_NCR5380.c:727: warning: 'id_table' defined but not used

In the non-modular case, MODULE_DEVICE_TABLE() expands to nothing, and
id_table is not referenced.

Correct the existing #ifdef to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9 years agoncr5380: Drop owner assignment from platform_drivers
Wolfram Sang [Thu, 29 Jan 2015 06:54:46 +0000 (17:54 +1100)]
ncr5380: Drop owner assignment from platform_drivers

This platform_driver does not need to set an owner, it will be populated by
the driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9 years agoLinux 4.0-rc2
Linus Torvalds [Tue, 3 Mar 2015 17:04:59 +0000 (09:04 -0800)]
Linux 4.0-rc2

9 years agodrm/i915: Fix modeset state confusion in the load detect code
Daniel Vetter [Tue, 3 Mar 2015 16:31:21 +0000 (17:31 +0100)]
drm/i915: Fix modeset state confusion in the load detect code

This is a tricky story of the new atomic state handling and the legacy
code fighting over each another. The bug at hand is an underrun of the
framebuffer reference with subsequent hilarity caused by the load
detect code. Which is peculiar since the the exact same code works
fine as the implementation of the legacy setcrtc ioctl.

Let's look at the ingredients:

- Currently our code is a crazy mix of legacy modeset interfaces to
  set the parameters and half-baked atomic state tracking underneath.
  While this transition is going we're using the transitional plane
  helpers to update the atomic side (drm_plane_helper_disable/update
  and friends), i.e. plane->state->fb. Since the state structure owns
  the fb those functions take care of that themselves.

  The legacy state (specifically crtc->primary->fb) is still managed
  by the old code (and mostly by the drm core), with the fb reference
  counting done by callers (core drm for the ioctl or the i915 load
  detect code). The relevant commit is

  commit ea2c67bb4affa84080c616920f3899f123786e56
  Author: Matt Roper <matthew.d.roper@intel.com>
  Date:   Tue Dec 23 10:41:52 2014 -0800

      drm/i915: Move to atomic plane helpers (v9)

- drm_plane_helper_disable has special code to handle multiple calls
  in a row - it checks plane->crtc == NULL and bails out. This is to
  match the proper atomic implementation which needs the crtc to get
  at the implied locking context atomic updates always need. See

  commit acf24a395c5a9290189b080383564437101d411c
  Author: Daniel Vetter <daniel.vetter@ffwll.ch>
  Date:   Tue Jul 29 15:33:05 2014 +0200

      drm/plane-helper: transitional atomic plane helpers

- The universal plane code split out the implicit primary plane from
  the CRTC into it's own full-blown drm_plane object. As part of that
  the setcrtc ioctl (which updated both the crtc mode and primary
  plane) learned to set crtc->primary->crtc on modeset to make sure
  the plane->crtc assignments statate up to date in

  commit e13161af80c185ecd8dc4641d0f5df58f9e3e0af
  Author: Matt Roper <matthew.d.roper@intel.com>
  Date:   Tue Apr 1 15:22:38 2014 -0700

      drm: Add drm_crtc_init_with_planes() (v2)

  Unfortunately we've forgotten to update the load detect code. Which
  wasn't a problem since the load detect modeset is temporary and
  always undone before we drop the locks.

- Finally there is a organically grown history (i.e. don't ask) around
  who sets the legacy plane->fb for the various driver entry points.
  Originally updating that was the drivers duty, but for almost all
  places we've moved that (plus updating the refcounts) into the core.
  Again the exception is the load detect code.

Taking all together the following happens:
- The load detect code doesn't set crtc->primary->crtc. This is only
  really an issue on crtcs never before used or when userspace
  explicitly disabled the primary plane.

- The plane helper glue code short-circuits because of that and leaves
  a non-NULL fb behind in plane->state->fb and plane->fb. The state
  fb isn't a real problem (it's properly refcounted on its own), it's
  just the canary.

- Load detect code drops the reference for that fb, but doesn't set
  plane->fb = NULL. This is ok since it's still living in that old
  world where drivers had to clear the pointer but the core/callers
  handled the refcounting.

- On the next modeset the drm core notices plane->fb and takes care of
  refcounting it properly by doing another unref. This drops the
  refcount to zero, leaving state->plane now pointing at freed memory.

- intel_plane_duplicate_state still assume it owns a reference to that
  very state->fb and bad things start to happen.

Fix this all by applying the same duct-tape as for the legacy setcrtc
ioctl code and set crtc->primary->crtc properly.

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Paulo Zanoni <przanoni@gmail.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Matt Roper <matthew.d.roper@intel.com>
Reported-and-tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge tag 'gpio-v4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux...
Linus Torvalds [Mon, 2 Mar 2015 22:13:39 +0000 (14:13 -0800)]
Merge tag 'gpio-v4.0-2' of git://git./linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "Two GPIO fixes:

   - Fix a translation problem in of_get_named_gpiod_flags()

   - Fix a long standing container_of() mistake in the TPS65912 driver"

* tag 'gpio-v4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: tps65912: fix wrong container_of arguments
  gpiolib: of: allow of_gpiochip_find_and_xlate to find more than one chip per node

9 years agoMerge branch 'fixes-for-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 2 Mar 2015 22:08:10 +0000 (14:08 -0800)]
Merge branch 'fixes-for-4.0-rc2' of git://git./linux/kernel/git/evalenti/linux-soc-thermal

Pull thermal management fixes from Eduardo Valentin:
 "Specifics:

   - Several fixes in tmon tool.

   - Fixes in intel int340x for _ART and _TRT tables.

   - Add id for Avoton SoC into powerclamp driver.

   - Fixes in RCAR thermal driver to remove race conditions and fix fail
     path

   - Fixes in TI thermal driver: removal of unnecessary code and build
     fix if !CONFIG_PM_SLEEP

   - Cleanups in exynos thermal driver

   - Add stubs for include/linux/thermal.h.  Now drivers using thermal
     calls but that also work without CONFIG_THERMAL will be able to
     compile for systems that don't care about thermal.

  Note: I am sending this pull on Rui's behalf while he fixes issues in
  his Linux box"

* 'fixes-for-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal:
  thermal: int340x_thermal: Ignore missing _ART, _TRT tables
  thermal/intel_powerclamp: add id for Avoton SoC
  tools/thermal: tmon: silence 'set but not used' warnings
  tools/thermal: tmon: use pkg-config to determine library dependencies
  tools/thermal: tmon: support cross-compiling
  tools/thermal: tmon: add .gitignore
  tools/thermal: tmon: fixup tui windowing calculations
  tools/thermal: tmon: tui: don't hard-code dialog window size assumptions
  tools/thermal: tmon: add min/max macros
  tools/thermal: tmon: add --target-temp parameter
  thermal: exynos: Clean-up code to use oneline entry for exynos compatible table
  thermal: rcar: Make error and remove paths symmetrical with init
  thermal: rcar: Fix race condition between init and interrupt
  thermal: Introduce dummy functions when thermal is not defined
  ti-soc-thermal: Delete an unnecessary check before the function call "cpufreq_cooling_unregister"
  thermal: ti-soc-thermal: bandgap: Fix build warning if !CONFIG_PM_SLEEP

9 years agoMerge tag 'md/4.0-fixes' of git://neil.brown.name/md
Linus Torvalds [Mon, 2 Mar 2015 22:03:27 +0000 (14:03 -0800)]
Merge tag 'md/4.0-fixes' of git://neil.brown.name/md

Pull md fixes from Neil Brown:
 "Three md fixes:

   - fix a read-balance problem that was reported 2 years ago, but that
     I never noticed the report :-(

   - fix for rare RAID6 problem causing incorrect bitmap updates when
     two devices fail.

   - add __ATTR_PREALLOC annotation now that it is possible"

* tag 'md/4.0-fixes' of git://neil.brown.name/md:
  md: mark some attributes as pre-alloc
  raid5: check faulty flag for array status during recovery.
  md/raid1: fix read balance when a drive is write-mostly.