Small driver suspend() fixes in preparation for the PRETHAW events:
- Only compare message events for equality against PM_EVENT_* codes;
not against integers, or using greater/less-than comparisons.
(PM_EVENT_* should really become a __bitwise thing.)
- Explicitly test for SUSPEND events (rather than not-something-else)
before suspending devices.
- Removes more of the confusion between a pm_message_t (wraps event code)
and a "state" ... suspend() originally took a target system state.
These updates are correct and appropriate even without new PM_EVENT codes.
benh: "I think in the Mesh case, we should handle the freeze case as well or
we might get wild DMA."
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Greg KH <greg@kroah.com>
Cc: Paul Mackerras <paulus@samba.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.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>
To whoever had written that code:
a) priority of >> is higher than that of &
b) priority of typecast is higher than that of any binary operator
c) learn the fscking C
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Some user tools parse /proc/scsi/scsi, so we can't yet change the names.
Change the existing ones back to their old names, and add an admonition
to not make the same mistake that I did.
Andrew Morton reports that this was breaking YDL 4.1 userspace.
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
nlmsg_multicast now takes an extra allocation flag, so add it to
the use in the fibre channel transport class.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Key more of the domain validation settings off the inquiry data from
the disk (in particular, don't try IU or DT unless the disk claims to
support them.
Also add a new dv_in_progress flag to prevent recursive DV.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This started as a PCI reference fixup but to do that I need to build it,
to build it I need to fix it and its full of 32bitisms and uglies.
It has been resurrected, I'm not sure if this is a thank you for the
work on the license stuff or punishment for some unknown misdeed however
8). I've also fixed a memory scribble in the init code.
One oddity - the changes from HZ * to constants are deliberate. Whoever
originally wrote the code (or cleaned it up) used HZ for a cycle timing
loop even though is not HZ related. I've put it back to the counts used
in the old days when the driver was most used.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Received from Mark Salyzyn:
Until the system is stabilized, I am suggesting the enclosed
modification to prevent the driver from tickling the panic. Once sysfs
and friends are stabilized, the patch may be backed out. We have yet to
evaluate if we really want to relinquish existing Scsi Devices in any
case, holding on to them as configuration of arrays comes and goes makes
some sense as well. As a result, we have opted to pull the lines rather
than comment them in legacy.
Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Received from Mark Salyzyn:
The only real difference between the rkt and rx platform modules is the
offset of the message registers. This patch recognizes this similarity
and simplifies the driver to reduce it's code footprint and to improve
maintainability by reducing the code duplication.
Visibly, the 'rkt.c' portion of this patch looks more complicated than
it really is. View it as retaining the rkt-only specifics of the
interface.
Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Received from Mark Salyzyn:
I am placing this functionality into an insmod parameter. Normally the physical
components are exported to sg, and are blocked from showing up in sd.
Note that the pass-through I/O path via the driver through the Firmware to the
physical disks is not an optimized path, the card is designed for Hardware
RAID, elevator sorting and caching. This should not be used as a means for
utilizing the aacraid based controllers as a generic scsi/SATA/SAS controller,
performance should suck by a few percentage points, any RAID meta-data on the
drives will confuse the controller about who owns the drives and there is a
high risk of destroying content in both directions. Unreliable and for
experimentation or strange controlled circumstances only.
Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Received from Mark Salyzyn:
Basically cleanup, nothing here will have an affect. Adjusting some
error codes, removing superfluous definitions and code fragments.
Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Some cards need to pause the sequencer before the SBLKCTL register is
touched. This fixes a PCI related oops seen on powerpc macs with this
card caused by trying to ascertain the bus signalling before beginning
domain validation.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
For cards that don't support LVD, checking the SBLKCTL register to
determine the bus singalling doesn't work. So, check that the card
supports LVD first (AHC_ULTRA2) before checking the register.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
See http://www.torque.net/sg/sdebug26.html for more
information on the scsi_debug driver.
ChangeLog:
- add 'vpd_use_hostno' parameter to allow simulated hosts
to see the same set of targets (and luns). For testing
multipath software.
- add 'fake_rw' parameter to ignore the data in READ and
WRITE commands
- add support for log subpages (new in SPC-4)
- yield appropriate block descriptor for MODE SENSE
commands (only for pdt=0 (i.e. disks))
- REQUEST SENSE response no longer shows the stopped
power condition (SAT changed to agree with SPC-3)
Signed-off-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Check copy_to_user() return value in drivers/scsi/megaraid.c::megadev_ioctl()
This gets rid of this little warning:
drivers/scsi/megaraid.c:3661: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: "Ju, Seokmann" <Seokmann.Ju@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Fix this driver not to use a static two element host array instead use
a list. This should fix panic on multiple eject reinsert of the
pcmcia version of this device.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This patch removes the reliance on FLASH Manufacture IDs for validation.
Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (64 commits)
[BLOCK] dm-crypt: trivial comment improvements
[CRYPTO] api: Deprecate crypto_digest_* and crypto_alg_available
[CRYPTO] padlock: Convert padlock-sha to use crypto_hash
[CRYPTO] users: Use crypto_comp and crypto_has_*
[CRYPTO] api: Add crypto_comp and crypto_has_*
[CRYPTO] users: Use crypto_hash interface instead of crypto_digest
[SCSI] iscsi: Use crypto_hash interface instead of crypto_digest
[CRYPTO] digest: Remove old HMAC implementation
[CRYPTO] doc: Update documentation for hash and me
[SCTP]: Use HMAC template and hash interface
[IPSEC]: Use HMAC template and hash interface
[CRYPTO] tcrypt: Use HMAC template and hash interface
[CRYPTO] hmac: Add crypto template implementation
[CRYPTO] digest: Added user API for new hash type
[CRYPTO] api: Mark parts of cipher interface as deprecated
[PATCH] scatterlist: Add const to sg_set_buf/sg_init_one pointer argument
[CRYPTO] drivers: Remove obsolete block cipher operations
[CRYPTO] users: Use block ciphers where applicable
[SUNRPC] GSS: Use block ciphers where applicable
[IPSEC] ESP: Use block ciphers where applicable
...
This patch converts ISCSI to use the new crypto_hash interface instead
of crypto_digest. It's a fairly straightforward substitution.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
0x848a in ID word 0 indicates CFA device iff the ID data is obtained from
IDENTIFY DEVICE. For ATAPI devices, 0x848a in ID work 0 indicates valid
ATAPI device. Fix sanity check in ata_dev_read_id() such that ATAPI
devices reporting 0x848a in ID word 0 is not handled as error.
The problem is identified by J.A. Magallon with HL-DT-ST DVDRAM GSA-4120B.
Signed-off-by: Tejun Helo <htejun@gmail.com>
Cc: J.A. Magallon <jamagallon@ono.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Changes obsolete typedef'd Scsi_Cmnd to struct scsi_cmnd.
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
LD .tmp_vmlinux1
drivers/built-in.o(.text+0x8e1f9): In function `scsi_device_put':
drivers/scsi/scsi.c:887: undefined reference to `module_refcount'
make: *** [.tmp_vmlinux1] Error 1
There are only two users of module_refcount() outside of kernel/module.c
and the other one uses ifdef's similar to this.
Signed-Off-By: Daniel Walker <dwalker@mvista.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
There are two changes here. The first reverses the broken PCI_DEVICE
conversion back to the old format. The second adds a missing PCI ID so
you can actually boot 2.6.18 on 2 month old VIA motherboards (right now
only 2.6.18-mm works).
CC'd to Jeff to check the PCI ident but its a) in several distro kernels
and b) in 2.6.18-mm [twice ??]
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Although the document says otherwise, some ich7m uses map 01b. This
patch adds separate map DB for ICH7M and adds map entry for 01b.
This was spotted on an ASUS laptop by Jonathan Dieter.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jonathan Dieter <jdieter@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Fix a buglet; the errata check below this code is assuming the value in
the sstatus variable is what was pulled out of the SCR_STATUS register.
However, the status checks in the timeout loop clobber everything
but the first 4 bits of sstatus, so the errata checks are invalid.
This patch changes it to not clobber SStatus.
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
CONFIG_SCSI_NETLINK can become a bool since the item its
selecting (CONFIG_NET) cannot be a module.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This patch implements the ability to set the minimum and maximum
linkrates for both libsas (for expanders) and aic94xx (for the host
phys). It also tidies up the setting of the hardware min and max to
make sure they're updated when the expander emits a change broadcast.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
According to SPEC, the minimum_linkrate and maximum_linkrate should be
settable by the user. This patch introduces a callback that allows the
sas class to pass these settings on to the driver.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
At the moment we have two separate linkspeed enumerations covering
roughly the same values. This patch consolidates on a single one enum
sas_linkspeed in scsi_transport_sas.h and uses it everywhere in the
aic94xx driver. Eventually I'll get around to removing the duplicated
fields in asd_sas_phy and sas_phy ...
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
The recent change to the way scsi_device_get()/put() work broke the
non modular build (we do a module_refcount on a NULL). Fix this by
checking for non-null before checking module_refcount().
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Spotted by: Dan Aloni <da-xx@monatomic.org>
The problem is there's inconsistent locking semantic usage of
scsi_alloc_target(). Two callers assume the target comes back with
reference unincremented and the third assumes its incremented. Fix by
always making the reference incremented on return. Also fix path in
target alloc that could consistently increment the parent lock.
Finally document scsi_alloc_target() so its callers know what the
expectations are.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Add support for a new lpfc soft_wwpn sysfs attribute
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Add support for new dev_loss_tmo callback
Goodness is that it removes code for a parallel nodev timer that
existed in the driver
Add support for the new fast_io_fail callback
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This patch adds the following functionality to the FC transport:
- dev_loss_tmo LLDD callback :
Called to essentially confirm the deletion of an rport. Thus, it is
called whenever the dev_loss_tmo fires, or when the rport is deleted
due to other circumstances (module unload, etc). It is expected that
the callback will initiate the termination of any outstanding i/o on
the rport.
- fast_io_fail_tmo and LLD callback:
There are some cases where it may take a long while to truly determine
device loss, but the system is in a multipathing configuration that if
the i/o was failed quickly (faster than dev_loss_tmo), it could be
redirected to a different path and completed sooner.
Many thanks to Mike Reed who cleaned up the initial RFC in support
of this post.
The original RFC is at:
http://marc.theaimsgroup.com/?l=linux-scsi&m=115505981027246&w=2
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Add support to return adapter symbolic name (now that attribute is dynamic)
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Add support to post events via new FC event interfaces
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
During discussions with Mike Christie, I became convinced that we needed
a larger vendor id. This patch extends the id from 32 to 64 bits.
This applies on top of the prior patches that add SCSI transport events
via netlink.
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This patch formally adds support for the posting of FC events via netlink.
It is a followup to the original RFC at:
http://marc.theaimsgroup.com/?l=linux-scsi&m=114530667923464&w=2
and the initial posting at:
http://marc.theaimsgroup.com/?l=linux-scsi&m=115507374832500&w=2
The patch has been updated to optimize the send path, per the discussions
in the initial posting.
Per discussions at the Storage Summit and at OLS, we are to use netlink for
async events from transports. Also per discussions, to avoid a netlink
protocol per transport, I've create a single NETLINK_SCSITRANSPORT protocol,
which can then be used by all transports.
This patch:
- Creates new files scsi_netlink.c and scsi_netlink.h, which contains the
single and shared definitions for the SCSI Transport. It is tied into the
base SCSI subsystem intialization.
Contains a single interface routine, scsi_send_transport_event(), for a
transport to send an event (via multicast to a protocol specific group).
- Creates a new scsi_netlink_fc.h file, which contains the FC netlink event
messages
- Adds 3 new routines to the fc transport:
fc_get_event_number() - to get a FC event #
fc_host_post_event() - to send a simple FC event (32 bits of data)
fc_host_post_vendor_event() - to send a Vendor unique event, with
arbitrary amounts of data.
Note: the separation of event number allows for a LLD to send a standard
event, followed by vendor-specific data for the event.
Note: This patch assumes 2 prior fc transport patches have been installed:
http://marc.theaimsgroup.com/?l=linux-scsi&m=115555807316329&w=2http://marc.theaimsgroup.com/?l=linux-scsi&m=115581614930261&w=2
Sorry - next time I'll do something like making these individual
patches of the same posting when I know they'll be posted closely
together.
Signed-off-by: James Smart <James.Smart@emulex.com>
Tidy up configuration not to make SCSI always select NET
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>