History log of /drivers/scsi/ipr.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b2024459252a9d2d312ee562f86f332a1498f412 22-Mar-2012 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas, libata: fix start of life for a sas ata_port

This changes the ordering of initialization and probing events from:
1/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
2/ allocate ata_port and schedule port probe in DISCE_PROBE
...to:
1/ allocate ata_port in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
2/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
3/ schedule port probe in DISCE_PROBE

This ordering prevents PHYE_SIGNAL_LOSS_EVENTS from sneaking in to
destrory ata devices before they have been fully initialized:

BUG: unable to handle kernel paging request at 0000000000003b10
IP: [<ffffffffa0053d7e>] sas_ata_end_eh+0x12/0x5e [libsas]
...
[<ffffffffa004d1af>] sas_unregister_common_dev+0x78/0xc9 [libsas]
[<ffffffffa004d4d4>] sas_unregister_dev+0x4f/0xad [libsas]
[<ffffffffa004d5b1>] sas_unregister_domain_devices+0x7f/0xbf [libsas]
[<ffffffffa004c487>] sas_deform_port+0x61/0x1b8 [libsas]
[<ffffffffa004bed0>] sas_phye_loss_of_signal+0x29/0x2b [libsas]

...and kills the awkward "sata domain_device briefly existing in the
domain without an ata_port" state.

Reported-by: Michal Kosciowski <michal.kosciowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
1bfff2f8696ea13fc3d55a977f50abbddee336b2 15-Mar-2012 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Increase alignment boundary of command blocks

The latest generation of ipr hardware performs best when command blocks
are aligned to a boundary equal to the size of the command block. Ensure
512 byte alignment, since this is the largest size command block we
can send.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
89aad428317322044673cd9a3e1685a83abcba98 15-Mar-2012 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Increase max concurrent oustanding commands

Increase the total number of max concurrent outstanding commands
for the most recent family of adapters in order to improve overall
adapter performance.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
a5fb407eed819e950e369060a822640582a1e538 15-Mar-2012 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Remove unnecessary memory barriers

The ipr driver added some memory barriers in order to ensure
a PowerPC sync instruction was executed prior to sending a
command to the adapter to ensure the command block was
coherent with respect to the PCI bus's view of memory.
However, some time ago, the powerpc architecture writel
macros were changed to include the sync since most drivers
don't properly handle this. So remove these memory barriers
since they are not needed and result in executing twice
as many sync instructions, which has a significant performance
penalty.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
7dd21308b17e2b657d167adc7e20b41b7c6bbe5c 15-Mar-2012 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Remove unnecessary interrupt clearing on new adapters

The latest ipr hardware no longer requires the driver to issue any MMIOs
to clear the interrupt so remove this to optimize performance.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
0ee1d714c285aabaadf7495bf5820114ad0959b1 15-Mar-2012 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Fix target id allocation re-use problem

For the latest ipr SAS adapters, target id's are a completely
logical construct that are managed in the ipr driver. This fixes
an issue that can arise if a device is deleted via sysfs. If
a new device is then physically added, it will use the previous
device's target id. If the host is then rescanned, the device
that had been deleted, since it is using the same target id as
the new device is using, will never be found, resulting in
a missing device. Fix this by only freeing the target id
only if the resource is actually gone.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
cd9b3d04b4cae6bdfd639e603649777f819ed783 23-Feb-2012 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: update PCI ID definitions for new adapters

This patch updates some PCI ID definitions for new adapters based on the next
generation 64 bit IOA PCI interface chip.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
a92fa25c63a788758bd52e9123504d133210c8b7 16-Jan-2012 Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> [SCSI] ipr: fix eeh recovery for 64-bit adapters

In some scenarios, an EEH error can take a long time to be detected, since the
driver issues an MMIO read only after a device reset command times out and we
try to reset the adapter. This patch adds some code in ipr_cancel_op() to read
a hardware register so we detect the error earlier in case the op is being
aborted because of a timeout caused by a frozen adapter slot.

Another problem in such scenarios is that in __ipr_eh_host_reset() we change the
dump state flag from WAIT_FOR_DUMP to GET_DUMP, and the flag is later changed
from GET_DUMP to READ_DUMP in ipr_reset_restore_cfg_space(). However, if when
__ipr_eh_host_reset() is called by the SCSI error handling the function
ipr_reset_restore_cfg_space() has already been called by the PCI EEH code, we
end up with the flag in an inconsistent state. This patch also prevents this
problem.

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
fb51ccbf217c1c994607b6519c7d85250928553d 04-Nov-2011 Jan Kiszka <jan.kiszka@siemens.com> PCI: Rework config space blocking services

pci_block_user_cfg_access was designed for the use case that a single
context, the IPR driver, temporarily delays user space accesses to the
config space via sysfs. This assumption became invalid by the time
pci_dev_reset was added as locking instance. Today, if you run two loops
in parallel that reset the same device via sysfs, you end up with a
kernel BUG as pci_block_user_cfg_access detect the broken assumption.

This reworks the pci_block_user_cfg_access to a sleeping service
pci_cfg_access_lock and an atomic-compatible variant called
pci_cfg_access_trylock. The former not only blocks user space access as
before but also waits if access was already locked. The latter service
just returns false in this case, allowing the caller to resolve the
conflict instead of raising a BUG.

Adaptions of the ipr driver were originally written by Brian King.

Acked-by: Brian King <brking@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
/drivers/scsi/ipr.c
5a918353ec97bbce2af83a950eb38e2781bfe9e7 27-Oct-2011 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add definitions for additional adapter

Add the appropriate definition and table entry for an additional adapter.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
4c647e909fceb9df8ec8f06016dd56244045a929 15-Oct-2011 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Fix BUG on adapter dump timeout

If an adapter dump times out, the ipr driver will abort the
dump and proceed to reset and recover the adapter. When an
adapter dump completes, the work thread which is reading the
adapter dump will initiate an adapter reset to recover the
adapter. However, when the adapter dump gets aborted, the
work thread should not initiate an adapter reset, since an
adapter reset is already in progress. This fixes a case of
calling pci_block_user_cfg_access overlapped, which results
in a BUG.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
14ed9cc7e7b9a95d56c2bf91cab2f010968d6e73 04-Oct-2011 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: Add support to flash FPGA and flash back DRAM images

The write buffer command is used to download and burn new IOA FW images.
The same interface can now be used to flash FPGA and flash back DRAM images.
To download and flash the new images takes more than 15 minutes, so increase
the write buffer command timeout to 30 minutes.

The FPGA and flash back DRAM images don't have the same card_type as the IOA FW
image. So, remove the sanity checking from the driver. The adapter has sanity
checking and will only accept a valid image.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
41e9a69641fb3fa86fa9277a179f3ad261d072f7 21-Sep-2011 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Stop reading adapter dump prematurely

When the ipr driver decides to dump the adapter, it changes the
sdt_state to GET_DUMP, then prepares the adapter so that the dump
can be read. However, if the ipr worker thread wakes up for some
reason before the driver has put the adapter in a state where it
can succesfully dump the adapter, the driver will start dumping
the adapter too early, which can potentially trigger a BUG check
in the pci config blocking API. Fix this by adding a new
sdt_state to differentiate between the ipr driver wanting to dump
the adapter in the near future and wanting to dump the adapter now.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
5d7c20b7fa5c6ca19e871b4050e321c99d32bd43 01-Aug-2011 Anton Blanchard <anton@samba.org> [SCSI] ipr: Always initiate hard reset in kdump kernel

During kdump testing I noticed timeouts when initialising each IPR
adapter. While the driver has logic to detect an adapter in an
indeterminate state, it wasn't triggering and each adapter went
through a 5 minute timeout before finally going operational.

Some analysis showed the needs_hard_reset flag wasn't getting set.
We can check the reset_devices kernel parameter which is set by
kdump and force a full reset. This fixes the problem.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
f170c684b55cb8d3bab55b1fb8fa812778d551f2 11-Jul-2011 Julia Lawall <julia@diku.dk> [SCSI] ipr: reorder error handling code to include iounmap

The out_msi_disable label should be before cleanup_nomem to additionally
benefit from the call to iounmap. Subsequent gotos are adjusted to go to
out_msi_disable instead of cleanup_nomem, which now follows it. This is
safe because pci_disable_msi does nothing if pci_enable_msi was not called.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression e1,e2;
statement S;
@@

