You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "This patch is the usual mix of driver updates (srp, ipr, scsi_debug, NCR5380, fnic, 53c974, ses, wd719x, hpsa, megaraid_sas). Of those, wd7a9x is new and 53c974 is a rewrite of the old tmscsim driver and the extensive work by Finn Thain rewrites all the NCR5380 based drivers. There's also extensive infrastructure updates: a new logging infrastructure for sense information and a rewrite of the tagged command queue API and an assortment of minor updates" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (183 commits) scsi: set fmt to NULL scsi_extd_sense_format() by default libsas: remove task_collector mode wd719x: remove dma_cache_sync call scsi_debug: add Report supported opcodes+tmfs; Compare and write scsi_debug: change SCSI command parser to table driven scsi_debug: add Capacity Changed Unit Attention scsi_debug: append inject error flags onto scsi_cmnd object scsi_debug: pinpoint invalid field in sense data wd719x: Add firmware documentation wd719x: Introduce Western Digital WD7193/7197/7296 PCI SCSI card driver eeprom-93cx6: Add (read-only) support for 8-bit mode esas2r: fix an oversight in setting return value esas2r: fix an error path in esas2r_ioctl_handler esas2r: fir error handling in do_fm_api scsi: add SPC-3 command definitions scsi: rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 scsi: remove scsi_driver owner field scsi: move scsi_dispatch_cmd to scsi_lib.c scsi: stop passing a gfp_mask argument down the command setup path scsi: remove scsi_next_command ...
This commit is contained in:
@@ -55,12 +55,12 @@ Description: Interface for making ib_srp connect to a new target.
|
||||
only safe with partial memory descriptor list support enabled
|
||||
(allow_ext_sg=1).
|
||||
* comp_vector, a number in the range 0..n-1 specifying the
|
||||
MSI-X completion vector. Some HCA's allocate multiple (n)
|
||||
MSI-X vectors per HCA port. If the IRQ affinity masks of
|
||||
these interrupts have been configured such that each MSI-X
|
||||
interrupt is handled by a different CPU then the comp_vector
|
||||
parameter can be used to spread the SRP completion workload
|
||||
over multiple CPU's.
|
||||
MSI-X completion vector of the first RDMA channel. Some
|
||||
HCA's allocate multiple (n) MSI-X vectors per HCA port. If
|
||||
the IRQ affinity masks of these interrupts have been
|
||||
configured such that each MSI-X interrupt is handled by a
|
||||
different CPU then the comp_vector parameter can be used to
|
||||
spread the SRP completion workload over multiple CPU's.
|
||||
* tl_retry_count, a number in the range 2..7 specifying the
|
||||
IB RC retry count.
|
||||
* queue_size, the maximum number of commands that the
|
||||
@@ -88,6 +88,13 @@ Description: Whether ib_srp is allowed to include a partial memory
|
||||
descriptor list in an SRP_CMD when communicating with an SRP
|
||||
target.
|
||||
|
||||
What: /sys/class/scsi_host/host<n>/ch_count
|
||||
Date: April 1, 2015
|
||||
KernelVersion: 3.19
|
||||
Contact: linux-rdma@vger.kernel.org
|
||||
Description: Number of RDMA channels used for communication with the SRP
|
||||
target.
|
||||
|
||||
What: /sys/class/scsi_host/host<n>/cmd_sg_entries
|
||||
Date: May 19, 2011
|
||||
KernelVersion: 2.6.39
|
||||
@@ -95,6 +102,12 @@ Contact: linux-rdma@vger.kernel.org
|
||||
Description: Maximum number of data buffer descriptors that may be sent to
|
||||
the target in a single SRP_CMD request.
|
||||
|
||||
What: /sys/class/scsi_host/host<n>/comp_vector
|
||||
Date: September 2, 2013
|
||||
KernelVersion: 3.11
|
||||
Contact: linux-rdma@vger.kernel.org
|
||||
Description: Completion vector used for the first RDMA channel.
|
||||
|
||||
What: /sys/class/scsi_host/host<n>/dgid
|
||||
Date: June 17, 2006
|
||||
KernelVersion: 2.6.17
|
||||
|
||||
@@ -827,10 +827,6 @@ but in the event of any barrier requests in the tag queue we need to ensure
|
||||
that requests are restarted in the order they were queue. This may happen
|
||||
if the driver needs to use blk_queue_invalidate_tags().
|
||||
|
||||
Tagging also defines a new request flag, REQ_QUEUED. This is set whenever
|
||||
a request is currently tagged. You should not use this flag directly,
|
||||
blk_rq_tagged(rq) is the portable way to do so.
|
||||
|
||||
3.3 I/O Submission
|
||||
|
||||
The routine submit_bio() is used to submit a single io. Higher level i/o
|
||||
|
||||
@@ -226,9 +226,6 @@ static int register_sas_ha(struct my_sas_ha *my_ha)
|
||||
my_ha->sas_ha.lldd_dev_found = my_dev_found;
|
||||
my_ha->sas_ha.lldd_dev_gone = my_dev_gone;
|
||||
|
||||
my_ha->sas_ha.lldd_max_execute_num = lldd_max_execute_num; (1)
|
||||
|
||||
my_ha->sas_ha.lldd_queue_size = ha_can_queue;
|
||||
my_ha->sas_ha.lldd_execute_task = my_execute_task;
|
||||
|
||||
my_ha->sas_ha.lldd_abort_task = my_abort_task;
|
||||
@@ -247,28 +244,6 @@ static int register_sas_ha(struct my_sas_ha *my_ha)
|
||||
return sas_register_ha(&my_ha->sas_ha);
|
||||
}
|
||||
|
||||
(1) This is normally a LLDD parameter, something of the
|
||||
lines of a task collector. What it tells the SAS Layer is
|
||||
whether the SAS layer should run in Direct Mode (default:
|
||||
value 0 or 1) or Task Collector Mode (value greater than 1).
|
||||
|
||||
In Direct Mode, the SAS Layer calls Execute Task as soon as
|
||||
it has a command to send to the SDS, _and_ this is a single
|
||||
command, i.e. not linked.
|
||||
|
||||
Some hardware (e.g. aic94xx) has the capability to DMA more
|
||||
than one task at a time (interrupt) from host memory. Task
|
||||
Collector Mode is an optional feature for HAs which support
|
||||
this in their hardware. (Again, it is completely optional
|
||||
even if your hardware supports it.)
|
||||
|
||||
In Task Collector Mode, the SAS Layer would do _natural_
|
||||
coalescing of tasks and at the appropriate moment it would
|
||||
call your driver to DMA more than one task in a single HA
|
||||
interrupt. DMBS may want to use this by insmod/modprobe
|
||||
setting the lldd_max_execute_num to something greater than
|
||||
1.
|
||||
|
||||
(2) SAS 1.1 does not define I_T Nexus Reset TMF.
|
||||
|
||||
Events
|
||||
@@ -325,71 +300,22 @@ PHYE_SPINUP_HOLD -- SATA is present, COMWAKE not sent.
|
||||
|
||||
The Execute Command SCSI RPC:
|
||||
|
||||
int (*lldd_execute_task)(struct sas_task *, int num,
|
||||
unsigned long gfp_flags);
|
||||
int (*lldd_execute_task)(struct sas_task *, gfp_t gfp_flags);
|
||||
|
||||
Used to queue a task to the SAS LLDD. @task is the tasks to
|
||||
be executed. @num should be the number of tasks being
|
||||
queued at this function call (they are linked listed via
|
||||
task::list), @gfp_mask should be the gfp_mask defining the
|
||||
context of the caller.
|
||||
Used to queue a task to the SAS LLDD. @task is the task to be executed.
|
||||
@gfp_mask is the gfp_mask defining the context of the caller.
|
||||
|
||||
This function should implement the Execute Command SCSI RPC,
|
||||
or if you're sending a SCSI Task as linked commands, you
|
||||
should also use this function.
|
||||
|
||||
That is, when lldd_execute_task() is called, the command(s)
|
||||
That is, when lldd_execute_task() is called, the command
|
||||
go out on the transport *immediately*. There is *no*
|
||||
queuing of any sort and at any level in a SAS LLDD.
|
||||
|
||||
The use of task::list is two-fold, one for linked commands,
|
||||
the other discussed below.
|
||||
|
||||
It is possible to queue up more than one task at a time, by
|
||||
initializing the list element of struct sas_task, and
|
||||
passing the number of tasks enlisted in this manner in num.
|
||||
|
||||
Returns: -SAS_QUEUE_FULL, -ENOMEM, nothing was queued;
|
||||
0, the task(s) were queued.
|
||||
|
||||
If you want to pass num > 1, then either
|
||||
A) you're the only caller of this function and keep track
|
||||
of what you've queued to the LLDD, or
|
||||
B) you know what you're doing and have a strategy of
|
||||
retrying.
|
||||
|
||||
As opposed to queuing one task at a time (function call),
|
||||
batch queuing of tasks, by having num > 1, greatly
|
||||
simplifies LLDD code, sequencer code, and _hardware design_,
|
||||
and has some performance advantages in certain situations
|
||||
(DBMS).
|
||||
|
||||
The LLDD advertises if it can take more than one command at
|
||||
a time at lldd_execute_task(), by setting the
|
||||
lldd_max_execute_num parameter (controlled by "collector"
|
||||
module parameter in aic94xx SAS LLDD).
|
||||
|
||||
You should leave this to the default 1, unless you know what
|
||||
you're doing.
|
||||
|
||||
This is a function of the LLDD, to which the SAS layer can
|
||||
cater to.
|
||||
|
||||
int lldd_queue_size
|
||||
The host adapter's queue size. This is the maximum
|
||||
number of commands the lldd can have pending to domain
|
||||
devices on behalf of all upper layers submitting through
|
||||
lldd_execute_task().
|
||||
|
||||
You really want to set this to something (much) larger than
|
||||
1.
|
||||
|
||||
This _really_ has absolutely nothing to do with queuing.
|
||||
There is no queuing in SAS LLDDs.
|
||||
|
||||
struct sas_task {
|
||||
dev -- the device this task is destined to
|
||||
list -- must be initialized (INIT_LIST_HEAD)
|
||||
task_proto -- _one_ of enum sas_proto
|
||||
scatter -- pointer to scatter gather list array
|
||||
num_scatter -- number of elements in scatter
|
||||
|
||||
@@ -149,7 +149,7 @@ scsi_add_host() ---->
|
||||
scsi_scan_host() -------+
|
||||
|
|
||||
slave_alloc()
|
||||
slave_configure() --> scsi_adjust_queue_depth()
|
||||
slave_configure() --> scsi_change_queue_depth()
|
||||
|
|
||||
slave_alloc()
|
||||
slave_configure()
|
||||
@@ -159,7 +159,7 @@ scsi_scan_host() -------+
|
||||
------------------------------------------------------------
|
||||
|
||||
If the LLD wants to adjust the default queue settings, it can invoke
|
||||
scsi_adjust_queue_depth() in its slave_configure() routine.
|
||||
scsi_change_queue_depth() in its slave_configure() routine.
|
||||
|
||||
*** For scsi devices that the mid level tries to scan but do not
|
||||
respond, a slave_alloc(), slave_destroy() pair is called.
|
||||
@@ -203,7 +203,7 @@ LLD mid level LLD
|
||||
scsi_add_device() ------+
|
||||
|
|
||||
slave_alloc()
|
||||
slave_configure() [--> scsi_adjust_queue_depth()]
|
||||
slave_configure() [--> scsi_change_queue_depth()]
|
||||
------------------------------------------------------------
|
||||
|
||||
In a similar fashion, an LLD may become aware that a SCSI device has been
|
||||
@@ -261,7 +261,7 @@ init_this_scsi_driver() ----+
|
||||
| scsi_register()
|
||||
|
|
||||
slave_alloc()
|
||||
slave_configure() --> scsi_adjust_queue_depth()
|
||||
slave_configure() --> scsi_change_queue_depth()
|
||||
slave_alloc() ***
|
||||
slave_destroy() ***
|
||||
|
|
||||
@@ -271,9 +271,9 @@ init_this_scsi_driver() ----+
|
||||
slave_destroy() ***
|
||||
------------------------------------------------------------
|
||||
|
||||
The mid level invokes scsi_adjust_queue_depth() with tagged queuing off and
|
||||
"cmd_per_lun" for that host as the queue length. These settings can be
|
||||
overridden by a slave_configure() supplied by the LLD.
|
||||
The mid level invokes scsi_change_queue_depth() with "cmd_per_lun" for that
|
||||
host as the queue length. These settings can be overridden by a
|
||||
slave_configure() supplied by the LLD.
|
||||
|
||||
*** For scsi devices that the mid level tries to scan but do not
|
||||
respond, a slave_alloc(), slave_destroy() pair is called.
|
||||
@@ -366,13 +366,11 @@ is initialized. The functions below are listed alphabetically and their
|
||||
names all start with "scsi_".
|
||||
|
||||
Summary:
|
||||
scsi_activate_tcq - turn on tag command queueing
|
||||
scsi_add_device - creates new scsi device (lu) instance
|
||||
scsi_add_host - perform sysfs registration and set up transport class
|
||||
scsi_adjust_queue_depth - change the queue depth on a SCSI device
|
||||
scsi_change_queue_depth - change the queue depth on a SCSI device
|
||||
scsi_bios_ptable - return copy of block device's partition table
|
||||
scsi_block_requests - prevent further commands being queued to given host
|
||||
scsi_deactivate_tcq - turn off tag command queueing
|
||||
scsi_host_alloc - return a new scsi_host instance whose refcount==1
|
||||
scsi_host_get - increments Scsi_Host instance's refcount
|
||||
scsi_host_put - decrements Scsi_Host instance's refcount (free if 0)
|
||||
@@ -389,24 +387,6 @@ Summary:
|
||||
|
||||
Details:
|
||||
|
||||
/**
|
||||
* scsi_activate_tcq - turn on tag command queueing ("ordered" task attribute)
|
||||
* @sdev: device to turn on TCQ for
|
||||
* @depth: queue depth
|
||||
*
|
||||
* Returns nothing
|
||||
*
|
||||
* Might block: no
|
||||
*
|
||||
* Notes: Eventually, it is hoped depth would be the maximum depth
|
||||
* the device could cope with and the real queue depth
|
||||
* would be adjustable from 0 to depth.
|
||||
*
|
||||
* Defined (inline) in: include/scsi/scsi_tcq.h
|
||||
**/
|
||||
void scsi_activate_tcq(struct scsi_device *sdev, int depth)
|
||||
|
||||
|
||||
/**
|
||||
* scsi_add_device - creates new scsi device (lu) instance
|
||||
* @shost: pointer to scsi host instance
|
||||
@@ -456,11 +436,8 @@ int scsi_add_host(struct Scsi_Host *shost, struct device * dev)
|
||||
|
||||
|
||||
/**
|
||||
* scsi_adjust_queue_depth - allow LLD to change queue depth on a SCSI device
|
||||
* scsi_change_queue_depth - allow LLD to change queue depth on a SCSI device
|
||||
* @sdev: pointer to SCSI device to change queue depth on
|
||||
* @tagged: 0 - no tagged queuing
|
||||
* MSG_SIMPLE_TAG - simple tagged queuing
|
||||
* MSG_ORDERED_TAG - ordered tagged queuing
|
||||
* @tags Number of tags allowed if tagged queuing enabled,
|
||||
* or number of commands the LLD can queue up
|
||||
* in non-tagged mode (as per cmd_per_lun).
|
||||
@@ -471,15 +448,12 @@ int scsi_add_host(struct Scsi_Host *shost, struct device * dev)
|
||||
*
|
||||
* Notes: Can be invoked any time on a SCSI device controlled by this
|
||||
* LLD. [Specifically during and after slave_configure() and prior to
|
||||
* slave_destroy().] Can safely be invoked from interrupt code. Actual
|
||||
* queue depth change may be delayed until the next command is being
|
||||
* processed. See also scsi_activate_tcq() and scsi_deactivate_tcq().
|
||||
* slave_destroy().] Can safely be invoked from interrupt code.
|
||||
*
|
||||
* Defined in: drivers/scsi/scsi.c [see source code for more notes]
|
||||
*
|
||||
**/
|
||||
void scsi_adjust_queue_depth(struct scsi_device * sdev, int tagged,
|
||||
int tags)
|
||||
int scsi_change_queue_depth(struct scsi_device *sdev, int tags)
|
||||
|
||||
|
||||
/**
|
||||
@@ -514,20 +488,6 @@ unsigned char *scsi_bios_ptable(struct block_device *dev)
|
||||
void scsi_block_requests(struct Scsi_Host * shost)
|
||||
|
||||
|
||||
/**
|
||||
* scsi_deactivate_tcq - turn off tag command queueing
|
||||
* @sdev: device to turn off TCQ for
|
||||
* @depth: queue depth (stored in sdev)
|
||||
*
|
||||
* Returns nothing
|
||||
*
|
||||
* Might block: no
|
||||
*
|
||||
* Defined (inline) in: include/scsi/scsi_tcq.h
|
||||
**/
|
||||
void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
|
||||
|
||||
|
||||
/**
|
||||
* scsi_host_alloc - create a scsi host adapter instance and perform basic
|
||||
* initialization.
|
||||
@@ -1254,7 +1214,7 @@ of interest:
|
||||
for disk firmware uploads.
|
||||
cmd_per_lun - maximum number of commands that can be queued on devices
|
||||
controlled by the host. Overridden by LLD calls to
|
||||
scsi_adjust_queue_depth().
|
||||
scsi_change_queue_depth().
|
||||
unchecked_isa_dma - 1=>only use bottom 16 MB of ram (ISA DMA addressing
|
||||
restriction), 0=>can use full 32 bit (or better) DMA
|
||||
address space
|
||||
@@ -1294,7 +1254,7 @@ struct scsi_cmnd
|
||||
Instances of this structure convey SCSI commands to the LLD and responses
|
||||
back to the mid level. The SCSI mid level will ensure that no more SCSI
|
||||
commands become queued against the LLD than are indicated by
|
||||
scsi_adjust_queue_depth() (or struct Scsi_Host::cmd_per_lun). There will
|
||||
scsi_change_queue_depth() (or struct Scsi_Host::cmd_per_lun). There will
|
||||
be at least one instance of struct scsi_cmnd available for each SCSI device.
|
||||
Members of interest:
|
||||
cmnd - array containing SCSI command
|
||||
|
||||
@@ -506,9 +506,11 @@ user does not request data that far.)
|
||||
|
||||
DEBUGGING HINTS
|
||||
|
||||
To enable debugging messages, edit st.c and #define DEBUG 1. As seen
|
||||
above, debugging can be switched off with an ioctl if debugging is
|
||||
compiled into the driver. The debugging output is not voluminous.
|
||||
Debugging code is now compiled in by default but debugging is turned off
|
||||
with the kernel module parameter debug_flag defaulting to 0. Debugging
|
||||
can still be switched on and off with an ioctl. To enable debug at
|
||||
module load time add debug_flag=1 to the module load options, the
|
||||
debugging output is not voluminous.
|
||||
|
||||
If the tape seems to hang, I would be very interested to hear where
|
||||
the driver is waiting. With the command 'ps -l' you can see the state
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
Driver for Western Digital WD7193, WD7197 and WD7296 SCSI cards
|
||||
---------------------------------------------------------------
|
||||
|
||||
The card requires firmware that can be cut out of the Windows NT driver that
|
||||
can be downloaded from WD at:
|
||||
http://support.wdc.com/product/download.asp?groupid=801&sid=27&lang=en
|
||||
|
||||
There is no license anywhere in the file or on the page - so the firmware
|
||||
probably cannot be added to linux-firmware.
|
||||
|
||||
This script downloads and extracts the firmware, creating wd719x-risc.bin and
|
||||
d719x-wcs.bin files. Put them in /lib/firmware/.
|
||||
|
||||
#!/bin/sh
|
||||
wget http://support.wdc.com/download/archive/pciscsi.exe
|
||||
lha xi pciscsi.exe pci-scsi.exe
|
||||
lha xi pci-scsi.exe nt/wd7296a.sys
|
||||
rm pci-scsi.exe
|
||||
dd if=wd7296a.sys of=wd719x-risc.bin bs=1 skip=5760 count=14336
|
||||
dd if=wd7296a.sys of=wd719x-wcs.bin bs=1 skip=20096 count=514
|
||||
rm wd7296a.sys
|
||||
+9
-8
@@ -2862,11 +2862,10 @@ F: Documentation/networking/dmfe.txt
|
||||
F: drivers/net/ethernet/dec/tulip/dmfe.c
|
||||
|
||||
DC390/AM53C974 SCSI driver
|
||||
M: Kurt Garloff <garloff@suse.de>
|
||||
W: http://www.garloff.de/kurt/linux/dc390/
|
||||
M: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
|
||||
M: Hannes Reinecke <hare@suse.de>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/scsi/tmscsim.*
|
||||
F: drivers/scsi/am53c974.c
|
||||
|
||||
DC395x SCSI driver
|
||||
M: Oliver Neukum <oliver@neukum.org>
|
||||
@@ -5991,10 +5990,13 @@ W: http://linuxtv.org
|
||||
S: Odd Fixes
|
||||
F: drivers/media/parport/pms*
|
||||
|
||||
MEGARAID SCSI DRIVERS
|
||||
M: Neela Syam Kolli <megaraidlinux@lsi.com>
|
||||
MEGARAID SCSI/SAS DRIVERS
|
||||
M: Kashyap Desai <kashyap.desai@avagotech.com>
|
||||
M: Sumit Saxena <sumit.saxena@avagotech.com>
|
||||
M: Uday Lingala <uday.lingala@avagotech.com>
|
||||
L: megaraidlinux.pdl@avagotech.com
|
||||
L: linux-scsi@vger.kernel.org
|
||||
W: http://megaraid.lsilogic.com
|
||||
W: http://www.lsi.com
|
||||
S: Maintained
|
||||
F: Documentation/scsi/megaraid.txt
|
||||
F: drivers/scsi/megaraid.*
|
||||
@@ -6305,7 +6307,6 @@ F: drivers/scsi/g_NCR5380.*
|
||||
F: drivers/scsi/g_NCR5380_mmio.c
|
||||
F: drivers/scsi/mac_scsi.*
|
||||
F: drivers/scsi/pas16.*
|
||||
F: drivers/scsi/sun3_NCR5380.c
|
||||
F: drivers/scsi/sun3_scsi.*
|
||||
F: drivers/scsi/sun3_scsi_vme.c
|
||||
F: drivers/scsi/t128.*
|
||||
|
||||
@@ -858,6 +858,24 @@ static struct platform_device *atari_netusbee_devices[] __initdata = {
|
||||
};
|
||||
#endif /* CONFIG_ATARI_ETHERNEC */
|
||||
|
||||
#ifdef CONFIG_ATARI_SCSI
|
||||
static const struct resource atari_scsi_st_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = IRQ_MFP_FSCSI,
|
||||
.end = IRQ_MFP_FSCSI,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct resource atari_scsi_tt_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = IRQ_TT_MFP_SCSI,
|
||||
.end = IRQ_TT_MFP_SCSI,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
int __init atari_platform_init(void)
|
||||
{
|
||||
int rv = 0;
|
||||
@@ -892,6 +910,15 @@ int __init atari_platform_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ATARI_SCSI
|
||||
if (ATARIHW_PRESENT(ST_SCSI))
|
||||
platform_device_register_simple("atari_scsi", -1,
|
||||
atari_scsi_st_rsrc, ARRAY_SIZE(atari_scsi_st_rsrc));
|
||||
else if (ATARIHW_PRESENT(TT_SCSI))
|
||||
platform_device_register_simple("atari_scsi", -1,
|
||||
atari_scsi_tt_rsrc, ARRAY_SIZE(atari_scsi_tt_rsrc));
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
+40
-21
@@ -59,6 +59,31 @@ static irqreturn_t stdma_int (int irq, void *dummy);
|
||||
/************************* End of Prototypes **************************/
|
||||
|
||||
|
||||
/**
|
||||
* stdma_try_lock - attempt to acquire ST DMA interrupt "lock"
|
||||
* @handler: interrupt handler to use after acquisition
|
||||
*
|
||||
* Returns !0 if lock was acquired; otherwise 0.
|
||||
*/
|
||||
|
||||
int stdma_try_lock(irq_handler_t handler, void *data)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
if (stdma_locked) {
|
||||
local_irq_restore(flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
stdma_locked = 1;
|
||||
stdma_isr = handler;
|
||||
stdma_isr_data = data;
|
||||
local_irq_restore(flags);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(stdma_try_lock);
|
||||
|
||||
|
||||
/*
|
||||
* Function: void stdma_lock( isrfunc isr, void *data )
|
||||
@@ -78,19 +103,10 @@ static irqreturn_t stdma_int (int irq, void *dummy);
|
||||
|
||||
void stdma_lock(irq_handler_t handler, void *data)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags); /* protect lock */
|
||||
|
||||
/* Since the DMA is used for file system purposes, we
|
||||
have to sleep uninterruptible (there may be locked
|
||||
buffers) */
|
||||
wait_event(stdma_wait, !stdma_locked);
|
||||
|
||||
stdma_locked = 1;
|
||||
stdma_isr = handler;
|
||||
stdma_isr_data = data;
|
||||
local_irq_restore(flags);
|
||||
wait_event(stdma_wait, stdma_try_lock(handler, data));
|
||||
}
|
||||
EXPORT_SYMBOL(stdma_lock);
|
||||
|
||||
@@ -122,22 +138,25 @@ void stdma_release(void)
|
||||
EXPORT_SYMBOL(stdma_release);
|
||||
|
||||
|
||||
/*
|
||||
* Function: int stdma_others_waiting( void )
|
||||
*
|
||||
* Purpose: Check if someone waits for the ST-DMA lock.
|
||||
*
|
||||
* Inputs: none
|
||||
*
|
||||
* Returns: 0 if no one is waiting, != 0 otherwise
|
||||
/**
|
||||
* stdma_is_locked_by - allow lock holder to check whether it needs to release.
|
||||
* @handler: interrupt handler previously used to acquire lock.
|
||||
*
|
||||
* Returns !0 if locked for the given handler; 0 otherwise.
|
||||
*/
|
||||
|
||||
int stdma_others_waiting(void)
|
||||
int stdma_is_locked_by(irq_handler_t handler)
|
||||
{
|
||||
return waitqueue_active(&stdma_wait);
|
||||
unsigned long flags;
|
||||
int result;
|
||||
|
||||
local_irq_save(flags);
|
||||
result = stdma_locked && (stdma_isr == handler);
|
||||
local_irq_restore(flags);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(stdma_others_waiting);
|
||||
EXPORT_SYMBOL(stdma_is_locked_by);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
/***************************** Prototypes *****************************/
|
||||
|
||||
int stdma_try_lock(irq_handler_t, void *);
|
||||
void stdma_lock(irq_handler_t handler, void *data);
|
||||
void stdma_release( void );
|
||||
int stdma_others_waiting( void );
|
||||
int stdma_islocked( void );
|
||||
void *stdma_locked_by( void );
|
||||
int stdma_is_locked_by(irq_handler_t);
|
||||
void stdma_init( void );
|
||||
|
||||
/************************* End of Prototypes **************************/
|
||||
|
||||
@@ -53,6 +53,10 @@ struct mac_model
|
||||
#define MAC_SCSI_QUADRA 2
|
||||
#define MAC_SCSI_QUADRA2 3
|
||||
#define MAC_SCSI_QUADRA3 4
|
||||
#define MAC_SCSI_IIFX 5
|
||||
#define MAC_SCSI_DUO 6
|
||||
#define MAC_SCSI_CCL 7
|
||||
#define MAC_SCSI_LATE 8
|
||||
|
||||
#define MAC_IDE_NONE 0
|
||||
#define MAC_IDE_QUADRA 1
|
||||
|
||||
+132
-14
@@ -278,7 +278,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "IIfx",
|
||||
.adb_type = MAC_ADB_IOP,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_IIFX,
|
||||
.scc_type = MAC_SCC_IOP,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_IOP,
|
||||
@@ -329,7 +329,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "Color Classic",
|
||||
.adb_type = MAC_ADB_CUDA,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_CCL,
|
||||
.scc_type = MAC_SCC_II,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -338,7 +338,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "Color Classic II",
|
||||
.adb_type = MAC_ADB_CUDA,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_CCL,
|
||||
.scc_type = MAC_SCC_II,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -526,7 +526,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "Performa 520",
|
||||
.adb_type = MAC_ADB_CUDA,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_CCL,
|
||||
.scc_type = MAC_SCC_II,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -535,7 +535,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "Performa 550",
|
||||
.adb_type = MAC_ADB_CUDA,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_CCL,
|
||||
.scc_type = MAC_SCC_II,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -567,7 +567,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "TV",
|
||||
.adb_type = MAC_ADB_CUDA,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_CCL,
|
||||
.scc_type = MAC_SCC_II,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -712,7 +712,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "PowerBook 190",
|
||||
.adb_type = MAC_ADB_PB2,
|
||||
.via_type = MAC_VIA_QUADRA,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_LATE,
|
||||
.ide_type = MAC_IDE_BABOON,
|
||||
.scc_type = MAC_SCC_QUADRA,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
@@ -722,7 +722,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "PowerBook 520",
|
||||
.adb_type = MAC_ADB_PB2,
|
||||
.via_type = MAC_VIA_QUADRA,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_LATE,
|
||||
.scc_type = MAC_SCC_QUADRA,
|
||||
.ether_type = MAC_ETHER_SONIC,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
@@ -740,7 +740,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "PowerBook Duo 210",
|
||||
.adb_type = MAC_ADB_PB2,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_DUO,
|
||||
.scc_type = MAC_SCC_QUADRA,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -749,7 +749,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "PowerBook Duo 230",
|
||||
.adb_type = MAC_ADB_PB2,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_DUO,
|
||||
.scc_type = MAC_SCC_QUADRA,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -758,7 +758,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "PowerBook Duo 250",
|
||||
.adb_type = MAC_ADB_PB2,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_DUO,
|
||||
.scc_type = MAC_SCC_QUADRA,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -767,7 +767,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "PowerBook Duo 270c",
|
||||
.adb_type = MAC_ADB_PB2,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_DUO,
|
||||
.scc_type = MAC_SCC_QUADRA,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -776,7 +776,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "PowerBook Duo 280",
|
||||
.adb_type = MAC_ADB_PB2,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_DUO,
|
||||
.scc_type = MAC_SCC_QUADRA,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -785,7 +785,7 @@ static struct mac_model mac_data_table[] = {
|
||||
.name = "PowerBook Duo 280c",
|
||||
.adb_type = MAC_ADB_PB2,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scsi_type = MAC_SCSI_DUO,
|
||||
.scc_type = MAC_SCC_QUADRA,
|
||||
.nubus_type = MAC_NUBUS,
|
||||
.floppy_type = MAC_FLOPPY_SWIM_ADDR2,
|
||||
@@ -929,6 +929,70 @@ static struct platform_device swim_pdev = {
|
||||
.resource = &swim_rsrc,
|
||||
};
|
||||
|
||||
static const struct resource mac_scsi_iifx_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = IRQ_MAC_SCSI,
|
||||
.end = IRQ_MAC_SCSI,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0x50008000,
|
||||
.end = 0x50009FFF,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct resource mac_scsi_duo_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0xFEE02000,
|
||||
.end = 0xFEE03FFF,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct resource mac_scsi_old_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = IRQ_MAC_SCSI,
|
||||
.end = IRQ_MAC_SCSI,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0x50010000,
|
||||
.end = 0x50011FFF,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0x50006000,
|
||||
.end = 0x50007FFF,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct resource mac_scsi_late_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = IRQ_MAC_SCSI,
|
||||
.end = IRQ_MAC_SCSI,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0x50010000,
|
||||
.end = 0x50011FFF,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct resource mac_scsi_ccl_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = IRQ_MAC_SCSI,
|
||||
.end = IRQ_MAC_SCSI,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0x50F10000,
|
||||
.end = 0x50F11FFF,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0x50F06000,
|
||||
.end = 0x50F07FFF,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device esp_0_pdev = {
|
||||
.name = "mac_esp",
|
||||
.id = 0,
|
||||
@@ -1000,6 +1064,60 @@ int __init mac_platform_init(void)
|
||||
(macintosh_config->ident == MAC_MODEL_Q950))
|
||||
platform_device_register(&esp_1_pdev);
|
||||
break;
|
||||
case MAC_SCSI_IIFX:
|
||||
/* Addresses from The Guide to Mac Family Hardware.
|
||||
* $5000 8000 - $5000 9FFF: SCSI DMA
|
||||
* $5000 C000 - $5000 DFFF: Alternate SCSI (DMA)
|
||||
* $5000 E000 - $5000 FFFF: Alternate SCSI (Hsk)
|
||||
* The SCSI DMA custom IC embeds the 53C80 core. mac_scsi does
|
||||
* not make use of its DMA or hardware handshaking logic.
|
||||
*/
|
||||
platform_device_register_simple("mac_scsi", 0,
|
||||
mac_scsi_iifx_rsrc, ARRAY_SIZE(mac_scsi_iifx_rsrc));
|
||||
break;
|
||||
case MAC_SCSI_DUO:
|
||||
/* Addresses from the Duo Dock II Developer Note.
|
||||
* $FEE0 2000 - $FEE0 3FFF: normal mode
|
||||
* $FEE0 4000 - $FEE0 5FFF: pseudo DMA without /DRQ
|
||||
* $FEE0 6000 - $FEE0 7FFF: pseudo DMA with /DRQ
|
||||
* The NetBSD code indicates that both 5380 chips share
|
||||
* an IRQ (?) which would need careful handling (see mac_esp).
|
||||
*/
|
||||
platform_device_register_simple("mac_scsi", 1,
|
||||
mac_scsi_duo_rsrc, ARRAY_SIZE(mac_scsi_duo_rsrc));
|
||||
/* fall through */
|
||||
case MAC_SCSI_OLD:
|
||||
/* Addresses from Developer Notes for Duo System,
|
||||
* PowerBook 180 & 160, 140 & 170, Macintosh IIsi
|
||||
* and also from The Guide to Mac Family Hardware for
|
||||
* SE/30, II, IIx, IIcx, IIci.
|
||||
* $5000 6000 - $5000 7FFF: pseudo-DMA with /DRQ
|
||||
* $5001 0000 - $5001 1FFF: normal mode
|
||||
* $5001 2000 - $5001 3FFF: pseudo-DMA without /DRQ
|
||||
* GMFH says that $5000 0000 - $50FF FFFF "wraps
|
||||
* $5000 0000 - $5001 FFFF eight times" (!)
|
||||
* mess.org says IIci and Color Classic do not alias
|
||||
* I/O address space.
|
||||
*/
|
||||
platform_device_register_simple("mac_scsi", 0,
|
||||
mac_scsi_old_rsrc, ARRAY_SIZE(mac_scsi_old_rsrc));
|
||||
break;
|
||||
case MAC_SCSI_LATE:
|
||||
/* PDMA logic in 68040 PowerBooks is somehow different to
|
||||
* '030 models. It's probably more like Quadras (see mac_esp).
|
||||
*/
|
||||
platform_device_register_simple("mac_scsi", 0,
|
||||
mac_scsi_late_rsrc, ARRAY_SIZE(mac_scsi_late_rsrc));
|
||||
break;
|
||||
case MAC_SCSI_CCL:
|
||||
/* Addresses from the Color Classic Developer Note.
|
||||
* $50F0 6000 - $50F0 7FFF: SCSI handshake
|
||||
* $50F1 0000 - $50F1 1FFF: SCSI
|
||||
* $50F1 2000 - $50F1 3FFF: SCSI DMA
|
||||
*/
|
||||
platform_device_register_simple("mac_scsi", 0,
|
||||
mac_scsi_ccl_rsrc, ARRAY_SIZE(mac_scsi_ccl_rsrc));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <linux/console.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/oplib.h>
|
||||
#include <asm/setup.h>
|
||||
@@ -27,6 +28,7 @@
|
||||
#include <asm/sun3mmu.h>
|
||||
#include <asm/rtc.h>
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/machines.h>
|
||||
#include <asm/idprom.h>
|
||||
#include <asm/intersil.h>
|
||||
#include <asm/irq.h>
|
||||
@@ -169,3 +171,61 @@ static void __init sun3_sched_init(irq_handler_t timer_routine)
|
||||
intersil_clear();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SUN3_SCSI
|
||||
|
||||
static const struct resource sun3_scsi_vme_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = SUN3_VEC_VMESCSI0,
|
||||
.end = SUN3_VEC_VMESCSI0,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0xff200000,
|
||||
.end = 0xff200021,
|
||||
}, {
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = SUN3_VEC_VMESCSI1,
|
||||
.end = SUN3_VEC_VMESCSI1,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0xff204000,
|
||||
.end = 0xff204021,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* Int: level 2 autovector
|
||||
* IO: type 1, base 0x00140000, 5 bits phys space: A<4..0>
|
||||
*/
|
||||
static const struct resource sun3_scsi_rsrc[] __initconst = {
|
||||
{
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = 2,
|
||||
.end = 2,
|
||||
}, {
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = 0x00140000,
|
||||
.end = 0x0014001f,
|
||||
},
|
||||
};
|
||||
|
||||
int __init sun3_platform_init(void)
|
||||
{
|
||||
switch (idprom->id_machtype) {
|
||||
case SM_SUN3 | SM_3_160:
|
||||
case SM_SUN3 | SM_3_260:
|
||||
platform_device_register_simple("sun3_scsi_vme", -1,
|
||||
sun3_scsi_vme_rsrc, ARRAY_SIZE(sun3_scsi_vme_rsrc));
|
||||
break;
|
||||
case SM_SUN3 | SM_3_50:
|
||||
case SM_SUN3 | SM_3_60:
|
||||
platform_device_register_simple("sun3_scsi", -1,
|
||||
sun3_scsi_rsrc, ARRAY_SIZE(sun3_scsi_rsrc));
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
arch_initcall(sun3_platform_init);
|
||||
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -1266,7 +1266,7 @@ void blk_requeue_request(struct request_queue *q, struct request *rq)
|
||||
blk_clear_rq_complete(rq);
|
||||
trace_block_rq_requeue(q, rq);
|
||||
|
||||
if (blk_rq_tagged(rq))
|
||||
if (rq->cmd_flags & REQ_QUEUED)
|
||||
blk_queue_end_tag(q, rq);
|
||||
|
||||
BUG_ON(blk_queued_rq(rq));
|
||||
@@ -2554,7 +2554,7 @@ EXPORT_SYMBOL_GPL(blk_unprep_request);
|
||||
*/
|
||||
void blk_finish_request(struct request *req, int error)
|
||||
{
|
||||
if (blk_rq_tagged(req))
|
||||
if (req->cmd_flags & REQ_QUEUED)
|
||||
blk_queue_end_tag(req->q, req);
|
||||
|
||||
BUG_ON(blk_queued_rq(req));
|
||||
|
||||
@@ -584,6 +584,34 @@ int blk_mq_tag_update_depth(struct blk_mq_tags *tags, unsigned int tdepth)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* blk_mq_unique_tag() - return a tag that is unique queue-wide
|
||||
* @rq: request for which to compute a unique tag
|
||||
*
|
||||
* The tag field in struct request is unique per hardware queue but not over
|
||||
* all hardware queues. Hence this function that returns a tag with the
|
||||
* hardware context index in the upper bits and the per hardware queue tag in
|
||||
* the lower bits.
|
||||
*
|
||||
* Note: When called for a request that is queued on a non-multiqueue request
|
||||
* queue, the hardware context index is set to zero.
|
||||
*/
|
||||
u32 blk_mq_unique_tag(struct request *rq)
|
||||
{
|
||||
struct request_queue *q = rq->q;
|
||||
struct blk_mq_hw_ctx *hctx;
|
||||
int hwq = 0;
|
||||
|
||||
if (q->mq_ops) {
|
||||
hctx = q->mq_ops->map_queue(q, rq->mq_ctx->cpu);
|
||||
hwq = hctx->queue_num;
|
||||
}
|
||||
|
||||
return (hwq << BLK_MQ_UNIQUE_TAG_BITS) |
|
||||
(rq->tag & BLK_MQ_UNIQUE_TAG_MASK);
|
||||
}
|
||||
EXPORT_SYMBOL(blk_mq_unique_tag);
|
||||
|
||||
ssize_t blk_mq_tag_sysfs_show(struct blk_mq_tags *tags, char *page)
|
||||
{
|
||||
char *orig_page = page;
|
||||
|
||||
@@ -2049,6 +2049,8 @@ static int blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set)
|
||||
*/
|
||||
int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
|
||||
{
|
||||
BUILD_BUG_ON(BLK_MQ_MAX_DEPTH > 1 << BLK_MQ_UNIQUE_TAG_BITS);
|
||||
|
||||
if (!set->nr_hw_queues)
|
||||
return -EINVAL;
|
||||
if (!set->queue_depth)
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ static void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)
|
||||
__set_bit(GPCMD_VERIFY_10, filter->read_ok);
|
||||
__set_bit(VERIFY_16, filter->read_ok);
|
||||
__set_bit(REPORT_LUNS, filter->read_ok);
|
||||
__set_bit(SERVICE_ACTION_IN, filter->read_ok);
|
||||
__set_bit(SERVICE_ACTION_IN_16, filter->read_ok);
|
||||
__set_bit(RECEIVE_DIAGNOSTIC, filter->read_ok);
|
||||
__set_bit(MAINTENANCE_IN, filter->read_ok);
|
||||
__set_bit(GPCMD_READ_BUFFER_CAPACITY, filter->read_ok);
|
||||
|
||||
@@ -1164,7 +1164,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
|
||||
|
||||
depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
|
||||
depth = min(ATA_MAX_QUEUE - 1, depth);
|
||||
scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, depth);
|
||||
scsi_change_queue_depth(sdev, depth);
|
||||
}
|
||||
|
||||
blk_queue_flush_queueable(q, false);
|
||||
@@ -1243,21 +1243,17 @@ void ata_scsi_slave_destroy(struct scsi_device *sdev)
|
||||
* @ap: ATA port to which the device change the queue depth
|
||||
* @sdev: SCSI device to configure queue depth for
|
||||
* @queue_depth: new queue depth
|
||||
* @reason: calling context
|
||||
*
|
||||
* libsas and libata have different approaches for associating a sdev to
|
||||
* its ata_port.
|
||||
*
|
||||
*/
|
||||
int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
|
||||
int queue_depth, int reason)
|
||||
int queue_depth)
|
||||
{
|
||||
struct ata_device *dev;
|
||||
unsigned long flags;
|
||||
|
||||
if (reason != SCSI_QDEPTH_DEFAULT)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (queue_depth < 1 || queue_depth == sdev->queue_depth)
|
||||
return sdev->queue_depth;
|
||||
|
||||
@@ -1282,15 +1278,13 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
|
||||
if (sdev->queue_depth == queue_depth)
|
||||
return -EINVAL;
|
||||
|
||||
scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, queue_depth);
|
||||
return queue_depth;
|
||||
return scsi_change_queue_depth(sdev, queue_depth);
|
||||
}
|
||||
|
||||
/**
|
||||
* ata_scsi_change_queue_depth - SCSI callback for queue depth config
|
||||
* @sdev: SCSI device to configure queue depth for
|
||||
* @queue_depth: new queue depth
|
||||
* @reason: calling context
|
||||
*
|
||||
* This is libata standard hostt->change_queue_depth callback.
|
||||
* SCSI will call into this callback when user tries to set queue
|
||||
@@ -1302,12 +1296,11 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
|
||||
* RETURNS:
|
||||
* Newly configured queue depth.
|
||||
*/
|
||||
int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth,
|
||||
int reason)
|
||||
int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth)
|
||||
{
|
||||
struct ata_port *ap = ata_shost_to_port(sdev->host);
|
||||
|
||||
return __ata_change_queue_depth(ap, sdev, queue_depth, reason);
|
||||
return __ata_change_queue_depth(ap, sdev, queue_depth);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3570,7 +3563,7 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd)
|
||||
ata_scsi_rbuf_fill(&args, ata_scsiop_read_cap);
|
||||
break;
|
||||
|
||||
case SERVICE_ACTION_IN:
|
||||
case SERVICE_ACTION_IN_16:
|
||||
if ((scsicmd[1] & 0x1f) == SAI_READ_CAPACITY_16)
|
||||
ata_scsi_rbuf_fill(&args, ata_scsiop_read_cap);
|
||||
else
|
||||
|
||||
@@ -1951,7 +1951,7 @@ static int nv_swncq_slave_config(struct scsi_device *sdev)
|
||||
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
|
||||
|
||||
if (strncmp(model_num, "Maxtor", 6) == 0) {
|
||||
ata_scsi_change_queue_depth(sdev, 1, SCSI_QDEPTH_DEFAULT);
|
||||
ata_scsi_change_queue_depth(sdev, 1);
|
||||
ata_dev_notice(dev, "Disabling SWNCQ mode (depth %x)\n",
|
||||
sdev->queue_depth);
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ INQUIRY_EVPD_BIT_MASK) ? 1 : 0)
|
||||
(GET_U32_FROM_CDB(cdb, READ_CAP_16_CDB_ALLOC_LENGTH_OFFSET))
|
||||
|
||||
#define IS_READ_CAP_16(cdb) \
|
||||
((cdb[0] == SERVICE_ACTION_IN && cdb[1] == SAI_READ_CAPACITY_16) ? 1 : 0)
|
||||
((cdb[0] == SERVICE_ACTION_IN_16 && cdb[1] == SAI_READ_CAPACITY_16) ? 1 : 0)
|
||||
|
||||
/* Request Sense Helper Macros */
|
||||
#define GET_REQUEST_SENSE_ALLOC_LENGTH(cdb) \
|
||||
@@ -2947,7 +2947,7 @@ static int nvme_scsi_translate(struct nvme_ns *ns, struct sg_io_hdr *hdr)
|
||||
case READ_CAPACITY:
|
||||
retcode = nvme_trans_read_capacity(ns, hdr, cmd);
|
||||
break;
|
||||
case SERVICE_ACTION_IN:
|
||||
case SERVICE_ACTION_IN_16:
|
||||
if (IS_READ_CAP_16(cmd))
|
||||
retcode = nvme_trans_read_capacity(ns, hdr, cmd);
|
||||
else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user