Merge 509d2cd12a ("Merge tag 'Smack-for-6.12' of https://github.com/cschaufler/smack-next") into android-mainline
Steps on the way to 6.12-rc1 Bug: 367265496 Change-Id: Ic506fdd0a8f3d6c4e8275b8222cd0d4cf0853437 Signed-off-by: Matthias Maennich <maennich@google.com>
This commit is contained in:
@@ -1532,3 +1532,30 @@ Contact: Bean Huo <beanhuo@micron.com>
|
||||
Description:
|
||||
rtc_update_ms indicates how often the host should synchronize or update the
|
||||
UFS RTC. If set to 0, this will disable UFS RTC periodic update.
|
||||
|
||||
What: /sys/devices/platform/.../ufshci_capabilities/version
|
||||
Date: August 2024
|
||||
Contact: Avri Altman <avri.altman@wdc.com>
|
||||
Description:
|
||||
Host Capabilities register group: UFS version register.
|
||||
Symbol - VER. This file shows the UFSHCD version.
|
||||
Example: Version 3.12 would be represented as 0000_0312h.
|
||||
The file is read only.
|
||||
|
||||
What: /sys/devices/platform/.../ufshci_capabilities/product_id
|
||||
Date: August 2024
|
||||
Contact: Avri Altman <avri.altman@wdc.com>
|
||||
Description:
|
||||
Host Capabilities register group: product ID register.
|
||||
Symbol - HCPID. This file shows the UFSHCD product id.
|
||||
The content of this register is vendor specific.
|
||||
The file is read only.
|
||||
|
||||
What: /sys/devices/platform/.../ufshci_capabilities/man_id
|
||||
Date: August 2024
|
||||
Contact: Avri Altman <avri.altman@wdc.com>
|
||||
Description:
|
||||
Host Capabilities register group: manufacturer ID register.
|
||||
Symbol - HCMID. This file shows the UFSHCD manufacturer id.
|
||||
The Manufacturer ID is defined by JEDEC in JEDEC-JEP106.
|
||||
The file is read only.
|
||||
|
||||
@@ -11848,6 +11848,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
|
||||
F: drivers/iommu/dma-iommu.c
|
||||
F: drivers/iommu/dma-iommu.h
|
||||
F: drivers/iommu/iova.c
|
||||
F: include/linux/iommu-dma.h
|
||||
F: include/linux/iova.h
|
||||
|
||||
IOMMU SUBSYSTEM
|
||||
|
||||
@@ -17,6 +17,15 @@ config CPU_MITIGATIONS
|
||||
def_bool y
|
||||
endif
|
||||
|
||||
#
|
||||
# Selected by architectures that need custom DMA operations for e.g. legacy
|
||||
# IOMMUs not handled by dma-iommu. Drivers must never select this symbol.
|
||||
#
|
||||
config ARCH_HAS_DMA_OPS
|
||||
depends on HAS_DMA
|
||||
select DMA_OPS_HELPERS
|
||||
bool
|
||||
|
||||
menu "General architecture-dependent options"
|
||||
|
||||
config ARCH_HAS_SUBPAGE_FAULTS
|
||||
|
||||
+1
-1
@@ -4,12 +4,12 @@ config ALPHA
|
||||
default y
|
||||
select ARCH_32BIT_USTAT_F_TINODE
|
||||
select ARCH_HAS_CURRENT_STACK_POINTER
|
||||
select ARCH_HAS_DMA_OPS if PCI
|
||||
select ARCH_MIGHT_HAVE_PC_PARPORT
|
||||
select ARCH_MIGHT_HAVE_PC_SERIO
|
||||
select ARCH_NO_PREEMPT
|
||||
select ARCH_NO_SG_CHAIN
|
||||
select ARCH_USE_CMPXCHG_LOCKREF
|
||||
select DMA_OPS if PCI
|
||||
select FORCE_PCI
|
||||
select PCI_DOMAINS if PCI
|
||||
select PCI_SYSCALL if PCI
|
||||
|
||||
+1
-1
@@ -10,6 +10,7 @@ config ARM
|
||||
select ARCH_HAS_CURRENT_STACK_POINTER
|
||||
select ARCH_HAS_DEBUG_VIRTUAL if MMU
|
||||
select ARCH_HAS_DMA_ALLOC if MMU
|
||||
select ARCH_HAS_DMA_OPS
|
||||
select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE
|
||||
select ARCH_HAS_ELF_RANDOMIZE
|
||||
select ARCH_HAS_FORTIFY_SOURCE
|
||||
@@ -54,7 +55,6 @@ config ARM
|
||||
select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||||
select DMA_DECLARE_COHERENT
|
||||
select DMA_GLOBAL_POOL if !MMU
|
||||
select DMA_OPS
|
||||
select DMA_NONCOHERENT_MMAP if MMU
|
||||
select EDAC_SUPPORT
|
||||
select EDAC_ATOMIC_SCRUB
|
||||
|
||||
@@ -24,6 +24,7 @@ config ARM64
|
||||
select ARCH_HAS_CURRENT_STACK_POINTER
|
||||
select ARCH_HAS_DEBUG_VIRTUAL
|
||||
select ARCH_HAS_DEBUG_VM_PGTABLE
|
||||
select ARCH_HAS_DMA_OPS if XEN
|
||||
select ARCH_HAS_DMA_PREP_COHERENT
|
||||
select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
|
||||
select ARCH_HAS_FAST_MULTIPLIER
|
||||
|
||||
+18
-21
@@ -114,36 +114,33 @@ static void __init arch_reserve_crashkernel(void)
|
||||
low_size, high);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the maximum physical address for a zone accessible by the given bits
|
||||
* limit. If DRAM starts above 32-bit, expand the zone to the maximum
|
||||
* available memory, otherwise cap it at 32-bit.
|
||||
*/
|
||||
static phys_addr_t __init max_zone_phys(unsigned int zone_bits)
|
||||
static phys_addr_t __init max_zone_phys(phys_addr_t zone_limit)
|
||||
{
|
||||
phys_addr_t zone_mask = DMA_BIT_MASK(zone_bits);
|
||||
phys_addr_t phys_start = memblock_start_of_DRAM();
|
||||
/**
|
||||
* Information we get from firmware (e.g. DT dma-ranges) describe DMA
|
||||
* bus constraints. Devices using DMA might have their own limitations.
|
||||
* Some of them rely on DMA zone in low 32-bit memory. Keep low RAM
|
||||
* DMA zone on platforms that have RAM there.
|
||||
*/
|
||||
if (memblock_start_of_DRAM() < U32_MAX)
|
||||
zone_limit = min(zone_limit, U32_MAX);
|
||||
|
||||
if (phys_start > U32_MAX)
|
||||
zone_mask = PHYS_ADDR_MAX;
|
||||
else if (phys_start > zone_mask)
|
||||
zone_mask = U32_MAX;
|
||||
|
||||
return min(zone_mask, memblock_end_of_DRAM() - 1) + 1;
|
||||
return min(zone_limit, memblock_end_of_DRAM() - 1) + 1;
|
||||
}
|
||||
|
||||
static void __init zone_sizes_init(void)
|
||||
{
|
||||
unsigned long max_zone_pfns[MAX_NR_ZONES] = {0};
|
||||
unsigned int __maybe_unused acpi_zone_dma_bits;
|
||||
unsigned int __maybe_unused dt_zone_dma_bits;
|
||||
phys_addr_t __maybe_unused dma32_phys_limit = max_zone_phys(32);
|
||||
phys_addr_t __maybe_unused acpi_zone_dma_limit;
|
||||
phys_addr_t __maybe_unused dt_zone_dma_limit;
|
||||
phys_addr_t __maybe_unused dma32_phys_limit =
|
||||
max_zone_phys(DMA_BIT_MASK(32));
|
||||
|
||||
#ifdef CONFIG_ZONE_DMA
|
||||
acpi_zone_dma_bits = fls64(acpi_iort_dma_get_max_cpu_address());
|
||||
dt_zone_dma_bits = fls64(of_dma_get_max_cpu_address(NULL));
|
||||
zone_dma_bits = min3(32U, dt_zone_dma_bits, acpi_zone_dma_bits);
|
||||
arm64_dma_phys_limit = max_zone_phys(zone_dma_bits);
|
||||
acpi_zone_dma_limit = acpi_iort_dma_get_max_cpu_address();
|
||||
dt_zone_dma_limit = of_dma_get_max_cpu_address(NULL);
|
||||
zone_dma_limit = min(dt_zone_dma_limit, acpi_zone_dma_limit);
|
||||
arm64_dma_phys_limit = max_zone_phys(zone_dma_limit);
|
||||
max_zone_pfns[ZONE_DMA] = PFN_DOWN(arm64_dma_phys_limit);
|
||||
#endif
|
||||
#ifdef CONFIG_ZONE_DMA32
|
||||
|
||||
+1
-1
@@ -8,6 +8,7 @@ config MIPS
|
||||
select ARCH_HAS_CPU_FINALIZE_INIT
|
||||
select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
|
||||
select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
|
||||
select ARCH_HAS_DMA_OPS if MACH_JAZZ
|
||||
select ARCH_HAS_FORTIFY_SOURCE
|
||||
select ARCH_HAS_KCOV
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE if !EVA
|
||||
@@ -393,7 +394,6 @@ config MACH_JAZZ
|
||||
select ARC_PROMLIB
|
||||
select ARCH_MIGHT_HAVE_PC_PARPORT
|
||||
select ARCH_MIGHT_HAVE_PC_SERIO
|
||||
select DMA_OPS
|
||||
select FW_ARC
|
||||
select FW_ARC32
|
||||
select ARCH_MAY_HAVE_PC_FDC
|
||||
|
||||
+1
-1
@@ -10,6 +10,7 @@ config PARISC
|
||||
select ARCH_WANT_FRAME_POINTERS
|
||||
select ARCH_HAS_CPU_CACHE_ALIASING
|
||||
select ARCH_HAS_DMA_ALLOC if PA11
|
||||
select ARCH_HAS_DMA_OPS
|
||||
select ARCH_HAS_ELF_RANDOMIZE
|
||||
select ARCH_HAS_STRICT_KERNEL_RWX
|
||||
select ARCH_HAS_STRICT_MODULE_RWX
|
||||
@@ -23,7 +24,6 @@ config PARISC
|
||||
select ARCH_HAS_CACHE_LINE_SIZE
|
||||
select ARCH_HAS_DEBUG_VM_PGTABLE
|
||||
select HAVE_RELIABLE_STACKTRACE
|
||||
select DMA_OPS
|
||||
select RTC_CLASS
|
||||
select RTC_DRV_GENERIC
|
||||
select INIT_ALL_POSSIBLE
|
||||
|
||||
@@ -133,6 +133,7 @@ config PPC
|
||||
select ARCH_HAS_DEBUG_WX if STRICT_KERNEL_RWX
|
||||
select ARCH_HAS_DEVMEM_IS_ALLOWED
|
||||
select ARCH_HAS_DMA_MAP_DIRECT if PPC_PSERIES
|
||||
select ARCH_HAS_DMA_OPS if PPC64
|
||||
select ARCH_HAS_FORTIFY_SOURCE
|
||||
select ARCH_HAS_GCOV_PROFILE_ALL
|
||||
select ARCH_HAS_KCOV
|
||||
@@ -185,7 +186,6 @@ config PPC
|
||||
select CPUMASK_OFFSTACK if NR_CPUS >= 8192
|
||||
select DCACHE_WORD_ACCESS if PPC64 && CPU_LITTLE_ENDIAN
|
||||
select DMA_OPS_BYPASS if PPC64
|
||||
select DMA_OPS if PPC64
|
||||
select DYNAMIC_FTRACE if FUNCTION_TRACER
|
||||
select EDAC_ATOMIC_SCRUB
|
||||
select EDAC_SUPPORT
|
||||
|
||||
@@ -216,7 +216,7 @@ static int __init mark_nonram_nosave(void)
|
||||
* everything else. GFP_DMA32 page allocations automatically fall back to
|
||||
* ZONE_DMA.
|
||||
*
|
||||
* By using 31-bit unconditionally, we can exploit zone_dma_bits to inform the
|
||||
* By using 31-bit unconditionally, we can exploit zone_dma_limit to inform the
|
||||
* generic DMA mapping code. 32-bit only devices (if not handled by an IOMMU
|
||||
* anyway) will take a first dip into ZONE_NORMAL and get otherwise served by
|
||||
* ZONE_DMA.
|
||||
@@ -230,6 +230,7 @@ void __init paging_init(void)
|
||||
{
|
||||
unsigned long long total_ram = memblock_phys_mem_size();
|
||||
phys_addr_t top_of_ram = memblock_end_of_DRAM();
|
||||
int zone_dma_bits;
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
unsigned long v = __fix_to_virt(FIX_KMAP_END);
|
||||
@@ -256,6 +257,8 @@ void __init paging_init(void)
|
||||
else
|
||||
zone_dma_bits = 31;
|
||||
|
||||
zone_dma_limit = DMA_BIT_MASK(zone_dma_bits);
|
||||
|
||||
#ifdef CONFIG_ZONE_DMA
|
||||
max_zone_pfns[ZONE_DMA] = min(max_low_pfn,
|
||||
1UL << (zone_dma_bits - PAGE_SHIFT));
|
||||
|
||||
+1
-1
@@ -70,6 +70,7 @@ config S390
|
||||
select ARCH_HAS_DEBUG_VM_PGTABLE
|
||||
select ARCH_HAS_DEBUG_WX
|
||||
select ARCH_HAS_DEVMEM_IS_ALLOWED
|
||||
select ARCH_HAS_DMA_OPS if PCI
|
||||
select ARCH_HAS_ELF_RANDOMIZE
|
||||
select ARCH_HAS_FORCE_DMA_UNENCRYPTED
|
||||
select ARCH_HAS_FORTIFY_SOURCE
|
||||
@@ -137,7 +138,6 @@ config S390
|
||||
select BUILDTIME_TABLE_SORT
|
||||
select CLONE_BACKWARDS2
|
||||
select DCACHE_WORD_ACCESS if !KMSAN
|
||||
select DMA_OPS if PCI
|
||||
select DYNAMIC_FTRACE if FUNCTION_TRACER
|
||||
select FUNCTION_ALIGNMENT_8B if CC_IS_GCC
|
||||
select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ void __init paging_init(void)
|
||||
|
||||
vmem_map_init();
|
||||
sparse_init();
|
||||
zone_dma_bits = 31;
|
||||
zone_dma_limit = DMA_BIT_MASK(31);
|
||||
memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
|
||||
max_zone_pfns[ZONE_DMA] = virt_to_pfn(MAX_DMA_ADDRESS);
|
||||
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
|
||||
|
||||
+1
-1
@@ -14,9 +14,9 @@ config SPARC
|
||||
bool
|
||||
default y
|
||||
select ARCH_HAS_CPU_CACHE_ALIASING
|
||||
select ARCH_HAS_DMA_OPS
|
||||
select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI
|
||||
select ARCH_MIGHT_HAVE_PC_SERIO
|
||||
select DMA_OPS
|
||||
select OF
|
||||
select OF_PROMTREE
|
||||
select HAVE_ASM_MODVERSIONS
|
||||
|
||||
+1
-1
@@ -79,6 +79,7 @@ config X86
|
||||
select ARCH_HAS_DEBUG_VIRTUAL
|
||||
select ARCH_HAS_DEBUG_VM_PGTABLE if !X86_PAE
|
||||
select ARCH_HAS_DEVMEM_IS_ALLOWED
|
||||
select ARCH_HAS_DMA_OPS if GART_IOMMU || XEN
|
||||
select ARCH_HAS_EARLY_DEBUG if KGDB
|
||||
select ARCH_HAS_ELF_RANDOMIZE
|
||||
select ARCH_HAS_FAST_MULTIPLIER
|
||||
@@ -944,7 +945,6 @@ config DMI
|
||||
|
||||
config GART_IOMMU
|
||||
bool "Old AMD GART IOMMU support"
|
||||
select DMA_OPS
|
||||
select IOMMU_HELPER
|
||||
select SWIOTLB
|
||||
depends on X86_64 && PCI && AMD_NB
|
||||
|
||||
@@ -799,6 +799,7 @@ void submit_bio_noacct(struct bio *bio)
|
||||
|
||||
switch (bio_op(bio)) {
|
||||
case REQ_OP_READ:
|
||||
break;
|
||||
case REQ_OP_WRITE:
|
||||
if (bio->bi_opf & REQ_ATOMIC) {
|
||||
status = blk_validate_atomic_write_op_size(q, bio);
|
||||
|
||||
@@ -447,9 +447,7 @@ static int init_pci(struct qaic_device *qdev, struct pci_dev *pdev)
|
||||
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = dma_set_max_seg_size(&pdev->dev, UINT_MAX);
|
||||
if (ret)
|
||||
return ret;
|
||||
dma_set_max_seg_size(&pdev->dev, UINT_MAX);
|
||||
|
||||
qdev->bar_0 = devm_ioremap_resource(&pdev->dev, &pdev->resource[0]);
|
||||
if (IS_ERR(qdev->bar_0))
|
||||
|
||||
@@ -598,9 +598,7 @@ static int idma64_probe(struct idma64_chip *chip)
|
||||
|
||||
idma64->dma.dev = chip->sysdev;
|
||||
|
||||
ret = dma_set_max_seg_size(idma64->dma.dev, IDMA64C_CTLH_BLOCK_TS_MASK);
|
||||
if (ret)
|
||||
return ret;
|
||||
dma_set_max_seg_size(idma64->dma.dev, IDMA64C_CTLH_BLOCK_TS_MASK);
|
||||
|
||||
ret = dma_async_device_register(&idma64->dma);
|
||||
if (ret)
|
||||
|
||||
+1
-4
@@ -3163,10 +3163,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
* This is the limit for transfers with a buswidth of 1, larger
|
||||
* buswidths will have larger limits.
|
||||
*/
|
||||
ret = dma_set_max_seg_size(&adev->dev, 1900800);
|
||||
if (ret)
|
||||
dev_err(&adev->dev, "unable to set the seg size\n");
|
||||
|
||||
dma_set_max_seg_size(&adev->dev, 1900800);
|
||||
|
||||
init_pl330_debugfs(pl330);
|
||||
dev_info(&adev->dev,
|
||||
|
||||
@@ -1325,11 +1325,7 @@ static int bam_dma_probe(struct platform_device *pdev)
|
||||
|
||||
/* set max dma segment size */
|
||||
bdev->common.dev = bdev->dev;
|
||||
ret = dma_set_max_seg_size(bdev->common.dev, BAM_FIFO_SIZE);
|
||||
if (ret) {
|
||||
dev_err(bdev->dev, "cannot set maximum segment size\n");
|
||||
goto err_bam_channel_exit;
|
||||
}
|
||||
dma_set_max_seg_size(bdev->common.dev, BAM_FIFO_SIZE);
|
||||
|
||||
platform_set_drvdata(pdev, bdev);
|
||||
|
||||
|
||||
@@ -1868,9 +1868,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
|
||||
|
||||
dmac->dev = &pdev->dev;
|
||||
platform_set_drvdata(pdev, dmac);
|
||||
ret = dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK);
|
||||
if (ret)
|
||||
return ret;
|
||||
dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK);
|
||||
|
||||
ret = dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40));
|
||||
if (ret)
|
||||
|
||||
@@ -3632,11 +3632,7 @@ static int __init d40_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
goto destroy_cache;
|
||||
|
||||
ret = dma_set_max_seg_size(base->dev, STEDMA40_MAX_SEG_SIZE);
|
||||
if (ret) {
|
||||
d40_err(dev, "Failed to set dma max seg size\n");
|
||||
goto destroy_cache;
|
||||
}
|
||||
dma_set_max_seg_size(base->dev, STEDMA40_MAX_SEG_SIZE);
|
||||
|
||||
d40_hw_init(base);
|
||||
|
||||
|
||||
@@ -559,11 +559,7 @@ static int mtk_drm_kms_init(struct drm_device *drm)
|
||||
* Configure the DMA segment size to make sure we get contiguous IOVA
|
||||
* when importing PRIME buffers.
|
||||
*/
|
||||
ret = dma_set_max_seg_size(dma_dev, UINT_MAX);
|
||||
if (ret) {
|
||||
dev_err(dma_dev, "Failed to set DMA segment size\n");
|
||||
goto err_component_unbind;
|
||||
}
|
||||
dma_set_max_seg_size(dma_dev, UINT_MAX);
|
||||
|
||||
ret = drm_vblank_init(drm, MAX_CRTC);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -170,6 +170,13 @@ struct aspeed_i2c_bus {
|
||||
|
||||
static int aspeed_i2c_reset(struct aspeed_i2c_bus *bus);
|
||||
|
||||
/* precondition: bus.lock has been acquired. */
|
||||
static void aspeed_i2c_do_stop(struct aspeed_i2c_bus *bus)
|
||||
{
|
||||
bus->master_state = ASPEED_I2C_MASTER_STOP;
|
||||
writel(ASPEED_I2CD_M_STOP_CMD, bus->base + ASPEED_I2C_CMD_REG);
|
||||
}
|
||||
|
||||
static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus)
|
||||
{
|
||||
unsigned long time_left, flags;
|
||||
@@ -187,7 +194,7 @@ static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus)
|
||||
command);
|
||||
|
||||
reinit_completion(&bus->cmd_complete);
|
||||
writel(ASPEED_I2CD_M_STOP_CMD, bus->base + ASPEED_I2C_CMD_REG);
|
||||
aspeed_i2c_do_stop(bus);
|
||||
spin_unlock_irqrestore(&bus->lock, flags);
|
||||
|
||||
time_left = wait_for_completion_timeout(
|
||||
@@ -390,13 +397,6 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
|
||||
writel(command, bus->base + ASPEED_I2C_CMD_REG);
|
||||
}
|
||||
|
||||
/* precondition: bus.lock has been acquired. */
|
||||
static void aspeed_i2c_do_stop(struct aspeed_i2c_bus *bus)
|
||||
{
|
||||
bus->master_state = ASPEED_I2C_MASTER_STOP;
|
||||
writel(ASPEED_I2CD_M_STOP_CMD, bus->base + ASPEED_I2C_CMD_REG);
|
||||
}
|
||||
|
||||
/* precondition: bus.lock has been acquired. */
|
||||
static void aspeed_i2c_next_msg_or_stop(struct aspeed_i2c_bus *bus)
|
||||
{
|
||||
|
||||
@@ -99,8 +99,7 @@ static int sch_transaction(void)
|
||||
if (retries > MAX_RETRIES) {
|
||||
dev_err(&sch_adapter.dev, "SMBus Timeout!\n");
|
||||
result = -ETIMEDOUT;
|
||||
}
|
||||
if (temp & 0x04) {
|
||||
} else if (temp & 0x04) {
|
||||
result = -EIO;
|
||||
dev_dbg(&sch_adapter.dev, "Bus collision! SMBus may be "
|
||||
"locked until next hard reset. (sorry!)\n");
|
||||
|
||||
@@ -818,15 +818,13 @@ static int geni_i2c_probe(struct platform_device *pdev)
|
||||
init_completion(&gi2c->done);
|
||||
spin_lock_init(&gi2c->lock);
|
||||
platform_set_drvdata(pdev, gi2c);
|
||||
ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, 0,
|
||||
ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, IRQF_NO_AUTOEN,
|
||||
dev_name(dev), gi2c);
|
||||
if (ret) {
|
||||
dev_err(dev, "Request_irq failed:%d: err:%d\n",
|
||||
gi2c->irq, ret);
|
||||
return ret;
|
||||
}
|
||||
/* Disable the interrupt so that the system can enter low-power mode */
|
||||
disable_irq(gi2c->irq);
|
||||
i2c_set_adapdata(&gi2c->adap, gi2c);
|
||||
gi2c->adap.dev.parent = dev;
|
||||
gi2c->adap.dev.of_node = dev->of_node;
|
||||
|
||||
@@ -772,14 +772,17 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
|
||||
goto out;
|
||||
}
|
||||
|
||||
xiic_fill_tx_fifo(i2c);
|
||||
|
||||
/* current message sent and there is space in the fifo */
|
||||
if (!xiic_tx_space(i2c) && xiic_tx_fifo_space(i2c) >= 2) {
|
||||
if (xiic_tx_space(i2c)) {
|
||||
xiic_fill_tx_fifo(i2c);
|
||||
} else {
|
||||
/* current message fully written */
|
||||
dev_dbg(i2c->adap.dev.parent,
|
||||
"%s end of message sent, nmsgs: %d\n",
|
||||
__func__, i2c->nmsgs);
|
||||
if (i2c->nmsgs > 1) {
|
||||
/* Don't move onto the next message until the TX FIFO empties,
|
||||
* to ensure that a NAK is not missed.
|
||||
*/
|
||||
if (i2c->nmsgs > 1 && (pend & XIIC_INTR_TX_EMPTY_MASK)) {
|
||||
i2c->nmsgs--;
|
||||
i2c->tx_msg++;
|
||||
xfer_more = 1;
|
||||
@@ -790,11 +793,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
|
||||
"%s Got TX IRQ but no more to do...\n",
|
||||
__func__);
|
||||
}
|
||||
} else if (!xiic_tx_space(i2c) && (i2c->nmsgs == 1))
|
||||
/* current frame is sent and is last,
|
||||
* make sure to disable tx half
|
||||
*/
|
||||
xiic_irq_dis(i2c, XIIC_INTR_TX_HALF_MASK);
|
||||
}
|
||||
}
|
||||
|
||||
if (pend & XIIC_INTR_BNB_MASK) {
|
||||
@@ -844,23 +843,11 @@ static int xiic_bus_busy(struct xiic_i2c *i2c)
|
||||
return (sr & XIIC_SR_BUS_BUSY_MASK) ? -EBUSY : 0;
|
||||
}
|
||||
|
||||
static int xiic_busy(struct xiic_i2c *i2c)
|
||||
static int xiic_wait_not_busy(struct xiic_i2c *i2c)
|
||||
{
|
||||
int tries = 3;
|
||||
int err;
|
||||
|
||||
if (i2c->tx_msg || i2c->rx_msg)
|
||||
return -EBUSY;
|
||||
|
||||
/* In single master mode bus can only be busy, when in use by this
|
||||
* driver. If the register indicates bus being busy for some reason we
|
||||
* should ignore it, since bus will never be released and i2c will be
|
||||
* stuck forever.
|
||||
*/
|
||||
if (i2c->singlemaster) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* for instance if previous transfer was terminated due to TX error
|
||||
* it might be that the bus is on it's way to become available
|
||||
* give it at most 3 ms to wake
|
||||
@@ -1104,13 +1091,36 @@ static int xiic_start_xfer(struct xiic_i2c *i2c, struct i2c_msg *msgs, int num)
|
||||
|
||||
mutex_lock(&i2c->lock);
|
||||
|
||||
ret = xiic_busy(i2c);
|
||||
if (ret) {
|
||||
if (i2c->tx_msg || i2c->rx_msg) {
|
||||
dev_err(i2c->adap.dev.parent,
|
||||
"cannot start a transfer while busy\n");
|
||||
ret = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* In single master mode bus can only be busy, when in use by this
|
||||
* driver. If the register indicates bus being busy for some reason we
|
||||
* should ignore it, since bus will never be released and i2c will be
|
||||
* stuck forever.
|
||||
*/
|
||||
if (!i2c->singlemaster) {
|
||||
ret = xiic_wait_not_busy(i2c);
|
||||
if (ret) {
|
||||
/* If the bus is stuck in a busy state, such as due to spurious low
|
||||
* pulses on the bus causing a false start condition to be detected,
|
||||
* then try to recover by re-initializing the controller and check
|
||||
* again if the bus is still busy.
|
||||
*/
|
||||
dev_warn(i2c->adap.dev.parent, "I2C bus busy timeout, reinitializing\n");
|
||||
ret = xiic_reinit(i2c);
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = xiic_wait_not_busy(i2c);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
i2c->tx_msg = msgs;
|
||||
i2c->rx_msg = NULL;
|
||||
i2c->nmsgs = num;
|
||||
|
||||
@@ -151,7 +151,7 @@ config OF_IOMMU
|
||||
# IOMMU-agnostic DMA-mapping layer
|
||||
config IOMMU_DMA
|
||||
def_bool ARM64 || X86 || S390
|
||||
select DMA_OPS
|
||||
select DMA_OPS_HELPERS
|
||||
select IOMMU_API
|
||||
select IOMMU_IOVA
|
||||
select IRQ_MSI_IOMMU
|
||||
|
||||
+36
-68
@@ -17,6 +17,7 @@
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/huge_mm.h>
|
||||
#include <linux/iommu.h>
|
||||
#include <linux/iommu-dma.h>
|
||||
#include <linux/iova.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/list_sort.h>
|
||||
@@ -1041,9 +1042,8 @@ out_unmap:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct sg_table *iommu_dma_alloc_noncontiguous(struct device *dev,
|
||||
size_t size, enum dma_data_direction dir, gfp_t gfp,
|
||||
unsigned long attrs)
|
||||
struct sg_table *iommu_dma_alloc_noncontiguous(struct device *dev, size_t size,
|
||||
enum dma_data_direction dir, gfp_t gfp, unsigned long attrs)
|
||||
{
|
||||
struct dma_sgt_handle *sh;
|
||||
|
||||
@@ -1059,7 +1059,7 @@ static struct sg_table *iommu_dma_alloc_noncontiguous(struct device *dev,
|
||||
return &sh->sgt;
|
||||
}
|
||||
|
||||
static void iommu_dma_free_noncontiguous(struct device *dev, size_t size,
|
||||
void iommu_dma_free_noncontiguous(struct device *dev, size_t size,
|
||||
struct sg_table *sgt, enum dma_data_direction dir)
|
||||
{
|
||||
struct dma_sgt_handle *sh = sgt_handle(sgt);
|
||||
@@ -1070,8 +1070,8 @@ static void iommu_dma_free_noncontiguous(struct device *dev, size_t size,
|
||||
kfree(sh);
|
||||
}
|
||||
|
||||
static void iommu_dma_sync_single_for_cpu(struct device *dev,
|
||||
dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
|
||||
void iommu_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
|
||||
size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
phys_addr_t phys;
|
||||
|
||||
@@ -1085,8 +1085,8 @@ static void iommu_dma_sync_single_for_cpu(struct device *dev,
|
||||
swiotlb_sync_single_for_cpu(dev, phys, size, dir);
|
||||
}
|
||||
|
||||
static void iommu_dma_sync_single_for_device(struct device *dev,
|
||||
dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
|
||||
void iommu_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
|
||||
size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
phys_addr_t phys;
|
||||
|
||||
@@ -1100,9 +1100,8 @@ static void iommu_dma_sync_single_for_device(struct device *dev,
|
||||
arch_sync_dma_for_device(phys, size, dir);
|
||||
}
|
||||
|
||||
static void iommu_dma_sync_sg_for_cpu(struct device *dev,
|
||||
struct scatterlist *sgl, int nelems,
|
||||
enum dma_data_direction dir)
|
||||
void iommu_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sgl,
|
||||
int nelems, enum dma_data_direction dir)
|
||||
{
|
||||
struct scatterlist *sg;
|
||||
int i;
|
||||
@@ -1116,9 +1115,8 @@ static void iommu_dma_sync_sg_for_cpu(struct device *dev,
|
||||
arch_sync_dma_for_cpu(sg_phys(sg), sg->length, dir);
|
||||
}
|
||||
|
||||
static void iommu_dma_sync_sg_for_device(struct device *dev,
|
||||
struct scatterlist *sgl, int nelems,
|
||||
enum dma_data_direction dir)
|
||||
void iommu_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sgl,
|
||||
int nelems, enum dma_data_direction dir)
|
||||
{
|
||||
struct scatterlist *sg;
|
||||
int i;
|
||||
@@ -1133,9 +1131,9 @@ static void iommu_dma_sync_sg_for_device(struct device *dev,
|
||||
arch_sync_dma_for_device(sg_phys(sg), sg->length, dir);
|
||||
}
|
||||
|
||||
static dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
|
||||
unsigned long offset, size_t size, enum dma_data_direction dir,
|
||||
unsigned long attrs)
|
||||
dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
|
||||
unsigned long offset, size_t size, enum dma_data_direction dir,
|
||||
unsigned long attrs)
|
||||
{
|
||||
phys_addr_t phys = page_to_phys(page) + offset;
|
||||
bool coherent = dev_is_dma_coherent(dev);
|
||||
@@ -1193,7 +1191,7 @@ static dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
|
||||
return iova;
|
||||
}
|
||||
|
||||
static void iommu_dma_unmap_page(struct device *dev, dma_addr_t dma_handle,
|
||||
void iommu_dma_unmap_page(struct device *dev, dma_addr_t dma_handle,
|
||||
size_t size, enum dma_data_direction dir, unsigned long attrs)
|
||||
{
|
||||
struct iommu_domain *domain = iommu_get_dma_domain(dev);
|
||||
@@ -1346,8 +1344,8 @@ out_unmap:
|
||||
* impedance-matching, to be able to hand off a suitably-aligned list,
|
||||
* but still preserve the original offsets and sizes for the caller.
|
||||
*/
|
||||
static int iommu_dma_map_sg(struct device *dev, struct scatterlist *sg,
|
||||
int nents, enum dma_data_direction dir, unsigned long attrs)
|
||||
int iommu_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
|
||||
enum dma_data_direction dir, unsigned long attrs)
|
||||
{
|
||||
struct iommu_domain *domain = iommu_get_dma_domain(dev);
|
||||
struct iommu_dma_cookie *cookie = domain->iova_cookie;
|
||||
@@ -1466,8 +1464,8 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
|
||||
int nents, enum dma_data_direction dir, unsigned long attrs)
|
||||
void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
|
||||
enum dma_data_direction dir, unsigned long attrs)
|
||||
{
|
||||
dma_addr_t end = 0, start;
|
||||
struct scatterlist *tmp;
|
||||
@@ -1516,7 +1514,7 @@ static void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
|
||||
__iommu_dma_unmap(dev, start, end - start);
|
||||
}
|
||||
|
||||
static dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
|
||||
dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
|
||||
size_t size, enum dma_data_direction dir, unsigned long attrs)
|
||||
{
|
||||
return __iommu_dma_map(dev, phys, size,
|
||||
@@ -1524,7 +1522,7 @@ static dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
|
||||
dma_get_mask(dev));
|
||||
}
|
||||
|
||||
static void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
|
||||
void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
|
||||
size_t size, enum dma_data_direction dir, unsigned long attrs)
|
||||
{
|
||||
__iommu_dma_unmap(dev, handle, size);
|
||||
@@ -1561,7 +1559,7 @@ static void __iommu_dma_free(struct device *dev, size_t size, void *cpu_addr)
|
||||
dma_free_contiguous(dev, page, alloc_size);
|
||||
}
|
||||
|
||||
static void iommu_dma_free(struct device *dev, size_t size, void *cpu_addr,
|
||||
void iommu_dma_free(struct device *dev, size_t size, void *cpu_addr,
|
||||
dma_addr_t handle, unsigned long attrs)
|
||||
{
|
||||
__iommu_dma_unmap(dev, handle, size);
|
||||
@@ -1605,8 +1603,8 @@ out_free_pages:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *iommu_dma_alloc(struct device *dev, size_t size,
|
||||
dma_addr_t *handle, gfp_t gfp, unsigned long attrs)
|
||||
void *iommu_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
|
||||
gfp_t gfp, unsigned long attrs)
|
||||
{
|
||||
bool coherent = dev_is_dma_coherent(dev);
|
||||
int ioprot = dma_info_to_prot(DMA_BIDIRECTIONAL, coherent, attrs);
|
||||
@@ -1639,7 +1637,7 @@ static void *iommu_dma_alloc(struct device *dev, size_t size,
|
||||
return cpu_addr;
|
||||
}
|
||||
|
||||
static int iommu_dma_mmap(struct device *dev, struct vm_area_struct *vma,
|
||||
int iommu_dma_mmap(struct device *dev, struct vm_area_struct *vma,
|
||||
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
||||
unsigned long attrs)
|
||||
{
|
||||
@@ -1670,7 +1668,7 @@ static int iommu_dma_mmap(struct device *dev, struct vm_area_struct *vma,
|
||||
vma->vm_page_prot);
|
||||
}
|
||||
|
||||
static int iommu_dma_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
int iommu_dma_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
||||
unsigned long attrs)
|
||||
{
|
||||
@@ -1697,19 +1695,19 @@ static int iommu_dma_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned long iommu_dma_get_merge_boundary(struct device *dev)
|
||||
unsigned long iommu_dma_get_merge_boundary(struct device *dev)
|
||||
{
|
||||
struct iommu_domain *domain = iommu_get_dma_domain(dev);
|
||||
|
||||
return (1UL << __ffs(domain->pgsize_bitmap)) - 1;
|
||||
}
|
||||
|
||||
static size_t iommu_dma_opt_mapping_size(void)
|
||||
size_t iommu_dma_opt_mapping_size(void)
|
||||
{
|
||||
return iova_rcache_range();
|
||||
}
|
||||
|
||||
static size_t iommu_dma_max_mapping_size(struct device *dev)
|
||||
size_t iommu_dma_max_mapping_size(struct device *dev)
|
||||
{
|
||||
if (dev_is_untrusted(dev))
|
||||
return swiotlb_max_mapping_size(dev);
|
||||
@@ -1717,32 +1715,6 @@ static size_t iommu_dma_max_mapping_size(struct device *dev)
|
||||
return SIZE_MAX;
|
||||
}
|
||||
|
||||
static const struct dma_map_ops iommu_dma_ops = {
|
||||
.flags = DMA_F_PCI_P2PDMA_SUPPORTED |
|
||||
DMA_F_CAN_SKIP_SYNC,
|
||||
.alloc = iommu_dma_alloc,
|
||||
.free = iommu_dma_free,
|
||||
.alloc_pages_op = dma_common_alloc_pages,
|
||||
.free_pages = dma_common_free_pages,
|
||||
.alloc_noncontiguous = iommu_dma_alloc_noncontiguous,
|
||||
.free_noncontiguous = iommu_dma_free_noncontiguous,
|
||||
.mmap = iommu_dma_mmap,
|
||||
.get_sgtable = iommu_dma_get_sgtable,
|
||||
.map_page = iommu_dma_map_page,
|
||||
.unmap_page = iommu_dma_unmap_page,
|
||||
.map_sg = iommu_dma_map_sg,
|
||||
.unmap_sg = iommu_dma_unmap_sg,
|
||||
.sync_single_for_cpu = iommu_dma_sync_single_for_cpu,
|
||||
.sync_single_for_device = iommu_dma_sync_single_for_device,
|
||||
.sync_sg_for_cpu = iommu_dma_sync_sg_for_cpu,
|
||||
.sync_sg_for_device = iommu_dma_sync_sg_for_device,
|
||||
.map_resource = iommu_dma_map_resource,
|
||||
.unmap_resource = iommu_dma_unmap_resource,
|
||||
.get_merge_boundary = iommu_dma_get_merge_boundary,
|
||||
.opt_mapping_size = iommu_dma_opt_mapping_size,
|
||||
.max_mapping_size = iommu_dma_max_mapping_size,
|
||||
};
|
||||
|
||||
void iommu_setup_dma_ops(struct device *dev)
|
||||
{
|
||||
struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
|
||||
@@ -1750,19 +1722,15 @@ void iommu_setup_dma_ops(struct device *dev)
|
||||
if (dev_is_pci(dev))
|
||||
dev->iommu->pci_32bit_workaround = !iommu_dma_forcedac;
|
||||
|
||||
if (iommu_is_dma_domain(domain)) {
|
||||
if (iommu_dma_init_domain(domain, dev))
|
||||
goto out_err;
|
||||
dev->dma_ops = &iommu_dma_ops;
|
||||
} else if (dev->dma_ops == &iommu_dma_ops) {
|
||||
/* Clean up if we've switched *from* a DMA domain */
|
||||
dev->dma_ops = NULL;
|
||||
}
|
||||
dev->dma_iommu = iommu_is_dma_domain(domain);
|
||||
if (dev->dma_iommu && iommu_dma_init_domain(domain, dev))
|
||||
goto out_err;
|
||||
|
||||
return;
|
||||
out_err:
|
||||
pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
|
||||
dev_name(dev));
|
||||
pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
|
||||
dev_name(dev));
|
||||
dev->dma_iommu = false;
|
||||
}
|
||||
|
||||
static struct iommu_dma_msi_page *iommu_dma_get_msi_page(struct device *dev,
|
||||
|
||||
@@ -12,7 +12,6 @@ config DMAR_DEBUG
|
||||
config INTEL_IOMMU
|
||||
bool "Support for Intel IOMMU using DMA Remapping Devices"
|
||||
depends on PCI_MSI && ACPI && X86
|
||||
select DMA_OPS
|
||||
select IOMMU_API
|
||||
select IOMMU_IOVA
|
||||
select IOMMUFD_DRIVER if IOMMUFD
|
||||
|
||||
@@ -387,7 +387,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
|
||||
dma_set_max_seg_size(&dev->ofdev.dev, 65536);
|
||||
dma_set_seg_boundary(&dev->ofdev.dev, 0xffffffff);
|
||||
|
||||
#if defined(CONFIG_PCI) && defined(CONFIG_DMA_OPS)
|
||||
#if defined(CONFIG_PCI) && defined(CONFIG_ARCH_HAS_DMA_OPS)
|
||||
/* Set the DMA ops to the ones from the PCI device, this could be
|
||||
* fishy if we didn't know that on PowerMac it's always direct ops
|
||||
* or iommu ops that will work fine
|
||||
@@ -396,7 +396,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
|
||||
*/
|
||||
dev->ofdev.dev.archdata = chip->lbus.pdev->dev.archdata;
|
||||
dev->ofdev.dev.dma_ops = chip->lbus.pdev->dev.dma_ops;
|
||||
#endif /* CONFIG_PCI && CONFIG_DMA_OPS */
|
||||
#endif /* CONFIG_PCI && CONFIG_ARCH_HAS_DMA_OPS */
|
||||
|
||||
#ifdef DEBUG
|
||||
printk("preparing mdev @%p, ofdev @%p, dev @%p, kobj @%p\n",
|
||||
|
||||
@@ -854,8 +854,7 @@ int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size)
|
||||
return -ENODEV;
|
||||
}
|
||||
if (dma_get_max_seg_size(dev) < size)
|
||||
return dma_set_max_seg_size(dev, size);
|
||||
|
||||
dma_set_max_seg_size(dev, size);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);
|
||||
|
||||
@@ -4,8 +4,13 @@ config VIDEO_INTEL_IPU6
|
||||
depends on VIDEO_DEV
|
||||
depends on X86 && X86_64 && HAS_DMA
|
||||
depends on IPU_BRIDGE || !IPU_BRIDGE
|
||||
#
|
||||
# This driver incorrectly tries to override the dma_ops. It should
|
||||
# never have done that, but for now keep it working on architectures
|
||||
# that use dma ops
|
||||
#
|
||||
depends on ARCH_HAS_DMA_OPS
|
||||
select AUXILIARY_BUS
|
||||
select DMA_OPS
|
||||
select IOMMU_IOVA
|
||||
select VIDEO_V4L2_SUBDEV_API
|
||||
select MEDIA_CONTROLLER
|
||||
|
||||
@@ -576,9 +576,7 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to set DMA mask\n");
|
||||
|
||||
ret = dma_set_max_seg_size(dev, UINT_MAX);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to set max_seg_size\n");
|
||||
dma_set_max_seg_size(dev, UINT_MAX);
|
||||
|
||||
ret = ipu6_pci_config_setup(pdev, isp->hw_ver);
|
||||
if (ret)
|
||||
|
||||
@@ -1018,14 +1018,6 @@ typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL
|
||||
|
||||
#define MPI_IOCPAGE2_FLAG_VOLUME_INACTIVE (0x08)
|
||||
|
||||
/*
|
||||
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
|
||||
* one and check Header.PageLength at runtime.
|
||||
*/
|
||||
#ifndef MPI_IOC_PAGE_2_RAID_VOLUME_MAX
|
||||
#define MPI_IOC_PAGE_2_RAID_VOLUME_MAX (1)
|
||||
#endif
|
||||
|
||||
typedef struct _CONFIG_PAGE_IOC_2
|
||||
{
|
||||
CONFIG_PAGE_HEADER Header; /* 00h */
|
||||
@@ -1034,7 +1026,7 @@ typedef struct _CONFIG_PAGE_IOC_2
|
||||
U8 MaxVolumes; /* 09h */
|
||||
U8 NumActivePhysDisks; /* 0Ah */
|
||||
U8 MaxPhysDisks; /* 0Bh */
|
||||
CONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[MPI_IOC_PAGE_2_RAID_VOLUME_MAX];/* 0Ch */
|
||||
CONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[] __counted_by(NumActiveVolumes); /* 0Ch */
|
||||
} CONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2,
|
||||
IOCPage2_t, MPI_POINTER pIOCPage2_t;
|
||||
|
||||
@@ -1064,21 +1056,13 @@ typedef struct _IOC_3_PHYS_DISK
|
||||
} IOC_3_PHYS_DISK, MPI_POINTER PTR_IOC_3_PHYS_DISK,
|
||||
Ioc3PhysDisk_t, MPI_POINTER pIoc3PhysDisk_t;
|
||||
|
||||
/*
|
||||
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
|
||||
* one and check Header.PageLength at runtime.
|
||||
*/
|
||||
#ifndef MPI_IOC_PAGE_3_PHYSDISK_MAX
|
||||
#define MPI_IOC_PAGE_3_PHYSDISK_MAX (1)
|
||||
#endif
|
||||
|
||||
typedef struct _CONFIG_PAGE_IOC_3
|
||||
{
|
||||
CONFIG_PAGE_HEADER Header; /* 00h */
|
||||
U8 NumPhysDisks; /* 04h */
|
||||
U8 Reserved1; /* 05h */
|
||||
U16 Reserved2; /* 06h */
|
||||
IOC_3_PHYS_DISK PhysDisk[MPI_IOC_PAGE_3_PHYSDISK_MAX]; /* 08h */
|
||||
IOC_3_PHYS_DISK PhysDisk[] __counted_by(NumPhysDisks); /* 08h */
|
||||
} CONFIG_PAGE_IOC_3, MPI_POINTER PTR_CONFIG_PAGE_IOC_3,
|
||||
IOCPage3_t, MPI_POINTER pIOCPage3_t;
|
||||
|
||||
@@ -1093,21 +1077,13 @@ typedef struct _IOC_4_SEP
|
||||
} IOC_4_SEP, MPI_POINTER PTR_IOC_4_SEP,
|
||||
Ioc4Sep_t, MPI_POINTER pIoc4Sep_t;
|
||||
|
||||
/*
|
||||
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
|
||||
* one and check Header.PageLength at runtime.
|
||||
*/
|
||||
#ifndef MPI_IOC_PAGE_4_SEP_MAX
|
||||
#define MPI_IOC_PAGE_4_SEP_MAX (1)
|
||||
#endif
|
||||
|
||||
typedef struct _CONFIG_PAGE_IOC_4
|
||||
{
|
||||
CONFIG_PAGE_HEADER Header; /* 00h */
|
||||
U8 ActiveSEP; /* 04h */
|
||||
U8 MaxSEP; /* 05h */
|
||||
U16 Reserved1; /* 06h */
|
||||
IOC_4_SEP SEP[MPI_IOC_PAGE_4_SEP_MAX]; /* 08h */
|
||||
IOC_4_SEP SEP[] __counted_by(ActiveSEP); /* 08h */
|
||||
} CONFIG_PAGE_IOC_4, MPI_POINTER PTR_CONFIG_PAGE_IOC_4,
|
||||
IOCPage4_t, MPI_POINTER pIOCPage4_t;
|
||||
|
||||
@@ -2295,14 +2271,6 @@ typedef struct _RAID_VOL0_SETTINGS
|
||||
#define MPI_RAID_HOT_SPARE_POOL_6 (0x40)
|
||||
#define MPI_RAID_HOT_SPARE_POOL_7 (0x80)
|
||||
|
||||
/*
|
||||
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
|
||||
* one and check Header.PageLength at runtime.
|
||||
*/
|
||||
#ifndef MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX
|
||||
#define MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX (1)
|
||||
#endif
|
||||
|
||||
typedef struct _CONFIG_PAGE_RAID_VOL_0
|
||||
{
|
||||
CONFIG_PAGE_HEADER Header; /* 00h */
|
||||
@@ -2321,7 +2289,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
|
||||
U8 DataScrubRate; /* 25h */
|
||||
U8 ResyncRate; /* 26h */
|
||||
U8 InactiveStatus; /* 27h */
|
||||
RAID_VOL0_PHYS_DISK PhysDisk[MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX];/* 28h */
|
||||
RAID_VOL0_PHYS_DISK PhysDisk[] __counted_by(NumPhysDisks); /* 28h */
|
||||
} CONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0,
|
||||
RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t;
|
||||
|
||||
@@ -2455,14 +2423,6 @@ typedef struct _RAID_PHYS_DISK1_PATH
|
||||
#define MPI_RAID_PHYSDISK1_FLAG_INVALID (0x0001)
|
||||
|
||||
|
||||
/*
|
||||
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
|
||||
* one and check Header.PageLength or NumPhysDiskPaths at runtime.
|
||||
*/
|
||||
#ifndef MPI_RAID_PHYS_DISK1_PATH_MAX
|
||||
#define MPI_RAID_PHYS_DISK1_PATH_MAX (1)
|
||||
#endif
|
||||
|
||||
typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1
|
||||
{
|
||||
CONFIG_PAGE_HEADER Header; /* 00h */
|
||||
@@ -2470,7 +2430,7 @@ typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1
|
||||
U8 PhysDiskNum; /* 05h */
|
||||
U16 Reserved2; /* 06h */
|
||||
U32 Reserved1; /* 08h */
|
||||
RAID_PHYS_DISK1_PATH Path[MPI_RAID_PHYS_DISK1_PATH_MAX];/* 0Ch */
|
||||
RAID_PHYS_DISK1_PATH Path[] __counted_by(NumPhysDiskPaths);/* 0Ch */
|
||||
} CONFIG_PAGE_RAID_PHYS_DISK_1, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_1,
|
||||
RaidPhysDiskPage1_t, MPI_POINTER pRaidPhysDiskPage1_t;
|
||||
|
||||
@@ -2555,14 +2515,6 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA
|
||||
} MPI_SAS_IO_UNIT0_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT0_PHY_DATA,
|
||||
SasIOUnit0PhyData, MPI_POINTER pSasIOUnit0PhyData;
|
||||
|
||||
/*
|
||||
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
|
||||
* one and check Header.PageLength at runtime.
|
||||
*/
|
||||
#ifndef MPI_SAS_IOUNIT0_PHY_MAX
|
||||
#define MPI_SAS_IOUNIT0_PHY_MAX (1)
|
||||
#endif
|
||||
|
||||
typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
|
||||
{
|
||||
CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
|
||||
@@ -2571,7 +2523,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
|
||||
U8 NumPhys; /* 0Ch */
|
||||
U8 Reserved2; /* 0Dh */
|
||||
U16 Reserved3; /* 0Eh */
|
||||
MPI_SAS_IO_UNIT0_PHY_DATA PhyData[MPI_SAS_IOUNIT0_PHY_MAX]; /* 10h */
|
||||
MPI_SAS_IO_UNIT0_PHY_DATA PhyData[] __counted_by(NumPhys); /* 10h */
|
||||
} CONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0,
|
||||
SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t;
|
||||
|
||||
|
||||
@@ -1856,10 +1856,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
/* Initialize workqueue */
|
||||
INIT_DELAYED_WORK(&ioc->fault_reset_work, mpt_fault_reset_work);
|
||||
|
||||
snprintf(ioc->reset_work_q_name, MPT_KOBJ_NAME_LEN,
|
||||
"mpt_poll_%d", ioc->id);
|
||||
ioc->reset_work_q = alloc_workqueue(ioc->reset_work_q_name,
|
||||
WQ_MEM_RECLAIM, 0);
|
||||
ioc->reset_work_q =
|
||||
alloc_workqueue("mpt_poll_%d", WQ_MEM_RECLAIM, 0, ioc->id);
|
||||
if (!ioc->reset_work_q) {
|
||||
printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n",
|
||||
ioc->name);
|
||||
@@ -1986,9 +1984,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
INIT_LIST_HEAD(&ioc->fw_event_list);
|
||||
spin_lock_init(&ioc->fw_event_lock);
|
||||
snprintf(ioc->fw_event_q_name, MPT_KOBJ_NAME_LEN, "mpt/%d", ioc->id);
|
||||
ioc->fw_event_q = alloc_workqueue(ioc->fw_event_q_name,
|
||||
WQ_MEM_RECLAIM, 0);
|
||||
ioc->fw_event_q = alloc_workqueue("mpt/%d", WQ_MEM_RECLAIM, 0, ioc->id);
|
||||
if (!ioc->fw_event_q) {
|
||||
printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n",
|
||||
ioc->name);
|
||||
|
||||
@@ -729,7 +729,6 @@ typedef struct _MPT_ADAPTER
|
||||
struct list_head fw_event_list;
|
||||
spinlock_t fw_event_lock;
|
||||
u8 fw_events_off; /* if '1', then ignore events */
|
||||
char fw_event_q_name[MPT_KOBJ_NAME_LEN];
|
||||
|
||||
struct mutex sas_discovery_mutex;
|
||||
u8 sas_discovery_runtime;
|
||||
@@ -764,7 +763,6 @@ typedef struct _MPT_ADAPTER
|
||||
u8 fc_link_speed[2];
|
||||
spinlock_t fc_rescan_work_lock;
|
||||
struct work_struct fc_rescan_work;
|
||||
char fc_rescan_work_q_name[MPT_KOBJ_NAME_LEN];
|
||||
struct workqueue_struct *fc_rescan_work_q;
|
||||
|
||||
/* driver forced bus resets count */
|
||||
@@ -778,7 +776,6 @@ typedef struct _MPT_ADAPTER
|
||||
spinlock_t scsi_lookup_lock;
|
||||
u64 dma_mask;
|
||||
u32 broadcast_aen_busy;
|
||||
char reset_work_q_name[MPT_KOBJ_NAME_LEN];
|
||||
struct workqueue_struct *reset_work_q;
|
||||
struct delayed_work fault_reset_work;
|
||||
|
||||
|
||||
@@ -1349,11 +1349,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
/* initialize workqueue */
|
||||
|
||||
snprintf(ioc->fc_rescan_work_q_name, sizeof(ioc->fc_rescan_work_q_name),
|
||||
"mptfc_wq_%d", sh->host_no);
|
||||
ioc->fc_rescan_work_q =
|
||||
alloc_ordered_workqueue(ioc->fc_rescan_work_q_name,
|
||||
WQ_MEM_RECLAIM);
|
||||
ioc->fc_rescan_work_q = alloc_ordered_workqueue(
|
||||
"mptfc_wq_%d", WQ_MEM_RECLAIM, sh->host_no);
|
||||
if (!ioc->fc_rescan_work_q) {
|
||||
error = -ENOMEM;
|
||||
goto out_mptfc_host;
|
||||
|
||||
@@ -213,7 +213,8 @@ static int sdmmc_idma_setup(struct mmci_host *host)
|
||||
host->mmc->max_seg_size = host->mmc->max_req_size;
|
||||
}
|
||||
|
||||
return dma_set_max_seg_size(dev, host->mmc->max_seg_size);
|
||||
dma_set_max_seg_size(dev, host->mmc->max_seg_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sdmmc_idma_start(struct mmci_host *host, unsigned int *datactrl)
|
||||
|
||||
@@ -1496,11 +1496,7 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
if (err)
|
||||
goto release_region;
|
||||
|
||||
err = dma_set_max_seg_size(&pdev->dev, UINT_MAX);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Failed to set dma device segment size\n");
|
||||
goto release_region;
|
||||
}
|
||||
dma_set_max_seg_size(&pdev->dev, UINT_MAX);
|
||||
|
||||
err = -ENOMEM;
|
||||
gc = vzalloc(sizeof(*gc));
|
||||
|
||||
+116
-117
@@ -157,7 +157,6 @@ static inline void initialize_SCp(struct scsi_cmnd *cmd)
|
||||
}
|
||||
|
||||
ncmd->status = 0;
|
||||
ncmd->message = 0;
|
||||
}
|
||||
|
||||
static inline void advance_sg_buffer(struct NCR5380_cmd *ncmd)
|
||||
@@ -199,7 +198,6 @@ static inline void set_resid_from_SCp(struct scsi_cmnd *cmd)
|
||||
* Polls the chip in a reasonably efficient manner waiting for an
|
||||
* event to occur. After a short quick poll we begin to yield the CPU
|
||||
* (if possible). In irq contexts the time-out is arbitrarily limited.
|
||||
* Callers may hold locks as long as they are held in irq mode.
|
||||
*
|
||||
* Returns 0 if either or both event(s) occurred otherwise -ETIMEDOUT.
|
||||
*/
|
||||
@@ -1228,24 +1226,15 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function : int NCR5380_transfer_pio (struct Scsi_Host *instance,
|
||||
* unsigned char *phase, int *count, unsigned char **data)
|
||||
/**
|
||||
* NCR5380_transfer_pio() - transfers data in given phase using polled I/O
|
||||
* @instance: instance of driver
|
||||
* @phase: pointer to what phase is expected
|
||||
* @count: pointer to number of bytes to transfer
|
||||
* @data: pointer to data pointer
|
||||
* @can_sleep: 1 or 0 when sleeping is permitted or not, respectively
|
||||
*
|
||||
* Purpose : transfers data in given phase using polled I/O
|
||||
*
|
||||
* Inputs : instance - instance of driver, *phase - pointer to
|
||||
* what phase is expected, *count - pointer to number of
|
||||
* bytes to transfer, **data - pointer to data pointer,
|
||||
* can_sleep - 1 or 0 when sleeping is permitted or not, respectively.
|
||||
*
|
||||
* Returns : -1 when different phase is entered without transferring
|
||||
* maximum number of bytes, 0 if all bytes are transferred or exit
|
||||
* is in same phase.
|
||||
*
|
||||
* Also, *phase, *count, *data are modified in place.
|
||||
*
|
||||
* XXX Note : handling for bus free may be useful.
|
||||
* Returns: void. *phase, *count, *data are modified in place.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -1254,9 +1243,9 @@ out:
|
||||
* counts, we will always do a pseudo DMA or DMA transfer.
|
||||
*/
|
||||
|
||||
static int NCR5380_transfer_pio(struct Scsi_Host *instance,
|
||||
unsigned char *phase, int *count,
|
||||
unsigned char **data, unsigned int can_sleep)
|
||||
static void NCR5380_transfer_pio(struct Scsi_Host *instance,
|
||||
unsigned char *phase, int *count,
|
||||
unsigned char **data, unsigned int can_sleep)
|
||||
{
|
||||
struct NCR5380_hostdata *hostdata = shost_priv(instance);
|
||||
unsigned char p = *phase, tmp;
|
||||
@@ -1277,8 +1266,8 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
|
||||
* valid
|
||||
*/
|
||||
|
||||
if (NCR5380_poll_politely(hostdata, STATUS_REG, SR_REQ, SR_REQ,
|
||||
HZ * can_sleep) < 0)
|
||||
if (NCR5380_poll_politely(hostdata, STATUS_REG, SR_REQ | SR_BSY,
|
||||
SR_REQ | SR_BSY, HZ * can_sleep) < 0)
|
||||
break;
|
||||
|
||||
dsprintk(NDEBUG_HANDSHAKE, instance, "REQ asserted\n");
|
||||
@@ -1329,17 +1318,19 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
|
||||
|
||||
dsprintk(NDEBUG_HANDSHAKE, instance, "REQ negated, handshake complete\n");
|
||||
|
||||
/*
|
||||
* We have several special cases to consider during REQ/ACK handshaking :
|
||||
* 1. We were in MSGOUT phase, and we are on the last byte of the
|
||||
* message. ATN must be dropped as ACK is dropped.
|
||||
*
|
||||
* 2. We are in a MSGIN phase, and we are on the last byte of the
|
||||
* message. We must exit with ACK asserted, so that the calling
|
||||
* code may raise ATN before dropping ACK to reject the message.
|
||||
*
|
||||
* 3. ACK and ATN are clear and the target may proceed as normal.
|
||||
*/
|
||||
/*
|
||||
* We have several special cases to consider during REQ/ACK
|
||||
* handshaking:
|
||||
*
|
||||
* 1. We were in MSGOUT phase, and we are on the last byte of
|
||||
* the message. ATN must be dropped as ACK is dropped.
|
||||
*
|
||||
* 2. We are in MSGIN phase, and we are on the last byte of the
|
||||
* message. We must exit with ACK asserted, so that the calling
|
||||
* code may raise ATN before dropping ACK to reject the message.
|
||||
*
|
||||
* 3. ACK and ATN are clear & the target may proceed as normal.
|
||||
*/
|
||||
if (!(p == PHASE_MSGIN && c == 1)) {
|
||||
if (p == PHASE_MSGOUT && c > 1)
|
||||
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
|
||||
@@ -1361,11 +1352,6 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
|
||||
*phase = tmp & PHASE_MASK;
|
||||
else
|
||||
*phase = PHASE_UNKNOWN;
|
||||
|
||||
if (!c || (*phase == p))
|
||||
return 0;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1485,6 +1471,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
|
||||
unsigned char **data)
|
||||
{
|
||||
struct NCR5380_hostdata *hostdata = shost_priv(instance);
|
||||
struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(hostdata->connected);
|
||||
int c = *count;
|
||||
unsigned char p = *phase;
|
||||
unsigned char *d = *data;
|
||||
@@ -1496,7 +1483,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
|
||||
return -1;
|
||||
}
|
||||
|
||||
NCR5380_to_ncmd(hostdata->connected)->phase = p;
|
||||
ncmd->phase = p;
|
||||
|
||||
if (p & SR_IO) {
|
||||
if (hostdata->read_overruns)
|
||||
@@ -1574,79 +1561,80 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
|
||||
/* The result is zero iff pseudo DMA send/receive was completed. */
|
||||
hostdata->dma_len = c;
|
||||
|
||||
/*
|
||||
* A note regarding the DMA errata workarounds for early NMOS silicon.
|
||||
*
|
||||
* For DMA sends, we want to wait until the last byte has been
|
||||
* transferred out over the bus before we turn off DMA mode. Alas, there
|
||||
* seems to be no terribly good way of doing this on a 5380 under all
|
||||
* conditions. For non-scatter-gather operations, we can wait until REQ
|
||||
* and ACK both go false, or until a phase mismatch occurs. Gather-sends
|
||||
* are nastier, since the device will be expecting more data than we
|
||||
* are prepared to send it, and REQ will remain asserted. On a 53C8[01] we
|
||||
* could test Last Byte Sent to assure transfer (I imagine this is precisely
|
||||
* why this signal was added to the newer chips) but on the older 538[01]
|
||||
* this signal does not exist. The workaround for this lack is a watchdog;
|
||||
* we bail out of the wait-loop after a modest amount of wait-time if
|
||||
* the usual exit conditions are not met. Not a terribly clean or
|
||||
* correct solution :-%
|
||||
*
|
||||
* DMA receive is equally tricky due to a nasty characteristic of the NCR5380.
|
||||
* If the chip is in DMA receive mode, it will respond to a target's
|
||||
* REQ by latching the SCSI data into the INPUT DATA register and asserting
|
||||
* ACK, even if it has _already_ been notified by the DMA controller that
|
||||
* the current DMA transfer has completed! If the NCR5380 is then taken
|
||||
* out of DMA mode, this already-acknowledged byte is lost. This is
|
||||
* not a problem for "one DMA transfer per READ command", because
|
||||
* the situation will never arise... either all of the data is DMA'ed
|
||||
* properly, or the target switches to MESSAGE IN phase to signal a
|
||||
* disconnection (either operation bringing the DMA to a clean halt).
|
||||
* However, in order to handle scatter-receive, we must work around the
|
||||
* problem. The chosen fix is to DMA fewer bytes, then check for the
|
||||
* condition before taking the NCR5380 out of DMA mode. One or two extra
|
||||
* bytes are transferred via PIO as necessary to fill out the original
|
||||
* request.
|
||||
*/
|
||||
/*
|
||||
* A note regarding the DMA errata workarounds for early NMOS silicon.
|
||||
*
|
||||
* For DMA sends, we want to wait until the last byte has been
|
||||
* transferred out over the bus before we turn off DMA mode. Alas, there
|
||||
* seems to be no terribly good way of doing this on a 5380 under all
|
||||
* conditions. For non-scatter-gather operations, we can wait until REQ
|
||||
* and ACK both go false, or until a phase mismatch occurs. Gather-sends
|
||||
* are nastier, since the device will be expecting more data than we
|
||||
* are prepared to send it, and REQ will remain asserted. On a 53C8[01]
|
||||
* we could test Last Byte Sent to assure transfer (I imagine this is
|
||||
* precisely why this signal was added to the newer chips) but on the
|
||||
* older 538[01] this signal does not exist. The workaround for this
|
||||
* lack is a watchdog; we bail out of the wait-loop after a modest
|
||||
* amount of wait-time if the usual exit conditions are not met.
|
||||
* Not a terribly clean or correct solution :-%
|
||||
*
|
||||
* DMA receive is equally tricky due to a nasty characteristic of the
|
||||
* NCR5380. If the chip is in DMA receive mode, it will respond to a
|
||||
* target's REQ by latching the SCSI data into the INPUT DATA register
|
||||
* and asserting ACK, even if it has _already_ been notified by the
|
||||
* DMA controller that the current DMA transfer has completed! If the
|
||||
* NCR5380 is then taken out of DMA mode, this already-acknowledged
|
||||
* byte is lost.
|
||||
*
|
||||
* This is not a problem for "one DMA transfer per READ
|
||||
* command", because the situation will never arise... either all of
|
||||
* the data is DMA'ed properly, or the target switches to MESSAGE IN
|
||||
* phase to signal a disconnection (either operation bringing the DMA
|
||||
* to a clean halt). However, in order to handle scatter-receive, we
|
||||
* must work around the problem. The chosen fix is to DMA fewer bytes,
|
||||
* then check for the condition before taking the NCR5380 out of DMA
|
||||
* mode. One or two extra bytes are transferred via PIO as necessary
|
||||
* to fill out the original request.
|
||||
*/
|
||||
|
||||
if (hostdata->flags & FLAG_DMA_FIXUP) {
|
||||
if (p & SR_IO) {
|
||||
/*
|
||||
* The workaround was to transfer fewer bytes than we
|
||||
* intended to with the pseudo-DMA read function, wait for
|
||||
* the chip to latch the last byte, read it, and then disable
|
||||
* pseudo-DMA mode.
|
||||
*
|
||||
* After REQ is asserted, the NCR5380 asserts DRQ and ACK.
|
||||
* REQ is deasserted when ACK is asserted, and not reasserted
|
||||
* until ACK goes false. Since the NCR5380 won't lower ACK
|
||||
* until DACK is asserted, which won't happen unless we twiddle
|
||||
* the DMA port or we take the NCR5380 out of DMA mode, we
|
||||
* can guarantee that we won't handshake another extra
|
||||
* byte.
|
||||
*/
|
||||
|
||||
if (NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG,
|
||||
BASR_DRQ, BASR_DRQ, 0) < 0) {
|
||||
result = -1;
|
||||
shost_printk(KERN_ERR, instance, "PDMA read: DRQ timeout\n");
|
||||
}
|
||||
if (NCR5380_poll_politely(hostdata, STATUS_REG,
|
||||
SR_REQ, 0, 0) < 0) {
|
||||
result = -1;
|
||||
shost_printk(KERN_ERR, instance, "PDMA read: !REQ timeout\n");
|
||||
}
|
||||
d[*count - 1] = NCR5380_read(INPUT_DATA_REG);
|
||||
} else {
|
||||
/*
|
||||
* Wait for the last byte to be sent. If REQ is being asserted for
|
||||
* the byte we're interested, we'll ACK it and it will go false.
|
||||
*/
|
||||
if (NCR5380_poll_politely2(hostdata,
|
||||
BUS_AND_STATUS_REG, BASR_DRQ, BASR_DRQ,
|
||||
BUS_AND_STATUS_REG, BASR_PHASE_MATCH, 0, 0) < 0) {
|
||||
result = -1;
|
||||
shost_printk(KERN_ERR, instance, "PDMA write: DRQ and phase timeout\n");
|
||||
if ((hostdata->flags & FLAG_DMA_FIXUP) &&
|
||||
(NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)) {
|
||||
/*
|
||||
* The workaround was to transfer fewer bytes than we
|
||||
* intended to with the pseudo-DMA receive function, wait for
|
||||
* the chip to latch the last byte, read it, and then disable
|
||||
* DMA mode.
|
||||
*
|
||||
* After REQ is asserted, the NCR5380 asserts DRQ and ACK.
|
||||
* REQ is deasserted when ACK is asserted, and not reasserted
|
||||
* until ACK goes false. Since the NCR5380 won't lower ACK
|
||||
* until DACK is asserted, which won't happen unless we twiddle
|
||||
* the DMA port or we take the NCR5380 out of DMA mode, we
|
||||
* can guarantee that we won't handshake another extra
|
||||
* byte.
|
||||
*
|
||||
* If sending, wait for the last byte to be sent. If REQ is
|
||||
* being asserted for the byte we're interested, we'll ACK it
|
||||
* and it will go false.
|
||||
*/
|
||||
if (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG,
|
||||
BASR_DRQ, BASR_DRQ, 0)) {
|
||||
if ((p & SR_IO) &&
|
||||
(NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)) {
|
||||
if (!NCR5380_poll_politely(hostdata, STATUS_REG,
|
||||
SR_REQ, 0, 0)) {
|
||||
d[c] = NCR5380_read(INPUT_DATA_REG);
|
||||
--ncmd->this_residual;
|
||||
} else {
|
||||
result = -1;
|
||||
scmd_printk(KERN_ERR, hostdata->connected,
|
||||
"PDMA fixup: !REQ timeout\n");
|
||||
}
|
||||
}
|
||||
} else if (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH) {
|
||||
result = -1;
|
||||
scmd_printk(KERN_ERR, hostdata->connected,
|
||||
"PDMA fixup: DRQ timeout\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1666,9 +1654,6 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
|
||||
* Side effects : SCSI things happen, the disconnected queue will be
|
||||
* modified if a command disconnects, *instance->connected will
|
||||
* change.
|
||||
*
|
||||
* XXX Note : we need to watch for bus free or a reset condition here
|
||||
* to recover from an unexpected bus free condition.
|
||||
*/
|
||||
|
||||
static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
||||
@@ -1807,9 +1792,11 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
||||
return;
|
||||
case PHASE_MSGIN:
|
||||
len = 1;
|
||||
tmp = 0xff;
|
||||
data = &tmp;
|
||||
NCR5380_transfer_pio(instance, &phase, &len, &data, 0);
|
||||
ncmd->message = tmp;
|
||||
if (tmp == 0xff)
|
||||
break;
|
||||
|
||||
switch (tmp) {
|
||||
case ABORT:
|
||||
@@ -1996,6 +1983,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
||||
break;
|
||||
case PHASE_STATIN:
|
||||
len = 1;
|
||||
tmp = ncmd->status;
|
||||
data = &tmp;
|
||||
NCR5380_transfer_pio(instance, &phase, &len, &data, 0);
|
||||
ncmd->status = tmp;
|
||||
@@ -2005,9 +1993,20 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
||||
NCR5380_dprint(NDEBUG_ANY, instance);
|
||||
} /* switch(phase) */
|
||||
} else {
|
||||
int err;
|
||||
|
||||
spin_unlock_irq(&hostdata->lock);
|
||||
NCR5380_poll_politely(hostdata, STATUS_REG, SR_REQ, SR_REQ, HZ);
|
||||
err = NCR5380_poll_politely(hostdata, STATUS_REG,
|
||||
SR_REQ, SR_REQ, HZ);
|
||||
spin_lock_irq(&hostdata->lock);
|
||||
|
||||
if (err < 0 && hostdata->connected &&
|
||||
!(NCR5380_read(STATUS_REG) & SR_BSY)) {
|
||||
scmd_printk(KERN_ERR, hostdata->connected,
|
||||
"BSY signal lost\n");
|
||||
do_reset(instance);
|
||||
bus_reset_cleanup(instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -3,10 +3,10 @@
|
||||
* NCR 5380 defines
|
||||
*
|
||||
* Copyright 1993, Drew Eckhardt
|
||||
* Visionary Computing
|
||||
* (Unix consulting and custom programming)
|
||||
* drew@colorado.edu
|
||||
* +1 (303) 666-5836
|
||||
* Visionary Computing
|
||||
* (Unix consulting and custom programming)
|
||||
* drew@colorado.edu
|
||||
* +1 (303) 666-5836
|
||||
*
|
||||
* For more information, please consult
|
||||
*
|
||||
@@ -78,7 +78,7 @@
|
||||
#define ICR_DIFF_ENABLE 0x20 /* wo Set to enable diff. drivers */
|
||||
#define ICR_ASSERT_ACK 0x10 /* rw ini Set to assert ACK */
|
||||
#define ICR_ASSERT_BSY 0x08 /* rw Set to assert BSY */
|
||||
#define ICR_ASSERT_SEL 0x04 /* rw Set to assert SEL */
|
||||
#define ICR_ASSERT_SEL 0x04 /* rw Set to assert SEL */
|
||||
#define ICR_ASSERT_ATN 0x02 /* rw Set to assert ATN */
|
||||
#define ICR_ASSERT_DATA 0x01 /* rw SCSI_DATA_REG is asserted */
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
#define BASR_IRQ 0x10 /* ro mirror of IRQ pin */
|
||||
#define BASR_PHASE_MATCH 0x08 /* ro Set when MSG CD IO match TCR */
|
||||
#define BASR_BUSY_ERROR 0x04 /* ro Unexpected change to inactive state */
|
||||
#define BASR_ATN 0x02 /* ro BUS status */
|
||||
#define BASR_ATN 0x02 /* ro BUS status */
|
||||
#define BASR_ACK 0x01 /* ro BUS status */
|
||||
|
||||
/* Write any value to this register to start a DMA send */
|
||||
@@ -170,7 +170,7 @@
|
||||
#define CSR_BASE CSR_53C80_INTR
|
||||
|
||||
/* Note : PHASE_* macros are based on the values of the STATUS register */
|
||||
#define PHASE_MASK (SR_MSG | SR_CD | SR_IO)
|
||||
#define PHASE_MASK (SR_MSG | SR_CD | SR_IO)
|
||||
|
||||
#define PHASE_DATAOUT 0
|
||||
#define PHASE_DATAIN SR_IO
|
||||
@@ -231,7 +231,6 @@ struct NCR5380_cmd {
|
||||
int this_residual;
|
||||
struct scatterlist *buffer;
|
||||
int status;
|
||||
int message;
|
||||
int phase;
|
||||
struct list_head list;
|
||||
};
|
||||
@@ -286,8 +285,9 @@ static const char *NCR5380_info(struct Scsi_Host *instance);
|
||||
static void NCR5380_reselect(struct Scsi_Host *instance);
|
||||
static bool NCR5380_select(struct Scsi_Host *, struct scsi_cmnd *);
|
||||
static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data);
|
||||
static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data,
|
||||
unsigned int can_sleep);
|
||||
static void NCR5380_transfer_pio(struct Scsi_Host *instance,
|
||||
unsigned char *phase, int *count,
|
||||
unsigned char **data, unsigned int can_sleep);
|
||||
static int NCR5380_poll_politely2(struct NCR5380_hostdata *,
|
||||
unsigned int, u8, u8,
|
||||
unsigned int, u8, u8, unsigned long);
|
||||
|
||||
@@ -1267,7 +1267,7 @@ static int aac_read_raw_io(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u3
|
||||
return ret;
|
||||
command = ContainerRawIo;
|
||||
fibsize = sizeof(struct aac_raw_io) +
|
||||
((le32_to_cpu(readcmd->sg.count)-1) * sizeof(struct sgentryraw));
|
||||
(le32_to_cpu(readcmd->sg.count) * sizeof(struct sgentryraw));
|
||||
}
|
||||
|
||||
BUG_ON(fibsize > (fib->dev->max_fib_size - sizeof(struct aac_fibhdr)));
|
||||
@@ -1302,7 +1302,7 @@ static int aac_read_block64(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
fibsize = sizeof(struct aac_read64) +
|
||||
((le32_to_cpu(readcmd->sg.count) - 1) *
|
||||
(le32_to_cpu(readcmd->sg.count) *
|
||||
sizeof (struct sgentry64));
|
||||
BUG_ON (fibsize > (fib->dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr)));
|
||||
@@ -1337,7 +1337,7 @@ static int aac_read_block(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
fibsize = sizeof(struct aac_read) +
|
||||
((le32_to_cpu(readcmd->sg.count) - 1) *
|
||||
(le32_to_cpu(readcmd->sg.count) *
|
||||
sizeof (struct sgentry));
|
||||
BUG_ON (fibsize > (fib->dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr)));
|
||||
@@ -1401,7 +1401,7 @@ static int aac_write_raw_io(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u
|
||||
return ret;
|
||||
command = ContainerRawIo;
|
||||
fibsize = sizeof(struct aac_raw_io) +
|
||||
((le32_to_cpu(writecmd->sg.count)-1) * sizeof (struct sgentryraw));
|
||||
(le32_to_cpu(writecmd->sg.count) * sizeof(struct sgentryraw));
|
||||
}
|
||||
|
||||
BUG_ON(fibsize > (fib->dev->max_fib_size - sizeof(struct aac_fibhdr)));
|
||||
@@ -1436,7 +1436,7 @@ static int aac_write_block64(struct fib * fib, struct scsi_cmnd * cmd, u64 lba,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
fibsize = sizeof(struct aac_write64) +
|
||||
((le32_to_cpu(writecmd->sg.count) - 1) *
|
||||
(le32_to_cpu(writecmd->sg.count) *
|
||||
sizeof (struct sgentry64));
|
||||
BUG_ON (fibsize > (fib->dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr)));
|
||||
@@ -1473,7 +1473,7 @@ static int aac_write_block(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u3
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
fibsize = sizeof(struct aac_write) +
|
||||
((le32_to_cpu(writecmd->sg.count) - 1) *
|
||||
(le32_to_cpu(writecmd->sg.count) *
|
||||
sizeof (struct sgentry));
|
||||
BUG_ON (fibsize > (fib->dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr)));
|
||||
@@ -1592,9 +1592,9 @@ static int aac_scsi_64(struct fib * fib, struct scsi_cmnd * cmd)
|
||||
/*
|
||||
* Build Scatter/Gather list
|
||||
*/
|
||||
fibsize = sizeof (struct aac_srb) - sizeof (struct sgentry) +
|
||||
fibsize = sizeof(struct aac_srb) +
|
||||
((le32_to_cpu(srbcmd->sg.count) & 0xff) *
|
||||
sizeof (struct sgentry64));
|
||||
sizeof(struct sgentry64));
|
||||
BUG_ON (fibsize > (fib->dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr)));
|
||||
|
||||
@@ -1624,7 +1624,7 @@ static int aac_scsi_32(struct fib * fib, struct scsi_cmnd * cmd)
|
||||
* Build Scatter/Gather list
|
||||
*/
|
||||
fibsize = sizeof (struct aac_srb) +
|
||||
(((le32_to_cpu(srbcmd->sg.count) & 0xff) - 1) *
|
||||
((le32_to_cpu(srbcmd->sg.count) & 0xff) *
|
||||
sizeof (struct sgentry));
|
||||
BUG_ON (fibsize > (fib->dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr)));
|
||||
@@ -1693,8 +1693,7 @@ static int aac_send_safw_bmic_cmd(struct aac_dev *dev,
|
||||
fibptr->hw_fib_va->header.XferState &=
|
||||
~cpu_to_le32(FastResponseCapable);
|
||||
|
||||
fibsize = sizeof(struct aac_srb) - sizeof(struct sgentry) +
|
||||
sizeof(struct sgentry64);
|
||||
fibsize = sizeof(struct aac_srb) + sizeof(struct sgentry64);
|
||||
|
||||
/* allocate DMA buffer for response */
|
||||
addr = dma_map_single(&dev->pdev->dev, xfer_buf, xfer_len,
|
||||
@@ -1833,7 +1832,7 @@ static int aac_get_safw_ciss_luns(struct aac_dev *dev)
|
||||
struct aac_ciss_phys_luns_resp *phys_luns;
|
||||
|
||||
datasize = sizeof(struct aac_ciss_phys_luns_resp) +
|
||||
(AAC_MAX_TARGETS - 1) * sizeof(struct _ciss_lun);
|
||||
AAC_MAX_TARGETS * sizeof(struct _ciss_lun);
|
||||
phys_luns = kmalloc(datasize, GFP_KERNEL);
|
||||
if (phys_luns == NULL)
|
||||
goto out;
|
||||
@@ -2267,7 +2266,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
|
||||
dev->a_ops.adapter_bounds = aac_bounds_32;
|
||||
dev->scsi_host_ptr->sg_tablesize = (dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr) -
|
||||
sizeof(struct aac_write) + sizeof(struct sgentry)) /
|
||||
sizeof(struct aac_write)) /
|
||||
sizeof(struct sgentry);
|
||||
if (dev->dac_support) {
|
||||
dev->a_ops.adapter_read = aac_read_block64;
|
||||
@@ -2278,8 +2277,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
|
||||
dev->scsi_host_ptr->sg_tablesize =
|
||||
(dev->max_fib_size -
|
||||
sizeof(struct aac_fibhdr) -
|
||||
sizeof(struct aac_write64) +
|
||||
sizeof(struct sgentry64)) /
|
||||
sizeof(struct aac_write64)) /
|
||||
sizeof(struct sgentry64);
|
||||
} else {
|
||||
dev->a_ops.adapter_read = aac_read_block;
|
||||
|
||||
@@ -322,7 +322,7 @@ struct aac_ciss_phys_luns_resp {
|
||||
u8 level3[2];
|
||||
u8 level2[2];
|
||||
u8 node_ident[16]; /* phys. node identifier */
|
||||
} lun[1]; /* List of phys. devices */
|
||||
} lun[]; /* List of phys. devices */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -507,32 +507,27 @@ struct sge_ieee1212 {
|
||||
|
||||
struct sgmap {
|
||||
__le32 count;
|
||||
struct sgentry sg[1];
|
||||
struct sgentry sg[];
|
||||
};
|
||||
|
||||
struct user_sgmap {
|
||||
u32 count;
|
||||
struct user_sgentry sg[1];
|
||||
struct user_sgentry sg[];
|
||||
};
|
||||
|
||||
struct sgmap64 {
|
||||
__le32 count;
|
||||
struct sgentry64 sg[1];
|
||||
struct sgentry64 sg[];
|
||||
};
|
||||
|
||||
struct user_sgmap64 {
|
||||
u32 count;
|
||||
struct user_sgentry64 sg[1];
|
||||
struct user_sgentry64 sg[];
|
||||
};
|
||||
|
||||
struct sgmapraw {
|
||||
__le32 count;
|
||||
struct sgentryraw sg[1];
|
||||
};
|
||||
|
||||
struct user_sgmapraw {
|
||||
u32 count;
|
||||
struct user_sgentryraw sg[1];
|
||||
struct sgentryraw sg[];
|
||||
};
|
||||
|
||||
struct creation_info
|
||||
@@ -873,7 +868,7 @@ union aac_init
|
||||
__le16 element_count;
|
||||
__le16 comp_thresh;
|
||||
__le16 unused;
|
||||
} rrq[1]; /* up to 64 RRQ addresses */
|
||||
} rrq[] __counted_by_le(rr_queue_count); /* up to 64 RRQ addresses */
|
||||
} r8;
|
||||
};
|
||||
|
||||
@@ -2029,8 +2024,8 @@ struct aac_srb_reply
|
||||
};
|
||||
|
||||
struct aac_srb_unit {
|
||||
struct aac_srb srb;
|
||||
struct aac_srb_reply srb_reply;
|
||||
struct aac_srb srb;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -523,7 +523,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if ((fibsize < (sizeof(struct user_aac_srb) - sizeof(struct user_sgentry))) ||
|
||||
if ((fibsize < sizeof(struct user_aac_srb)) ||
|
||||
(fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr)))) {
|
||||
rcode = -EINVAL;
|
||||
goto cleanup;
|
||||
@@ -561,7 +561,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
|
||||
rcode = -EINVAL;
|
||||
goto cleanup;
|
||||
}
|
||||
actual_fibsize = sizeof(struct aac_srb) - sizeof(struct sgentry) +
|
||||
actual_fibsize = sizeof(struct aac_srb) +
|
||||
((user_srbcmd->sg.count & 0xff) * sizeof(struct sgentry));
|
||||
actual_fibsize64 = actual_fibsize + (user_srbcmd->sg.count & 0xff) *
|
||||
(sizeof(struct sgentry64) - sizeof(struct sgentry));
|
||||
|
||||
@@ -522,8 +522,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
|
||||
spin_lock_init(&dev->iq_lock);
|
||||
dev->max_fib_size = sizeof(struct hw_fib);
|
||||
dev->sg_tablesize = host->sg_tablesize = (dev->max_fib_size
|
||||
- sizeof(struct aac_fibhdr)
|
||||
- sizeof(struct aac_write) + sizeof(struct sgentry))
|
||||
- sizeof(struct aac_fibhdr) - sizeof(struct aac_write))
|
||||
/ sizeof(struct sgentry);
|
||||
dev->comm_interface = AAC_COMM_PRODUCER;
|
||||
dev->raw_io_interface = dev->raw_io_64 = 0;
|
||||
|
||||
@@ -2327,8 +2327,9 @@ static int aac_send_wellness_command(struct aac_dev *dev, char *wellness_str,
|
||||
sg64->sg[0].addr[0] = cpu_to_le32((u32)(addr & 0xffffffff));
|
||||
sg64->sg[0].count = cpu_to_le32(datasize);
|
||||
|
||||
ret = aac_fib_send(ScsiPortCommand64, fibptr, sizeof(struct aac_srb),
|
||||
FsaNormal, 1, 1, NULL, NULL);
|
||||
ret = aac_fib_send(ScsiPortCommand64, fibptr,
|
||||
sizeof(struct aac_srb) + sizeof(struct sgentry),
|
||||
FsaNormal, 1, 1, NULL, NULL);
|
||||
|
||||
dma_free_coherent(&dev->pdev->dev, datasize, dma_buf, addr);
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ static void aac_src_start_adapter(struct aac_dev *dev)
|
||||
lower_32_bits(dev->init_pa),
|
||||
upper_32_bits(dev->init_pa),
|
||||
sizeof(struct _r8) +
|
||||
(AAC_MAX_HRRQ - 1) * sizeof(struct _rrq),
|
||||
AAC_MAX_HRRQ * sizeof(struct _rrq),
|
||||
0, 0, 0, NULL, NULL, NULL, NULL, NULL);
|
||||
} else {
|
||||
init->r7.host_elapsed_seconds =
|
||||
|
||||
@@ -5528,7 +5528,6 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
|
||||
struct beiscsi_hba *phba = NULL;
|
||||
struct be_eq_obj *pbe_eq;
|
||||
unsigned int s_handle;
|
||||
char wq_name[20];
|
||||
int ret, i;
|
||||
|
||||
ret = beiscsi_enable_pci(pcidev);
|
||||
@@ -5634,9 +5633,8 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
|
||||
|
||||
phba->ctrl.mcc_alloc_index = phba->ctrl.mcc_free_index = 0;
|
||||
|
||||
snprintf(wq_name, sizeof(wq_name), "beiscsi_%02x_wq",
|
||||
phba->shost->host_no);
|
||||
phba->wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, wq_name);
|
||||
phba->wq = alloc_workqueue("beiscsi_%02x_wq", WQ_MEM_RECLAIM, 1,
|
||||
phba->shost->host_no);
|
||||
if (!phba->wq) {
|
||||
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
|
||||
"BM_%d : beiscsi_dev_probe-"
|
||||
|
||||
@@ -766,9 +766,8 @@ bfad_thread_workq(struct bfad_s *bfad)
|
||||
struct bfad_im_s *im = bfad->im;
|
||||
|
||||
bfa_trc(bfad, 0);
|
||||
snprintf(im->drv_workq_name, KOBJ_NAME_LEN, "bfad_wq_%d",
|
||||
bfad->inst_no);
|
||||
im->drv_workq = create_singlethread_workqueue(im->drv_workq_name);
|
||||
im->drv_workq = alloc_ordered_workqueue("bfad_wq_%d", WQ_MEM_RECLAIM,
|
||||
bfad->inst_no);
|
||||
if (!im->drv_workq)
|
||||
return BFA_STATUS_FAILED;
|
||||
|
||||
|
||||
@@ -134,7 +134,6 @@ struct bfad_fcp_binding {
|
||||
struct bfad_im_s {
|
||||
struct bfad_s *bfad;
|
||||
struct workqueue_struct *drv_workq;
|
||||
char drv_workq_name[KOBJ_NAME_LEN];
|
||||
struct work_struct aen_im_notify_work;
|
||||
};
|
||||
|
||||
|
||||
@@ -358,18 +358,12 @@ struct bnx2fc_rport {
|
||||
dma_addr_t lcq_dma;
|
||||
u32 lcq_mem_size;
|
||||
|
||||
void *ofld_req[4];
|
||||
dma_addr_t ofld_req_dma[4];
|
||||
void *enbl_req;
|
||||
dma_addr_t enbl_req_dma;
|
||||
|
||||
spinlock_t tgt_lock;
|
||||
spinlock_t cq_lock;
|
||||
atomic_t num_active_ios;
|
||||
u32 flush_in_prog;
|
||||
unsigned long timestamp;
|
||||
unsigned long retry_delay_timestamp;
|
||||
struct list_head free_task_list;
|
||||
struct bnx2fc_cmd *pending_queue[BNX2FC_SQ_WQES_MAX+1];
|
||||
struct list_head active_cmd_queue;
|
||||
struct list_head els_queue;
|
||||
|
||||
@@ -2363,8 +2363,8 @@ static int _bnx2fc_create(struct net_device *netdev,
|
||||
interface->vlan_id = vlan_id;
|
||||
interface->tm_timeout = BNX2FC_TM_TIMEOUT;
|
||||
|
||||
interface->timer_work_queue =
|
||||
create_singlethread_workqueue("bnx2fc_timer_wq");
|
||||
interface->timer_work_queue = alloc_ordered_workqueue(
|
||||
"%s", WQ_MEM_RECLAIM, "bnx2fc_timer_wq");
|
||||
if (!interface->timer_work_queue) {
|
||||
printk(KERN_ERR PFX "ulp_init could not create timer_wq\n");
|
||||
rc = -EINVAL;
|
||||
|
||||
@@ -815,11 +815,6 @@ extern struct bnx2i_hba *get_adapter_list_head(void);
|
||||
struct bnx2i_conn *bnx2i_get_conn_from_id(struct bnx2i_hba *hba,
|
||||
u16 iscsi_cid);
|
||||
|
||||
int bnx2i_alloc_ep_pool(void);
|
||||
void bnx2i_release_ep_pool(void);
|
||||
struct bnx2i_endpoint *bnx2i_ep_ofld_list_next(struct bnx2i_hba *hba);
|
||||
struct bnx2i_endpoint *bnx2i_ep_destroy_list_next(struct bnx2i_hba *hba);
|
||||
|
||||
struct bnx2i_hba *bnx2i_find_hba_for_cnic(struct cnic_dev *cnic);
|
||||
|
||||
struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic);
|
||||
@@ -869,12 +864,6 @@ extern int bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action);
|
||||
|
||||
extern int bnx2i_hw_ep_disconnect(struct bnx2i_endpoint *bnx2i_ep);
|
||||
|
||||
/* Debug related function prototypes */
|
||||
extern void bnx2i_print_pend_cmd_queue(struct bnx2i_conn *conn);
|
||||
extern void bnx2i_print_active_cmd_queue(struct bnx2i_conn *conn);
|
||||
extern void bnx2i_print_xmit_pdu_queue(struct bnx2i_conn *conn);
|
||||
extern void bnx2i_print_recv_state(struct bnx2i_conn *conn);
|
||||
|
||||
extern int bnx2i_percpu_io_thread(void *arg);
|
||||
extern int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session,
|
||||
struct bnx2i_conn *bnx2i_conn,
|
||||
|
||||
@@ -822,7 +822,8 @@ static int __init rdac_init(void)
|
||||
/*
|
||||
* Create workqueue to handle mode selects for rdac
|
||||
*/
|
||||
kmpath_rdacd = create_singlethread_workqueue("kmpath_rdacd");
|
||||
kmpath_rdacd =
|
||||
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "kmpath_rdacd");
|
||||
if (!kmpath_rdacd) {
|
||||
scsi_unregister_device_handler(&rdac_dh);
|
||||
printk(KERN_ERR "kmpath_rdacd creation failed.\n");
|
||||
|
||||
@@ -1114,7 +1114,8 @@ int efct_scsi_tgt_new_device(struct efct *efct)
|
||||
atomic_set(&efct->tgt_efct.watermark_hit, 0);
|
||||
atomic_set(&efct->tgt_efct.initiator_count, 0);
|
||||
|
||||
lio_wq = create_singlethread_workqueue("efct_lio_worker");
|
||||
lio_wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
|
||||
"efct_lio_worker");
|
||||
if (!lio_wq) {
|
||||
efc_log_err(efct, "workqueue create failed\n");
|
||||
return -EIO;
|
||||
|
||||
@@ -705,9 +705,9 @@ efc_nport_vport_del(struct efc *efc, struct efc_domain *domain,
|
||||
spin_lock_irqsave(&efc->lock, flags);
|
||||
list_for_each_entry(nport, &domain->nport_list, list_entry) {
|
||||
if (nport->wwpn == wwpn && nport->wwnn == wwnn) {
|
||||
kref_put(&nport->ref, nport->release);
|
||||
/* Shutdown this NPORT */
|
||||
efc_sm_post_event(&nport->sm, EFC_EVT_SHUTDOWN, NULL);
|
||||
kref_put(&nport->ref, nport->release);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -929,7 +929,6 @@ struct esas2r_adapter {
|
||||
struct list_head fw_event_list;
|
||||
spinlock_t fw_event_lock;
|
||||
u8 fw_events_off; /* if '1', then ignore events */
|
||||
char fw_event_q_name[ESAS2R_KOBJ_NAME_LEN];
|
||||
/*
|
||||
* intr_mode stores the interrupt mode currently being used by this
|
||||
* adapter. it is based on the interrupt_mode module parameter, but
|
||||
|
||||
@@ -311,9 +311,8 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid,
|
||||
sema_init(&a->nvram_semaphore, 1);
|
||||
|
||||
esas2r_fw_event_off(a);
|
||||
snprintf(a->fw_event_q_name, ESAS2R_KOBJ_NAME_LEN, "esas2r/%d",
|
||||
a->index);
|
||||
a->fw_event_q = create_singlethread_workqueue(a->fw_event_q_name);
|
||||
a->fw_event_q =
|
||||
alloc_ordered_workqueue("esas2r/%d", WQ_MEM_RECLAIM, a->index);
|
||||
|
||||
init_waitqueue_head(&a->buffered_ioctl_waiter);
|
||||
init_waitqueue_head(&a->nvram_waiter);
|
||||
|
||||
@@ -45,12 +45,8 @@ MODULE_PARM_DESC(fcf_dev_loss_tmo,
|
||||
*/
|
||||
#define fcoe_ctlr_id(x) \
|
||||
((x)->id)
|
||||
#define fcoe_ctlr_work_q_name(x) \
|
||||
((x)->work_q_name)
|
||||
#define fcoe_ctlr_work_q(x) \
|
||||
((x)->work_q)
|
||||
#define fcoe_ctlr_devloss_work_q_name(x) \
|
||||
((x)->devloss_work_q_name)
|
||||
#define fcoe_ctlr_devloss_work_q(x) \
|
||||
((x)->devloss_work_q)
|
||||
#define fcoe_ctlr_mode(x) \
|
||||
@@ -797,18 +793,14 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
|
||||
|
||||
ctlr->fcf_dev_loss_tmo = fcoe_fcf_dev_loss_tmo;
|
||||
|
||||
snprintf(ctlr->work_q_name, sizeof(ctlr->work_q_name),
|
||||
"ctlr_wq_%d", ctlr->id);
|
||||
ctlr->work_q = create_singlethread_workqueue(
|
||||
ctlr->work_q_name);
|
||||
ctlr->work_q = alloc_ordered_workqueue("ctlr_wq_%d", WQ_MEM_RECLAIM,
|
||||
ctlr->id);
|
||||
if (!ctlr->work_q)
|
||||
goto out_del;
|
||||
|
||||
snprintf(ctlr->devloss_work_q_name,
|
||||
sizeof(ctlr->devloss_work_q_name),
|
||||
"ctlr_dl_wq_%d", ctlr->id);
|
||||
ctlr->devloss_work_q = create_singlethread_workqueue(
|
||||
ctlr->devloss_work_q_name);
|
||||
ctlr->devloss_work_q = alloc_ordered_workqueue("ctlr_dl_wq_%d",
|
||||
WQ_MEM_RECLAIM,
|
||||
ctlr->id);
|
||||
if (!ctlr->devloss_work_q)
|
||||
goto out_del_q;
|
||||
|
||||
|
||||
@@ -1161,14 +1161,16 @@ static int __init fnic_init_module(void)
|
||||
goto err_create_fnic_ioreq_slab;
|
||||
}
|
||||
|
||||
fnic_event_queue = create_singlethread_workqueue("fnic_event_wq");
|
||||
fnic_event_queue =
|
||||
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fnic_event_wq");
|
||||
if (!fnic_event_queue) {
|
||||
printk(KERN_ERR PFX "fnic work queue create failed\n");
|
||||
err = -ENOMEM;
|
||||
goto err_create_fnic_workq;
|
||||
}
|
||||
|
||||
fnic_fip_queue = create_singlethread_workqueue("fnic_fip_q");
|
||||
fnic_fip_queue =
|
||||
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fnic_fip_q");
|
||||
if (!fnic_fip_queue) {
|
||||
printk(KERN_ERR PFX "fnic FIP work queue create failed\n");
|
||||
err = -ENOMEM;
|
||||
|
||||
@@ -2302,7 +2302,8 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba)
|
||||
|
||||
hisi_hba->last_slot_index = 0;
|
||||
|
||||
hisi_hba->wq = create_singlethread_workqueue(dev_name(dev));
|
||||
hisi_hba->wq =
|
||||
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, dev_name(dev));
|
||||
if (!hisi_hba->wq) {
|
||||
dev_err(dev, "sas_alloc: failed to create workqueue\n");
|
||||
goto err_out;
|
||||
|
||||
@@ -292,11 +292,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
|
||||
}
|
||||
|
||||
if (shost->transportt->create_work_queue) {
|
||||
snprintf(shost->work_q_name, sizeof(shost->work_q_name),
|
||||
"scsi_wq_%d", shost->host_no);
|
||||
shost->work_q = alloc_workqueue("%s",
|
||||
WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
|
||||
1, shost->work_q_name);
|
||||
shost->work_q = alloc_workqueue(
|
||||
"scsi_wq_%d",
|
||||
WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND, 1,
|
||||
shost->host_no);
|
||||
|
||||
if (!shost->work_q) {
|
||||
error = -EINVAL;
|
||||
|
||||
@@ -3425,7 +3425,6 @@ static int ibmvscsis_probe(struct vio_dev *vdev,
|
||||
struct scsi_info *vscsi;
|
||||
int rc = 0;
|
||||
long hrc = 0;
|
||||
char wq_name[24];
|
||||
|
||||
vscsi = kzalloc(sizeof(*vscsi), GFP_KERNEL);
|
||||
if (!vscsi) {
|
||||
@@ -3536,8 +3535,8 @@ static int ibmvscsis_probe(struct vio_dev *vdev,
|
||||
init_completion(&vscsi->wait_idle);
|
||||
init_completion(&vscsi->unconfig);
|
||||
|
||||
snprintf(wq_name, 24, "ibmvscsis%s", dev_name(&vdev->dev));
|
||||
vscsi->work_q = create_workqueue(wq_name);
|
||||
vscsi->work_q = alloc_workqueue("ibmvscsis%s", WQ_MEM_RECLAIM, 1,
|
||||
dev_name(&vdev->dev));
|
||||
if (!vscsi->work_q) {
|
||||
rc = -ENOMEM;
|
||||
dev_err(&vscsi->dev, "create_workqueue failed\n");
|
||||
|
||||
+2
-2
@@ -1030,7 +1030,7 @@ struct ipr_hostrcb_fabric_desc {
|
||||
#define IPR_PATH_FAILED 0x03
|
||||
|
||||
__be16 num_entries;
|
||||
struct ipr_hostrcb_config_element elem[1];
|
||||
struct ipr_hostrcb_config_element elem[];
|
||||
}__attribute__((packed, aligned (4)));
|
||||
|
||||
struct ipr_hostrcb64_fabric_desc {
|
||||
@@ -1044,7 +1044,7 @@ struct ipr_hostrcb64_fabric_desc {
|
||||
u8 res_path[8];
|
||||
u8 reserved3[6];
|
||||
__be16 num_entries;
|
||||
struct ipr_hostrcb64_config_element elem[1];
|
||||
struct ipr_hostrcb64_config_element elem[];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
#define for_each_hrrq(hrrq, ioa_cfg) \
|
||||
|
||||
@@ -2693,7 +2693,8 @@ int fc_setup_exch_mgr(void)
|
||||
fc_cpu_order = ilog2(roundup_pow_of_two(nr_cpu_ids));
|
||||
fc_cpu_mask = (1 << fc_cpu_order) - 1;
|
||||
|
||||
fc_exch_workqueue = create_singlethread_workqueue("fc_exch_workqueue");
|
||||
fc_exch_workqueue = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
|
||||
"fc_exch_workqueue");
|
||||
if (!fc_exch_workqueue)
|
||||
goto err;
|
||||
return 0;
|
||||
|
||||
@@ -2263,7 +2263,8 @@ struct fc4_prov fc_rport_t0_prov = {
|
||||
*/
|
||||
int fc_setup_rport(void)
|
||||
{
|
||||
rport_event_queue = create_singlethread_workqueue("fc_rport_eq");
|
||||
rport_event_queue =
|
||||
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fc_rport_eq");
|
||||
if (!rport_event_queue)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
||||
@@ -122,12 +122,12 @@ int sas_register_ha(struct sas_ha_struct *sas_ha)
|
||||
|
||||
error = -ENOMEM;
|
||||
snprintf(name, sizeof(name), "%s_event_q", dev_name(sas_ha->dev));
|
||||
sas_ha->event_q = create_singlethread_workqueue(name);
|
||||
sas_ha->event_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name);
|
||||
if (!sas_ha->event_q)
|
||||
goto Undo_ports;
|
||||
|
||||
snprintf(name, sizeof(name), "%s_disco_q", dev_name(sas_ha->dev));
|
||||
sas_ha->disco_q = create_singlethread_workqueue(name);
|
||||
sas_ha->disco_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name);
|
||||
if (!sas_ha->disco_q)
|
||||
goto Undo_event_q;
|
||||
|
||||
|
||||
@@ -306,6 +306,14 @@ struct lpfc_stats {
|
||||
|
||||
struct lpfc_hba;
|
||||
|
||||
/* Data structure to keep withheld FLOGI_ACC information */
|
||||
struct lpfc_defer_flogi_acc {
|
||||
bool flag;
|
||||
u16 rx_id;
|
||||
u16 ox_id;
|
||||
struct lpfc_nodelist *ndlp;
|
||||
|
||||
};
|
||||
|
||||
#define LPFC_VMID_TIMER 300 /* timer interval in seconds */
|
||||
|
||||
@@ -1430,9 +1438,7 @@ struct lpfc_hba {
|
||||
uint16_t vlan_id;
|
||||
struct list_head fcf_conn_rec_list;
|
||||
|
||||
bool defer_flogi_acc_flag;
|
||||
uint16_t defer_flogi_acc_rx_id;
|
||||
uint16_t defer_flogi_acc_ox_id;
|
||||
struct lpfc_defer_flogi_acc defer_flogi_acc;
|
||||
|
||||
spinlock_t ct_ev_lock; /* synchronize access to ct_ev_waiters */
|
||||
struct list_head ct_ev_waiters;
|
||||
|
||||
@@ -1099,8 +1099,10 @@ stop_rr_fcf_flogi:
|
||||
sp->cmn.priority_tagging, kref_read(&ndlp->kref));
|
||||
|
||||
/* reinitialize the VMID datastructure before returning */
|
||||
if (lpfc_is_vmid_enabled(phba))
|
||||
if (lpfc_is_vmid_enabled(phba)) {
|
||||
lpfc_reinit_vmid(vport);
|
||||
vport->vmid_flag = 0;
|
||||
}
|
||||
if (sp->cmn.priority_tagging)
|
||||
vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA |
|
||||
LPFC_VMID_TYPE_PRIO);
|
||||
@@ -1390,7 +1392,7 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
||||
phba->link_flag &= ~LS_EXTERNAL_LOOPBACK;
|
||||
|
||||
/* Check for a deferred FLOGI ACC condition */
|
||||
if (phba->defer_flogi_acc_flag) {
|
||||
if (phba->defer_flogi_acc.flag) {
|
||||
/* lookup ndlp for received FLOGI */
|
||||
ndlp = lpfc_findnode_did(vport, 0);
|
||||
if (!ndlp)
|
||||
@@ -1404,34 +1406,38 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
||||
if (phba->sli_rev == LPFC_SLI_REV4) {
|
||||
bf_set(wqe_ctxt_tag,
|
||||
&defer_flogi_acc.wqe.xmit_els_rsp.wqe_com,
|
||||
phba->defer_flogi_acc_rx_id);
|
||||
phba->defer_flogi_acc.rx_id);
|
||||
bf_set(wqe_rcvoxid,
|
||||
&defer_flogi_acc.wqe.xmit_els_rsp.wqe_com,
|
||||
phba->defer_flogi_acc_ox_id);
|
||||
phba->defer_flogi_acc.ox_id);
|
||||
} else {
|
||||
icmd = &defer_flogi_acc.iocb;
|
||||
icmd->ulpContext = phba->defer_flogi_acc_rx_id;
|
||||
icmd->ulpContext = phba->defer_flogi_acc.rx_id;
|
||||
icmd->unsli3.rcvsli3.ox_id =
|
||||
phba->defer_flogi_acc_ox_id;
|
||||
phba->defer_flogi_acc.ox_id;
|
||||
}
|
||||
|
||||
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
|
||||
"3354 Xmit deferred FLOGI ACC: rx_id: x%x,"
|
||||
" ox_id: x%x, hba_flag x%lx\n",
|
||||
phba->defer_flogi_acc_rx_id,
|
||||
phba->defer_flogi_acc_ox_id, phba->hba_flag);
|
||||
phba->defer_flogi_acc.rx_id,
|
||||
phba->defer_flogi_acc.ox_id, phba->hba_flag);
|
||||
|
||||
/* Send deferred FLOGI ACC */
|
||||
lpfc_els_rsp_acc(vport, ELS_CMD_FLOGI, &defer_flogi_acc,
|
||||
ndlp, NULL);
|
||||
|
||||
phba->defer_flogi_acc_flag = false;
|
||||
vport->fc_myDID = did;
|
||||
phba->defer_flogi_acc.flag = false;
|
||||
|
||||
/* Decrement ndlp reference count to indicate the node can be
|
||||
* released when other references are removed.
|
||||
/* Decrement the held ndlp that was incremented when the
|
||||
* deferred flogi acc flag was set.
|
||||
*/
|
||||
lpfc_nlp_put(ndlp);
|
||||
if (phba->defer_flogi_acc.ndlp) {
|
||||
lpfc_nlp_put(phba->defer_flogi_acc.ndlp);
|
||||
phba->defer_flogi_acc.ndlp = NULL;
|
||||
}
|
||||
|
||||
vport->fc_myDID = did;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -5240,9 +5246,10 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
|
||||
/* ACC to LOGO completes to NPort <nlp_DID> */
|
||||
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
|
||||
"0109 ACC to LOGO completes to NPort x%x refcnt %d "
|
||||
"Data: x%x x%x x%x\n",
|
||||
ndlp->nlp_DID, kref_read(&ndlp->kref), ndlp->nlp_flag,
|
||||
ndlp->nlp_state, ndlp->nlp_rpi);
|
||||
"last els x%x Data: x%x x%x x%x\n",
|
||||
ndlp->nlp_DID, kref_read(&ndlp->kref),
|
||||
ndlp->nlp_last_elscmd, ndlp->nlp_flag, ndlp->nlp_state,
|
||||
ndlp->nlp_rpi);
|
||||
|
||||
/* This clause allows the LOGO ACC to complete and free resources
|
||||
* for the Fabric Domain Controller. It does deliberately skip
|
||||
@@ -5254,18 +5261,22 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
|
||||
goto out;
|
||||
|
||||
if (ndlp->nlp_state == NLP_STE_NPR_NODE) {
|
||||
/* If PLOGI is being retried, PLOGI completion will cleanup the
|
||||
* node. The NLP_NPR_2B_DISC flag needs to be retained to make
|
||||
* progress on nodes discovered from last RSCN.
|
||||
*/
|
||||
if ((ndlp->nlp_flag & NLP_DELAY_TMO) &&
|
||||
(ndlp->nlp_last_elscmd == ELS_CMD_PLOGI))
|
||||
goto out;
|
||||
|
||||
if (ndlp->nlp_flag & NLP_RPI_REGISTERED)
|
||||
lpfc_unreg_rpi(vport, ndlp);
|
||||
|
||||
/* If came from PRLO, then PRLO_ACC is done.
|
||||
* Start rediscovery now.
|
||||
*/
|
||||
if (ndlp->nlp_last_elscmd == ELS_CMD_PRLO) {
|
||||
spin_lock_irq(&ndlp->lock);
|
||||
ndlp->nlp_flag |= NLP_NPR_2B_DISC;
|
||||
spin_unlock_irq(&ndlp->lock);
|
||||
ndlp->nlp_prev_state = ndlp->nlp_state;
|
||||
lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE);
|
||||
lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0);
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
/*
|
||||
* The driver received a LOGO from the rport and has ACK'd it.
|
||||
@@ -8454,9 +8465,9 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
|
||||
|
||||
/* Defer ACC response until AFTER we issue a FLOGI */
|
||||
if (!test_bit(HBA_FLOGI_ISSUED, &phba->hba_flag)) {
|
||||
phba->defer_flogi_acc_rx_id = bf_get(wqe_ctxt_tag,
|
||||
phba->defer_flogi_acc.rx_id = bf_get(wqe_ctxt_tag,
|
||||
&wqe->xmit_els_rsp.wqe_com);
|
||||
phba->defer_flogi_acc_ox_id = bf_get(wqe_rcvoxid,
|
||||
phba->defer_flogi_acc.ox_id = bf_get(wqe_rcvoxid,
|
||||
&wqe->xmit_els_rsp.wqe_com);
|
||||
|
||||
vport->fc_myDID = did;
|
||||
@@ -8464,11 +8475,17 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
|
||||
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
|
||||
"3344 Deferring FLOGI ACC: rx_id: x%x,"
|
||||
" ox_id: x%x, hba_flag x%lx\n",
|
||||
phba->defer_flogi_acc_rx_id,
|
||||
phba->defer_flogi_acc_ox_id, phba->hba_flag);
|
||||
phba->defer_flogi_acc.rx_id,
|
||||
phba->defer_flogi_acc.ox_id, phba->hba_flag);
|
||||
|
||||
phba->defer_flogi_acc_flag = true;
|
||||
phba->defer_flogi_acc.flag = true;
|
||||
|
||||
/* This nlp_get is paired with nlp_puts that reset the
|
||||
* defer_flogi_acc.flag back to false. We need to retain
|
||||
* a kref on the ndlp until the deferred FLOGI ACC is
|
||||
* processed or cancelled.
|
||||
*/
|
||||
phba->defer_flogi_acc.ndlp = lpfc_nlp_get(ndlp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -10504,7 +10521,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
|
||||
|
||||
lpfc_els_rcv_flogi(vport, elsiocb, ndlp);
|
||||
/* retain node if our response is deferred */
|
||||
if (phba->defer_flogi_acc_flag)
|
||||
if (phba->defer_flogi_acc.flag)
|
||||
break;
|
||||
if (newnode)
|
||||
lpfc_disc_state_machine(vport, ndlp, NULL,
|
||||
@@ -10742,7 +10759,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
|
||||
rjt_exp = LSEXP_NOTHING_MORE;
|
||||
|
||||
/* Unknown ELS command <elsCmd> received from NPORT <did> */
|
||||
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
|
||||
lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
|
||||
"0115 Unknown ELS command x%x "
|
||||
"received from NPORT x%x\n", cmd, did);
|
||||
if (newnode)
|
||||
|
||||
@@ -175,7 +175,8 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
|
||||
ndlp->nlp_state, ndlp->fc4_xpt_flags);
|
||||
|
||||
/* Don't schedule a worker thread event if the vport is going down. */
|
||||
if (test_bit(FC_UNLOADING, &vport->load_flag)) {
|
||||
if (test_bit(FC_UNLOADING, &vport->load_flag) ||
|
||||
!test_bit(HBA_SETUP, &phba->hba_flag)) {
|
||||
spin_lock_irqsave(&ndlp->lock, iflags);
|
||||
ndlp->rport = NULL;
|
||||
|
||||
@@ -1254,7 +1255,14 @@ lpfc_linkdown(struct lpfc_hba *phba)
|
||||
lpfc_scsi_dev_block(phba);
|
||||
offline = pci_channel_offline(phba->pcidev);
|
||||
|
||||
phba->defer_flogi_acc_flag = false;
|
||||
/* Decrement the held ndlp if there is a deferred flogi acc */
|
||||
if (phba->defer_flogi_acc.flag) {
|
||||
if (phba->defer_flogi_acc.ndlp) {
|
||||
lpfc_nlp_put(phba->defer_flogi_acc.ndlp);
|
||||
phba->defer_flogi_acc.ndlp = NULL;
|
||||
}
|
||||
}
|
||||
phba->defer_flogi_acc.flag = false;
|
||||
|
||||
/* Clear external loopback plug detected flag */
|
||||
phba->link_flag &= ~LS_EXTERNAL_LOOPBACK;
|
||||
@@ -1376,7 +1384,7 @@ lpfc_linkup_port(struct lpfc_vport *vport)
|
||||
(vport != phba->pport))
|
||||
return;
|
||||
|
||||
if (phba->defer_flogi_acc_flag) {
|
||||
if (phba->defer_flogi_acc.flag) {
|
||||
clear_bit(FC_ABORT_DISCOVERY, &vport->fc_flag);
|
||||
clear_bit(FC_RSCN_MODE, &vport->fc_flag);
|
||||
clear_bit(FC_NLP_MORE, &vport->fc_flag);
|
||||
|
||||
@@ -13861,12 +13861,7 @@ fcponly:
|
||||
if (sli4_params->sge_supp_len > LPFC_MAX_SGE_SIZE)
|
||||
sli4_params->sge_supp_len = LPFC_MAX_SGE_SIZE;
|
||||
|
||||
rc = dma_set_max_seg_size(&phba->pcidev->dev, sli4_params->sge_supp_len);
|
||||
if (unlikely(rc)) {
|
||||
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
|
||||
"6400 Can't set dma maximum segment size\n");
|
||||
return rc;
|
||||
}
|
||||
dma_set_max_seg_size(&phba->pcidev->dev, sli4_params->sge_supp_len);
|
||||
|
||||
/*
|
||||
* Check whether the adapter supports an embedded copy of the
|
||||
|
||||
@@ -2652,8 +2652,26 @@ lpfc_rcv_prlo_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
||||
/* flush the target */
|
||||
lpfc_sli_abort_iocb(vport, ndlp->nlp_sid, 0, LPFC_CTX_TGT);
|
||||
|
||||
/* Treat like rcv logo */
|
||||
lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_PRLO);
|
||||
/* Send PRLO_ACC */
|
||||
spin_lock_irq(&ndlp->lock);
|
||||
ndlp->nlp_flag |= NLP_LOGO_ACC;
|
||||
spin_unlock_irq(&ndlp->lock);
|
||||
lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
|
||||
|
||||
/* Save ELS_CMD_PRLO as the last elscmd and then set to NPR.
|
||||
* lpfc_cmpl_els_logo_acc is expected to restart discovery.
|
||||
*/
|
||||
ndlp->nlp_last_elscmd = ELS_CMD_PRLO;
|
||||
ndlp->nlp_prev_state = ndlp->nlp_state;
|
||||
|
||||
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_ELS | LOG_DISCOVERY,
|
||||
"3422 DID x%06x nflag x%x lastels x%x ref cnt %u\n",
|
||||
ndlp->nlp_DID, ndlp->nlp_flag,
|
||||
ndlp->nlp_last_elscmd,
|
||||
kref_read(&ndlp->kref));
|
||||
|
||||
lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
|
||||
|
||||
return ndlp->nlp_state;
|
||||
}
|
||||
|
||||
|
||||
@@ -5555,11 +5555,20 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
|
||||
|
||||
iocb = &lpfc_cmd->cur_iocbq;
|
||||
if (phba->sli_rev == LPFC_SLI_REV4) {
|
||||
pring_s4 = phba->sli4_hba.hdwq[iocb->hba_wqidx].io_wq->pring;
|
||||
if (!pring_s4) {
|
||||
/* if the io_wq & pring are gone, the port was reset. */
|
||||
if (!phba->sli4_hba.hdwq[iocb->hba_wqidx].io_wq ||
|
||||
!phba->sli4_hba.hdwq[iocb->hba_wqidx].io_wq->pring) {
|
||||
lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
|
||||
"2877 SCSI Layer I/O Abort Request "
|
||||
"IO CMPL Status x%x ID %d LUN %llu "
|
||||
"HBA_SETUP %d\n", FAILED,
|
||||
cmnd->device->id,
|
||||
(u64)cmnd->device->lun,
|
||||
test_bit(HBA_SETUP, &phba->hba_flag));
|
||||
ret = FAILED;
|
||||
goto out_unlock_hba;
|
||||
}
|
||||
pring_s4 = phba->sli4_hba.hdwq[iocb->hba_wqidx].io_wq->pring;
|
||||
spin_lock(&pring_s4->ring_lock);
|
||||
}
|
||||
/* the command is in process of being cancelled */
|
||||
|
||||
@@ -4687,6 +4687,17 @@ lpfc_sli_flush_io_rings(struct lpfc_hba *phba)
|
||||
/* Look on all the FCP Rings for the iotag */
|
||||
if (phba->sli_rev >= LPFC_SLI_REV4) {
|
||||
for (i = 0; i < phba->cfg_hdw_queue; i++) {
|
||||
if (!phba->sli4_hba.hdwq ||
|
||||
!phba->sli4_hba.hdwq[i].io_wq) {
|
||||
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
|
||||
"7777 hdwq's deleted %lx "
|
||||
"%lx %x %x\n",
|
||||
phba->pport->load_flag,
|
||||
phba->hba_flag,
|
||||
phba->link_state,
|
||||
phba->sli.sli_flag);
|
||||
return;
|
||||
}
|
||||
pring = phba->sli4_hba.hdwq[i].io_wq->pring;
|
||||
|
||||
spin_lock_irq(&pring->ring_lock);
|
||||
@@ -12473,8 +12484,6 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
|
||||
cmdiocb->iocb.ulpClass,
|
||||
LPFC_WQE_CQ_ID_DEFAULT, ia, false);
|
||||
|
||||
abtsiocbp->vport = vport;
|
||||
|
||||
/* ABTS WQE must go to the same WQ as the WQE to be aborted */
|
||||
abtsiocbp->hba_wqidx = cmdiocb->hba_wqidx;
|
||||
if (cmdiocb->cmd_flag & LPFC_IO_FCP)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* included with this package. *
|
||||
*******************************************************************/
|
||||
|
||||
#define LPFC_DRIVER_VERSION "14.4.0.3"
|
||||
#define LPFC_DRIVER_VERSION "14.4.0.4"
|
||||
#define LPFC_DRIVER_NAME "lpfc"
|
||||
|
||||
/* Used for SLI 2/3 */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*******************************************************************
|
||||
* This file is part of the Emulex Linux Device Driver for *
|
||||
* Fibre Channel Host Bus Adapters. *
|
||||
* Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
|
||||
* Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
|
||||
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
|
||||
* Copyright (C) 2004-2016 Emulex. All rights reserved. *
|
||||
* EMULEX and SLI are trademarks of Emulex. *
|
||||
@@ -321,6 +321,5 @@ lpfc_reinit_vmid(struct lpfc_vport *vport)
|
||||
if (!hash_empty(vport->hash_table))
|
||||
hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode)
|
||||
hash_del(&cur->hnode);
|
||||
vport->vmid_flag = 0;
|
||||
write_unlock(&vport->vmid_lock);
|
||||
}
|
||||
|
||||
+90
-84
@@ -102,11 +102,15 @@ __setup("mac5380=", mac_scsi_setup);
|
||||
* Linux SCSI drivers lack knowledge of the timing behaviour of SCSI targets
|
||||
* so bus errors are unavoidable.
|
||||
*
|
||||
* If a MOVE.B instruction faults, we assume that zero bytes were transferred
|
||||
* and simply retry. That assumption probably depends on target behaviour but
|
||||
* seems to hold up okay. The NOP provides synchronization: without it the
|
||||
* fault can sometimes occur after the program counter has moved past the
|
||||
* offending instruction. Post-increment addressing can't be used.
|
||||
* If a MOVE.B instruction faults during a receive operation, we assume the
|
||||
* target sent nothing and try again. That assumption probably depends on
|
||||
* target firmware but it seems to hold up okay. If a fault happens during a
|
||||
* send operation, the target may or may not have seen /ACK and got the byte.
|
||||
* It's uncertain so the whole SCSI command gets retried.
|
||||
*
|
||||
* The NOP is needed for synchronization because the fault address in the
|
||||
* exception stack frame may or may not be the instruction that actually
|
||||
* caused the bus error. Post-increment addressing can't be used.
|
||||
*/
|
||||
|
||||
#define MOVE_BYTE(operands) \
|
||||
@@ -208,8 +212,6 @@ __setup("mac5380=", mac_scsi_setup);
|
||||
".previous \n" \
|
||||
: "+a" (addr), "+r" (n), "+r" (result) : "a" (io))
|
||||
|
||||
#define MAC_PDMA_DELAY 32
|
||||
|
||||
static inline int mac_pdma_recv(void __iomem *io, unsigned char *start, int n)
|
||||
{
|
||||
unsigned char *addr = start;
|
||||
@@ -245,22 +247,21 @@ static inline int mac_pdma_send(unsigned char *start, void __iomem *io, int n)
|
||||
if (n >= 1) {
|
||||
MOVE_BYTE("%0@,%3@");
|
||||
if (result)
|
||||
goto out;
|
||||
return -1;
|
||||
}
|
||||
if (n >= 1 && ((unsigned long)addr & 1)) {
|
||||
MOVE_BYTE("%0@,%3@");
|
||||
if (result)
|
||||
goto out;
|
||||
return -2;
|
||||
}
|
||||
while (n >= 32)
|
||||
MOVE_16_WORDS("%0@+,%3@");
|
||||
while (n >= 2)
|
||||
MOVE_WORD("%0@+,%3@");
|
||||
if (result)
|
||||
return start - addr; /* Negated to indicate uncertain length */
|
||||
return start - addr - 1; /* Negated to indicate uncertain length */
|
||||
if (n == 1)
|
||||
MOVE_BYTE("%0@,%3@");
|
||||
out:
|
||||
return addr - start;
|
||||
}
|
||||
|
||||
@@ -274,25 +275,56 @@ static inline void write_ctrl_reg(struct NCR5380_hostdata *hostdata, u32 value)
|
||||
out_be32(hostdata->io + (CTRL_REG << 4), value);
|
||||
}
|
||||
|
||||
static inline int macscsi_wait_for_drq(struct NCR5380_hostdata *hostdata)
|
||||
{
|
||||
unsigned int n = 1; /* effectively multiplies NCR5380_REG_POLL_TIME */
|
||||
unsigned char basr;
|
||||
|
||||
again:
|
||||
basr = NCR5380_read(BUS_AND_STATUS_REG);
|
||||
|
||||
if (!(basr & BASR_PHASE_MATCH))
|
||||
return 1;
|
||||
|
||||
if (basr & BASR_IRQ)
|
||||
return -1;
|
||||
|
||||
if (basr & BASR_DRQ)
|
||||
return 0;
|
||||
|
||||
if (n-- == 0) {
|
||||
NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host);
|
||||
dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
|
||||
"%s: DRQ timeout\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NCR5380_poll_politely2(hostdata,
|
||||
BUS_AND_STATUS_REG, BASR_DRQ, BASR_DRQ,
|
||||
BUS_AND_STATUS_REG, BASR_PHASE_MATCH, 0, 0);
|
||||
goto again;
|
||||
}
|
||||
|
||||
static inline int macscsi_pread(struct NCR5380_hostdata *hostdata,
|
||||
unsigned char *dst, int len)
|
||||
{
|
||||
u8 __iomem *s = hostdata->pdma_io + (INPUT_DATA_REG << 4);
|
||||
unsigned char *d = dst;
|
||||
int result = 0;
|
||||
|
||||
hostdata->pdma_residual = len;
|
||||
|
||||
while (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG,
|
||||
BASR_DRQ | BASR_PHASE_MATCH,
|
||||
BASR_DRQ | BASR_PHASE_MATCH, 0)) {
|
||||
int bytes;
|
||||
while (macscsi_wait_for_drq(hostdata) == 0) {
|
||||
int bytes, chunk_bytes;
|
||||
|
||||
if (macintosh_config->ident == MAC_MODEL_IIFX)
|
||||
write_ctrl_reg(hostdata, CTRL_HANDSHAKE_MODE |
|
||||
CTRL_INTERRUPTS_ENABLE);
|
||||
|
||||
bytes = mac_pdma_recv(s, d, min(hostdata->pdma_residual, 512));
|
||||
chunk_bytes = min(hostdata->pdma_residual, 512);
|
||||
bytes = mac_pdma_recv(s, d, chunk_bytes);
|
||||
|
||||
if (macintosh_config->ident == MAC_MODEL_IIFX)
|
||||
write_ctrl_reg(hostdata, CTRL_INTERRUPTS_ENABLE);
|
||||
|
||||
if (bytes > 0) {
|
||||
d += bytes;
|
||||
@@ -300,37 +332,25 @@ static inline int macscsi_pread(struct NCR5380_hostdata *hostdata,
|
||||
}
|
||||
|
||||
if (hostdata->pdma_residual == 0)
|
||||
goto out;
|
||||
break;
|
||||
|
||||
if (NCR5380_poll_politely2(hostdata, STATUS_REG, SR_REQ, SR_REQ,
|
||||
BUS_AND_STATUS_REG, BASR_ACK,
|
||||
BASR_ACK, 0) < 0)
|
||||
scmd_printk(KERN_DEBUG, hostdata->connected,
|
||||
"%s: !REQ and !ACK\n", __func__);
|
||||
if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH))
|
||||
goto out;
|
||||
|
||||
if (bytes == 0)
|
||||
udelay(MAC_PDMA_DELAY);
|
||||
|
||||
if (bytes >= 0)
|
||||
if (bytes > 0)
|
||||
continue;
|
||||
|
||||
dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
|
||||
"%s: bus error (%d/%d)\n", __func__, d - dst, len);
|
||||
NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host);
|
||||
result = -1;
|
||||
goto out;
|
||||
dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
|
||||
"%s: bus error [%d/%d] (%d/%d)\n",
|
||||
__func__, d - dst, len, bytes, chunk_bytes);
|
||||
|
||||
if (bytes == 0)
|
||||
continue;
|
||||
|
||||
if (macscsi_wait_for_drq(hostdata) <= 0)
|
||||
set_host_byte(hostdata->connected, DID_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
scmd_printk(KERN_ERR, hostdata->connected,
|
||||
"%s: phase mismatch or !DRQ\n", __func__);
|
||||
NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host);
|
||||
result = -1;
|
||||
out:
|
||||
if (macintosh_config->ident == MAC_MODEL_IIFX)
|
||||
write_ctrl_reg(hostdata, CTRL_INTERRUPTS_ENABLE);
|
||||
return result;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int macscsi_pwrite(struct NCR5380_hostdata *hostdata,
|
||||
@@ -338,67 +358,47 @@ static inline int macscsi_pwrite(struct NCR5380_hostdata *hostdata,
|
||||
{
|
||||
unsigned char *s = src;
|
||||
u8 __iomem *d = hostdata->pdma_io + (OUTPUT_DATA_REG << 4);
|
||||
int result = 0;
|
||||
|
||||
hostdata->pdma_residual = len;
|
||||
|
||||
while (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG,
|
||||
BASR_DRQ | BASR_PHASE_MATCH,
|
||||
BASR_DRQ | BASR_PHASE_MATCH, 0)) {
|
||||
int bytes;
|
||||
while (macscsi_wait_for_drq(hostdata) == 0) {
|
||||
int bytes, chunk_bytes;
|
||||
|
||||
if (macintosh_config->ident == MAC_MODEL_IIFX)
|
||||
write_ctrl_reg(hostdata, CTRL_HANDSHAKE_MODE |
|
||||
CTRL_INTERRUPTS_ENABLE);
|
||||
|
||||
bytes = mac_pdma_send(s, d, min(hostdata->pdma_residual, 512));
|
||||
chunk_bytes = min(hostdata->pdma_residual, 512);
|
||||
bytes = mac_pdma_send(s, d, chunk_bytes);
|
||||
|
||||
if (macintosh_config->ident == MAC_MODEL_IIFX)
|
||||
write_ctrl_reg(hostdata, CTRL_INTERRUPTS_ENABLE);
|
||||
|
||||
if (bytes > 0) {
|
||||
s += bytes;
|
||||
hostdata->pdma_residual -= bytes;
|
||||
}
|
||||
|
||||
if (hostdata->pdma_residual == 0) {
|
||||
if (NCR5380_poll_politely(hostdata, TARGET_COMMAND_REG,
|
||||
TCR_LAST_BYTE_SENT,
|
||||
TCR_LAST_BYTE_SENT,
|
||||
0) < 0) {
|
||||
scmd_printk(KERN_ERR, hostdata->connected,
|
||||
"%s: Last Byte Sent timeout\n", __func__);
|
||||
result = -1;
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
if (hostdata->pdma_residual == 0)
|
||||
break;
|
||||
|
||||
if (NCR5380_poll_politely2(hostdata, STATUS_REG, SR_REQ, SR_REQ,
|
||||
BUS_AND_STATUS_REG, BASR_ACK,
|
||||
BASR_ACK, 0) < 0)
|
||||
scmd_printk(KERN_DEBUG, hostdata->connected,
|
||||
"%s: !REQ and !ACK\n", __func__);
|
||||
if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH))
|
||||
goto out;
|
||||
|
||||
if (bytes == 0)
|
||||
udelay(MAC_PDMA_DELAY);
|
||||
|
||||
if (bytes >= 0)
|
||||
if (bytes > 0)
|
||||
continue;
|
||||
|
||||
dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
|
||||
"%s: bus error (%d/%d)\n", __func__, s - src, len);
|
||||
NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host);
|
||||
result = -1;
|
||||
goto out;
|
||||
dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
|
||||
"%s: bus error [%d/%d] (%d/%d)\n",
|
||||
__func__, s - src, len, bytes, chunk_bytes);
|
||||
|
||||
if (bytes == 0)
|
||||
continue;
|
||||
|
||||
if (macscsi_wait_for_drq(hostdata) <= 0)
|
||||
set_host_byte(hostdata->connected, DID_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
scmd_printk(KERN_ERR, hostdata->connected,
|
||||
"%s: phase mismatch or !DRQ\n", __func__);
|
||||
NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host);
|
||||
result = -1;
|
||||
out:
|
||||
if (macintosh_config->ident == MAC_MODEL_IIFX)
|
||||
write_ctrl_reg(hostdata, CTRL_INTERRUPTS_ENABLE);
|
||||
return result;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int macscsi_dma_xfer_len(struct NCR5380_hostdata *hostdata,
|
||||
@@ -432,7 +432,7 @@ static struct scsi_host_template mac_scsi_template = {
|
||||
.eh_host_reset_handler = macscsi_host_reset,
|
||||
.can_queue = 16,
|
||||
.this_id = 7,
|
||||
.sg_tablesize = 1,
|
||||
.sg_tablesize = SG_ALL,
|
||||
.cmd_per_lun = 2,
|
||||
.dma_boundary = PAGE_SIZE - 1,
|
||||
.cmd_size = sizeof(struct NCR5380_cmd),
|
||||
@@ -470,6 +470,9 @@ static int __init mac_scsi_probe(struct platform_device *pdev)
|
||||
if (setup_hostid >= 0)
|
||||
mac_scsi_template.this_id = setup_hostid & 7;
|
||||
|
||||
if (macintosh_config->ident == MAC_MODEL_IIFX)
|
||||
mac_scsi_template.sg_tablesize = 1;
|
||||
|
||||
instance = scsi_host_alloc(&mac_scsi_template,
|
||||
sizeof(struct NCR5380_hostdata));
|
||||
if (!instance)
|
||||
@@ -491,6 +494,9 @@ static int __init mac_scsi_probe(struct platform_device *pdev)
|
||||
|
||||
host_flags |= setup_toshiba_delay > 0 ? FLAG_TOSHIBA_DELAY : 0;
|
||||
|
||||
if (instance->sg_tablesize > 1)
|
||||
host_flags |= FLAG_DMA_FIXUP;
|
||||
|
||||
error = NCR5380_init(instance, host_flags | FLAG_LATE_DMA_SETUP);
|
||||
if (error)
|
||||
goto fail_init;
|
||||
|
||||
@@ -814,12 +814,12 @@ struct MR_HOST_DEVICE_LIST {
|
||||
__le32 size;
|
||||
__le32 count;
|
||||
__le32 reserved[2];
|
||||
struct MR_HOST_DEVICE_LIST_ENTRY host_device_list[1];
|
||||
struct MR_HOST_DEVICE_LIST_ENTRY host_device_list[] __counted_by_le(count);
|
||||
} __packed;
|
||||
|
||||
#define HOST_DEVICE_LIST_SZ (sizeof(struct MR_HOST_DEVICE_LIST) + \
|
||||
(sizeof(struct MR_HOST_DEVICE_LIST_ENTRY) * \
|
||||
(MEGASAS_MAX_PD + MAX_LOGICAL_DRIVES_EXT - 1)))
|
||||
(MEGASAS_MAX_PD + MAX_LOGICAL_DRIVES_EXT)))
|
||||
|
||||
|
||||
/*
|
||||
@@ -2473,7 +2473,7 @@ struct MR_LD_VF_MAP {
|
||||
union MR_LD_REF ref;
|
||||
u8 ldVfCount;
|
||||
u8 reserved[6];
|
||||
u8 policy[1];
|
||||
u8 policy[];
|
||||
};
|
||||
|
||||
struct MR_LD_VF_AFFILIATION {
|
||||
|
||||
@@ -1988,8 +1988,8 @@ megasas_fusion_start_watchdog(struct megasas_instance *instance)
|
||||
sizeof(instance->fault_handler_work_q_name),
|
||||
"poll_megasas%d_status", instance->host->host_no);
|
||||
|
||||
instance->fw_fault_work_q =
|
||||
create_singlethread_workqueue(instance->fault_handler_work_q_name);
|
||||
instance->fw_fault_work_q = alloc_ordered_workqueue(
|
||||
"%s", WQ_MEM_RECLAIM, instance->fault_handler_work_q_name);
|
||||
if (!instance->fw_fault_work_q) {
|
||||
dev_err(&instance->pdev->dev, "Failed from %s %d\n",
|
||||
__func__, __LINE__);
|
||||
|
||||
@@ -1565,16 +1565,13 @@ struct mpi3_sas_io_unit0_phy_data {
|
||||
__le32 reserved10;
|
||||
};
|
||||
|
||||
#ifndef MPI3_SAS_IO_UNIT0_PHY_MAX
|
||||
#define MPI3_SAS_IO_UNIT0_PHY_MAX (1)
|
||||
#endif
|
||||
struct mpi3_sas_io_unit_page0 {
|
||||
struct mpi3_config_page_header header;
|
||||
__le32 reserved08;
|
||||
u8 num_phys;
|
||||
u8 init_status;
|
||||
__le16 reserved0e;
|
||||
struct mpi3_sas_io_unit0_phy_data phy_data[MPI3_SAS_IO_UNIT0_PHY_MAX];
|
||||
struct mpi3_sas_io_unit0_phy_data phy_data[];
|
||||
};
|
||||
|
||||
#define MPI3_SASIOUNIT0_PAGEVERSION (0x00)
|
||||
@@ -1606,9 +1603,6 @@ struct mpi3_sas_io_unit1_phy_data {
|
||||
__le32 reserved08;
|
||||
};
|
||||
|
||||
#ifndef MPI3_SAS_IO_UNIT1_PHY_MAX
|
||||
#define MPI3_SAS_IO_UNIT1_PHY_MAX (1)
|
||||
#endif
|
||||
struct mpi3_sas_io_unit_page1 {
|
||||
struct mpi3_config_page_header header;
|
||||
__le16 control_flags;
|
||||
@@ -1618,7 +1612,7 @@ struct mpi3_sas_io_unit_page1 {
|
||||
u8 num_phys;
|
||||
u8 sata_max_q_depth;
|
||||
__le16 reserved12;
|
||||
struct mpi3_sas_io_unit1_phy_data phy_data[MPI3_SAS_IO_UNIT1_PHY_MAX];
|
||||
struct mpi3_sas_io_unit1_phy_data phy_data[];
|
||||
};
|
||||
|
||||
#define MPI3_SASIOUNIT1_PAGEVERSION (0x00)
|
||||
|
||||
@@ -453,9 +453,6 @@ struct mpi3_event_data_sas_notify_primitive {
|
||||
#define MPI3_EVENT_NOTIFY_PRIMITIVE_POWER_LOSS_EXPECTED (0x02)
|
||||
#define MPI3_EVENT_NOTIFY_PRIMITIVE_RESERVED1 (0x03)
|
||||
#define MPI3_EVENT_NOTIFY_PRIMITIVE_RESERVED2 (0x04)
|
||||
#ifndef MPI3_EVENT_SAS_TOPO_PHY_COUNT
|
||||
#define MPI3_EVENT_SAS_TOPO_PHY_COUNT (1)
|
||||
#endif
|
||||
struct mpi3_event_sas_topo_phy_entry {
|
||||
__le16 attached_dev_handle;
|
||||
u8 link_rate;
|
||||
@@ -496,7 +493,7 @@ struct mpi3_event_data_sas_topology_change_list {
|
||||
u8 start_phy_num;
|
||||
u8 exp_status;
|
||||
u8 io_unit_port;
|
||||
struct mpi3_event_sas_topo_phy_entry phy_entry[MPI3_EVENT_SAS_TOPO_PHY_COUNT];
|
||||
struct mpi3_event_sas_topo_phy_entry phy_entry[] __counted_by(num_entries);
|
||||
};
|
||||
|
||||
#define MPI3_EVENT_SAS_TOPO_ES_NO_EXPANDER (0x00)
|
||||
@@ -545,9 +542,6 @@ struct mpi3_event_data_pcie_enumeration {
|
||||
#define MPI3_EVENT_PCIE_ENUM_ES_MAX_SWITCHES_EXCEED (0x40000000)
|
||||
#define MPI3_EVENT_PCIE_ENUM_ES_MAX_DEVICES_EXCEED (0x20000000)
|
||||
#define MPI3_EVENT_PCIE_ENUM_ES_RESOURCES_EXHAUSTED (0x10000000)
|
||||
#ifndef MPI3_EVENT_PCIE_TOPO_PORT_COUNT
|
||||
#define MPI3_EVENT_PCIE_TOPO_PORT_COUNT (1)
|
||||
#endif
|
||||
struct mpi3_event_pcie_topo_port_entry {
|
||||
__le16 attached_dev_handle;
|
||||
u8 port_status;
|
||||
@@ -588,7 +582,7 @@ struct mpi3_event_data_pcie_topology_change_list {
|
||||
u8 switch_status;
|
||||
u8 io_unit_port;
|
||||
__le32 reserved0c;
|
||||
struct mpi3_event_pcie_topo_port_entry port_entry[MPI3_EVENT_PCIE_TOPO_PORT_COUNT];
|
||||
struct mpi3_event_pcie_topo_port_entry port_entry[] __counted_by(num_entries);
|
||||
};
|
||||
|
||||
#define MPI3_EVENT_PCIE_TOPO_SS_NO_PCIE_SWITCH (0x00)
|
||||
|
||||
@@ -57,8 +57,8 @@ extern struct list_head mrioc_list;
|
||||
extern int prot_mask;
|
||||
extern atomic64_t event_counter;
|
||||
|
||||
#define MPI3MR_DRIVER_VERSION "8.9.1.0.51"
|
||||
#define MPI3MR_DRIVER_RELDATE "29-May-2024"
|
||||
#define MPI3MR_DRIVER_VERSION "8.10.0.5.50"
|
||||
#define MPI3MR_DRIVER_RELDATE "08-Aug-2024"
|
||||
|
||||
#define MPI3MR_DRIVER_NAME "mpi3mr"
|
||||
#define MPI3MR_DRIVER_LICENSE "GPL"
|
||||
@@ -213,6 +213,7 @@ extern atomic64_t event_counter;
|
||||
#define MPI3MR_HDB_QUERY_ELEMENT_TRIGGER_FORMAT_INDEX 0
|
||||
#define MPI3MR_HDB_QUERY_ELEMENT_TRIGGER_FORMAT_DATA 1
|
||||
|
||||
#define MPI3MR_THRESHOLD_REPLY_COUNT 100
|
||||
|
||||
/* SGE Flag definition */
|
||||
#define MPI3MR_SGEFLAGS_SYSTEM_SIMPLE_END_OF_LIST \
|
||||
@@ -1059,7 +1060,6 @@ struct scmd_priv {
|
||||
* @sbq_lock: Sense buffer queue lock
|
||||
* @sbq_host_index: Sense buffer queuehost index
|
||||
* @event_masks: Event mask bitmap
|
||||
* @fwevt_worker_name: Firmware event worker thread name
|
||||
* @fwevt_worker_thread: Firmware event worker thread
|
||||
* @fwevt_lock: Firmware event lock
|
||||
* @fwevt_list: Firmware event list
|
||||
@@ -1240,7 +1240,6 @@ struct mpi3mr_ioc {
|
||||
u32 sbq_host_index;
|
||||
u32 event_masks[MPI3_EVENT_NOTIFY_EVENTMASK_WORDS];
|
||||
|
||||
char fwevt_worker_name[MPI3MR_NAME_LENGTH];
|
||||
struct workqueue_struct *fwevt_worker_thread;
|
||||
spinlock_t fwevt_lock;
|
||||
struct list_head fwevt_list;
|
||||
|
||||
@@ -345,6 +345,7 @@ static void mpi3mr_process_admin_reply_desc(struct mpi3mr_ioc *mrioc,
|
||||
{
|
||||
u16 reply_desc_type, host_tag = 0;
|
||||
u16 ioc_status = MPI3_IOCSTATUS_SUCCESS;
|
||||
u16 masked_ioc_status = MPI3_IOCSTATUS_SUCCESS;
|
||||
u32 ioc_loginfo = 0, sense_count = 0;
|
||||
struct mpi3_status_reply_descriptor *status_desc;
|
||||
struct mpi3_address_reply_descriptor *addr_desc;
|
||||
@@ -366,8 +367,8 @@ static void mpi3mr_process_admin_reply_desc(struct mpi3mr_ioc *mrioc,
|
||||
if (ioc_status &
|
||||
MPI3_REPLY_DESCRIPT_STATUS_IOCSTATUS_LOGINFOAVAIL)
|
||||
ioc_loginfo = le32_to_cpu(status_desc->ioc_log_info);
|
||||
ioc_status &= MPI3_REPLY_DESCRIPT_STATUS_IOCSTATUS_STATUS_MASK;
|
||||
mpi3mr_reply_trigger(mrioc, ioc_status, ioc_loginfo);
|
||||
masked_ioc_status = ioc_status & MPI3_IOCSTATUS_STATUS_MASK;
|
||||
mpi3mr_reply_trigger(mrioc, masked_ioc_status, ioc_loginfo);
|
||||
break;
|
||||
case MPI3_REPLY_DESCRIPT_FLAGS_TYPE_ADDRESS_REPLY:
|
||||
addr_desc = (struct mpi3_address_reply_descriptor *)reply_desc;
|
||||
@@ -380,7 +381,7 @@ static void mpi3mr_process_admin_reply_desc(struct mpi3mr_ioc *mrioc,
|
||||
if (ioc_status &
|
||||
MPI3_REPLY_DESCRIPT_STATUS_IOCSTATUS_LOGINFOAVAIL)
|
||||
ioc_loginfo = le32_to_cpu(def_reply->ioc_log_info);
|
||||
ioc_status &= MPI3_REPLY_DESCRIPT_STATUS_IOCSTATUS_STATUS_MASK;
|
||||
masked_ioc_status = ioc_status & MPI3_IOCSTATUS_STATUS_MASK;
|
||||
if (def_reply->function == MPI3_FUNCTION_SCSI_IO) {
|
||||
scsi_reply = (struct mpi3_scsi_io_reply *)def_reply;
|
||||
sense_buf = mpi3mr_get_sensebuf_virt_addr(mrioc,
|
||||
@@ -393,7 +394,7 @@ static void mpi3mr_process_admin_reply_desc(struct mpi3mr_ioc *mrioc,
|
||||
sshdr.asc, sshdr.ascq);
|
||||
}
|
||||
}
|
||||
mpi3mr_reply_trigger(mrioc, ioc_status, ioc_loginfo);
|
||||
mpi3mr_reply_trigger(mrioc, masked_ioc_status, ioc_loginfo);
|
||||
break;
|
||||
case MPI3_REPLY_DESCRIPT_FLAGS_TYPE_SUCCESS:
|
||||
success_desc = (struct mpi3_success_reply_descriptor *)reply_desc;
|
||||
@@ -408,7 +409,10 @@ static void mpi3mr_process_admin_reply_desc(struct mpi3mr_ioc *mrioc,
|
||||
if (cmdptr->state & MPI3MR_CMD_PENDING) {
|
||||
cmdptr->state |= MPI3MR_CMD_COMPLETE;
|
||||
cmdptr->ioc_loginfo = ioc_loginfo;
|
||||
cmdptr->ioc_status = ioc_status;
|
||||
if (host_tag == MPI3MR_HOSTTAG_BSG_CMDS)
|
||||
cmdptr->ioc_status = ioc_status;
|
||||
else
|
||||
cmdptr->ioc_status = masked_ioc_status;
|
||||
cmdptr->state &= ~MPI3MR_CMD_PENDING;
|
||||
if (def_reply) {
|
||||
cmdptr->state |= MPI3MR_CMD_REPLY_VALID;
|
||||
@@ -439,6 +443,7 @@ int mpi3mr_process_admin_reply_q(struct mpi3mr_ioc *mrioc)
|
||||
u32 admin_reply_ci = mrioc->admin_reply_ci;
|
||||
u32 num_admin_replies = 0;
|
||||
u64 reply_dma = 0;
|
||||
u16 threshold_comps = 0;
|
||||
struct mpi3_default_reply_descriptor *reply_desc;
|
||||
|
||||
if (!atomic_add_unless(&mrioc->admin_reply_q_in_use, 1, 1))
|
||||
@@ -462,6 +467,7 @@ int mpi3mr_process_admin_reply_q(struct mpi3mr_ioc *mrioc)
|
||||
if (reply_dma)
|
||||
mpi3mr_repost_reply_buf(mrioc, reply_dma);
|
||||
num_admin_replies++;
|
||||
threshold_comps++;
|
||||
if (++admin_reply_ci == mrioc->num_admin_replies) {
|
||||
admin_reply_ci = 0;
|
||||
exp_phase ^= 1;
|
||||
@@ -472,6 +478,11 @@ int mpi3mr_process_admin_reply_q(struct mpi3mr_ioc *mrioc)
|
||||
if ((le16_to_cpu(reply_desc->reply_flags) &
|
||||
MPI3_REPLY_DESCRIPT_FLAGS_PHASE_MASK) != exp_phase)
|
||||
break;
|
||||
if (threshold_comps == MPI3MR_THRESHOLD_REPLY_COUNT) {
|
||||
writel(admin_reply_ci,
|
||||
&mrioc->sysif_regs->admin_reply_queue_ci);
|
||||
threshold_comps = 0;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
writel(admin_reply_ci, &mrioc->sysif_regs->admin_reply_queue_ci);
|
||||
@@ -525,7 +536,7 @@ int mpi3mr_process_op_reply_q(struct mpi3mr_ioc *mrioc,
|
||||
u32 num_op_reply = 0;
|
||||
u64 reply_dma = 0;
|
||||
struct mpi3_default_reply_descriptor *reply_desc;
|
||||
u16 req_q_idx = 0, reply_qidx;
|
||||
u16 req_q_idx = 0, reply_qidx, threshold_comps = 0;
|
||||
|
||||
reply_qidx = op_reply_q->qid - 1;
|
||||
|
||||
@@ -556,6 +567,7 @@ int mpi3mr_process_op_reply_q(struct mpi3mr_ioc *mrioc,
|
||||
if (reply_dma)
|
||||
mpi3mr_repost_reply_buf(mrioc, reply_dma);
|
||||
num_op_reply++;
|
||||
threshold_comps++;
|
||||
|
||||
if (++reply_ci == op_reply_q->num_replies) {
|
||||
reply_ci = 0;
|
||||
@@ -577,13 +589,19 @@ int mpi3mr_process_op_reply_q(struct mpi3mr_ioc *mrioc,
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (threshold_comps == MPI3MR_THRESHOLD_REPLY_COUNT) {
|
||||
writel(reply_ci,
|
||||
&mrioc->sysif_regs->oper_queue_indexes[reply_qidx].consumer_index);
|
||||
atomic_sub(threshold_comps, &op_reply_q->pend_ios);
|
||||
threshold_comps = 0;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
writel(reply_ci,
|
||||
&mrioc->sysif_regs->oper_queue_indexes[reply_qidx].consumer_index);
|
||||
op_reply_q->ci = reply_ci;
|
||||
op_reply_q->ephase = exp_phase;
|
||||
|
||||
atomic_sub(threshold_comps, &op_reply_q->pend_ios);
|
||||
atomic_dec(&op_reply_q->in_use);
|
||||
return num_op_reply;
|
||||
}
|
||||
@@ -2742,8 +2760,8 @@ void mpi3mr_start_watchdog(struct mpi3mr_ioc *mrioc)
|
||||
snprintf(mrioc->watchdog_work_q_name,
|
||||
sizeof(mrioc->watchdog_work_q_name), "watchdog_%s%d", mrioc->name,
|
||||
mrioc->id);
|
||||
mrioc->watchdog_work_q =
|
||||
create_singlethread_workqueue(mrioc->watchdog_work_q_name);
|
||||
mrioc->watchdog_work_q = alloc_ordered_workqueue(
|
||||
"%s", WQ_MEM_RECLAIM, mrioc->watchdog_work_q_name);
|
||||
if (!mrioc->watchdog_work_q) {
|
||||
ioc_err(mrioc, "%s: failed (line=%d)\n", __func__, __LINE__);
|
||||
return;
|
||||
|
||||
@@ -5317,10 +5317,8 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
else
|
||||
scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC);
|
||||
|
||||
snprintf(mrioc->fwevt_worker_name, sizeof(mrioc->fwevt_worker_name),
|
||||
"%s%d_fwevt_wrkr", mrioc->driver_name, mrioc->id);
|
||||
mrioc->fwevt_worker_thread = alloc_ordered_workqueue(
|
||||
mrioc->fwevt_worker_name, 0);
|
||||
"%s%d_fwevt_wrkr", 0, mrioc->driver_name, mrioc->id);
|
||||
if (!mrioc->fwevt_worker_thread) {
|
||||
ioc_err(mrioc, "failure at %s:%d/%s()!\n",
|
||||
__FILE__, __LINE__, __func__);
|
||||
|
||||
@@ -846,8 +846,8 @@ mpt3sas_base_start_watchdog(struct MPT3SAS_ADAPTER *ioc)
|
||||
snprintf(ioc->fault_reset_work_q_name,
|
||||
sizeof(ioc->fault_reset_work_q_name), "poll_%s%d_status",
|
||||
ioc->driver_name, ioc->id);
|
||||
ioc->fault_reset_work_q =
|
||||
create_singlethread_workqueue(ioc->fault_reset_work_q_name);
|
||||
ioc->fault_reset_work_q = alloc_ordered_workqueue(
|
||||
"%s", WQ_MEM_RECLAIM, ioc->fault_reset_work_q_name);
|
||||
if (!ioc->fault_reset_work_q) {
|
||||
ioc_err(ioc, "%s: failed (line=%d)\n", __func__, __LINE__);
|
||||
return;
|
||||
|
||||
@@ -1162,8 +1162,7 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc);
|
||||
* @fault_reset_work_q_name: fw fault work queue
|
||||
* @fault_reset_work_q: ""
|
||||
* @fault_reset_work: ""
|
||||
* @firmware_event_name: fw event work queue
|
||||
* @firmware_event_thread: ""
|
||||
* @firmware_event_thread: fw event work queue
|
||||
* @fw_event_lock:
|
||||
* @fw_event_list: list of fw events
|
||||
* @current_evet: current processing firmware event
|
||||
@@ -1351,7 +1350,6 @@ struct MPT3SAS_ADAPTER {
|
||||
struct delayed_work fault_reset_work;
|
||||
|
||||
/* fw event handler */
|
||||
char firmware_event_name[20];
|
||||
struct workqueue_struct *firmware_event_thread;
|
||||
spinlock_t fw_event_lock;
|
||||
struct list_head fw_event_list;
|
||||
|
||||
@@ -12301,10 +12301,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC);
|
||||
|
||||
/* event thread */
|
||||
snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name),
|
||||
"fw_event_%s%d", ioc->driver_name, ioc->id);
|
||||
ioc->firmware_event_thread = alloc_ordered_workqueue(
|
||||
ioc->firmware_event_name, 0);
|
||||
"fw_event_%s%d", 0, ioc->driver_name, ioc->id);
|
||||
if (!ioc->firmware_event_thread) {
|
||||
ioc_err(ioc, "failure at %s:%d/%s()!\n",
|
||||
__FILE__, __LINE__, __func__);
|
||||
|
||||
+2
-3
@@ -112,9 +112,8 @@ static bool myrb_create_mempools(struct pci_dev *pdev, struct myrb_hba *cb)
|
||||
return false;
|
||||
}
|
||||
|
||||
snprintf(cb->work_q_name, sizeof(cb->work_q_name),
|
||||
"myrb_wq_%d", cb->host->host_no);
|
||||
cb->work_q = create_singlethread_workqueue(cb->work_q_name);
|
||||
cb->work_q = alloc_ordered_workqueue("myrb_wq_%d", WQ_MEM_RECLAIM,
|
||||
cb->host->host_no);
|
||||
if (!cb->work_q) {
|
||||
dma_pool_destroy(cb->dcdb_pool);
|
||||
cb->dcdb_pool = NULL;
|
||||
|
||||
@@ -712,7 +712,6 @@ struct myrb_hba {
|
||||
struct Scsi_Host *host;
|
||||
|
||||
struct workqueue_struct *work_q;
|
||||
char work_q_name[20];
|
||||
struct delayed_work monitor_work;
|
||||
unsigned long primary_monitor_time;
|
||||
unsigned long secondary_monitor_time;
|
||||
|
||||
+2
-3
@@ -2206,9 +2206,8 @@ static bool myrs_create_mempools(struct pci_dev *pdev, struct myrs_hba *cs)
|
||||
return false;
|
||||
}
|
||||
|
||||
snprintf(cs->work_q_name, sizeof(cs->work_q_name),
|
||||
"myrs_wq_%d", shost->host_no);
|
||||
cs->work_q = create_singlethread_workqueue(cs->work_q_name);
|
||||
cs->work_q = alloc_ordered_workqueue("myrs_wq_%d", WQ_MEM_RECLAIM,
|
||||
shost->host_no);
|
||||
if (!cs->work_q) {
|
||||
dma_pool_destroy(cs->dcdb_pool);
|
||||
cs->dcdb_pool = NULL;
|
||||
|
||||
@@ -904,7 +904,6 @@ struct myrs_hba {
|
||||
bool disable_enc_msg;
|
||||
|
||||
struct workqueue_struct *work_q;
|
||||
char work_q_name[20];
|
||||
struct delayed_work monitor_work;
|
||||
unsigned long primary_monitor_time;
|
||||
unsigned long secondary_monitor_time;
|
||||
|
||||
@@ -3372,9 +3372,8 @@ retry_probe:
|
||||
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_INFO, "qedf->io_mempool=%p.\n",
|
||||
qedf->io_mempool);
|
||||
|
||||
sprintf(host_buf, "qedf_%u_link",
|
||||
qedf->lport->host->host_no);
|
||||
qedf->link_update_wq = create_workqueue(host_buf);
|
||||
qedf->link_update_wq = alloc_workqueue("qedf_%u_link", WQ_MEM_RECLAIM,
|
||||
1, qedf->lport->host->host_no);
|
||||
INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update);
|
||||
INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery);
|
||||
INIT_DELAYED_WORK(&qedf->grcdump_work, qedf_wq_grcdump);
|
||||
@@ -3584,9 +3583,8 @@ retry_probe:
|
||||
ether_addr_copy(params.ll2_mac_address, qedf->mac);
|
||||
|
||||
/* Start LL2 processing thread */
|
||||
snprintf(host_buf, 20, "qedf_%d_ll2", host->host_no);
|
||||
qedf->ll2_recv_wq =
|
||||
create_workqueue(host_buf);
|
||||
qedf->ll2_recv_wq = alloc_workqueue("qedf_%d_ll2", WQ_MEM_RECLAIM, 1,
|
||||
host->host_no);
|
||||
if (!qedf->ll2_recv_wq) {
|
||||
QEDF_ERR(&(qedf->dbg_ctx), "Failed to LL2 workqueue.\n");
|
||||
rc = -ENOMEM;
|
||||
@@ -3627,9 +3625,8 @@ retry_probe:
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(host_buf, "qedf_%u_timer", qedf->lport->host->host_no);
|
||||
qedf->timer_work_queue =
|
||||
create_workqueue(host_buf);
|
||||
qedf->timer_work_queue = alloc_workqueue("qedf_%u_timer",
|
||||
WQ_MEM_RECLAIM, 1, qedf->lport->host->host_no);
|
||||
if (!qedf->timer_work_queue) {
|
||||
QEDF_ERR(&(qedf->dbg_ctx), "Failed to start timer "
|
||||
"workqueue.\n");
|
||||
@@ -3641,7 +3638,8 @@ retry_probe:
|
||||
if (mode != QEDF_MODE_RECOVERY) {
|
||||
sprintf(host_buf, "qedf_%u_dpc",
|
||||
qedf->lport->host->host_no);
|
||||
qedf->dpc_wq = create_workqueue(host_buf);
|
||||
qedf->dpc_wq =
|
||||
alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
|
||||
}
|
||||
INIT_DELAYED_WORK(&qedf->recovery_work, qedf_recovery_handler);
|
||||
|
||||
@@ -4182,7 +4180,7 @@ static int __init qedf_init(void)
|
||||
goto err3;
|
||||
}
|
||||
|
||||
qedf_io_wq = create_workqueue("qedf_io_wq");
|
||||
qedf_io_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, "qedf_io_wq");
|
||||
if (!qedf_io_wq) {
|
||||
QEDF_ERR(NULL, "Could not create qedf_io_wq.\n");
|
||||
goto err4;
|
||||
|
||||
@@ -2767,7 +2767,8 @@ retry_probe:
|
||||
}
|
||||
|
||||
sprintf(host_buf, "host_%d", qedi->shost->host_no);
|
||||
qedi->tmf_thread = create_singlethread_workqueue(host_buf);
|
||||
qedi->tmf_thread =
|
||||
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, host_buf);
|
||||
if (!qedi->tmf_thread) {
|
||||
QEDI_ERR(&qedi->dbg_ctx,
|
||||
"Unable to start tmf thread!\n");
|
||||
@@ -2775,8 +2776,9 @@ retry_probe:
|
||||
goto free_cid_que;
|
||||
}
|
||||
|
||||
sprintf(host_buf, "qedi_ofld%d", qedi->shost->host_no);
|
||||
qedi->offload_thread = create_workqueue(host_buf);
|
||||
qedi->offload_thread = alloc_workqueue("qedi_ofld%d",
|
||||
WQ_MEM_RECLAIM,
|
||||
1, qedi->shost->host_no);
|
||||
if (!qedi->offload_thread) {
|
||||
QEDI_ERR(&qedi->dbg_ctx,
|
||||
"Unable to start offload thread!\n");
|
||||
|
||||
@@ -2621,7 +2621,6 @@ typedef struct fc_port {
|
||||
struct kref sess_kref;
|
||||
struct qla_tgt *tgt;
|
||||
unsigned long expires;
|
||||
struct list_head del_list_entry;
|
||||
struct work_struct free_work;
|
||||
struct work_struct reg_work;
|
||||
uint64_t jiffies_at_registration;
|
||||
|
||||
@@ -3501,11 +3501,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
if (IS_QLA8031(ha) || IS_MCTP_CAPABLE(ha)) {
|
||||
sprintf(wq_name, "qla2xxx_%lu_dpc_lp_wq", base_vha->host_no);
|
||||
ha->dpc_lp_wq = create_singlethread_workqueue(wq_name);
|
||||
ha->dpc_lp_wq =
|
||||
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name);
|
||||
INIT_WORK(&ha->idc_aen, qla83xx_service_idc_aen);
|
||||
|
||||
sprintf(wq_name, "qla2xxx_%lu_dpc_hp_wq", base_vha->host_no);
|
||||
ha->dpc_hp_wq = create_singlethread_workqueue(wq_name);
|
||||
ha->dpc_hp_wq =
|
||||
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name);
|
||||
INIT_WORK(&ha->nic_core_reset, qla83xx_nic_core_reset_work);
|
||||
INIT_WORK(&ha->idc_state_handler,
|
||||
qla83xx_idc_state_handler_work);
|
||||
|
||||
@@ -8806,7 +8806,7 @@ skip_retry_init:
|
||||
DEBUG2(printk("scsi: %s: Starting kernel thread for "
|
||||
"qla4xxx_dpc\n", __func__));
|
||||
sprintf(buf, "qla4xxx_%lu_dpc", ha->host_no);
|
||||
ha->dpc_thread = create_singlethread_workqueue(buf);
|
||||
ha->dpc_thread = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, buf);
|
||||
if (!ha->dpc_thread) {
|
||||
ql4_printk(KERN_WARNING, ha, "Unable to start DPC thread!\n");
|
||||
ret = -ENODEV;
|
||||
|
||||
@@ -1988,8 +1988,15 @@ void scsi_init_limits(struct Scsi_Host *shost, struct queue_limits *lim)
|
||||
if (shost->no_highmem)
|
||||
lim->features |= BLK_FEAT_BOUNCE_HIGH;
|
||||
|
||||
dma_set_seg_boundary(dev, shost->dma_boundary);
|
||||
dma_set_max_seg_size(dev, shost->max_segment_size);
|
||||
/*
|
||||
* Propagate the DMA formation properties to the dma-mapping layer as
|
||||
* a courtesy service to the LLDDs. This needs to check that the buses
|
||||
* actually support the DMA API first, though.
|
||||
*/
|
||||
if (dev->dma_parms) {
|
||||
dma_set_seg_boundary(dev, shost->dma_boundary);
|
||||
dma_set_max_seg_size(dev, shost->max_segment_size);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(scsi_init_limits);
|
||||
|
||||
|
||||
@@ -441,18 +441,13 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
|
||||
fc_host->next_vport_number = 0;
|
||||
fc_host->npiv_vports_inuse = 0;
|
||||
|
||||
snprintf(fc_host->work_q_name, sizeof(fc_host->work_q_name),
|
||||
"fc_wq_%d", shost->host_no);
|
||||
fc_host->work_q = alloc_workqueue("%s", 0, 0, fc_host->work_q_name);
|
||||
fc_host->work_q = alloc_workqueue("fc_wq_%d", 0, 0, shost->host_no);
|
||||
if (!fc_host->work_q)
|
||||
return -ENOMEM;
|
||||
|
||||
fc_host->dev_loss_tmo = fc_dev_loss_tmo;
|
||||
snprintf(fc_host->devloss_work_q_name,
|
||||
sizeof(fc_host->devloss_work_q_name),
|
||||
"fc_dl_%d", shost->host_no);
|
||||
fc_host->devloss_work_q = alloc_workqueue("%s", 0, 0,
|
||||
fc_host->devloss_work_q_name);
|
||||
fc_host->devloss_work_q = alloc_workqueue("fc_dl_%d", 0, 0,
|
||||
shost->host_no);
|
||||
if (!fc_host->devloss_work_q) {
|
||||
destroy_workqueue(fc_host->work_q);
|
||||
fc_host->work_q = NULL;
|
||||
|
||||
+1
-1
@@ -1382,7 +1382,7 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)
|
||||
if (protect && sdkp->protection_type == T10_PI_TYPE2_PROTECTION) {
|
||||
ret = sd_setup_rw32_cmnd(cmd, write, lba, nr_blocks,
|
||||
protect | fua, dld);
|
||||
} else if (rq->cmd_flags & REQ_ATOMIC && write) {
|
||||
} else if (rq->cmd_flags & REQ_ATOMIC) {
|
||||
ret = sd_setup_atomic_cmnd(cmd, lba, nr_blocks,
|
||||
sdkp->use_atomic_write_boundary,
|
||||
protect | fua);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user