e1 = pci_ioremap_bar(...);
... when != e1 = e2
when != iounmap(e1)
when any
(
if (<+...e1...+>) S
|
if(...) { ... return 0; }
|
if (...) { ... when != iounmap(e1)
when != if (...) { ... iounmap(e1) ... }
* return ...;
} else S
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/ipr.c
a5442ba4a428081ebac7090f46c62ffaa17ca951 17-May-2011 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix possible false positive detection of stuck interrupt

If the driver is getting flooded with interrupts, there's a possibility
that the interrupt service routine could falsely detect a stuck interrupt
condition and reset the adapter.

This patch changes the logic such that the routine will loop back into
the command processing code one more time after detecting the stuck
interrupt signature. If there are no commands to process after that pass,
and the interrupt is still not cleared, then the driver will print the
"Error clearing HRRQ" message and reset the adapter.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
/drivers/scsi/ipr.c
51f52a47527a07e45746b1bac1ab6123892095a0 09-May-2011 Anton Blanchard <anton@samba.org> [SCSI] ipr: Rate limit DMA mapping errors

I noticed a stream of errors from the IPR driver while doing
IOMMU fault injection. Rate limit the errors so we don't clog
up the console and logfiles.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
4d4dd7065572225bf6d97e5eb9915d94f9d53548 27-Apr-2011 Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> [SCSI] ipr: increase the dump size for 64 bit adapters

Currently the size of the dump generated by the driver is limited
in 4MB, which is insufficient to gather much useful data from the
new 64 bit adapters.

This patch makes the needed changes to increase the dump limit
for the 64 bit adapters to 32MB, or even to a bigger value in the
future, but keeping the current limitations for the legacy 32 bit
adapters.

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
7dacb64f49848f1f28018fd3e58af8d6ba234960 12-Apr-2011 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: improve interrupt service routine performance

During performance testing on P7 machines it was observed that the interrupt
service routine was doing unnecessary MMIO operations.

This patch rearranges the logic of the routine and moves some of the code out
of the main routine. The result is that there are now fewer MMIO operations in
the performance path of the code.

As a result of the above change, an existing condition was exposed where the
driver could get an "unexpected" hrrq interrupt. The original code would flag
the interrupt as unexpected and then reset the adapter. After further analysis
it was confirmed that this condition can occasionally occur and that the
interrupt can safely be ignored. Additional code in this patch detects this
condition, clears the interrupt and allows the driver to continue without
resetting the adapter.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
630ad8317feed51c55fa5c1c701e67430923aad8 07-Apr-2011 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: remove unneeded volatile declarations

This patch removes three volatile declarations based on some feedback and code
analysis.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
ab6c10b136d5f8eb856a0f17247edc7c19805e1b 31-Mar-2011 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix synchronous request flags for better performance

In testing it was noticed that Extended Delay after Reset flag was being set
for gscsi and volume set devices. This had a negative effect on performance
for volume sets. The fix is to only set the flag for gscsi devices.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
c55d267de274d308927b60c3e740c1a826832317 18-Mar-2011 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (170 commits)
[SCSI] scsi_dh_rdac: Add MD36xxf into device list
[SCSI] scsi_debug: add consecutive medium errors
[SCSI] libsas: fix ata list corruption issue
[SCSI] hpsa: export resettable host attribute
[SCSI] hpsa: move device attributes to avoid forward declarations
[SCSI] scsi_debug: Logical Block Provisioning (SBC3r26)
[SCSI] sd: Logical Block Provisioning update
[SCSI] Include protection operation in SCSI command trace
[SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try)
[SCSI] target: Fix volume size misreporting for volumes > 2TB
[SCSI] bnx2fc: Broadcom FCoE offload driver
[SCSI] fcoe: fix broken fcoe interface reset
[SCSI] fcoe: precedence bug in fcoe_filter_frames()
[SCSI] libfcoe: Remove stale fcoe-netdev entries
[SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h
[SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument
[SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs
[SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out"
[SCSI] libfc: Fixing a memory leak when destroying an interface
[SCSI] megaraid_sas: Version and Changelog update
...

Fix up trivial conflicts due to whitespace differences in
drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}
9cbe056f6c467e7395d5aec39aceec47812eb98e 04-Feb-2011 Sergei Shtylyov <sshtylyov@ru.mvista.com> libata: remove ATA_FLAG_NO_LEGACY

All checks of ATA_FLAG_NO_LEGACY have been removed by the commits
c791c30670ea61f19eec390124128bf278e854fe ([libata] minor PCI IDE probe
fixes and cleanups) and f0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (libata:
update libata core layer to use devres), so I think it's time to finally
get rid of this flag...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
3696df309971b3427cb9cb039138a1732a865a0b 04-Feb-2011 Sergei Shtylyov <sshtylyov@ru.mvista.com> libata: remove ATA_FLAG_MMIO

Commit 0d5ff566779f894ca9937231a181eb31e4adff0e (libata: convert to iomap)
removed all checks of ATA_FLAG_MMIO but neglected to remove the flag itself.
Do it now, at last...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
c10f97b9d8df818e51e6073be1b96454630595c1 04-Feb-2011 Sergei Shtylyov <sshtylyov@ru.mvista.com> libata: remove ATA_FLAG_{SRST|SATA_RESET}

These flags are marked as obsolete and the checks for them have been removed
by commit 294440887b32c58d220fb54b73b7a58079b78f20 (libata-sff: kill unused
ata_bus_reset()), so I think it's time to finally get rid of them...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
0f2e0330a85d351b0300583da1e335690c86bdd7 21-Jan-2011 Sergei Shtylyov <sshtylyov@ru.mvista.com> ipr/sas_ata: use mode mask macros from <linux/ata.h>

Commit 14bdef982caeda19afe34010482867c18217c641 ([libata] convert drivers to
use ata.h mode mask defines) didn't convert these two libata driver outside
drivers/ata/...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
5767a1c498931417e69e663ddd5e110cbaabec32 14-Feb-2011 Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> [SCSI] ipr: Fix a race on multiple configuration changes

In a multiple configuration change scenario a remove notification can be
followed by an immediate add notification for the same device, which
will cause the device to be removed but never added back. This patch
fixes the problem by ensuring that in such situations the device will be
added back.

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
a684b8da35a429a246ec2a91e2742bdff5209709 24-Jan-2011 Tejun Heo <tj@kernel.org> [SCSI] remove flush_scheduled_work() usages

Simple conversions to drop flush_scheduled_work() usages in
drivers/scsi. More involved ones will be done in separate patches.

* NCR5380, megaraid_sas: cancel_delayed_work() +
flush_scheduled_work() -> cancel_delayed_work_sync().

* mpt2sas_scsih: drop unnecessary flush_scheduled_work().

* arcmsr_hba, ipr, pmcraid: flush the used work explicitly instead of
using flush_scheduled_work().

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
d73b388459b1ee2e80f8ff9c1916d75640d7d920 14-Jan-2011 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6

* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
PCI/PM: Report wakeup events before resuming devices
PCI/PM: Use pm_wakeup_event() directly for reporting wakeup events
PCI: sysfs: Update ROM to include default owner write access
x86/PCI: make Broadcom CNB20LE driver EMBEDDED and EXPERIMENTAL
x86/PCI: don't use native Broadcom CNB20LE driver when ACPI is available
PCI/ACPI: Request _OSC control once for each root bridge (v3)
PCI: enable pci=bfsort by default on future Dell systems
PCI/PCIe: Clear Root PME Status bits early during system resume
PCI: pci-stub: ignore zero-length id parameters
x86/PCI: irq and pci_ids patch for Intel Patsburg
PCI: Skip id checking if no id is passed
PCI: fix __pci_device_probe kernel-doc warning
PCI: make pci_restore_state return void
PCI: Disable ASPM if BIOS asks us to
PCI: Add mask bit definition for MSI-X table
PCI: MSI: Move MSI-X entry definition to pci_regs.h

Fix up trivial conflicts in drivers/net/{skge.c,sky2.c} that had in the
meantime been converted to not use legacy PCI power management, and thus
no longer use pci_restore_state() at all (and that caused trivial
conflicts with the "make pci_restore_state return void" patch)
1542dec1c9109fdcd1c53460f064096f24fc49d2 10-Jan-2011 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
pata_platform: Remove CONFIG_HAVE_PATA_PLATFORM's dependencies.
pata_hpt37x: actually limit HPT370 to UltraDMA/66
pata_hpt3x2n: coding style cleanup
pata_hpt37x: coding style cleanup
pata_hpt366: coding style cleanup
pata_hpt3x2n: calculate average f_CNT
pata_hpt3x2n: clarify about HPT371N support
pata_hpt{37x|3x2n}: SATA mode filtering
[libata] avoid needlessly passing around ptr to SCSI completion func
[libata] new driver acard_ahci, for ATP8620 host controller
b27dcfb0670ea7352a67137f4ff7947c2a9f6892 18-Nov-2010 Jeff Garzik <jeff@garzik.org> [libata] avoid needlessly passing around ptr to SCSI completion func

It's stored in struct scsi_cmnd->scsi_done, making several 'done'
parameters to functions redundant.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
1d3c16a818e992c199844954d95c17fd7ce6cbba 01-Dec-2010 Jon Mason <jon.mason@exar.com> PCI: make pci_restore_state return void

pci_restore_state only ever returns 0, thus there is no benefit in
having it return any value. Also, a large majority of the callers do
not check the return code of pci_restore_state. Make the
pci_restore_state a void return and avoid the overhead.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
/drivers/scsi/ipr.c
110def851fc823bb1a4584cb6308e30e5ffb3e05 04-Nov-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix mailbox register definition and add a delay before reading

The definition for the mailbox register for new adapters was incorrect. The
value has been updated to the correct offset.

After an adapter reset, the mailbox register on the new adapters takes a
number of seconds to stabilize. A delay has been added before reading the
register.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
0cb992eda1f7e7672775032378690baa87c0e13d 04-Nov-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix lun assignment and comparison

The lun value was not getting set up correctly for all devices attached to the
new 64 bit adapters. The fix is to move the logic to earlier in the
ipr_init_res_entry routine such that the value does get set correctly for all
devices.

Then the ipr_is_same_device comparison function was using the wrong lun value
in the logic for the new adapters. Change this to use the correct lun value.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
f281233d3eba15fb225d21ae2e228fd4553d824a 16-Nov-2010 Jeff Garzik <jeff@garzik.org> SCSI host lock push-down

Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation. No locking or other behavior should change
with this patch. All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
struct Scsi_Host *
and remove one parameter from queuecommand,
void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change. Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/scsi/ipr.c
32622bdea031a5a6a6efd6dac9b317de46d5c6f8 19-Oct-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add definitions for a new adapter

There was an addition to the hardware roadmap that includes a new adapter.
This patch adds the new definitions for the adapter.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
7262026f0eded76b935a12b9b15af05516a8610a 27-Sep-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix array error logging

The structure definitions for reporting array errors did not have the correct
size for the Array WWID field. This patch fixes those definitions. It also
fixes part of the output formatting that did not have newlines and fixes size
calculations.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
634651fab36dc8d7c3b1a1aa14f9ec1e29de9f0f 27-Aug-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: reverse the isr optimization changes

The isr optimization patch that was submitted a few months ago
exposed problems with receiving and handling spurious HRRQ interrutps.

commit 64ffdb762241c0a9c0c8fac7ea92aa0ba1529334
Author: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Date: Wed May 19 11:56:13 2010 -0700

[SCSI] ipr: improve interrupt service routine performance

That patch is reverted with this one. A new patch will be submitted
once the issue is better understood and properly handled in the driver.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
46d7456324766cd291d7ccd5b4927cbd3c28fb1b 11-Aug-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix resource address formatting and add attribute for device ID

This patch fixes a resource address formatting problem where the first byte
was being zeroed out.

Also, the device ID is now made available as a sysfs attribute.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
75576bb9b208d7c66822f310cdef9ca2d72c879c 14-Jul-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix resource type update and add sdev and shost attributes

Setting the resource type in the ipr_update_res_entry function was incorrect in
that the top 4 bits were masked off. The assignment has been updated to no
longer mask those bits.

Then, two new attributes were added to allow the user space utilities to more
easily get information. The resource_type sdev attribute is set for all devices
in the adapter's configuration table and indicates the type of device. The
fw_type shost attribute indicates the firmware type supported by the adapter.

Finally, the resource_path attribute was changed to be mode S_IRUGO.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
1df79ca4223632113f14618833b8bb1727a8ca15 14-Jul-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix transition to operational for new adapters

The method of transitioning to operational for new adapters includes using
initialization stages. The current stage is indicated via a register read.
The final good stage in the sequence is "operational" but does not necessarily
indicate that the driver can proceed. There is another bit that gets set in the
adapter->host interrupt register when the adapter has completed enough of its
bringup such that it can accept commands. The driver was not checking that
bit before proceeding which led to intermittent errors and adapter resets.

The fix is to check the "transition to operational" bit in the interrupt
register after detecting that the initialization stage is "operational" and
only proceed if both are set.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
b0f56d3d6becfb338a41615d6ce43d41547502c3 24-Jun-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add support for new Obsidian-E embedded adapter

This patch allows the driver to recognize a new Obsidian-E based adapter that
uses a new subsystem ID.

This patch also fixes a few tab/space problems.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
cb237ef7a45f22373575b2d2ad2d06f7d38d6bce 17-Jun-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add MMIO write to perform BIST for 64 bit adapters

The 64 bit chip used in new adapters does not properly support the BIST register
in PCI config space. This patch implements an alternative MMIO write reset
method.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
56115598c571cadd4b465836e1423a452a908c89 10-Jun-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: move setting of the allow_restart flag for vsets and disks

A problem was found where the call to scsi_add_device() fails intermittently
for an adapter. This is caused when __scsi_add_device() returns -ENODEV as
a result of not calling scsi_probe_and_add_lun() since the call to
scsi_host_scan_allowed() fails. scsi_host_scan_allowed() fails because the
adapter state is set to SHOST_RECOVERY instead of SHOST_RUNNING. The state of
the adapter is being set to SHOST_RECOVERY by scsi_eh_scmd_add() during
error handling.

This problem is avoided by moving the setting of the allow_restart flag to
later in the device initialization sequence. This prevents further error
handling if we get a NOT_READY response from a TUR command by causing
scsi_check_sense() to return SUCCESS. Therefore, scsi_eh_scmd_add() will
not run and the adapter state will remain as SHOST_RUNNING.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
8701f18504751a5b89be3203e28c5ec04c147167 04-Jun-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add endian swap enablement for 64 bit adapters

A change in the hardware design of the chip for the new adapters changes the
default endianness of MMIO operations. This patch adds a register definition
which when written to with a predefined value will change the endianness
back to what the driver expects.

This patch also fixes two problems found during testing.

First, the first reserved field in the ipr_hostrcb64_fabirc_desc structure only
reserved one byte. The correct amount to reserve is 2 bytes.

Second, the reserved field of the ipr_hostrcb64_error structure only reserved
2 bytes. The correct amount to reserve is 16 bytes.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
5adcbeb34d2a031d3baca227eef23e56734006ba 04-Jun-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix resource path display and formatting

It was possible to overflow the buffer used to print out the formatted
version of the resource path. The fix is to limit the number of
bytes that get formatted.

This patch also updates the ipr_show_resource_path function to display the
resource address for devices that are attached to adapters that don't
support resource paths.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
64ffdb762241c0a9c0c8fac7ea92aa0ba1529334 19-May-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: improve interrupt service routine performance

During performance testing on P7 machines it was observed that the interrupt
service routine was doing unnecessary MMIO operations.

This patch rearranges the logic of the routine and moves some of the code out
of the main routine. The result is that there are now fewer MMIO operations in
the performance path of the code.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
b8803b1cef28af785c4e903b9b1449898d68c758 14-May-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: set the data list length in the request control block

In bring up testing for the new 64 bit adapters, the first read command failed
after loading the driver. The cause was that the command requires more than
one scatter gather element and the corresponding code to set the data list
length in the request control block was missing. This patch adds the correct
assignment.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
7be96900a2a662c67403559acd250f011b1d70db 10-May-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: fix a register read to use the correct address for 64 bit adapters

Fix ipr_reset_enable_ioa() to read the correct IOA to host interrupt register
address for 64 bit adapters. We need to read the lower 32 bits, not the upper
32 bits.

Also change the write of the 64 bit mask value to a single writeq instead
of two writel calls.

Finally, use the correct u8 type for the type field in the ipr_resource_entry
structure.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
96d21f00ab59c9f27fad191d12a2ccfeff3c9108 10-May-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: include the resource path in the IOA status area structure

The IOA status area now includes the new resource path field for 64 bit
adapters. This patch changes the driver to fix the ioasa structure and to use
the correct structure definition based on the type of adatper.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
438b03311108b05a7b794bcf3941700853c62d1e 10-May-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: implement fixes for 64 bit adapter support

Implement some small fixes for 64 bit support that were preventing
the adapter from becoming operational.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
2c3c8bea608866d8bd9dcf92657d57fdcac011c5 13-May-2010 Chris Wright <chrisw@sous-sol.org> sysfs: add struct file* to bin_attr callbacks

This allows bin_attr->read,write,mmap callbacks to check file specific data
(such as inode owner) as part of any privilege validation.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/ipr.c
3e4ec3443f70fbe144799ccf0b1c3797f78d1715 10-May-2010 Tejun Heo <tj@kernel.org> libata: kill ATA_FLAG_DISABLED

ATA_FLAG_DISABLED is only used by drivers which don't use
->error_handler framework and is largely broken. Its only meaningful
function is to make irq handlers skip processing if the flag is set,
which is largely useless and even harmful as it makes those ports more
likely to cause IRQ storms.

Kill ATA_FLAG_DISABLED and makes the callers disable attached devices
instead. ata_port_probe() and ata_port_disable() which manipulate the
flag are also killed.

This simplifies condition check in IRQ handlers. While updating IRQ
handlers, remove ap NULL check as libata guarantees consecutive port
allocation (unoccupied ports are initialized with dummies) and
long-obsolete ATA_QCFLAG_ACTIVE check (checked by ata_qc_from_tag()).

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
/drivers/scsi/ipr.c
d7b4627f5f3390a2f350f16c047b3fc3eccce6d8 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: adds PCI ID definitions for new adapters

This patch adds the PCI ID definitions for new adapters based on the next
generation 64 bit IOA PCI interface chip. New entries have been added to the
ipr_pci_table[] array for the adapters and to the ipr_chip[] array for the new
versions of the chip.

Older entries have been removed for cards that did not ship.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
5aa3a333eaae1016f5a72f9e0e2dce39c08762f8 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add support for new IOASCs

This patch adds support for new errors that can be received from adapters
using the next generation 64 bit IOA PCI interface chip.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
214777ba125e2902c9b84c764be38099c94d0bd2 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add support for multiple stages of initialization

This patch adds support for using the new IOA initialization feedback register.
It also enables 64 bit support in the ipr_ioafp_identify_hrrq and
ipr_mask_and_clear_interrupts routines.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
f72919ec2bbbe1c42cdda7857a96c0c40e1d78aa 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: implement shutdown changes and remove obsolete write cache parameter

This patch adds a reboot notifier that will issue a shutdown prepare command
to all adapters. This helps to prevent a problem where the primary adapter can
get shut down before the secondary adapter and cause the secondary adapter to
fail over and log and error.
This patch also removes the "enable_cache" paramater as it is obsolete. Write
cache for an adapter is now controlled from the iprconfig utility.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
dcbad00e6b403089b1846e788bc1a0c67b2bfd2d 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add hardware assisted smart dump functionality

This patch adds the hardware assisted smart dump functionality for the next
generation IOA PCI interface chip.

Signea-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
4565e3706329f65b5e64328b5369c53b6ab2715c 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add error handling updates for the next generation chip

Add support for the new log data notification and overlay IDs.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
3e7ebdfa58ddaef361f9538219e66a7226fb1e5d 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: update the configuration table code for the next generation chip

This patch changes the configuration table structures and related code such
that both 32 bit and 64 bit based adapters can work with the driver.

This patch also implements the code to generate the virtual bus/id/lun values
for devices connected to the new adapters. It also implements support for the
new device resource path.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
a74c16390a47dcb6c96b20b572ffc9936073d4b1 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: define new offsets to registers for the next generation chip

This patch adds the entry to the ipr_chip_cfg array that defines the register
offsets for the next generation 64 bit IOA PCI interface chip.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
a32c055feed74246747bf4f45adb765136d3a4d3 19-Feb-2010 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add support for new adapter command structures for the next generation chip

Change the adapter command structures such that both 32 bit and 64 bit based
adapters can work with the driver.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
086fa5ff0854c676ec333760f4c0154b3b242616 26-Feb-2010 Martin K. Petersen <martin.petersen@oracle.com> block: Rename blk_queue_max_sectors to blk_queue_max_hw_sectors

The block layer calling convention is blk_queue_<limit name>.
blk_queue_max_sectors predates this practice, leading to some confusion.
Rename the function to appropriately reflect that its intended use is to
set max_hw_sectors.

Also introduce a temporary wrapper for backwards compability. This can
be removed after the merge window is closed.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
/drivers/scsi/ipr.c
fc6f0700d5cd54b5f8b30c4f0d93b06a6ba04b81 18-Dec-2009 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (40 commits)
[SCSI] 3w-9xxx fix bug in sgl loading
[SCSI] fcoe, libfc: adds enable/disable for fcoe interface
[SCSI] libfc: reduce hold time on SCSI host lock
[SCSI] libfc: remote port gets stuck in restart state without really restarting
[SCSI] pm8001: misc code cleanup
[SCSI] pm8001: enable read HBA SAS address from VPD
[SCSI] pm8001: do not reset local sata as it will not be found if reset
[SCSI] pm8001: bit set pm8001_ha->flags
[SCSI] pm8001:fix potential NULL pointer dereference
[SCSI] pm8001: set SSC down-spreading only to get less errors on some 6G device.
[SCSI] pm8001: fix endian issues with SAS address
[SCSI] pm8001: enhance error handle for IO patch
[SCSI] pm8001: Fix for sata io circular lock dependency.
[SCSI] hpsa: add driver for HP Smart Array controllers.
[SCSI] cxgb3i: always use negative errno in case of error
[SCSI] bnx2i: minor code cleanup and update driver version
[SCSI] bnx2i: Task management ABORT TASK fixes
[SCSI] bnx2i: update CQ arming algorith for 5771x chipsets
[SCSI] bnx2i: Adjust sq_size module parametr to power of 2 only if a non-zero value is specified
[SCSI] bnx2i: Add 5771E device support to bnx2i driver
...
ca54cb8c9eb38095dc420b73c6380ce1dbeb10fa 15-Dec-2009 KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Subject: Re: [PATCH] strstrip incorrectly marked __must_check

Recently, We marked strstrip() as must_check. because it was frequently
misused and it should be checked. However, we found one exception.
scsi/ipr.c intentionally ignore return value of strstrip. Because it
wishes to keep the whitespace at the beginning.

Thus we need to keep with and without checked whitespace trim function.
This patch adds a new strim() and changes ipr.c to use it.

[akpm@linux-foundation.org: coding-style fixes]
Suggested-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/scsi/ipr.c
99c965dd9ee1a004efc083c3d760ba982bb76adf 25-Nov-2009 Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> [SCSI] ipr: fix EEH recovery

After commits c82f63e411f1b58427c103bd95af2863b1c96dd1 (PCI: check saved
state before restore) and 4b77b0a2ba27d64f58f16d8d4d48d8319dda36ff (PCI:
Clear saved_state after the state has been restored) PCI drivers are
prevented from restoring the device standard configuration registers
twice in a row. These changes introduced a regression on ipr EEH
recovery.

The ipr device driver saves the PCI state only during the device probe
and restores it on ipr_reset_restore_cfg_space() during IOA resets. This
behavior is causing the EEH recovery to fail after the second error
detected, since the registers are not being restored.

One possible solution would be saving the registers after restoring
them. The problem with this approach is that while recovering from an
EEH error if pci_save_state() results in an EEH error, the adapter/slot
will be reset, and end up back in ipr_reset_restore_cfg_space(), but it
won't have a valid saved state to restore, so pci_restore_state() will
fail.

The following patch introduces a workaround for this problem, hacking
around the PCI API by setting pdev->state_saved = true before we do the
restore. It fixes the EEH regression and prevents that we hit another
EEH error during EEH recovery.


[jejb: fix is a hack ... Jesse and Rafael will fix properly]
Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
382f51fe2f2276344d8a21447656778cdf6583b6 10-Dec-2009 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits)
[SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP
[SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class
[SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED
[SCSI] zfcp: Update FSF error reporting
[SCSI] zfcp: Improve ELS ADISC handling
[SCSI] zfcp: Simplify handling of ct and els requests
[SCSI] zfcp: Remove ZFCP_DID_MASK
[SCSI] zfcp: Move WKA port to zfcp FC code
[SCSI] zfcp: Use common code definitions for FC CT structs
[SCSI] zfcp: Use common code definitions for FC ELS structs
[SCSI] zfcp: Update FCP protocol related code
[SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport
[SCSI] zfcp: Assign scheduled work to driver queue
[SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore
[SCSI] zfcp: Implement module unloading
[SCSI] zfcp: Merge trace code for fsf requests in one function
[SCSI] zfcp: Access ports and units with container_of in sysfs code
[SCSI] zfcp: Remove suspend callback
[SCSI] zfcp: Remove global config_mutex
[SCSI] zfcp: Replace local reference counting with common kref
...
e881a172dac4d9ea3b2a1540041d872963c269bd 16-Oct-2009 Mike Christie <michaelc@cs.wisc.edu> [SCSI] modify change_queue_depth to take in reason why it is being called

This patch modifies scsi_host_template->change_queue_depth so that
it takes an argument indicating why it is being called. This will be
used so that if a LLD needs to do some extra processing when
handling queue fulls or later ramp ups, it can do so.

This is a simple port of the drivers setting a change_queue_depth
callback. In the patch I just have these LLDs adjust the queue depth
if the user was requesting it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>

[Vasu.Dev: v2
Also converted pmcraid_change_queue_depth and then verified
all modules compile using "make allmodconfig" for any new build
warnings on X86_64.

Updated original description after combing two original
patches from Mike to make this patch git bisectable.]
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
[jejb: fixed up 53c700]
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
3feeb89d40cc0ab3777f12571509b23da466105c 20-Oct-2009 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add workaround for MSI interrupts on P7

This patch adds some additional logic to the interrupt service routine to fix
a potential problem where an MSI interrupt does not get cleared the first time.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/ipr.c
1be7bd82bf4c5d9d3efd1de0e2ebe2c5b1db8340 17-Jun-2009 Wayne Boyer <wayneb@linux.vnet.ibm.com> ipr: differentiate pci-x and pci-e based adapters

MSI has only been tested on and known to work with PCI-E based adapters. This
patch adds a field to struct ipr_chip_t to indicate which type of interrupt to
use based on what is known about the chip.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
95fecd90397ec1f85eb31ede955d846a86d2077b 17-Jun-2009 Wayne Boyer <wayneb@linux.vnet.ibm.com> ipr: add test for MSI interrupt support

The return value from pci_enable_msi() can not always be trusted. This patch
adds code to generate an interrupt after MSI has been enabled and tests
whether or not we can receive and process it. If the tests fails, then fall
back to LSI.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
6ff63896e5bd624d8563f4b67fe2fe06ce99c8dc 04-May-2009 Kleber S. Souza <klebers@linux.vnet.ibm.com> [SCSI] ipr: fix PCI permanent error handler

The ipr driver can hang if it encounters enough PCI errors
to trigger the permanent error handler. The driver will attempt
to initiate a "bringdown" of the adapter and fail all pending
ops back. However, this bringdown is unlike any other bringdown
of the adapter in the code as the driver. In this code path we
end up failing back ops with allow_cmds still set to 1. This results
in some commands, the HCAM commands in particular, getting immediately
re-issued to the adapter on the done call, which results in
an infinite loop in ipr_fail_all_ops. Fix this by setting allow_cmds
to zero in this path.

Signed-off-by: Kleber S. Souza <klebers@linux.vnet.ibm.com>
[brking@linux.vnet.ibm.com: alternate patch substituted]
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
f381642d8f8963e62f5d45774505fd936f2b6072 22-Apr-2009 Kleber S. Souza <klebers@linux.vnet.ibm.com> [SCSI] ipr: ipr_remove() marked __devexit

Marking the ipr clean up function ipr_remove() as __devexit and using
__devexit_p() macro in its address reference.

Signed-off-by: Kleber Sacilotto de Souza <kleber@linux.vnet.ibm.com>
Reported-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
dd406ef8950e76b17d74c5764a1e3d3a87d4a855 22-Apr-2009 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Fix sleeping function called with interrupts disabled

The ata_sas_slave_configure was changed such that it now allocates
some memory for a drain buffer for ATAPI devices. Fixup the ipr
driver such that we no longer make this call with interrupts disabled.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
284901a90a9e0b812ca3f5f852cbbfb60d10249d 07-Apr-2009 Yang Hongyang <yanghy@cn.fujitsu.com> dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)

Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/scsi/ipr.c
2cf22be045ee1b29f9ce5cf4f4552811bb24916a 24-Feb-2009 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: Expose debug and fastfail parameters

Expose the debug and fastfail parameters to /sys/module/ipr/parameters such
that they can be enabled/disabled at run time.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
b75424fcfe8fae56344a65e3f04bbc7e975e750e 28-Jan-2009 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add message to error table

Adds a message to the error table for an error that wasn't previously handled.
In some cases the I/O Adapter will detect an error condition and mark a block
as "logically bad".

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
5a9ef25b14d39b8413364df12cb8d9bb7a673a32 23-Jan-2009 Wayne Boyer <wayneb@linux.vnet.ibm.com> [SCSI] ipr: add MSI support

Enable MSI if available/supported.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
94be9a58d7e683ac3c1df1858a17f09ebade8da0 16-Jan-2009 Jeff Garzik <jeff@garzik.org> [libata] get-identity ioctl: Fix use of invalid memory pointer
for SAS drivers.

Caught by Ke Wei (and team?) at Marvell.

Also, move the ata_scsi_ioctl export to libata-scsi.c, as that seems to be the
general trend.

Acked-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
71610f55fa4db63dbf5385929a47c9fb2451f332 03-Dec-2008 Kay Sievers <kay.sievers@vrfy.org> [SCSI] struct device - replace bus_id with dev_name(), dev_set_name()

[jejb: limit ioctl to returning 20 characters to avoid overrun
on long device names and add a few more conversions]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
302378534c8d4403f9a9b2a20f875b6866a27e42 09-Dec-2008 Mark Nelson <markn@au1.ibm.com> [SCSI] ipr: fix lockdep warning from ipr_ioa_reset_done

To fix the following lockdep warning we turn the spin_unlock_irq() into
a spin_unlock() and similarly for the corresponding spin_lock_irq(). We
can do this because there is no need to enable interrupts in this path
(thanks to Bring King for the tip).

Badness at kernel/lockdep.c:2193
NIP: c0000000000855d0 LR: c0000000000855b4 CTR: c0000000000482d0
REGS: c00000000fffb8d0 TRAP: 0700 Not tainted (2.6.28-rc5-autokern1)
MSR: 8000000000021032 <ME,IR,DR> CR: 28000022 XER: 00000004
TASK = c00000000091fa80[0] 'swapper' THREAD: c000000000a3c000 CPU: 0
GPR00: 0000000000000000 c00000000fffbb50 c000000000a3c2e0 0000000000000001
GPR04: 000000000000a580 c0000000003870d4 0000000000000000 0000000000000001
GPR08: 0000000000000000 c00000000112fdf0 c0000000008ed918 c000000000abcfd0
GPR12: 0000000048000088 c000000000a7f300 0000000000000000 0000000002100000
GPR16: c000000000644bd0 c000000000643390 0000000000000000 00000000003d0c00
GPR20: 00000000028372d8 c0000000007372d8 0000000002837548 c000000000737548
GPR24: c000000000644660 00000000028372d8 000000000000001a c000000076760000
GPR28: 0000000000000004 c0000000004e8450 c0000000009aafb0 c00000000091fa80
NIP [c0000000000855d0] .trace_hardirqs_on_caller+0x10c/0x194
LR [c0000000000855b4] .trace_hardirqs_on_caller+0xf0/0x194
Call Trace:
[c00000000fffbb50] [c00000000fffbbe0] 0xc00000000fffbbe0 (unreliable)
[c00000000fffbbe0] [c0000000004e8450] ._spin_unlock_irq+0x38/0x5c
[c00000000fffbc70] [c0000000003870d4] .ipr_ioa_reset_done+0x204/0x284
[c00000000fffbd10] [c00000000037d234] .ipr_reset_ioa_job+0xc4/0xec
[c00000000fffbda0] [c000000000385ce0] .ipr_isr+0x208/0x484
[c00000000fffbe50] [c0000000000aaf3c] .handle_IRQ_event+0x58/0xd4
[c00000000fffbef0] [c0000000000ad978] .handle_fasteoi_irq+0x110/0x1ac
[c00000000fffbf90] [c000000000025214] .call_handle_irq+0x1c/0x2c
[c000000000a3f9a0] [c00000000000d168] .do_IRQ+0x120/0x210
[c000000000a3fa40] [c000000000004804] hardware_interrupt_entry+0x1c/0x98
--- Exception: 501 at .pseries_dedicated_idle_sleep+0xec/0x1cc
LR = .pseries_dedicated_idle_sleep+0xdc/0x1cc
[c000000000a3fd30] [c000000000038208] .pseries_dedicated_idle_sleep+0x74/0x1cc (unreliable)
[c000000000a3fdd0] [c000000000012134] .cpu_idle+0x114/0x1dc
[c000000000a3fe60] [c0000000004ecb18] .rest_init+0x7c/0x94
[c000000000a3fee0] [c000000000700a40] .start_kernel+0x4b8/0x4e0
[c000000000a3ff90] [c000000000008368] .start_here_common+0x1c/0x34
Instruction dump:
e92d01b0 80090894 2f800000 41be002c 481ed1d1 60000000 2fa30000 419e0080
e93e8090 80090000 2f800000 409e0070 <0fe00000> 48000068 7fe3fb78 38800001

Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
25729a7fb88ef2912fcb869abe3a76b3be07fc06 29-Sep-2008 Arjan van de Ven <arjan@linux.intel.com> [SCSI] advansys, arcmsr, ipr, nsp32, qla1280, stex: use pci_ioremap_bar()

Use the newly introduced pci_ioremap_bar() function in drivers/scsi.
pci_ioremap_bar() just takes a pci device and a bar number, with the goal
of making it really hard to get wrong, while also having a central place
to stick sanity checks.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Brian King <brking@us.ibm.com>
Cc: Ed Lin <ed.lin@promise.com>
Cc: Nick Cheng <nick.cheng@areca.com.tw>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
f8aea20018aefa51bf818914c9c1ef9006353dbb 23-Oct-2008 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (21 commits)
[SCSI] sd: fix computation of the full size of the device
[SCSI] lib: string_get_size(): don't hang on zero; no decimals on exact
[SCSI] sun3x_esp: Convert && to ||
[SCSI] sd: remove command-size switching code
[SCSI] 3w-9xxx: remove unnecessary local_irq_save/restore for scsi sg copy API
[SCSI] 3w-xxxx: remove unnecessary local_irq_save/restore for scsi sg copy API
[SCSI] fix netlink kernel-doc
[SCSI] sd: Fix handling of NO_SENSE check condition
[SCSI] export busy state via q->lld_busy_fn()
[SCSI] refactor sdev/starget/shost busy checking
[SCSI] mptfusion: Increase scsi-timeouts, similariy to the LSI 4.x driver.
[SCSI] aic7xxx: Take the LED out of diagnostic mode on PM resume
[SCSI] aic79xx: user visible misuse wrong SI units (not disk size!)
[SCSI] ipr: use memory_read_from_buffer()
[SCSI] aic79xx: fix shadowed variables
[SCSI] aic79xx: fix shadowed variables, add statics
[SCSI] aic7xxx: update *_shipped files
[SCSI] aic7xxx: update .reg files
[SCSI] aic7xxx: introduce "dont_generate_debug_code" keyword in aicasm parser
[SCSI] scsi_dh: Initialize path state to be passive when path is not owned
...
d777aaf386ba71d6fbe803c015330a766cad53d8 22-Sep-2008 Akinobu Mita <akinobu.mita@gmail.com> [SCSI] ipr: use memory_read_from_buffer()

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
edbc25caaa492a82e19baa915f1f6b0a0db6554d 10-Jul-2008 Milton Miller <miltonm@bga.com> PCI: remove dynids.use_driver_data

The driver flag dynids.use_driver_data is almost consistently not set,
and causes more problems than it solves. It was initially intended as a
flag to indicate whether a driver's usage of driver_data had been
carefully inspected and was ready for values from userspace. That audit
was never done, so most drivers just get a 0 for driver_data when new
IDs are added from userspace via sysfs. So remove the flag, allowing
drivers to see the data directly (a followon patch validates the passed
driver_data value against what the drivers expect).

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
/drivers/scsi/ipr.c
242f9dcb8ba6f68fcd217a119a7648a4f69290e9 14-Sep-2008 Jens Axboe <jens.axboe@oracle.com> block: unify request timeout handling

Right now SCSI and others do their own command timeout handling.
Move those bits to the block layer.

Instead of having a timer per command, we try to be a bit more clever
and simply have one per-queue. This avoids the overhead of having to
tear down and setup a timer for each command, so it will result in a lot
less timer fiddling.

Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
/drivers/scsi/ipr.c
0ce3a7e5bd305e96c924fab1e3126480c665f017 11-Jul-2008 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Fix HDIO_GET_IDENTITY oops for SATA devices

Currently, ipr does not support HDIO_GET_IDENTITY to SATA devices.
An oops occurs if userspace attempts to send the command. Since hald
issues the command, ensure we fail the ioctl in ipr. This is a
temporary solution to the oops. Once the ipr libata EH conversion
is upstream, ipr will fully support HDIO_GET_IDENTITY.

Tested-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
49dd09613cf8ae3b697c341c501b7526b462cfeb 29-Apr-2008 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Rename ipr's state scsi host attribute to prevent collisions

Due to recent device model changes it now no longer tolerates name
collisions. This causes a problem for ipr whose "state" attribute
collides with an identically named one in the SCSI mid-layer. Rename
the ipr driver attribute to be more specific.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
ee959b00c335d7780136c5abda37809191fe52c3 22-Feb-2008 Tony Jones <tonyj@suse.de> SCSI: convert struct class_device to struct device

It's big, but there doesn't seem to be a way to split it up smaller...

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/ipr.c
c9f75b04ed5ed65a058d18a8a8dda50632a96de8 07-Apr-2008 Tejun Heo <htejun@gmail.com> libata: kill ata_noop_dev_select()

Now that SFF assumptions are separated out from non-SFF reset
sequence, port_ops->sff_dev_select() is no longer necessary for
non-SFF controllers. Kill ata_noop_dev_select() and ->sff_dev_select
initialization from base and other non-SFF port_ops.

Signed-off-by: Tejun Heo <htejun@gmail.com>
/drivers/scsi/ipr.c
520d06f92b32d7abe5127d7cc46a819db0f384e6 07-Apr-2008 Tejun Heo <htejun@gmail.com> libata: remove check_status from non-SFF drivers

Now that all SFF stuff is separated out of core layer, core layer
doesn't call ops->[alt_]check_status(). In fact, no one calls them
for non-SFF drivers anymore. Kill them.

Signed-off-by: Tejun Heo <htejun@gmail.com>
/drivers/scsi/ipr.c
4c9bf4e799ce06a7378f1196587084802a414c03 07-Apr-2008 Tejun Heo <htejun@gmail.com> libata: replace tf_read with qc_fill_rtf for non-SFF drivers

Now that all SFF stuff is separated out of core layer, core layer
doesn't call ops->tf_read directly. It gets called only via
ops->qc_fill_rtf() for non-SFF drivers. This patch directly
implements private ops->qc_fill_rtf() for non-SFF controllers and kill
ops->tf_read().

This is much cleaner for non-SFF controllers as some of them have to
cache SFF register values in private data structure and report the
cached values via ops->tf_read(). Also, ops->tf_read() gets nasty for
controllers which don't have clear notion of TF registers when
operation is not in progress.

As this change makes default ops->qc_fill_rtf unnecessary, move
ata_sff_qc_fill_rtf() form ata_base_port_ops to ata_sff_port_ops where
it belongs.

Signed-off-by: Tejun Heo <htejun@gmail.com>
/drivers/scsi/ipr.c
22183bf569c8600ff414ac25f23134044e0ef453 07-Apr-2008 Tejun Heo <htejun@gmail.com> libata: add qc_fill_rtf port operation

On command completion, ata_qc_complete() directly called ops->tf_read
to fill qc->result_tf. This patch adds ops->qc_fill_rtf to replace
hardcoded ops->tf_read usage.

ata_sff_qc_fill_rtf() which uses ops->tf_read to fill result_tf is
implemented and set in ata_base_port_ops and other ops tables which
don't inherit from ata_base_port_ops, so this patch doesn't introduce
any behavior change.

ops->qc_fill_rtf() is similar to ops->sff_tf_read() but can only be
called when a command finishes. As some non-SFF controllers don't
have TF registers defined unless they're associated with in-flight
commands, this limited operation makes life easier for those drivers
and help lifting SFF assumptions from libata core layer.

Signed-off-by: Tejun Heo <htejun@gmail.com>
/drivers/scsi/ipr.c
5682ed33aae05d10a25c95633ef9d9c062825888 07-Apr-2008 Tejun Heo <htejun@gmail.com> libata: rename SFF port ops

Add sff_ prefix to SFF specific port ops.

This rename is in preparation of separating SFF support out of libata
core layer. This patch strictly renames ops and doesn't introduce any
behavior difference.

Signed-off-by: Tejun Heo <htejun@gmail.com>
/drivers/scsi/ipr.c
a1efdaba2dbd6fb89e23a87b66d3f4dd92c9f5af 24-Mar-2008 Tejun Heo <htejun@gmail.com> libata: make reset related methods proper port operations

Currently reset methods are not specified directly in the
ata_port_operations table. If a LLD wants to use custom reset
methods, it should construct and use a error_handler which uses those
reset methods. It's done this way for two reasons.

First, the ops table already contained too many methods and adding
four more of them would noticeably increase the amount of necessary
boilerplate code all over low level drivers.

Second, as ->error_handler uses those reset methods, it can get
confusing. ie. By overriding ->error_handler, those reset ops can be
made useless making layering a bit hazy.

Now that ops table uses inheritance, the first problem doesn't exist
anymore. The second isn't completely solved but is relieved by
providing default values - most drivers can just override what it has
implemented and don't have to concern itself about higher level
callbacks. In fact, there currently is no driver which actually
modifies error handling behavior. Drivers which override
->error_handler just wraps the standard error handler only to prepare
the controller for EH. I don't think making ops layering strict has
any noticeable benefit.

This patch makes ->prereset, ->softreset, ->hardreset, ->postreset and
their PMP counterparts propoer ops. Default ops are provided in the
base ops tables and drivers are converted to override individual reset
methods instead of creating custom error_handler.

* ata_std_error_handler() doesn't use sata_std_hardreset() if SCRs
aren't accessible. sata_promise doesn't need to use separate
error_handlers for PATA and SATA anymore.

* softreset is broken for sata_inic162x and sata_sx4. As libata now
always prefers hardreset, this doesn't really matter but the ops are
forced to NULL using ATA_OP_NULL for documentation purpose.

* pata_hpt374 needs to use different prereset for the first and second
PCI functions. This used to be done by branching from
hpt374_error_handler(). The proper way to do this is to use
separate ops and port_info tables for each function. Converted.

Signed-off-by: Tejun Heo <htejun@gmail.com>
/drivers/scsi/ipr.c
dde2020754aeb14e17052d61784dcb37f252aac2 19-Feb-2008 James Bottomley <James.Bottomley@HansenPartnership.com> libata: eliminate the home grown dma padding in favour of

that provided by the block layer

ATA requires that all DMA transfers begin and end on word boundaries.
Because of this, a large amount of machinery grew up in ide to adjust
scatterlists on this basis. However, as of 2.5, the block layer has a
dma_alignment variable which ensures both the beginning and length of a
DMA transfer are aligned on the dma_alignment boundary. Although the
block layer does adjust the beginning of the transfer to ensure this
happens, it doesn't actually adjust the length, it merely makes sure
that space is allocated for transfers beyond the declared length. The
upshot of this is that scatterlists may be padded to any size between
the actual length and the length adjusted to the dma_alignment safely
knowing that memory is allocated in this region.

Right at the moment, SCSI takes the default dma_aligment which is on a
512 byte boundary. Note that this aligment only applies to transfers
coming in from user space. However, since all kernel allocations are
automatically aligned on a minimum of 32 byte boundaries, it is safe to
adjust them in this manner as well.

tj: * Adjusting sg after padding is done in block layer. Make libata
set queue alignment correctly for ATAPI devices and drop broken
sg mangling from ata_sg_setup().
* Use request->raw_data_len for ATAPI transfer chunk size.
* Killed qc->raw_nbytes.
* Separated out killing qc->n_iter.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
/drivers/scsi/ipr.c
b1c118121ae37285ddc0a7a908999196bb35fb0b 03-Feb-2008 Joe Perches <joe@perches.com> drivers/scsi/: Spelling fixes

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Acked-by: James Smart <james.smart@emulex.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: David Somayajulu <david.somayajulu@qlogic.com>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
/drivers/scsi/ipr.c
9b73e76f3cf63379dcf45fcd4f112f5812418d0a 26-Jan-2008 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (200 commits)
[SCSI] usbstorage: use last_sector_bug flag universally
[SCSI] libsas: abstract STP task status into a function
[SCSI] ultrastor: clean up inline asm warnings
[SCSI] aic7xxx: fix firmware build
[SCSI] aacraid: fib context lock for management ioctls
[SCSI] ch: remove forward declarations
[SCSI] ch: fix device minor number management bug
[SCSI] ch: handle class_device_create failure properly
[SCSI] NCR5380: fix section mismatch
[SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
[SCSI] IB/iSER: add logical unit reset support
[SCSI] don't use __GFP_DMA for sense buffers if not required
[SCSI] use dynamically allocated sense buffer
[SCSI] scsi.h: add macro for enclosure bit of inquiry data
[SCSI] sd: add fix for devices with last sector access problems
[SCSI] fix pcmcia compile problem
[SCSI] aacraid: add Voodoo Lite class of cards.
[SCSI] aacraid: add new driver features flags
[SCSI] qla2xxx: Update version number to 8.02.00-k7.
[SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
...
ff2aeb1eb64c8a4770a6304f9addbae9f9828646 05-Dec-2007 Tejun Heo <htejun@gmail.com> libata: convert to chained sg

libata used private sg iterator to handle padding sg. Now that sg can
be chained, padding can be handled using standard sg ops. Convert to
chained sg.

* s/qc->__sg/qc->sg/

* s/qc->pad_sgent/qc->extra_sg[]/. Because chaining consumes one sg
entry. There need to be two extra sg entries. The renaming is also
for future addition of other extra sg entries.

* Padding setup is moved into ata_sg_setup_extra() which is organized
in a way that future addition of other extra sg entries is easy.

* qc->orig_n_elem is unused and removed.

* qc->n_elem now contains the number of sg entries that LLDs should
map. qc->mapped_n_elem is added to carry the original number of
mapped sgs for unmapping.

* The last sg of the original sg list is used to chain to extra sg
list. The original last sg is pointed to by qc->last_sg and the
content is stored in qc->saved_last_sg. It's restored during
ata_sg_clean().

* All sg walking code has been updated. Unnecessary assertions and
checks for conditions the core layer already guarantees are removed.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
/drivers/scsi/ipr.c
0dc36888d4422140f9eaf50f24953ec109f750a3 18-Dec-2007 Tejun Heo <htejun@gmail.com> libata: rename ATA_PROT_ATAPI_* to ATAPI_PROT_*

ATA_PROT_ATAPI_* are ugly and naming schemes between ATA_PROT_* and
ATA_PROT_ATAPI_* are inconsistent causing confusion. Rename them to
ATAPI_PROT_* and make them consistent with ATA counterpart.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
b7d68ca3f055b90bb782bcfcf535f54cead7d7db 14-Dec-2007 Denis Cheng <crquan@gmail.com> [SCSI] ipr: use LIST_HEAD instead of LIST_HEAD_INIT

Signed-off-by: Denis Cheng <crquan@gmail.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/ipr.c
642f149031d70415d9318b919d50b71e4724adbd 24-Oct-2007 Jens Axboe <jens.axboe@oracle.com> SG: Change sg_set_page() to take length and offset argument

Most drivers need to set length and offset as well, so may as well fold
those three lines into one.

Add sg_assign_page() for those two locations that only needed to set
the page, where the offset/length is set outside of the function context.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
/drivers/scsi/ipr.c
45711f1af6eff1a6d010703b4862e0d2b9afd056 22-Oct-2007 Jens Axboe <jens.axboe@oracle.com> [SG] Update drivers to use sg helpers

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
/drivers/scsi/ipr.c
3be6cbd73f74b4a3da82cc7d6e1688a4ae595fc7 18-Oct-2007 Jeff Garzik <jeff@garzik.org> [libata] kill ata_sg_is_last()

Short term, this works around a bug introduced by early sg-chaining
work.

Long term, removing this function eliminates a branch from a hot
path loop in each scatter/gather table build. Also, as this code
demonstrates, we don't need to _track_ the end of the s/g list, as
long as we mark it in some way. And doing so programatically is nice.
So its a useful cleanup, regardless of its short term effects.

Based conceptually on a quick patch by Jens Axboe.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/ipr.c
ac8869d56d95a8c74403e6f7a47d74fcfcc1b988 16-Aug-2007 Jeff Garzik <jeff@garzik.org> [libata] Remove ->port_disable() hook

It was always set to ata_port_disable(). Removed the hook, and replaced
the very few ap->ops->port_disable() callsites with direct calls to
ata_port_disable().

Signed-off-by: Jeff Garzik <jeff@garzik.org>
/drivers/scsi/ipr.c
cc0680a580b5be81a1ca321b58f8e9b80b5c1052 06-Aug-2007 Tejun Heo <htejun@gmail.com> libata-link: linkify reset

Make reset methods and related functions deal with ata_link instead of
ata_port.

* ata_do_reset()
* ata_eh_reset()
* all prereset/reset/postreset methods and related functions

This patch introduces no behavior change.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
/drivers/scsi/ipr.c
9af5c9c97dc9d599281778864c72b385f0c63341 06-Aug-2007 Tejun Heo <htejun@gmail.com> libata-link: introduce ata_link

Introduce ata_link. It abstracts PHY and sits between ata_port and
ata_device. This new level of abstraction is necessary to support
SATA Port Multiplier, which basically adds a bunch of links (PHYs) to
a ATA host port. Fields related to command execution, spd_limit and
EH are per-link and thus moved to ata_link.

This patch only defines the host link. Multiple link handling will be
added later. Also, a lot of ap->link derefences are added but many of
them will be removed as each part is converted to deal directly with
ata_link instead of ata_port.

This patch introduces no behavior change.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
/drivers/scsi/ipr.c
bc06cffdec85d487c77109dffcd2f285bdc502d3 16-Jul-2007 Linus Torvalds <torvalds@woody.linux-foundation.org> Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (166 commits)
[SCSI] ibmvscsi: convert to use the data buffer accessors
[SCSI] dc395x: convert to use the data buffer accessors
[SCSI] ncr53c8xx: convert to use the data buffer accessors
[SCSI] sym53c8xx: convert to use the data buffer accessors
[SCSI] ppa: coding police and printk levels
[SCSI] aic7xxx_old: remove redundant GFP_ATOMIC from kmalloc
[SCSI] i2o: remove redundant GFP_ATOMIC from kmalloc from device.c
[SCSI] remove the dead CYBERSTORMIII_SCSI option
[SCSI] don't build scsi_dma_{map,unmap} for !HAS_DMA
[SCSI] Clean up scsi_add_lun a bit
[SCSI] 53c700: Remove printk, which triggers because of low scsi clock on SNI RMs
[SCSI] sni_53c710: Cleanup
[SCSI] qla4xxx: Fix underrun/overrun conditions
[SCSI] megaraid_mbox: use mutex instead of semaphore
[SCSI] aacraid: add 51245, 51645 and 52245 adapters to documentation.
[SCSI] qla2xxx: update version to 8.02.00-k1.
[SCSI] qla2xxx: add support for NPIV
[SCSI] stex: use resid for xfer len information
[SCSI] Add Brownie 1200U3P to blacklist
[SCSI] scsi.c: convert to use the data buffer accessors
...
21ba0f88ae56da82a3a15fe54d729208b64c4f4b 12-Jul-2007 Linus Torvalds <torvalds@woody.linux-foundation.org> Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (34 commits)
PCI: Only build PCI syscalls on architectures that want them
PCI: limit pci_get_bus_and_slot to domain 0
PCI: hotplug: acpiphp: avoid acpiphp "cannot get bridge info" PCI hotplug failure
PCI: hotplug: acpiphp: remove hot plug parameter write to PCI host bridge
PCI: hotplug: acpiphp: fix slot poweroff problem on systems without _PS3
PCI: hotplug: pciehp: wait for 1 second after power off slot
PCI: pci_set_power_state(): check for PM capabilities earlier
PCI: cpci_hotplug: Convert to use the kthread API
PCI: add pci_try_set_mwi
PCI: pcie: remove SPIN_LOCK_UNLOCKED
PCI: ROUND_UP macro cleanup in drivers/pci
PCI: remove pci_dac_dma_... APIs
PCI: pci-x-pci-express-read-control-interfaces cleanups
PCI: Fix typo in include/linux/pci.h
PCI: pci_ids, remove double or more empty lines
PCI: pci_ids, add atheros and 3com_2 vendors
PCI: pci_ids, reorder some entries
PCI: i386: traps, change VENDOR to DEVICE
PCI: ATM: lanai, change VENDOR to DEVICE
PCI: Change all drivers to use pci_device->revision
...
91a6902958f052358899f58683d44e36228d85c2 09-Jun-2007 Zhang Rui <rui.zhang@intel.com> sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes

Well, first of all, I don't want to change so many files either.

What I do:
Adding a new parameter "struct bin_attribute *" in the
.read/.write methods for the sysfs binary attributes.

In fact, only the four lines change in fs/sysfs/bin.c and
include/linux/sysfs.h do the real work.
But I have to update all the files that use binary attributes
to make them compatible with the new .read and .write methods.
I'm not sure if I missed any. :(

Why I do this:
For a sysfs attribute, we can get a pointer pointing to the
struct attribute in the .show/.store method,
while we can't do this for the binary attributes.
I don't know why this is different, but this does make it not
so handy to use the binary attributes as the regular ones.
So I think this patch is reasonable. :)

Who benefits from it:
The patch that exposes ACPI tables in sysfs
requires such an improvement.
All the table binary attributes share the same .read method.
Parameter "struct bin_attribute *" is used to get
the table signature and instance number which are used to
distinguish different ACPI table binary attributes.

Without this parameter, we need to offer different .read methods
for different ACPI table binary attributes.
This is impossible as there are various ACPI tables on different
platforms, and we don't know what they are until they are loaded.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/ipr.c
44c10138fd4bbc4b6d6bff0873c24902f2a9da65 09-Jun-2007 Auke Kok <auke-jan.h.kok@intel.com> PCI: Change all drivers to use pci_device->revision

Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.

This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.

In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.

Compile tested with make all{yes,mod}config on x86_64 and i386.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/ipr.c
5bc65793cbf8da0d35f19ef025dda22887e79e80 31-May-2007 James Bottomley <jejb@mulgrave.il.steeleye.com> [SCSI] Merge up to linux-2.6 head

Conflicts:

drivers/scsi/jazz_esp.c

Same changes made by both SCSI and SPARC trees: problem with UTF-8
conversion in the copyright.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
63015bc9333907725f90a1691d0ade44e51cdcbf 25-May-2007 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> [SCSI] ipr: convert to use the data buffer accessors

- remove the unnecessary map_single path.

- convert to use the new accessors for the sg lists and the
parameters.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
5af23d263c33a3f6fc93facfd87d2a091eff2060 09-May-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Proper return codes for eh_dev_reset for SATA devices

Currently ipr always returns success from eh_dev_reset when
called for a SATA device. If ata_do_eh is unable to recover
for some reason, this can result in commands that are still
outstanding when ata_do_eh returns. Change ipr to verify no
commands are outstanding before returning success.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
463fc696ed723a9d854113e370cc177b0b63de42 08-May-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Use PCI-E reset API for new ipr adapter

Use a newly added PCI API to issue a PCI Fundamental reset
(warm reset) to a new ipr PCI-E adapter. Typically, the
ipr adapter uses the start BIST bit in config space to reset
an adapter. Issuing start BIST on this particular adapter
results in the PCI-E logic on the card losing sync, which
causes PCI-E errors, making the card unusable. The only reset
mechanism that exists on this hardware that does not have this
problem is PCI Fundamental reset (warm reset).

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
473b1e8ed2e4f545de22e58c8c073471b18459e8 02-May-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Better handle adapter boot time errors

If an ipr adapter encounters an adapter error requiring an
adapter reset to recover from prior to driver load time, the
error will be ignored and recovery will not happen until the
initial timeout occurs waiting for the firmware to come ready,
which means a five minute timeout. Fix is to read the interrupt
register before clearing any of the interrupts at probe time.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
ac09c349080008fdd54a15616a1b14771772d867 26-Apr-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Enable multi-initator RAID support

Enables multi-initiator support on ipr RAID adapters that support it.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
8cf093e275d0d703d3e6c23725e340006082beec 26-Apr-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Improved dual adapter errors

Formats ipr dual adapter errors so that they are more compact.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
22d2e402d1f671ca66919a36e04a650b735f4f0d 26-Apr-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Increase adapter operational timeout

Increases the adapter operational timeout for some adapters that support
dual controller configurations, since they may take longer to come ready.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
65f5647544960a68030352015d0b4a6234a818f8 26-Apr-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Handle IOA reset request

In ipr dual adapter configurations, the ipr adapter firmware
may require an adapter reset for various reasons. The reset
is requested by the adapter firmware logging an error with
an IOASC of 0x02048000. Add support to log this error, and
reset the adapter.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
8a048994f4be7d0b670a358cea7812c6d5232105 26-Apr-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Handle check condition status from disk array device

On newer levels of microcode for ipr RAID adapters supporting
multi-initiator configurations, the disk array, or VSET, resources
are capable of generating a check condition. This patch prevents
ipr from generating sense data in this scenario and retrieving it
from the logical device instead.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
6bb0417074e914e8d002df20c419e67732ae103e 26-Apr-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Handle UA on disk array following an adapter reset

On certain ipr RAID adapters, which are capable of multi-initiator
configurations, the disk array, or VSET, resources will be in a POR
Unit Attention state following an adapter reset. In order for the
midlayer to handle the UA, I must report a bus reset to the logical
disk array bus at the end of an adapter reset.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
68c96e5960e6f4b0ce7cf6034f252294484f78a8 26-Apr-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Allow driver_data to be passed for dynamic ids

Since driver_data for pci ids in the ipr driver is now
just flags, we can allow these to be passed in from userspace
for dynamic ids.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
970ea2941199f9c5f3b4faffd68e7e9a4505de8e 26-Apr-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Prevent overlapped adapter resets

This patch fixes some scenarios where an ipr adapter
could get reset overlapped, which could cause very
long timeouts to occur, or PCI bus errors.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
4f7a307dc6e4d8bfeb56f7cf7231b08cb845687c 05-May-2007 Linus Torvalds <torvalds@woody.linux-foundation.org> Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (87 commits)
[SCSI] fusion: fix domain validation loops
[SCSI] qla2xxx: fix regression on sparc64
[SCSI] modalias for scsi devices
[SCSI] sg: cap reserved_size values at max_sectors
[SCSI] BusLogic: stop using check_region
[SCSI] tgt: fix rdma transfer bugs
[SCSI] aacraid: fix aacraid not finding device
[SCSI] aacraid: Correct SMC products in aacraid.txt
[SCSI] scsi_error.c: Add EH Start Unit retry
[SCSI] aacraid: [Fastboot] Panics for AACRAID driver during 'insmod' for kexec test.
[SCSI] ipr: Driver version to 2.3.2
[SCSI] ipr: Faster sg list fetch
[SCSI] ipr: Return better qc_issue errors
[SCSI] ipr: Disrupt device error
[SCSI] ipr: Improve async error logging level control
[SCSI] ipr: PCI unblock config access fix
[SCSI] ipr: Fix for oops following SATA request sense
[SCSI] ipr: Log error for SAS dual path switch
[SCSI] ipr: Enable logging of debug error data for all devices
[SCSI] ipr: Add new PCI-E IDs to device table
...
120bda35ff8514c937dac6d4e5c7dc6c01c699ac 26-Mar-2007 Andrew Morton <akpm@linux-foundation.org> git-libata-all-ipr-fix

drivers/scsi/ipr.c: In function '__ipr_eh_dev_reset':
drivers/scsi/ipr.c:3865: warning: passing argument 4 of 'ata_do_eh' from incompatible pointer type

Cc: Tejun Heo <htejun@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
/drivers/scsi/ipr.c
51b1c7e19e18e84a44277951dd5c4c4617330baa 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Faster sg list fetch

Improve overall command performance by embedding the scatterlist
in the command block used by the adapter. This decreases
the overall number of DMAs required for a single command.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
0feeed823af05ca556087a89fdcf644f156f73b8 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Return better qc_issue errors

If qc_issue fails for some reason, return a better error
to libata.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
e435340c4b583b4472dad1178029b8e3e7dafd0b 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Disrupt device error

Add entry in ipr error translation table for an error
received when a device is forced into the failed state
by the user.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
933916f365f9ef1268c058bfaba2d4dcf26e4fd0 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Improve async error logging level control

Add the ability to control how much error data gets logged
on a per error basis.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
a9aedb098437655b7b78d66e0e28405830cbdbef 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: PCI unblock config access fix

Fix to make sure user config accesses get re-enabled if the
PCI config write to start BIST fails.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
24d6f2b50bd34d0da540a9e6f71c4b6ab25f4b93 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Fix for oops following SATA request sense

This patch fixes a problem discovered on a system with some
bad SATA devices attached. If a command to a SATAPI device
times out and the device gets reset as part of error recovery,
its possible that ipr will set err_mask to indicate a device
error has occurred. If this happens, a request sense will get
issued by libata. Since scsi core thinks this scsi command is
now completed, because the device reset handler completed successfully,
scsi core will free the associated scsi command, which may
cause an oops when that request sense is completed later
by ipr. This patch ensures that any commands that get aborted
as a result of a device reset set err_mask appropriately so
that the request sense does not get sent.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
b0692dd4d7e90ce5cf1241731c6e80118402e3b4 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Log error for SAS dual path switch

For ipr SAS adapters that support dual pathing, this
patch modifies ipr to log an error when a path fails.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
cc9bd5d4256ecc1b6e0448febb4be29db1a91256 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Enable logging of debug error data for all devices

The ipr driver has a sysfs attribute which can be used to
adjust the logging level of the driver for error events.
The error response data for commands can be dumped by
increasing the logging level of the ipr driver. This
currently only works for JBOD passthrough devices.
This patch enables this function for all devices, including
RAID devices, to aid in debugging problems.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
185eb31cc242f415800a1a06dca522d27c269279 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Add new PCI-E IDs to device table

Adds support for some new PCI-E ipr adapters.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
7d2267bb9d94aabfa316a13d04b0bce2fb51ff83 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Remove auto RAID create module parameter

Remove the auto RAID 0 array creation module parameter, since
support for this function has been removed from the firmware.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
5469cb5bdef76dbe18865fff30975f0694fff2c2 29-Mar-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Make adapter operational timeout be per adapter type

Some ipr adapters may take longer than others to come operational.
This patch makes this timeout different for different adapters,
while still preserving the module parameter which can be used
to globally override the default.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
20ce791a0e684dceea2b6804a7c7aaa22e8bfa5c 26-Jan-2007 Greg Kroah-Hartman <gregkh@suse.de> [SCSI] ipr: remove duplicate device id

This patch removes a duplicate device id from the IPR driver. Based on
the ipr.h file, I'm not so sure this was intended to be a duplicate, and
if so, the .h file should be modified to use the proper sub-device id
instead.

This was pointed out to me by Kay Sievers <kay.sievers@suse.de>

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
e619e1a7cbf73c27eacf53856443b1aa67cc1234 23-Jan-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: PCI error recovery fix

Since the pci_block_user_cfg_access API was modified to track
block/unblocks, it was discovered that the ipr driver had a
path through its code (in PCI error recovery) which would unblock
when not previously blocked.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
7dce0e1c84cfa8fb2a4b41877c20def386cade2b 23-Jan-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Tolerate not finding PCI-X registers

Don't fail initialization of an adapter if the PCI-X registers
cannot be found since it may be a PCI-E adapter.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
6d84c944fa17cf4e65660df50a0772f8a4836e0b 23-Jan-2007 Brian King <brking@linux.vnet.ibm.com> [SCSI] ipr: Remove usage of pci driver data

Since ipr handles dynamic ids, it must handle driver_data
not being set, so remove the current usage of driver_data
so it can be used for other things in future patches.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
e94b1766097d53e6f3ccfb36c8baa562ffeda3fc 07-Dec-2006 Christoph Lameter <clameter@sgi.com> [PATCH] slab: remove SLAB_KERNEL

SLAB_KERNEL is an alias of GFP_KERNEL.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/scsi/ipr.c
4796b71fbb907ce6b8a9acf1852d3646a80b4576 06-Dec-2006 David Howells <dhowells@redhat.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6

Conflicts:

drivers/pcmcia/ds.c

Fix up merge failures with Linus's head and fix new compile failures.

Signed-Off-By: David Howells <dhowells@redhat.com>
bd705f2d43d34c0309dfa48117bed7167024247b 21-Nov-2006 Adrian Bunk <bunk@stusta.de> [SCSI] ipr: Make ipr_ioctl static

This patch makes ipr_ioctl static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
ac719abab0fbe2b83dc99351f6605645aef814ab 21-Nov-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Reduce default error log size

Since the default error log size has increased on SAS adapters,
prevent ipr from logging this additional data unless requested
to do so by the user set log level in order to prevent flooding
the logs.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
49dc6a18185c12bae4980d17512fbe54ca6bae54 21-Nov-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Add support for logging SAS fabric errors

Adds support for logging SAS fabric errors logged by
the ipr firmware.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
9d66bdf81f97673b6e330a26438fcaea38c26cd5 21-Nov-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Remove debug trace points from dump code

Remove some debug trace points that clutter up the log
when ipr debugging is turned on.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
7402ecef94f416dcf03af7435c404a4079683d96 21-Nov-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Remove ipr_scsi_timed_out

Remove ipr's usage of the scsi transport eh_timed_out for
handling SATA timeouts. This was only needed in order to set
some flags on the qc prior to calling ata_do_eh.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
60e7486b190998745b548599c843f090d5624ae3 21-Nov-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: PCI IDs for new SAS adapters

Adds PCI IDs for some new ipr SAS adapters.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
04d9768ff8847b0ae8c41ac3cfb3c5bb2e31699a 21-Nov-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Stop issuing cancel all to disk arrays

The ipr disk array devices do not support a cancel all
requests primitive, so change the ipr driver to never
send it.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
73d98ff0fa8d9074792b7273f57d9f92810104c6 21-Nov-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: SATA reset - wait for host reset completion

If an ipr adapter hits a fatal microcode error requiring a reset
while a SATA device is going through EH, it can result in a command
getting issued to the ipr adapter while it is getting reset, which
can cause PCI bus errors. Wait for any outstanding adapter reset
to finish prior to issuing a SATA device reset.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
c4028958b6ecad064b1a6303a6a5906d4fe48d73 22-Nov-2006 David Howells <dhowells@redhat.com> WorkStruct: make allyesconfig

Fix up for make allyesconfig.

Signed-Off-By: David Howells <dhowells@redhat.com>
/drivers/scsi/ipr.c
7d12e780e003f93433d49ce78cfedf4b4c52adc5 05-Oct-2006 David Howells <dhowells@redhat.com> IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
/drivers/scsi/ipr.c
a2a65a3ecb54ecd1a8f0409f11cb82ae083c6964 26-Sep-2006 Eric Sesterhenn <snakebyte@gmx.de> [SCSI] Signedness issue in drivers/scsi/ipr.c

gcc 4.1 with some extra warnings show the following:

drivers/scsi/ipr.c:6361: warning: comparison of unsigned expression < 0 is always false
drivers/scsi/ipr.c:6385: warning: comparison of unsigned expression < 0 is always false
drivers/scsi/ipr.c:6415: warning: comparison of unsigned expression < 0 is always false

The problem is that rc is of the type u32, which can never be smaller than
zero, therefore all three error handling checks get useless. This patch
changes it to a normal int, because all usages / all functions it get used
with expect an int.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Acked-by: Brian King <brking@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
dcbccbde00b85b4d4a1c206b419e7a3d2ab2b1cd 26-Sep-2006 Henrik Kretzschmar <henne@nachtwindheim.de> [SCSI] pci_module_init conversion in scsi subsystem

Converts pci_module_init() to pci_register_driver() in the scsi subsys on
23 drivers which only return the value of pci_module_init().

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
35a39691e4daa3c371c265e4cb8356c67ded45ec 25-Sep-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Support attaching SATA devices

Adds support to attach SATA devices to ipr SAS adapters.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
117d2ce1cea25fc94302ff418ccef644cd3e59af 02-Aug-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Auto sense handling fix

Fix up a logic error in the checking for valid sense data.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
5b7304fbfb74bfca6f7d5a88b28197e3f7f2743b 02-Aug-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Properly handle IOA recovered errors

The ipr driver currently translates adapter recovered errors
to DID_ERROR. This patch fixes this to translate these
errors to success instead.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
896bbd21408ddbfb9a57819404dbb04f4f0afb35 02-Aug-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Handle new SAS error codes

Add definitions for some SAS error codes that can be
logged by ipr SAS adapters.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
1d6f359a2e06296418481239f8054a878f36e819 02-Jul-2006 Thomas Gleixner <tglx@linutronix.de> [PATCH] irq-flags: scsi: Use the new IRQF_ constants

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/scsi/ipr.c
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
/drivers/scsi/ipr.c
beb40487508290f5d6565598c60a3f44261beef2 10-Jun-2006 Christoph Hellwig <hch@lst.de> [SCSI] remove scsi_request infrastructure

With Achim patch the last user (gdth) is switched away from scsi_request
so we an kill it now. Also disables some code in i2o_scsi that was
broken since the sg driver stopped using scsi_requests.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
c65130967186dc53c0c66793cfe640521dcdada2 29-Mar-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Reset device cleanup

Encapsulate some more of the device reset processing in
preparation for SATA support.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
fb3ed3cb4b8ba84e5b0899ef752495f213973843 29-Mar-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: printk macro cleanup/removal

Remove some unused printk macros, make some more robust, and
convert some to use standard printk macros when possible.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
fe964d0a4bfa7c25e75c53d81acbf53099777e9e 29-Mar-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Simplify status area dumping

Simplify the dumping of the command status area by
removing some device specific information that has proven
to not be worthwhile.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
e4fbf44ed0618acce4a06010ed9fa9c02e06e36a 29-Mar-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Fixup device type check

Fixup a check used by the ipr driver to determine if a given
device is a SCSI disk. Due to the addition of support for
attaching SATA devices, this check needs to be more robust.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
1121b794a384bc317fe36e967b82308b0e2c3852 29-Mar-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Disk remove path cleanup

Instead of NULLing the resource entry pointer when a disk
goes away to prevent any new commands being sent to it,
set the adapter resource handle to an invalid value so
new ops getting sent to it will fail with a selection timeout
response. This patch is needed for future SATA patches.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
f8a88b19b9d4f59bd625b4852c1b1138a5cf89f3 03-Feb-2006 Linas Vepstas <linas@austin.ibm.com> [SCSI] PCI Error Recovery: IPR SCSI device driver

Various PCI bus errors can be signaled by newer PCI controllers. This
patch adds the PCI error recovery callbacks to the IPR SCSI device driver.
The patch has been tested, and appears to work well.

Signed-off-by: Linas Vepstas <linas@linas.org>
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
4733804c9f62fbc17ba69e8654a5fdf465f5bc41 09-Feb-2006 Brian King <brking@us.ibm.com> [SCSI] ipr: Fix adapter initialization failure

Since scsi core is always sending scatterlists now, remove
some code which was written with the bad assumption that
a small transfer would not be sent down in a scatterlist.
Without this fix, the ipr driver ends up sending garbage
data to the adapter following a reset, causing it to
fail the reset and take the adapter offline.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
db9edfd7e339ca4113153d887e782dd05be5a9eb 05-Jan-2006 Linus Torvalds <torvalds@g5.osdl.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6

Trivial manual merge fixup for usb_find_interface clashes.
312c004d36ce6c739512bac83b452f4c20ab1f62 16-Nov-2005 Kay Sievers <kay.sievers@suse.de> [PATCH] driver core: replace "hotplug" by "uevent"

Leave the overloaded "hotplug" word to susbsystems which are handling
real devices. The driver core does not "plug" anything, it just exports
the state to userspace and generates events.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/ipr.c
5f123fbd80f4f788554636f02bf73e40f914e0d6 11-Nov-2005 Kay Sievers <kay.sievers@suse.de> [PATCH] merge kobject_uevent and kobject_hotplug

The distinction between hotplug and uevent does not make sense these
days, netlink events are the default.

udev depends entirely on netlink uevents. Only during early boot and
in initramfs, /sbin/hotplug is needed. So merge the two functions and
provide only one interface without all the options.

The netlink layer got a nice generic interface with named slots
recently, which is probably a better facility to plug events for
subsystem specific events.
Also the new poll() interface to /proc/mounts is a nicer way to
notify about changes than sending events through the core.
The uevents should only be used for driver core related requests to
userspace now.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/ipr.c
ce155ccecd4094e7b5e68058d26db691713240fc 17-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Driver initialization fix for kexec/kdump

When kexec booting a kernel when the previous kernel did not
call ipr's shutdown method, the ipr adapter does not get
properly initialized, which can result in the ipr adapter
completing commands issued by the previous kernel. Fix ipr
to detect this scenario by reading the adapter's interrupt
mask register and the microprocessor interrupt register.
If the interrupt mask register indicates that interrupts
are enabled or the reset alert bit is set when the card is
probed, this means the card is in an unknown state and we
hard reset the card.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
dfed823eabf545795f04c8b5164d46a73c5b58ea 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Better handle failure of adapter bringup commands

Some new ipr adapters do not support some of the initialization
commands currently sent to it from the driver. Handle these
commands failing and continue on with the adapter initialization.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
86f51436dd851e1b8f33348be8a3d69f4f0e5e10 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: New PCI Ids

Adds support for some new ipr adapters

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
eeb88307aa483129d122137c88be7db0f0b56f63 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Support device reset to RAID disks

Support now exists in some ipr adapters to issue a device reset
to an Advanced Function disk.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
ee0a90fa3efffcaccffea5a9c1599f4c59ca55d4 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Support new device queueing model

New ipr adapters support a new device queueing model in the
adapter firmware. The queueing model is the NACA queueing model,
but it does not mean use of NACA is required. The new model removes
some of the adapter firmware queue state that made handling QERR=0
almost impossible. The queueing model on older adapters included the
concept of a queue frozen state, which would freeze the response
queue in the adapter when a check condition occurred, requiring a
a primitive to resume the queue. The new queueing model removes this
complexity.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
ee0f05b863df0a623792eaa46703019c100be2de 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: New adapter error types

Handle some new types of ipr errors that can be returned by the adapter.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
32d29776f8fe8293f7c5273624ec8fbd2b936bfa 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Module parm to disable RAID 0 auto create

Some ipr adapters will automatically create single device
RAID 0 arrays for all unconfigured RAID capable devices found
at adapter initialization time. This patch adds a module parameter
to disable this behavior.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
3d1d0da67520aa5dbcea617d52546ae046e946a4 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Runtime reset

Some IPR RAID adapter will automatically create single device RAID arrays
for all attached devices when the card is initialized. Setting the
RUNTIME_RESET doorbell bit will prevent this from occurring, since we
only want this behavior the first time the card is initialized and not
each time the card happens to get reset.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
b0df54bb4c9df6c1b1633a9f990b718059cda394 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: handle new adapter errors

Add support for handling some new errors that may be returned
by ipr adapters.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
f37eb54b48159f7384ad0e7e70e0f67d1317aac7 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Provide reset_adapter retry method for offlined adapters

If an ipr adapter repeatedly fails its initialization
the ipr driver will take the adapter offline and never talk
to it again. This provides a method for the user to manually
try the initialization again through sysfs.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
d3c74871bdcb9cb09dca22994dfee8500515f28f 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Runtime debugging options

Make some compile time debugging options runtime module options.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
12baa4202d74d799f4f8a4bd0455b485e4f8e876 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Fix adapter microcode update DMA mapping leak

If the write buffer command that is issued to the ipr adapter
to update its microcode fails for some reason, the DMA buffer
will never get unmapped. Move the pci_map/unmap out of the
IOA reset job so that the buffer is always clearly mapped
and unmapped.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
0bc42e35c74c0baab414cf623d6fe1e94cee4ca3 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Convert to use kzalloc

Convert appropriate kmalloc/memset calls to use kzalloc.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
622750406a1b4b230f1ee595cb555e5d9222feeb 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Write caching state host attribute

Adds a scsi_host sysfs attribute and module parm to enable/disable
the write cache on an ipr adapter.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
692aebfc6982a64e70ed11467545f2b9c95e6592 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: slave_alloc optimization

Optimize ipr's slave_alloc to return -ENXIO for devices that
do not exist.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
0726ce26104671e3072d90b9c697c253974e823d 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Prevent upper layer driver binding

Set the no_uld_attach for devices ipr does not want
upper layer drivers to attach to. These devices are
only reported for RAID management and only sg should
be used to talk to them.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
d0ad6f50399abc990adc4653c1eda5932b8adb52 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Include all disks in supported list

Fix ipr to include all disks in the supported device list,
not just disks formatted to advanced function format.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
cf8520376c2b752237095f6cd279e5443bd2fffe 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Error logging cleanup

Simplify error logging path, sanitize error length returned
by the adapter.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
a9cfca9622d660daf9422c2f041828e017eba58b 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Handle unknown errors

Better handle errors received which are not known to the device driver.
Just dump the hex data so that we have a hope of figuring out what
went wrong.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
6837c2bfda46887badf93ff67ace578877071984 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Generic adapter error cleaup

The generic ipr adapter error log currently logs 2 lines of useless
data. Delete these lines.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
fa15b1f6be4764bfeb29b0cf74442ea6dbb2ec9d 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Physical resource error logging macro

Adds a macro in the ipr driver for logging a physical device location.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
cfc321397e9e309a8148c18c32ade26ac40be39d 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Cleanup error structures

Simplify the ipr error structures a bit by removing some duplication.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
11cd8f120173a707e9ed7b78f7af8cde5a1ebb90 02-Nov-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Disk array rescanning fix

IPR RAID arrays show up on a virtual scsi bus, with a scsi bus number
of 255, which is generated by the adapter microcode. For the initial
scan of the host, we manually scan this bus since it does not obey
SAM in regards to sparse LUNs and the disk array devices do not have
a consistent product id to use scsi core's blacklist. If /proc/scsi/scsi
or sysfs is used to delete one of these devices, the device will not
be able to get added back by rescanning the host since scsi core
will see ipr's max_channel as 4, rather than 255. Update max_channel
after the initial scan so that ipr raid arrays can get re-added
if they get deleted.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
b30197d2c07b396907b81673354a015a9d2b216c 27-Sep-2005 Brian King <brking@us.ibm.com> [PATCH] PCI: ipr: Block config access during BIST

IPR scsi adapter have an exposure today in that they issue BIST to the adapter
to reset the card. If, during the time it takes to complete BIST, userspace
attempts to access PCI config space, the host bus bridge will master abort the
access since the ipr adapter does not respond on the PCI bus for a brief
period of time when running BIST. On PPC64 hardware, this master abort
results in the host PCI bridge isolating that PCI device from the rest of the
system, making the device unusable until Linux is rebooted. This patch makes
use of some newly added PCI layer APIs that allow for protection from
userspace accessing config space of a device in scenarios such as this.

Signed-off-by: Brian King <brking@us.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

drivers/scsi/ipr.c | 2 ++
1 file changed, 2 insertions(+)
/drivers/scsi/ipr.c
d18c3db58bc544fce6662ca7edba616ca9788a70 24-Jun-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] PCI: make drivers use the pci shutdown callback instead of the driver core callback.

Now we can change the pci core to always set this pointer, as pci drivers
should use it, not the driver core callback.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/ipr.c
10523b3b82456e416cbaffcc24ea2246980aa746 17-May-2005 Yani Ioannou <yani.ioannou@gmail.com> [PATCH] Driver Core: drivers/s390/net/qeth_sys.c - drivers/usb/gadget/pxa2xx_udc.c: update device attribute callbacks

Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/ipr.c
df0ae2497ddefd72a87f3a3b34ff32455d7d4ae0 28-May-2005 Jeff Garzik <jgarzik@pobox.com> [SCSI] allow sleeping in ->eh_host_reset_handler()

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
94d0e7b805961c44e4dc486ffc21075084bb7175 28-May-2005 Jeff Garzik <jgarzik@pobox.com> [SCSI] allow sleeping in ->eh_device_reset_handler()

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
8fa728a26886f56a9ee10a44fea0ddda301d21c3 28-May-2005 Jeff Garzik <jgarzik@pobox.com> [SCSI] allow sleeping in ->eh_abort_handler()

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
5cbf5eaef7e4430f60844748fd33e22a5fb15167 03-May-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Fix ipr PCI hotplug hang with CDROM attach

Currently, during PCI hotplug remove, if the upper layer
drivers of the attached devices send commands down as part
of the remove action, like a CDROM, the hotplug action
will hang forever due to the ipr driver returning
SCSI_MLQUEUE_HOST_BUSY. Patch fixes this.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
1b69f645f224d9bab7fd5988aca818c9445f11d0 03-May-2005 brking@us.ibm.com <brking@us.ibm.com> [SCSI] ipr: Array error logging fix

Bugme 4547. The following patch fixes a bug in ipr's error logging.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/ipr.c
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
/drivers/scsi/ipr.c