Re: sil3114 data corruption
On Monday 08 October 2007 17:09:17 Bernd Schubert wrote: [sorry for sending twice, but after I read the sil sources, I see the mail address had been wrong] Hi, somehow the sil3114 causes data corruption with some (newer?) disks. Simply filling the filesystem with zeros and reading the these data will make the kernel to report filesystem corruption. This is definitely not an issue of memory, since the systems (several tested) do have ECC memory and the memory is monitored with EDAC. kernel versions tested: 2.6.15-2.6.20 Update: Setting sata_sil.slow_down=1 fill fix the problem, seems there are some drives missing in the quirk table. Jeff, I found an old patch/workaround from you (http://uwsg.indiana.edu/hypermail/linux/kernel/0403.1/1957.html), can you give me any further information why this never went into the driver? Thanks, Bernd -- Bernd Schubert Q-Leap Networks GmbH - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] [PATCH 1/1] blk request timeout handler patches
On Tue, Oct 09 2007, James Bottomley wrote: On Tue, 2007-10-09 at 14:15 +0200, Jens Axboe wrote: On Tue, Oct 09 2007, Matthew Wilcox wrote: On Mon, Oct 08, 2007 at 10:36:10PM -0700, [EMAIL PROTECTED] wrote: Thank you Randy, Jens for your suggestions. I folded the second patch as it is just a clean up. Here is the fixed one patch version. I was thinking about this (in the context of shrinking scsi_cmnd -- obviously, things are not improved if we simply move the timer to request instead of scsi_cmnd). Why do we need a timer _per request_? We don't need one per network packet. I appreciate we had one per scsi_cmnd and this patch is just moving it upwards in the hierarchy, but perhaps we can do better. What if we have one timer per request queue instead? It needs to expire as soon as the earliest request timer would expire, then needs to be reset to the next earliest one. We might walk the request queue more frequently, but we'd save 48 bytes in the struct request. I agree, adding a full timer to each request is not nice. You jump over the actual implementation details of having just one timer in the queue though, it's pretty cheap to just say it can be done :-). You need to track each request anyways. If all drivers used the block layer tagging it would be easy since we are tracking each pending request in that case, but right now they don't. So pending requests may very well be outside of block layer knowledge. Can't we handle this a bit like the Linux timer infrastructure? Instead of a timer per cmnd we have one per queue that's reset by commands returning? If we retained a linked list of commands in timer order and expiry times, that's still going to save us an unsigned long and two pointers over struct timer_list. Here's an approach that uses a single timer. I purposely do not sort commands in expiry times, as that would introduce an O(N) operation far out weighing the IO scheduling cost, pretty silly for a timeout mechanism that supposedly should never trigger. Or we could waste more memory and fewer cycles (but still far more cycles than we need) by sorting in some sort of tree. So I don't sort the list, instead I push the cost of locating expired request to the timeout handler. It should really only run, when a request times out. Timeout is then reset to next command timeout (rounded), if further commands exist. It also doesn't fiddle with the timer unless an incoming command has a lower timeout than the current one. Totally untested... diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index ed39313..cb3210a 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -42,6 +42,7 @@ static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io); static void init_request_from_bio(struct request *req, struct bio *bio); static int __make_request(struct request_queue *q, struct bio *bio); static struct io_context *current_io_context(gfp_t gfp_flags, int node); +static void blk_rq_timed_out_timer(unsigned long); /* * For the allocated request tables @@ -177,6 +178,18 @@ void blk_queue_softirq_done(struct request_queue *q, softirq_done_fn *fn) EXPORT_SYMBOL(blk_queue_softirq_done); +void blk_queue_rq_timeout(struct request_queue *q, unsigned int timeout) +{ + q-rq_timeout = timeout; +} +EXPORT_SYMBOL_GPL(blk_queue_rq_timeout); + +void blk_queue_rq_timed_out(struct request_queue *q, rq_timed_out_fn *fn) +{ + q-rq_timed_out_fn = fn; +} +EXPORT_SYMBOL_GPL(blk_queue_rq_timed_out); + /** * blk_queue_make_request - define an alternate make_request function for a device * @q: the request queue for the device to be affected @@ -239,7 +252,9 @@ static void rq_init(struct request_queue *q, struct request *rq) { INIT_LIST_HEAD(rq-queuelist); INIT_LIST_HEAD(rq-donelist); + INIT_LIST_HEAD(rq-timeout_list); + rq-timeout = 0; rq-errors = 0; rq-bio = rq-biotail = NULL; INIT_HLIST_NODE(rq-hash); @@ -1851,6 +1866,8 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) return NULL; init_timer(q-unplug_timer); + setup_timer(q-timeout, blk_rq_timed_out_timer, (unsigned long) q); + INIT_LIST_HEAD(q-timeout_list); snprintf(q-kobj.name, KOBJ_NAME_LEN, %s, queue); q-kobj.ktype = queue_ktype; @@ -2271,6 +2288,7 @@ EXPORT_SYMBOL(blk_start_queueing); */ void blk_requeue_request(struct request_queue *q, struct request *rq) { + blk_delete_timer(rq); blk_add_trace_rq(q, rq, BLK_TA_REQUEUE); if (blk_rq_tagged(rq)) @@ -3600,24 +3618,132 @@ static struct notifier_block __devinitdata blk_cpu_notifier = { }; /** - * blk_complete_request - end I/O on a request - * @req: the request being processed + * blk_delete_timer - Delete/cancel timer for a given function. + * @req: request that we are canceling timer for * - * Description: - *
[ANNOUNCE] sdparm 1.02
sdparm is a command line utility designed to get and set SCSI device parameters (cf hdparm for ATA disks). The parameters are held in mode pages. Apart from SCSI devices (e.g. disks, tapes and enclosures) sdparm can be used on any device that uses a SCSI command set. Almost all CD/DVD drives use the SCSI MMC set irrespective of the transport. sdparm also can decode VPD pages including the device identification page. Commands to start and stop the media; load and unload removable media and some other housekeeping functions are supported. sdparm supports both the linux kernel 2.4 and 2.6 series with ports to FreeBSD, Solaris, Tru64 and Windows. ChangeLog for sdparm-1.02 [20071008] - support mode page descriptors with acronym_name[.descriptor_num] syntax - 2_acronym type entries replaced by new syntax - support medium partition mpage (SSC) with partitions as descriptors - append relative target port identifier to SAS target port address with '-iq' option - add solaris port - place vendor specific data in sdparm_data_vendor.c - in the absence of an explicit transport or vendor, and if no match on mode page name or field, then try SAS transport - add block device characteristics VPD page - add protocol-specific logical unit information VPD page (SAS) - use new sg_lib sg_get_num_nomult() - place source in subversion repository - use svn:externals property to point to sg3_utils' include/ and lib/ directories - move some files around (e.g. sdparm.8 to doc/) For more information and downloads see: http://www.torque.net/sg/sdparm.html A release announcement has been sent to freshmeat.net . Doug Gilbert - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Add ALUA hardware handler
Hi Alasdair, this is a patch to add a SPC-3 hardware handler. SPC-3 ALUA has provisioning for 'explicit' port group state change via the SET TARGET GROUP STATES command, and some newer storage arrays do benefit from this. Eg HP EVAs and newer EMC Clariions already support explicit ALUA. Please apply. Cheers, Hannes -- Dr. Hannes Reinecke zSeries Storage [EMAIL PROTECTED] +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig index 531d4d1..3fa9df3 100644 --- a/drivers/md/Kconfig +++ b/drivers/md/Kconfig @@ -267,6 +267,13 @@ config DM_MULTIPATH_RDAC ---help--- Multipath support for LSI/Engenio RDAC. +config DM_MULTIPATH_ALUA + tristate SPC-3 ALUA multipath support (EXPERIMENTAL) + depends on DM_MULTIPATH BLK_DEV_DM EXPERIMENTAL + ---help--- + Multipath support for SPC-3 Asymmetric Logical Unit + Access (ALUA). + config DM_DELAY tristate I/O delaying target (EXPERIMENTAL) depends on BLK_DEV_DM EXPERIMENTAL diff --git a/drivers/md/Makefile b/drivers/md/Makefile index c49366c..5013920 100644 --- a/drivers/md/Makefile +++ b/drivers/md/Makefile @@ -8,6 +8,7 @@ dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o dm-snapshot-objs := dm-snap.o dm-exception-store.o dm-mirror-objs := dm-log.o dm-raid1.o dm-rdac-objs := dm-mpath-rdac.o +dm-alua-objs := dm-mpath-alua.o md-mod-objs := md.o bitmap.o raid456-objs := raid5.o raid6algos.o raid6recov.o raid6tables.o \ raid6int1.o raid6int2.o raid6int4.o \ @@ -36,6 +37,7 @@ obj-$(CONFIG_DM_DELAY)+= dm-delay.o obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o obj-$(CONFIG_DM_MULTIPATH_RDAC)+= dm-rdac.o +obj-$(CONFIG_DM_MULTIPATH_ALUA)+= dm-alua.o obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o obj-$(CONFIG_DM_MIRROR)+= dm-mirror.o obj-$(CONFIG_DM_ZERO) += dm-zero.o diff --git a/drivers/md/dm-mpath-alua.c b/drivers/md/dm-mpath-alua.c new file mode 100644 index 000..40b9d4d --- /dev/null +++ b/drivers/md/dm-mpath-alua.c @@ -0,0 +1,662 @@ +/* + * Generic SCSI-3 ALUA DM HW handler + * + * Copyright (C) 2007 Hannes Reinecke. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ +#include scsi/scsi.h +#include scsi/scsi_cmnd.h +#include scsi/scsi_eh.h + +#define DM_MSG_PREFIX multipath alua + +#include dm.h +#include dm-hw-handler.h + +#define ALUA_DM_HWH_NAME alua +#define ALUA_DM_HWH_VER 0.2 + +enum tpgs_state { + TPGS_STATE_UNKNOWN = -1, + TPGS_STATE_OPTIMIZED = 0x0, + TPGS_STATE_NONOPTIMIZED, + TPGS_STATE_STANDBY, + TPGS_STATE_UNAVAILABLE, + TPGS_STATE_OFFLINE = 0xe, + TPGS_STATE_TRANSITIONING, +}; + +#define TPGS_SUPPORT_NONE 0x00 +#define TPGS_SUPPORT_OPTIMIZED 0x01 +#define TPGS_SUPPORT_NONOPTIMIZED 0x02 +#define TPGS_SUPPORT_STANDBY 0x04 +#define TPGS_SUPPORT_UNAVAILABLE 0x08 +#define TPGS_SUPPORT_OFFLINE 0x40 +#define TPGS_SUPPORT_TRANSITION0x80 + +#define TPGS_MODE_UNINITIALIZED-1 +#define TPGS_MODE_NONE 0x0 +#define TPGS_MODE_IMPLICIT 0x1 +#define TPGS_MODE_EXPLICIT 0x2 + +#define TPGS_INQUIRY_SIZE 36 +#define TPGS_FAILOVER_TIMEOUT (60 * HZ) + +struct alua_handler { + struct dm_path *path; + int debug; + int group_id; + int rel_port; + int tpgs; + enum tpgs_state state; + unsigned char inq[TPGS_INQUIRY_SIZE]; + unsigned char *buff; + int bufflen; + unsigned char sense[SCSI_SENSE_BUFFERSIZE]; +}; + +#define ALUA_POLICY_SWITCH_CURRENT 0 +#define ALUA_POLICY_SWITCH_ALL 1 + +#define DPRINT(h, f, arg...) \ + if (h-debug) DMINFO(%s: f, h-path-dev-name, arg) + +static inline int had_failures(int error) +{ + return (host_byte(error) != DID_OK || + msg_byte(error) != COMMAND_COMPLETE); +} + +static int
Re: [PATCH] aic94xx: Use request_firmware() to provide SAS address if the adapter lacks one
Darrick J. Wong wrote: Though I don't see why both can't coexist cleanly -- I take it the use case you are considering is: software recognizes no valid WWPN available, query via request_firmware() fails, software halts initialization (rather than fail), and awaits the admin to poke '0x123456.. /sys/.../fc_host/soft_port_name', causing a ping to the driver and continuation of initialization with requested portname? Hmm... could we use such a sysfs attribute to reassign adapter WWNs at arbitrary times? Is that even a good idea? As the threads on this topic has shown - allowing any kind of override or WWN generation isn't a well-liked idea. But there are plausible scenarios where it makes sense. Here's one pro for setting WWNs at arbitrary times... If the box is migrating applications (say containers) that want different SAN connectivity, where that connectivity (view) is based on their WWN, it would be really nice to selectively set the WWN and not touch the SAN config. Granted, in FC, NPIV can do the same thing, but this could be done on an adapter or configuration that can't do NPIV. So, what's the decision - are we only allowing this for physical adapters that don't have a name ? or are we allowing it to be more dynamic ? My thoughts on request_firmware() vs sysfs: via request_firmware pro: It seems to imply a stronger level of control, as it seems more hidden from the casual admin and/or tools. Too many random things now peruse sysfs attributes without knowing their meaning. Also, easier (more correct) to pass multiple elements (WWNN WWPN) if needed. con: ?? when does it get used - only at initial attachment and under failure ? If you were to make it more arbitrary, doesn't it imply some sysfs use to poke the driver/transport to get the new value ? and if arbitrary, how to marry that with kdump so the initrd is up to date. Also, it's yet another mgmt interface - how many does an admin need to know about ? Hotplug scripts to identify the adapter and specify the proper names are more complex for the admin than sysfs. via sysfs: pro: Keeps all mgmt in the sysfs area, which admins are starting to become comfortable with. Easily supports a dynamic, change at any time model. con: Drives to a set-after-attachment model, and doesn't support kdump well (requires initrd tools). Multiple elements can be a bit cumbersome if one follows the one-value-per-attribute sysfs rules. Must protect against random rogue sysfs tools. Overall, I guess I like the stronger controls of request_firmware(), but dislike using yet another mgmt interface for admins. -- james s - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] aic94xx: Use request_firmware() to provide SAS address if the adapter lacks one
James Smart wrote: So, what's the decision - are we only allowing this for physical adapters that don't have a name ? or are we allowing it to be more dynamic ? At a minimum, I think(?) we all agree that current upstream aic94xx behavior is nice: allow the admin to override the WWN manually, even if the adapter already has one. As to the question of request_firmware() versus sysfs, it's IMO largely a question of taste -- do you like the get property on-demand pull model, or a push model that presumes the property must be set before it is needed? And which solution requires the least amount of additional userspace machinery in order to be usable? Jeff - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: HP M820e CDRW - nsp32 driver.
On Mon, Oct 08, 2007 at 07:03:34PM -0400, cga2000 wrote: Would anyone know how I could get this external CDRW to work with a linux 2.6.20 kernel? The cardctl [info|status|config] commands seem to give me the expected output but a cdrecord -scanbus informs me that no target could be found. Boot messages suggests there is an IRQ conflict: They do suggest that, but after looking into it, it seems like a small mistake in the driver that won't actually affect operation. pccard: CardBus card inserted into slot 1 SCSI subsystem initialized nsp32: loading... es1968: clocking to 48000 PCI: Enabling device :06:00.0 ( - 0003) ACPI: PCI Interrupt :06:00.0[A] - Link [LNKA] - GSI 11 (level, low) - IRQ 11 PCI: Setting latency timer of device :06:00.0 to 64 nsp32: No EEPROM detected: 0x0 nsp32: term power on scsi0 : NinjaSCSI-32Bi/UDE: irq 11, io 0x3000+0x80 cs: IO port probe 0x100-0x3af: clean. cs: IO port probe 0x3e0-0x4ff: clean. cs: IO port probe 0x820-0x8ff: clean. cs: IO port probe 0xc00-0xcf7: clean. cs: IO port probe 0xa00-0xaff: clean. cs: IO port probe 0x100-0x3af: clean. cs: IO port probe 0x3e0-0x4ff: clean. cs: IO port probe 0x820-0x8ff: clean. cs: IO port probe 0xc00-0xcf7: clean. cs: IO port probe 0xa00-0xaff: clean. cs: memory probe 0xa000-0xa0ff: clean. pcmcia: registering new device pcmcia0.0 pcmcia: request for exclusive IRQ could not be fulfilled. pcmcia: the driver needs updating to supported shared IRQ lines. ASIC rev 1,6eth0: Megahertz 3CCFEM556 at io 0x300, irq 3, hw_addr 00:00:86:53:8D:F7. 64K FIFO split 1:1 Rx:Tx, autoselect MII interface. pcmcia: registering new device pcmcia0.1 pcmcia: request for exclusive IRQ could not be fulfilled. pcmcia: the driver needs updating to supported shared IRQ lines. 0.1: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A scsi 0:0:4:0: CD-ROMhp CD-Writer+ M820 1.23 PQ: 0 ANSI: 2 nsp32: irq: 11 mmio: d8806000+0x1000 slot: :06:00.0 model: KME SCSI CardBus card nsp32: Bus Reset nsp32: Host Reset nsp32: term power on sr 0:0:4:0: scsi: Device offlined - not ready after error recovery This procedure does suggest some kind of interrupt problem though. IRQ 11 makes sense; it's shared with yenta. I don't know why you're not seeing the nsp32 interrupt handler run though. sr 0:0:4:0: rejecting I/O to offline device sr 0:0:4:0: rejecting I/O to offline device sr0: scsi3-mmc drive: 0x/0x caddy sr 0:0:4:0: Attached scsi CD-ROM sr0 sr 0:0:4:0: Attached scsi generic sg0 type 5 Here's the output of lspci in case it helps: 00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03) 00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03) 00:04.0 CardBus bridge: Texas Instruments PCI1225 (rev 01) 00:04.1 CardBus bridge: Texas Instruments PCI1225 (rev 01) 00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 02) 00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01) 00:07.2 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01) 00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02) 00:08.0 Multimedia audio controller: ESS Technology ES1978 Maestro 2E (rev 10) 01:00.0 VGA compatible controller: ATI Technologies Inc Rage Mobility P/M AGP 2x (rev 64) 06:00.0 SCSI storage controller: Workbit Corporation NinjaSCSI-32 KME (rev 01) And this is the output of cat /proc/interrupts CPU0 0:1298388XT-PIC-XTtimer 1: 14705XT-PIC-XTi8042 2: 0XT-PIC-XTcascade 3: 203621XT-PIC-XTpcmcia0.0 5:1470504XT-PIC-XTuhci_hcd:usb1, ESS Maestro 6: 5XT-PIC-XTfloppy 7:136XT-PIC-XTparport0 9: 6986XT-PIC-XTacpi 11: 34XT-PIC-XTyenta, yenta, nsp32 12:577XT-PIC-XTi8042 14: 17562XT-PIC-XTide0 15: 45023XT-PIC-XTide1 NMI: 0 ERR: 0 I spent most of the day searching for clues as to what might be the problem but I didn't find anything that looked like a solution. Is there something wrong with my kernel configuration? Do I need to upgrade the nsp32 driver as suggested by the output of dmesg? I rely entirely on this external CD burner to back up my system so any help or pointers would be highly appreciated. If [OT]
Re: [RFC] [PATCH 1/1] blk request timeout handler patches
I don't see blk_delete_timer() actually calling mod_timer/del_timer at all. Doesn't that mean, your timer would eventually expire for no reason and walk through the list unnecessarily? Thanks, Malahal. Jens Axboe [EMAIL PROTECTED] wrote: On Tue, Oct 09 2007, James Bottomley wrote: On Tue, 2007-10-09 at 14:15 +0200, Jens Axboe wrote: On Tue, Oct 09 2007, Matthew Wilcox wrote: On Mon, Oct 08, 2007 at 10:36:10PM -0700, [EMAIL PROTECTED] wrote: Thank you Randy, Jens for your suggestions. I folded the second patch as it is just a clean up. Here is the fixed one patch version. I was thinking about this (in the context of shrinking scsi_cmnd -- obviously, things are not improved if we simply move the timer to request instead of scsi_cmnd). Why do we need a timer _per request_? We don't need one per network packet. I appreciate we had one per scsi_cmnd and this patch is just moving it upwards in the hierarchy, but perhaps we can do better. What if we have one timer per request queue instead? It needs to expire as soon as the earliest request timer would expire, then needs to be reset to the next earliest one. We might walk the request queue more frequently, but we'd save 48 bytes in the struct request. I agree, adding a full timer to each request is not nice. You jump over the actual implementation details of having just one timer in the queue though, it's pretty cheap to just say it can be done :-). You need to track each request anyways. If all drivers used the block layer tagging it would be easy since we are tracking each pending request in that case, but right now they don't. So pending requests may very well be outside of block layer knowledge. Can't we handle this a bit like the Linux timer infrastructure? Instead of a timer per cmnd we have one per queue that's reset by commands returning? If we retained a linked list of commands in timer order and expiry times, that's still going to save us an unsigned long and two pointers over struct timer_list. Here's an approach that uses a single timer. I purposely do not sort commands in expiry times, as that would introduce an O(N) operation far out weighing the IO scheduling cost, pretty silly for a timeout mechanism that supposedly should never trigger. Or we could waste more memory and fewer cycles (but still far more cycles than we need) by sorting in some sort of tree. So I don't sort the list, instead I push the cost of locating expired request to the timeout handler. It should really only run, when a request times out. Timeout is then reset to next command timeout (rounded), if further commands exist. It also doesn't fiddle with the timer unless an incoming command has a lower timeout than the current one. Totally untested... diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index ed39313..cb3210a 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -42,6 +42,7 @@ static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io); static void init_request_from_bio(struct request *req, struct bio *bio); static int __make_request(struct request_queue *q, struct bio *bio); static struct io_context *current_io_context(gfp_t gfp_flags, int node); +static void blk_rq_timed_out_timer(unsigned long); /* * For the allocated request tables @@ -177,6 +178,18 @@ void blk_queue_softirq_done(struct request_queue *q, softirq_done_fn *fn) EXPORT_SYMBOL(blk_queue_softirq_done); +void blk_queue_rq_timeout(struct request_queue *q, unsigned int timeout) +{ + q-rq_timeout = timeout; +} +EXPORT_SYMBOL_GPL(blk_queue_rq_timeout); + +void blk_queue_rq_timed_out(struct request_queue *q, rq_timed_out_fn *fn) +{ + q-rq_timed_out_fn = fn; +} +EXPORT_SYMBOL_GPL(blk_queue_rq_timed_out); + /** * blk_queue_make_request - define an alternate make_request function for a device * @q: the request queue for the device to be affected @@ -239,7 +252,9 @@ static void rq_init(struct request_queue *q, struct request *rq) { INIT_LIST_HEAD(rq-queuelist); INIT_LIST_HEAD(rq-donelist); + INIT_LIST_HEAD(rq-timeout_list); + rq-timeout = 0; rq-errors = 0; rq-bio = rq-biotail = NULL; INIT_HLIST_NODE(rq-hash); @@ -1851,6 +1866,8 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) return NULL; init_timer(q-unplug_timer); + setup_timer(q-timeout, blk_rq_timed_out_timer, (unsigned long) q); + INIT_LIST_HEAD(q-timeout_list); snprintf(q-kobj.name, KOBJ_NAME_LEN, %s, queue); q-kobj.ktype = queue_ktype; @@ -2271,6 +2288,7 @@ EXPORT_SYMBOL(blk_start_queueing); */ void blk_requeue_request(struct request_queue *q, struct request *rq) { + blk_delete_timer(rq); blk_add_trace_rq(q, rq, BLK_TA_REQUEUE); if (blk_rq_tagged(rq)) @@ -3600,24
Re: [RFC] [PATCH 1/1] blk request timeout handler patches
On Wed, Oct 10 2007, [EMAIL PROTECTED] wrote: I don't see blk_delete_timer() actually calling mod_timer/del_timer at all. Doesn't that mean, your timer would eventually expire for no reason and walk through the list unnecessarily? Please stop top posting, thanks. Yeah, it can only remove the request from the list. We could delete the timer as well if the list is now empty, I'll now add that check. It's part of the design that the timer may fire and find nothing to do, my theory is that this is much cheaper than making the enqueue path more costly. The latter is an absolute no-no, I'd much rather take the one-timer-per-request hit than start engaging in any type of expiry sorting or similar at request add time. -- Jens Axboe - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Advice on an sg issue
Greetings, I was wondering if anyone could give me advice on something.. it's probably a quick one for anyone (unlike myself) who actually know the subsystem :) I'm running into an issue using sg to issue a read data update command to a device attached to a qlogic controller. After the command is issued, it hangs for 20 minutes before it comes back with an error from the write(). This behavior only occurs with a certain firmware version of the device, so normally I'd just say it must be a device problem... however, the git commit which switched sg.c to use scsi_execute_async instead of scsi_do_req seems to fix the behavior. Does anyone know, offhand, what sort of behavior change could've resulted from switching that api use? Thanks, -- Chris Larson - clarson at kergoth dot com Software Engineer - MontaVista - clarson at mvista dot com Core Developer/Architect - TSLib, BitBake, OpenEmbedded, OpenZaurus - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 21/24 ver2] qlogicpti.c: convert to accessors and !use_sg cleanup
- convert to accessors and !use_sg cleanup Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/scsi/qlogicpti.c | 29 +++-- 1 files changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index e93f803..db43d1c 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c @@ -871,11 +871,12 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd, struct scatterlist *sg; int i, n; - if (Cmnd-use_sg) { + if (scsi_bufflen(Cmnd)) { int sg_count; - sg = (struct scatterlist *) Cmnd-request_buffer; - sg_count = sbus_map_sg(qpti-sdev, sg, Cmnd-use_sg, Cmnd-sc_data_direction); + sg = scsi_sglist(Cmnd); + sg_count = sbus_map_sg(qpti-sdev, sg, scsi_sg_count(Cmnd), + Cmnd-sc_data_direction); ds = cmd-dataseg; cmd-segment_cnt = sg_count; @@ -913,16 +914,6 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd, } sg_count -= n; } - } else if (Cmnd-request_bufflen) { - Cmnd-SCp.ptr = (char *)(unsigned long) - sbus_map_single(qpti-sdev, - Cmnd-request_buffer, - Cmnd-request_bufflen, - Cmnd-sc_data_direction); - - cmd-dataseg[0].d_base = (u32) ((unsigned long)Cmnd-SCp.ptr); - cmd-dataseg[0].d_count = Cmnd-request_bufflen; - cmd-segment_cnt = 1; } else { cmd-dataseg[0].d_base = 0; cmd-dataseg[0].d_count = 0; @@ -1158,17 +1149,11 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti) else Cmnd-result = DID_ERROR 16; - if (Cmnd-use_sg) { + if (scsi_bufflen(Cmnd)) sbus_unmap_sg(qpti-sdev, - (struct scatterlist *)Cmnd-request_buffer, - Cmnd-use_sg, + scsi_sglist(Cmnd), scsi_sg_count(Cmnd), Cmnd-sc_data_direction); - } else if (Cmnd-request_bufflen) { - sbus_unmap_single(qpti-sdev, - (__u32)((unsigned long)Cmnd-SCp.ptr), - Cmnd-request_bufflen, - Cmnd-sc_data_direction); - } + qpti-cmd_count[Cmnd-device-id]--; sbus_writew(out_ptr, qpti-qregs + MBOX5); Cmnd-host_scribble = (unsigned char *) done_queue; -- 1.5.3.1 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patchset 0/24] Lots of the Accessors patches and !use_sg cleanup
On Tue, Sep 11 2007 at 23:23 +0300, Boaz Harrosh [EMAIL PROTECTED] wrote: Here are more accessors patches. I have tried to find Maintainers of drivers but please help me if I missed any. After this there are 3 drivers left (I think) - gdth.c, pluto.c, seagate.c These I'll send only next week in a set of their own. {Please tell me I can kill pluto and seagate.} Some of the drivers that are not here were already posted by Tomo. Some of the drivers here were posted before but these are better versions of them. [USB] - Greg Kroah-Hartman [EMAIL PROTECTED], Alan Stern [EMAIL PROTECTED], Matthew Dharm [EMAIL PROTECTED] 0001- drivers/usb/storage/transport.c drivers/usb/storage/transport.h 0002- drivers/usb/storage/protocol.c 0003- drivers/usb/storage/shuttle_usbat.c 0004- drivers/usb/storage/freecom.c drivers/usb/storage/sddr09.c 0005 drivers/usb/storage/isd200.c [NCR5380 family] - ? 0006 drivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c drivers/scsi/sun3_NCR5380.c [esp family] - Maciej W. Rozycki [EMAIL PROTECTED] 0020 drivers/scsi/NCR53C9x.c drivers/scsi/NCR53C9x.h drivers/scsi/dec_esp.c drivers/scsi/oktagon_esp.c drivers/scsi/sun3x_esp.c [ARM] - Russell King [EMAIL PROTECTED] 0007 drivers/scsi/arm/acornscsi.c drivers/scsi/arm/scsi.h [other drivers] 0008 drivers/scsi/pcmcia/nsp_cs.c - YOKOTA Hiroshi [EMAIL PROTECTED] 0009 drivers/ata/libata-scsi.c - Jeff Garzik [EMAIL PROTECTED] 0010 drivers/scsi/eata_pio.c - Bartlomiej Zolnierkiewicz [EMAIL PROTECTED] ? 0011 drivers/scsi/a2091.c - ? 0012 drivers/scsi/a3000.c - ? 0013 drivers/scsi/aha1542.c - ? 0014 drivers/scsi/atp870u.c - ? 0015 drivers/scsi/fd_mcs.c - ? 0016 drivers/scsi/imm.c - ? 0017 drivers/scsi/in2000.c - ? 0018 drivers/scsi/ppa.c - ? 0019 drivers/scsi/wd33c93.c - ? 0021 drivers/scsi/qlogicpti.c - David S. Miller [EMAIL PROTECTED], Mark Fortescue [EMAIL PROTECTED] 0024 drivers/scsi/ide-scsi.c - Bartlomiej Zolnierkiewicz [EMAIL PROTECTED] [remove psi240i.c driver] - ? 0022 drivers/scsi/Kconfig drivers/scsi/Makefile delete drivers/scsi/psi240i.c delete drivers/scsi/psi240i.h delete drivers/scsi/psi_chip.h [fixes] 0023 drivers/scsi/wd7000.c - ? - James Hi! I just did a rebase for all drivers they patch and compile over current scsi-misc. Save one, qlogicpti.c, a fix will follow. (I keep stumbling over Matthew's patches ;) Please note that you must apply: [PATCH 05/24] isd200.c: use one-element sg list in issuing commands first and specifically before the usb patches. Otherwise this driver will be broken for the duration. (Sorry for the mess) Please ask for any help needed or if you need all any patches to be resent Thanks Boaz - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Add ALUA hardware handler
Hannes Reinecke wrote: Hi Alasdair, this is a patch to add a SPC-3 hardware handler. SPC-3 ALUA has provisioning for 'explicit' port group state change via the SET TARGET GROUP STATES command, and some newer storage arrays do benefit from this. Eg HP EVAs and newer EMC Clariions already support explicit ALUA. Please apply. Cheers, Hannes Does this also work for adaptec or snap iscsi targets or whatever they are called targets? Just some quick higher level comments +static int submit_std_inquiry(struct alua_handler *h) +{ + struct request *rq; + unsigned err = (DRIVER_ERROR 24); + + rq = prepare_req(h, h-inq, TPGS_INQUIRY_SIZE, READ); I do not think you want to use GFP_KERNEL allocations in this path, so all the prepare_req allocs should be changed. GFP_NOIO is probably best. + if (!rq) + return err; + + /* Prepare the command. */ + rq-cmd[0] = INQUIRY; + rq-cmd[1] = 0; + rq-cmd[2] = 0; + rq-cmd[4] = TPGS_INQUIRY_SIZE; + rq-cmd_len = COMMAND_SIZE(INQUIRY); + + blk_execute_rq(rq-q, NULL, rq, 1); There is only one workqueue for all the dm devices, so you do not want to do one command (or how many processors there are) at a time and wait for each one to complete with blk_execute_rq. You should use the async one, blk_execute_rq_nowait, like rdac. + err = rq-errors; + blk_put_request(rq); + + return err; +} - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patchset 0/24] Lots of the Accessors patches and !use_sg cleanup
On Wed, Oct 10, 2007 at 08:24:46PM +0200, Boaz Harrosh wrote: I just did a rebase for all drivers they patch and compile over current scsi-misc. Save one, qlogicpti.c, a fix will follow. (I keep stumbling over Matthew's patches ;) At least this time I only deleted some code you were patching. It's nothing on the mess in the gdth driver ;-) -- Intel are signing my paycheques ... these opinions are still mine Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] aic94xx: Use request_firmware() to provide SAS address if the adapter lacks one
--- James Smart [EMAIL PROTECTED] wrote: Here's one pro for setting WWNs at arbitrary times... If the box is migrating applications (say containers) that want different SAN connectivity, where that connectivity (view) is based on their WWN, it would be really nice to selectively set the WWN and not touch the SAN config. No. The WWN stays the same and the SAN is re-configured to be aware of the node migration. Access patterns could be more complex than just a single portal allowing access to/from the SAN from/to the node. WWN is supposed to be persistent. This is what it actually is. It is NOT supposed to be (auto)generated and/or changed at a whim. This also has security implications, and enterprise networks may refuse to use software (read kernel) which allows for arbitrary changes to a node's WWN. If access to a node is compromised, a rogue agent may change the node's WWN in order to access SAN zones that it normally will be denied access to. Luben - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 21/24 ver2] qlogicpti.c: convert to accessors and !use_sg cleanup
From: Boaz Harrosh [EMAIL PROTECTED] Date: Wed, 10 Oct 2007 20:25:30 +0200 - convert to accessors and !use_sg cleanup Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] Acked-by: David S. Miller [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] aic94xx: update BIOS image from user space.
1. Create a file update_bios in sysfs to allow user to update bios from user space. 2. The aic94xx BIOS image file can be downloaded from web site http://www.adaptec.com/en-US/downloads/bios_fw/bios_fw_ver?productId=SAS-48300dn=Adaptec+Serial+Attached+SCSI+48300; and copy the BIOS image into /lib/firmware folder. 3. The aic994xx will accept update bios_file and verify bios_file commands to perform update and verify BIOS image . For example: Type echo update asc483c01.ufi /sys/devices/.../update_bios to update BIOS image from /lib/firmware/as483c01.ufi file into HBA's flash memory. Type echo verify asc483c01.ufi /sys/devices/.../update_bios to verify BIOS image between /lib/firmware/asc48c01.ufi file and HBA's flash memory. 4. Type cat /sys/devices/.../update_bios to view the status or result of updating BIOS. Signed-off-by: Gilbert Wu [EMAIL PROTECTED] diff -urN a/drivers/scsi/aic94xx/aic94xx_hwi.h b/drivers/scsi/aic94xx/aic94xx_hwi.h --- a/drivers/scsi/aic94xx/aic94xx_hwi.h2007-10-10 17:13:55.0 -0700 +++ b/drivers/scsi/aic94xx/aic94xx_hwi.h2007-10-10 17:16:04.0 -0700 @@ -72,6 +72,7 @@ u8 manuf; u8 dev_id; u8 sec_prot; +u8 method; u32dir_offs; }; @@ -216,6 +217,8 @@ struct dma_pool *scb_pool; struct asd_seq_data seq; /* sequencer related */ +u32bios_status; + const struct firmware *bios_image; }; /* -- Common macros -- */ diff -urN a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c --- a/drivers/scsi/aic94xx/aic94xx_init.c 2007-10-10 17:13:29.0 -0700 +++ b/drivers/scsi/aic94xx/aic94xx_init.c 2007-10-10 17:15:58.0 -0700 @@ -29,6 +29,7 @@ #include linux/kernel.h #include linux/pci.h #include linux/delay.h +#include linux/firmware.h #include scsi/scsi_host.h @@ -36,6 +37,7 @@ #include aic94xx_reg.h #include aic94xx_hwi.h #include aic94xx_seq.h +#include aic94xx_sds.h /* The format is version.release.patchlevel */ #define ASD_DRIVER_VERSION 1.0.3 @@ -313,6 +315,179 @@ } static DEVICE_ATTR(pcba_sn, S_IRUGO, asd_show_dev_pcba_sn, NULL); +#define FLASH_CMD_NONE 0x00 +#define FLASH_CMD_UPDATE0x01 +#define FLASH_CMD_VERIFY0x02 + +struct flash_command { + u8 command[8]; + int code; +}; + +static struct flash_command flash_command_table[] = +{ + {verify, FLASH_CMD_VERIFY}, + {update, FLASH_CMD_UPDATE}, + {,FLASH_CMD_NONE} /* Last entry should be NULL. */ +}; + + +struct error_bios{ char*reason; int err_code; +}; + +static struct error_bios flash_error_table[] = +{ + {Failed to open bios image file, FAIL_OPEN_BIOS_FILE}, + {PCI ID mismatch, FAIL_CHECK_PCI_ID}, + {Checksum mismatch, FAIL_CHECK_SUM}, + {Unknown Error, FAIL_UNKNOWN}, + {Failed to verify., FAIL_VERIFY}, + {Failed to reset flash chip., FAIL_RESET_FLASH}, + {Failed to find flash chip type., FAIL_FIND_FLASH_ID}, + {Failed to erash flash chip., FAIL_ERASE_FLASH}, + {Failed to program flash chip., FAIL_WRITE_FLASH}, + {Flash in progress, FLASH_IN_PROGRESS}, + {Image file size Error, FAIL_FILE_SIZE}, + {Input parameter error, FAIL_PARAMETERS}, + {Out of memory, FAIL_OUT_MEMORY}, + {OK,0 } /* Last entry err_code = 0. */ +}; + +static ssize_t asd_store_update_bios(struct device *dev,struct device_attribute *attr, + const char *buf, size_t count) +{ + struct asd_ha_struct *asd_ha = dev_to_asd_ha(dev); + char *cmd_ptr,*filename_ptr; + struct bios_file_header header, *hdr_ptr; + int res,i; + u32 csum = 0; + int flash_command = FLASH_CMD_NONE; + int err = 0; + + + cmd_ptr = kmalloc(count*2, GFP_KERNEL); + + if (!cmd_ptr) { + err=FAIL_OUT_MEMORY; + goto out; + } + + memset(cmd_ptr,0,count*2); + filename_ptr = cmd_ptr+count; + res = sscanf(buf, %s %s, cmd_ptr, filename_ptr); + if (res != 2) + { + err = FAIL_PARAMETERS; + goto out1; + } + + for (i = 0; flash_command_table[i].code != FLASH_CMD_NONE; i++) { + if (!memcmp(flash_command_table[i].command,cmd_ptr, strlen(cmd_ptr))) { + flash_command = flash_command_table[i].code; + break; + } + } + if (flash_command == FLASH_CMD_NONE) { + err = FAIL_PARAMETERS; + goto out1; + } + + if (asd_ha-bios_status == FLASH_IN_PROGRESS) { + err =
[PATCH] aic94xx: update BIOS image from user space.
1. Create a file update_bios in sysfs to allow user to update bios from user space. 2. The BIOS image file can be downloaded from web site http://www.adaptec.com/en-US/downloads/bios_fw/bios_fw_ver?productId=SAS-48300dn=Adaptec+Serial+Attached+SCSI+48300; and copy the BIOS image into /lib/firmware folder. 3. The aic994xx will accept update bios_file and verify bios_file commands to perform update and verify BIOS image . For example: Type echo update asc483c01.ufi /sys/devices/.../update_bios to update BIOS image from /lib/firmware/as483c01.ufi file into HBA's flash memory. Type echo verify asc483c01.ufi /sys/devices/.../update_bios to verify BIOS image between /lib/firmware/asc48c01.ufi file and HBA's flash memory. 4. Type cat /sys/devices/.../update_bios to view the status or result of updating BIOS. Signed-off-by: Gilbert Wu [EMAIL PROTECTED] diff -urN a/drivers/scsi/aic94xx/aic94xx_hwi.h b/drivers/scsi/aic94xx/aic94xx_hwi.h --- a/drivers/scsi/aic94xx/aic94xx_hwi.h2007-10-10 17:13:55.0 -0700 +++ b/drivers/scsi/aic94xx/aic94xx_hwi.h2007-10-10 17:16:04.0 -0700 @@ -72,6 +72,7 @@ u8 manuf; u8 dev_id; u8 sec_prot; +u8 method; u32dir_offs; }; @@ -216,6 +217,8 @@ struct dma_pool *scb_pool; struct asd_seq_data seq; /* sequencer related */ +u32bios_status; + const struct firmware *bios_image; }; /* -- Common macros -- */ diff -urN a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c --- a/drivers/scsi/aic94xx/aic94xx_init.c 2007-10-10 17:13:29.0 -0700 +++ b/drivers/scsi/aic94xx/aic94xx_init.c 2007-10-10 17:15:58.0 -0700 @@ -29,6 +29,7 @@ #include linux/kernel.h #include linux/pci.h #include linux/delay.h +#include linux/firmware.h #include scsi/scsi_host.h @@ -36,6 +37,7 @@ #include aic94xx_reg.h #include aic94xx_hwi.h #include aic94xx_seq.h +#include aic94xx_sds.h /* The format is version.release.patchlevel */ #define ASD_DRIVER_VERSION 1.0.3 @@ -313,6 +315,179 @@ } static DEVICE_ATTR(pcba_sn, S_IRUGO, asd_show_dev_pcba_sn, NULL); +#define FLASH_CMD_NONE 0x00 +#define FLASH_CMD_UPDATE0x01 +#define FLASH_CMD_VERIFY0x02 + +struct flash_command { + u8 command[8]; + int code; +}; + +static struct flash_command flash_command_table[] = +{ + {verify, FLASH_CMD_VERIFY}, + {update, FLASH_CMD_UPDATE}, + {,FLASH_CMD_NONE} /* Last entry should be NULL. */ +}; + + +struct error_bios{ char*reason; int err_code; +}; + +static struct error_bios flash_error_table[] = +{ + {Failed to open bios image file, FAIL_OPEN_BIOS_FILE}, + {PCI ID mismatch, FAIL_CHECK_PCI_ID}, + {Checksum mismatch, FAIL_CHECK_SUM}, + {Unknown Error, FAIL_UNKNOWN}, + {Failed to verify., FAIL_VERIFY}, + {Failed to reset flash chip., FAIL_RESET_FLASH}, + {Failed to find flash chip type., FAIL_FIND_FLASH_ID}, + {Failed to erash flash chip., FAIL_ERASE_FLASH}, + {Failed to program flash chip., FAIL_WRITE_FLASH}, + {Flash in progress, FLASH_IN_PROGRESS}, + {Image file size Error, FAIL_FILE_SIZE}, + {Input parameter error, FAIL_PARAMETERS}, + {Out of memory, FAIL_OUT_MEMORY}, + {OK,0 } /* Last entry err_code = 0. */ +}; + +static ssize_t asd_store_update_bios(struct device *dev,struct device_attribute *attr, + const char *buf, size_t count) +{ + struct asd_ha_struct *asd_ha = dev_to_asd_ha(dev); + char *cmd_ptr,*filename_ptr; + struct bios_file_header header, *hdr_ptr; + int res,i; + u32 csum = 0; + int flash_command = FLASH_CMD_NONE; + int err = 0; + + + cmd_ptr = kmalloc(count*2, GFP_KERNEL); + + if (!cmd_ptr) { + err=FAIL_OUT_MEMORY; + goto out; + } + + memset(cmd_ptr,0,count*2); + filename_ptr = cmd_ptr+count; + res = sscanf(buf, %s %s, cmd_ptr, filename_ptr); + if (res != 2) + { + err = FAIL_PARAMETERS; + goto out1; + } + + for (i = 0; flash_command_table[i].code != FLASH_CMD_NONE; i++) { + if (!memcmp(flash_command_table[i].command,cmd_ptr, strlen(cmd_ptr))) { + flash_command = flash_command_table[i].code; + break; + } + } + if (flash_command == FLASH_CMD_NONE) { + err = FAIL_PARAMETERS; + goto out1; + } + + if (asd_ha-bios_status == FLASH_IN_PROGRESS) { + err = FLASH_IN_PROGRESS; +
Re: [dm-devel] [PATCH] Add ALUA hardware handler
Reviewed the code, and did not find any generic issues (other than what Mike Christie has stated). On Wed, 2007-10-10 at 14:55 +0200, Hannes Reinecke wrote: Hi Alasdair, this is a patch to add a SPC-3 hardware handler. SPC-3 ALUA has provisioning for 'explicit' port group state change via the SET TARGET GROUP STATES command, and some newer storage arrays do benefit from this. Eg HP EVAs and newer EMC Clariions already support explicit ALUA. Please apply. Cheers, Hannes plain text document attachment (dm-mpath-alua-support) diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig index 531d4d1..3fa9df3 100644 --- a/drivers/md/Kconfig +++ b/drivers/md/Kconfig @@ -267,6 +267,13 @@ config DM_MULTIPATH_RDAC ---help--- Multipath support for LSI/Engenio RDAC. +config DM_MULTIPATH_ALUA + tristate SPC-3 ALUA multipath support (EXPERIMENTAL) + depends on DM_MULTIPATH BLK_DEV_DM EXPERIMENTAL + ---help--- + Multipath support for SPC-3 Asymmetric Logical Unit + Access (ALUA). + config DM_DELAY tristate I/O delaying target (EXPERIMENTAL) depends on BLK_DEV_DM EXPERIMENTAL diff --git a/drivers/md/Makefile b/drivers/md/Makefile index c49366c..5013920 100644 --- a/drivers/md/Makefile +++ b/drivers/md/Makefile @@ -8,6 +8,7 @@ dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o dm-snapshot-objs := dm-snap.o dm-exception-store.o dm-mirror-objs := dm-log.o dm-raid1.o dm-rdac-objs := dm-mpath-rdac.o +dm-alua-objs := dm-mpath-alua.o md-mod-objs := md.o bitmap.o raid456-objs := raid5.o raid6algos.o raid6recov.o raid6tables.o \ raid6int1.o raid6int2.o raid6int4.o \ @@ -36,6 +37,7 @@ obj-$(CONFIG_DM_DELAY) += dm-delay.o obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o obj-$(CONFIG_DM_MULTIPATH_RDAC) += dm-rdac.o +obj-$(CONFIG_DM_MULTIPATH_ALUA) += dm-alua.o obj-$(CONFIG_DM_SNAPSHOT)+= dm-snapshot.o obj-$(CONFIG_DM_MIRROR) += dm-mirror.o obj-$(CONFIG_DM_ZERO)+= dm-zero.o diff --git a/drivers/md/dm-mpath-alua.c b/drivers/md/dm-mpath-alua.c new file mode 100644 index 000..40b9d4d --- /dev/null +++ b/drivers/md/dm-mpath-alua.c @@ -0,0 +1,662 @@ +/* + * Generic SCSI-3 ALUA DM HW handler + * + * Copyright (C) 2007 Hannes Reinecke. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ +#include scsi/scsi.h +#include scsi/scsi_cmnd.h +#include scsi/scsi_eh.h + +#define DM_MSG_PREFIX multipath alua + +#include dm.h +#include dm-hw-handler.h + +#define ALUA_DM_HWH_NAME alua +#define ALUA_DM_HWH_VER 0.2 + +enum tpgs_state { + TPGS_STATE_UNKNOWN = -1, + TPGS_STATE_OPTIMIZED = 0x0, + TPGS_STATE_NONOPTIMIZED, + TPGS_STATE_STANDBY, + TPGS_STATE_UNAVAILABLE, + TPGS_STATE_OFFLINE = 0xe, + TPGS_STATE_TRANSITIONING, +}; + +#define TPGS_SUPPORT_NONE0x00 +#define TPGS_SUPPORT_OPTIMIZED 0x01 +#define TPGS_SUPPORT_NONOPTIMIZED0x02 +#define TPGS_SUPPORT_STANDBY 0x04 +#define TPGS_SUPPORT_UNAVAILABLE 0x08 +#define TPGS_SUPPORT_OFFLINE 0x40 +#define TPGS_SUPPORT_TRANSITION 0x80 + +#define TPGS_MODE_UNINITIALIZED -1 +#define TPGS_MODE_NONE 0x0 +#define TPGS_MODE_IMPLICIT 0x1 +#define TPGS_MODE_EXPLICIT 0x2 + +#define TPGS_INQUIRY_SIZE36 +#define TPGS_FAILOVER_TIMEOUT(60 * HZ) + +struct alua_handler { + struct dm_path *path; + int debug; + int group_id; + int rel_port; + int tpgs; + enum tpgs_state state; + unsigned char inq[TPGS_INQUIRY_SIZE]; + unsigned char *buff; + int bufflen; + unsigned char sense[SCSI_SENSE_BUFFERSIZE]; +}; + +#define ALUA_POLICY_SWITCH_CURRENT 0 +#define ALUA_POLICY_SWITCH_ALL 1 + +#define DPRINT(h, f, arg...) \ + if (h-debug) DMINFO(%s: f, h-path-dev-name, arg) + +static inline int had_failures(int error) +{ + return (host_byte(error) !=
You won!
FreeLifetime Pass www 32promo cn roustabout octobers deemed methylglycine - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] aic94xx: update BIOS image from user space.
--- Gilbert Wu [EMAIL PROTECTED] wrote: 1. Create a file update_bios in sysfs to allow user to update bios from user space. 2. The BIOS image file can be downloaded from web site http://www.adaptec.com/en-US/downloads/bios_fw/bios_fw_ver?productId=SAS-48300dn=Adaptec+Serial+Attached+SCSI+48300; and copy the BIOS image into /lib/firmware folder. 3. The aic994xx will accept update bios_file and verify bios_file commands to perform update and verify BIOS image . For example: Type echo update asc483c01.ufi /sys/devices/.../update_bios to update BIOS image from /lib/firmware/as483c01.ufi file into HBA's flash memory. Type echo verify asc483c01.ufi /sys/devices/.../update_bios to verify BIOS image between /lib/firmware/asc48c01.ufi file and HBA's flash memory. 4. Type cat /sys/devices/.../update_bios to view the status or result of updating BIOS. Signed-off-by: Gilbert Wu [EMAIL PROTECTED] diff -urN a/drivers/scsi/aic94xx/aic94xx_hwi.h b/drivers/scsi/aic94xx/aic94xx_hwi.h --- a/drivers/scsi/aic94xx/aic94xx_hwi.h 2007-10-10 17:13:55.0 -0700 +++ b/drivers/scsi/aic94xx/aic94xx_hwi.h 2007-10-10 17:16:04.0 -0700 @@ -72,6 +72,7 @@ u8 manuf; u8 dev_id; u8 sec_prot; +u8 method; u32dir_offs; }; @@ -216,6 +217,8 @@ struct dma_pool *scb_pool; struct asd_seq_data seq; /* sequencer related */ +u32bios_status; + const struct firmware *bios_image; }; /* -- Common macros -- */ diff -urN a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c --- a/drivers/scsi/aic94xx/aic94xx_init.c 2007-10-10 17:13:29.0 -0700 +++ b/drivers/scsi/aic94xx/aic94xx_init.c 2007-10-10 17:15:58.0 -0700 @@ -29,6 +29,7 @@ #include linux/kernel.h #include linux/pci.h #include linux/delay.h +#include linux/firmware.h #include scsi/scsi_host.h @@ -36,6 +37,7 @@ #include aic94xx_reg.h #include aic94xx_hwi.h #include aic94xx_seq.h +#include aic94xx_sds.h /* The format is version.release.patchlevel */ #define ASD_DRIVER_VERSION 1.0.3 @@ -313,6 +315,179 @@ } static DEVICE_ATTR(pcba_sn, S_IRUGO, asd_show_dev_pcba_sn, NULL); +#define FLASH_CMD_NONE 0x00 +#define FLASH_CMD_UPDATE0x01 +#define FLASH_CMD_VERIFY0x02 + +struct flash_command { + u8 command[8]; + int code; +}; + +static struct flash_command flash_command_table[] = +{ + {verify, FLASH_CMD_VERIFY}, + {update, FLASH_CMD_UPDATE}, + {,FLASH_CMD_NONE} /* Last entry should be NULL. */ +}; + + +struct error_bios{ char*reason; int err_code; +}; + +static struct error_bios flash_error_table[] = +{ + {Failed to open bios image file, FAIL_OPEN_BIOS_FILE}, + {PCI ID mismatch, FAIL_CHECK_PCI_ID}, + {Checksum mismatch, FAIL_CHECK_SUM}, + {Unknown Error, FAIL_UNKNOWN}, + {Failed to verify., FAIL_VERIFY}, + {Failed to reset flash chip., FAIL_RESET_FLASH}, + {Failed to find flash chip type., FAIL_FIND_FLASH_ID}, + {Failed to erash flash chip., FAIL_ERASE_FLASH}, + {Failed to program flash chip., FAIL_WRITE_FLASH}, + {Flash in progress, FLASH_IN_PROGRESS}, + {Image file size Error, FAIL_FILE_SIZE}, + {Input parameter error, FAIL_PARAMETERS}, + {Out of memory, FAIL_OUT_MEMORY}, + {OK,0 } /* Last entry err_code = 0. */ +}; + +static ssize_t asd_store_update_bios(struct device *dev,struct device_attribute *attr, + const char *buf, size_t count) +{ + struct asd_ha_struct *asd_ha = dev_to_asd_ha(dev); + char *cmd_ptr,*filename_ptr; + struct bios_file_header header, *hdr_ptr; + int res,i; + u32 csum = 0; + int flash_command = FLASH_CMD_NONE; + int err = 0; + + + cmd_ptr = kmalloc(count*2, GFP_KERNEL); + + if (!cmd_ptr) { + err=FAIL_OUT_MEMORY; + goto out; + } + + memset(cmd_ptr,0,count*2); + filename_ptr = cmd_ptr+count; + res = sscanf(buf, %s %s, cmd_ptr, filename_ptr); + if (res != 2) + { + err = FAIL_PARAMETERS; + goto out1; + } + + for (i = 0; flash_command_table[i].code != FLASH_CMD_NONE; i++) { + if (!memcmp(flash_command_table[i].command,cmd_ptr, strlen(cmd_ptr))) { + flash_command = flash_command_table[i].code; + break; + } + } + if (flash_command == FLASH_CMD_NONE) { + err = FAIL_PARAMETERS; + goto out1; +