* Re: [PATCH V8 4/5] libsas: Align SMP req/resp to dma_get_cache_alignment()
From: Marek Szyprowski @ 2017-10-17 11:55 UTC (permalink / raw)
To: Huacai Chen, Christoph Hellwig
Cc: Robin Murphy, Andrew Morton, Fuxin Zhang, linux-kernel,
Ralf Baechle, James Hogan, linux-mips, James E . J . Bottomley,
Martin K . Petersen, linux-scsi, Tejun Heo, linux-ide, stable
In-Reply-To: <1508227542-13165-4-git-send-email-chenhc@lemote.com>
Hi Huacai,
On 2017-10-17 10:05, Huacai Chen wrote:
> In non-coherent DMA mode, kernel uses cache flushing operations to
> maintain I/O coherency, so libsas's SMP request/response should be
> aligned to ARCH_DMA_MINALIGN. Otherwise, If a DMA buffer and a kernel
> structure share a same cache line, and if the kernel structure has
> dirty data, cache_invalidate (no writeback) will cause data corruption.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> ---
> drivers/scsi/libsas/sas_expander.c | 93 +++++++++++++++++++++++---------------
> 1 file changed, 57 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
> index 6b4fd23..124a44b 100644
> --- a/drivers/scsi/libsas/sas_expander.c
> +++ b/drivers/scsi/libsas/sas_expander.c
> @@ -164,17 +164,17 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
>
> /* ---------- Allocations ---------- */
>
> -static inline void *alloc_smp_req(int size)
> +static inline void *alloc_smp_req(int size, int align)
> {
> - u8 *p = kzalloc(size, GFP_KERNEL);
> + u8 *p = kzalloc(ALIGN(size, align), GFP_KERNEL);
If I remember correctly, kernel guarantees that each kmalloced buffer is
always at least aligned to the CPU cache line, so CPU cache can be
invalidated on the allocated buffer without corrupting anything else.
Taking this into account, I wonder if the above change make sense.
Have you experienced any problems without this change?
> if (p)
> p[0] = SMP_REQUEST;
> return p;
> }
>
> -static inline void *alloc_smp_resp(int size)
> +static inline void *alloc_smp_resp(int size, int align)
> {
> - return kzalloc(size, GFP_KERNEL);
> + return kzalloc(ALIGN(size, align), GFP_KERNEL);
Save a above.
> }
>
> static char sas_route_char(struct domain_device *dev, struct ex_phy *phy)
> @@ -403,15 +403,17 @@ static int sas_ex_phy_discover_helper(struct domain_device *dev, u8 *disc_req,
> int sas_ex_phy_discover(struct domain_device *dev, int single)
> {
> struct expander_device *ex = &dev->ex_dev;
> - int res = 0;
> + int res = 0, align;
> u8 *disc_req;
> u8 *disc_resp;
>
> - disc_req = alloc_smp_req(DISCOVER_REQ_SIZE);
> + align = dma_get_cache_alignment(&dev->phy->dev);
> +
> + disc_req = alloc_smp_req(DISCOVER_REQ_SIZE, align);
> if (!disc_req)
> return -ENOMEM;
>
> - disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE);
> + disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE, align);
> if (!disc_resp) {
> kfree(disc_req);
> return -ENOMEM;
> @@ -480,14 +482,15 @@ static int sas_ex_general(struct domain_device *dev)
> {
> u8 *rg_req;
> struct smp_resp *rg_resp;
> - int res;
> - int i;
> + int i, res, align;
>
> - rg_req = alloc_smp_req(RG_REQ_SIZE);
> + align = dma_get_cache_alignment(&dev->phy->dev);
> +
> + rg_req = alloc_smp_req(RG_REQ_SIZE, align);
> if (!rg_req)
> return -ENOMEM;
>
> - rg_resp = alloc_smp_resp(RG_RESP_SIZE);
> + rg_resp = alloc_smp_resp(RG_RESP_SIZE, align);
> if (!rg_resp) {
> kfree(rg_req);
> return -ENOMEM;
> @@ -552,13 +555,15 @@ static int sas_ex_manuf_info(struct domain_device *dev)
> {
> u8 *mi_req;
> u8 *mi_resp;
> - int res;
> + int res, align;
>
> - mi_req = alloc_smp_req(MI_REQ_SIZE);
> + align = dma_get_cache_alignment(&dev->phy->dev);
> +
> + mi_req = alloc_smp_req(MI_REQ_SIZE, align);
> if (!mi_req)
> return -ENOMEM;
>
> - mi_resp = alloc_smp_resp(MI_RESP_SIZE);
> + mi_resp = alloc_smp_resp(MI_RESP_SIZE, align);
> if (!mi_resp) {
> kfree(mi_req);
> return -ENOMEM;
> @@ -593,13 +598,15 @@ int sas_smp_phy_control(struct domain_device *dev, int phy_id,
> {
> u8 *pc_req;
> u8 *pc_resp;
> - int res;
> + int res, align;
> +
> + align = dma_get_cache_alignment(&dev->phy->dev);
>
> - pc_req = alloc_smp_req(PC_REQ_SIZE);
> + pc_req = alloc_smp_req(PC_REQ_SIZE, align);
> if (!pc_req)
> return -ENOMEM;
>
> - pc_resp = alloc_smp_resp(PC_RESP_SIZE);
> + pc_resp = alloc_smp_resp(PC_RESP_SIZE, align);
> if (!pc_resp) {
> kfree(pc_req);
> return -ENOMEM;
> @@ -664,17 +671,19 @@ static int sas_dev_present_in_domain(struct asd_sas_port *port,
> #define RPEL_RESP_SIZE 32
> int sas_smp_get_phy_events(struct sas_phy *phy)
> {
> - int res;
> + int res, align;
> u8 *req;
> u8 *resp;
> struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent);
> struct domain_device *dev = sas_find_dev_by_rphy(rphy);
>
> - req = alloc_smp_req(RPEL_REQ_SIZE);
> + align = dma_get_cache_alignment(&phy->dev);
> +
> + req = alloc_smp_req(RPEL_REQ_SIZE, align);
> if (!req)
> return -ENOMEM;
>
> - resp = alloc_smp_resp(RPEL_RESP_SIZE);
> + resp = alloc_smp_resp(RPEL_RESP_SIZE, align);
> if (!resp) {
> kfree(req);
> return -ENOMEM;
> @@ -709,7 +718,8 @@ int sas_get_report_phy_sata(struct domain_device *dev, int phy_id,
> struct smp_resp *rps_resp)
> {
> int res;
> - u8 *rps_req = alloc_smp_req(RPS_REQ_SIZE);
> + int align = dma_get_cache_alignment(&dev->phy->dev);
> + u8 *rps_req = alloc_smp_req(RPS_REQ_SIZE, align);
> u8 *resp = (u8 *)rps_resp;
>
> if (!rps_req)
> @@ -1398,7 +1408,7 @@ static int sas_check_parent_topology(struct domain_device *child)
> static int sas_configure_present(struct domain_device *dev, int phy_id,
> u8 *sas_addr, int *index, int *present)
> {
> - int i, res = 0;
> + int i, res = 0, align;
> struct expander_device *ex = &dev->ex_dev;
> struct ex_phy *phy = &ex->ex_phy[phy_id];
> u8 *rri_req;
> @@ -1406,12 +1416,13 @@ static int sas_configure_present(struct domain_device *dev, int phy_id,
>
> *present = 0;
> *index = 0;
> + align = dma_get_cache_alignment(&dev->phy->dev);
>
> - rri_req = alloc_smp_req(RRI_REQ_SIZE);
> + rri_req = alloc_smp_req(RRI_REQ_SIZE, align);
> if (!rri_req)
> return -ENOMEM;
>
> - rri_resp = alloc_smp_resp(RRI_RESP_SIZE);
> + rri_resp = alloc_smp_resp(RRI_RESP_SIZE, align);
> if (!rri_resp) {
> kfree(rri_req);
> return -ENOMEM;
> @@ -1472,15 +1483,17 @@ static int sas_configure_present(struct domain_device *dev, int phy_id,
> static int sas_configure_set(struct domain_device *dev, int phy_id,
> u8 *sas_addr, int index, int include)
> {
> - int res;
> + int res, align;
> u8 *cri_req;
> u8 *cri_resp;
>
> - cri_req = alloc_smp_req(CRI_REQ_SIZE);
> + align = dma_get_cache_alignment(&dev->phy->dev);
> +
> + cri_req = alloc_smp_req(CRI_REQ_SIZE, align);
> if (!cri_req)
> return -ENOMEM;
>
> - cri_resp = alloc_smp_resp(CRI_RESP_SIZE);
> + cri_resp = alloc_smp_resp(CRI_RESP_SIZE, align);
> if (!cri_resp) {
> kfree(cri_req);
> return -ENOMEM;
> @@ -1689,10 +1702,12 @@ int sas_discover_root_expander(struct domain_device *dev)
> static int sas_get_phy_discover(struct domain_device *dev,
> int phy_id, struct smp_resp *disc_resp)
> {
> - int res;
> + int res, align;
> u8 *disc_req;
>
> - disc_req = alloc_smp_req(DISCOVER_REQ_SIZE);
> + align = dma_get_cache_alignment(&dev->phy->dev);
> +
> + disc_req = alloc_smp_req(DISCOVER_REQ_SIZE, align);
> if (!disc_req)
> return -ENOMEM;
>
> @@ -1715,10 +1730,12 @@ static int sas_get_phy_discover(struct domain_device *dev,
> static int sas_get_phy_change_count(struct domain_device *dev,
> int phy_id, int *pcc)
> {
> - int res;
> + int res, align;
> struct smp_resp *disc_resp;
>
> - disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE);
> + align = dma_get_cache_alignment(&dev->phy->dev);
> +
> + disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE, align);
> if (!disc_resp)
> return -ENOMEM;
>
> @@ -1733,11 +1750,13 @@ static int sas_get_phy_change_count(struct domain_device *dev,
> static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id,
> u8 *sas_addr, enum sas_device_type *type)
> {
> - int res;
> + int res, align;
> struct smp_resp *disc_resp;
> struct discover_resp *dr;
>
> - disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE);
> + align = dma_get_cache_alignment(&dev->phy->dev);
> +
> + disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE, align);
> if (!disc_resp)
> return -ENOMEM;
> dr = &disc_resp->disc;
> @@ -1787,15 +1806,17 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
>
> static int sas_get_ex_change_count(struct domain_device *dev, int *ecc)
> {
> - int res;
> + int res, align;
> u8 *rg_req;
> struct smp_resp *rg_resp;
>
> - rg_req = alloc_smp_req(RG_REQ_SIZE);
> + align = dma_get_cache_alignment(&dev->phy->dev);
> +
> + rg_req = alloc_smp_req(RG_REQ_SIZE, align);
> if (!rg_req)
> return -ENOMEM;
>
> - rg_resp = alloc_smp_resp(RG_RESP_SIZE);
> + rg_resp = alloc_smp_resp(RG_RESP_SIZE, align);
> if (!rg_resp) {
> kfree(rg_req);
> return -ENOMEM;
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply
* Re: [PATCH V8 5/5] libata: Align DMA buffer to dma_get_cache_alignment()
From: Sergei Shtylyov @ 2017-10-17 9:43 UTC (permalink / raw)
To: Huacai Chen, Christoph Hellwig
Cc: Marek Szyprowski, Robin Murphy, Andrew Morton, Fuxin Zhang,
linux-kernel, Ralf Baechle, James Hogan, linux-mips,
James E . J . Bottomley, Martin K . Petersen, linux-scsi,
Tejun Heo, linux-ide, stable
In-Reply-To: <1508227542-13165-5-git-send-email-chenhc@lemote.com>
On 10/17/2017 11:05 AM, Huacai Chen wrote:
> In non-coherent DMA mode, kernel uses cache flushing operations to
> maintain I/O coherency, so in ata_do_dev_read_id() the DMA buffer
> should be aligned to ARCH_DMA_MINALIGN. Otherwise, If a DMA buffer
> and a kernel structure share a same cache line, and if the kernel
> structure has dirty data, cache_invalidate (no writeback) will cause
> data corruption.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> ---
> drivers/ata/libata-core.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index ee4c1ec..e134955 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -1833,8 +1833,19 @@ static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
> unsigned int ata_do_dev_read_id(struct ata_device *dev,
> struct ata_taskfile *tf, u16 *id)
> {
> - return ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE,
> - id, sizeof(id[0]) * ATA_ID_WORDS, 0);
> + u16 *devid;
> + int res, size = sizeof(u16) * ATA_ID_WORDS;
> +
> + if (IS_ALIGNED((unsigned long)id, dma_get_cache_alignment(&dev->tdev)))
> + res = ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE, id, size, 0);
> + else {
> + devid = kmalloc(size, GFP_KERNEL);
> + res = ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE, devid, size, 0);
> + memcpy(id, devid, size);
> + kfree(devid);
> + }
> +
> + return res;
This function is called only for the PIO mode commands, so I doubt this is
necessary...
MBR, Sergei
^ permalink raw reply
* [PATCH V8 5/5] libata: Align DMA buffer to dma_get_cache_alignment()
From: Huacai Chen @ 2017-10-17 8:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Marek Szyprowski, Robin Murphy, Andrew Morton, Fuxin Zhang,
linux-kernel, Ralf Baechle, James Hogan, linux-mips,
James E . J . Bottomley, Martin K . Petersen, linux-scsi,
Tejun Heo, linux-ide, Huacai Chen, stable
In-Reply-To: <1508227542-13165-1-git-send-email-chenhc@lemote.com>
In non-coherent DMA mode, kernel uses cache flushing operations to
maintain I/O coherency, so in ata_do_dev_read_id() the DMA buffer
should be aligned to ARCH_DMA_MINALIGN. Otherwise, If a DMA buffer
and a kernel structure share a same cache line, and if the kernel
structure has dirty data, cache_invalidate (no writeback) will cause
data corruption.
Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
drivers/ata/libata-core.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ee4c1ec..e134955 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1833,8 +1833,19 @@ static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
unsigned int ata_do_dev_read_id(struct ata_device *dev,
struct ata_taskfile *tf, u16 *id)
{
- return ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE,
- id, sizeof(id[0]) * ATA_ID_WORDS, 0);
+ u16 *devid;
+ int res, size = sizeof(u16) * ATA_ID_WORDS;
+
+ if (IS_ALIGNED((unsigned long)id, dma_get_cache_alignment(&dev->tdev)))
+ res = ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE, id, size, 0);
+ else {
+ devid = kmalloc(size, GFP_KERNEL);
+ res = ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE, devid, size, 0);
+ memcpy(id, devid, size);
+ kfree(devid);
+ }
+
+ return res;
}
/**
--
2.7.0
^ permalink raw reply related
* [PATCH V8 3/5] scsi: Align block queue to dma_get_cache_alignment()
From: Huacai Chen @ 2017-10-17 8:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Marek Szyprowski, Robin Murphy, Andrew Morton, Fuxin Zhang,
linux-kernel, Ralf Baechle, James Hogan, linux-mips,
James E . J . Bottomley, Martin K . Petersen, linux-scsi,
Tejun Heo, linux-ide, Huacai Chen, stable
In-Reply-To: <1508227542-13165-1-git-send-email-chenhc@lemote.com>
In non-coherent DMA mode, kernel uses cache flushing operations to
maintain I/O coherency, so scsi's block queue should be aligned to
ARCH_DMA_MINALIGN. Otherwise, If a DMA buffer and a kernel structure
share a same cache line, and if the kernel structure has dirty data,
cache_invalidate (no writeback) will cause data corruption.
Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
drivers/scsi/scsi_lib.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 9cf6a80..19abc2e 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2132,11 +2132,11 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
q->limits.cluster = 0;
/*
- * set a reasonable default alignment on word boundaries: the
- * host and device may alter it using
+ * set a reasonable default alignment on word/cacheline boundaries:
+ * the host and device may alter it using
* blk_queue_update_dma_alignment() later.
*/
- blk_queue_dma_alignment(q, 0x03);
+ blk_queue_dma_alignment(q, max(4, dma_get_cache_alignment(dev)) - 1);
}
EXPORT_SYMBOL_GPL(__scsi_init_queue);
--
2.7.0
^ permalink raw reply related
* [PATCH V8 2/5] MIPS: Implement dma_map_ops::get_cache_alignment()
From: Huacai Chen @ 2017-10-17 8:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Marek Szyprowski, Robin Murphy, Andrew Morton, Fuxin Zhang,
linux-kernel, Ralf Baechle, James Hogan, linux-mips,
James E . J . Bottomley, Martin K . Petersen, linux-scsi,
Tejun Heo, linux-ide, Huacai Chen, stable
In-Reply-To: <1508227542-13165-1-git-send-email-chenhc@lemote.com>
Currently, MIPS is an architecture which support coherent & noncoherent
devices co-exist. So implement get_cache_alignment() function pointer
in 'struct dma_map_ops' to return different dma alignments.
Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
arch/mips/cavium-octeon/dma-octeon.c | 3 ++-
arch/mips/include/asm/dma-coherence.h | 2 ++
arch/mips/loongson64/common/dma-swiotlb.c | 1 +
arch/mips/mm/dma-default.c | 11 ++++++++++-
arch/mips/netlogic/common/nlm-dma.c | 3 ++-
5 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index c64bd87..41c29a85 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -324,7 +324,8 @@ static struct octeon_dma_map_ops _octeon_pci_dma_map_ops = {
.sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
.sync_sg_for_device = octeon_dma_sync_sg_for_device,
.mapping_error = swiotlb_dma_mapping_error,
- .dma_supported = swiotlb_dma_supported
+ .dma_supported = swiotlb_dma_supported,
+ .get_cache_alignment = mips_dma_get_cache_alignment
},
};
diff --git a/arch/mips/include/asm/dma-coherence.h b/arch/mips/include/asm/dma-coherence.h
index 72d0eab..5f7a9fc 100644
--- a/arch/mips/include/asm/dma-coherence.h
+++ b/arch/mips/include/asm/dma-coherence.h
@@ -29,4 +29,6 @@ extern int hw_coherentio;
#define hw_coherentio 0
#endif /* CONFIG_DMA_MAYBE_COHERENT */
+int mips_dma_get_cache_alignment(struct device *dev);
+
#endif
diff --git a/arch/mips/loongson64/common/dma-swiotlb.c b/arch/mips/loongson64/common/dma-swiotlb.c
index 34486c1..17b9897 100644
--- a/arch/mips/loongson64/common/dma-swiotlb.c
+++ b/arch/mips/loongson64/common/dma-swiotlb.c
@@ -119,6 +119,7 @@ static const struct dma_map_ops loongson_dma_map_ops = {
.sync_sg_for_device = loongson_dma_sync_sg_for_device,
.mapping_error = swiotlb_dma_mapping_error,
.dma_supported = loongson_dma_supported,
+ .get_cache_alignment = mips_dma_get_cache_alignment
};
void __init plat_swiotlb_setup(void)
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index c01bd20..e8f0659 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -394,6 +394,14 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
EXPORT_SYMBOL(dma_cache_sync);
+int mips_dma_get_cache_alignment(struct device *dev)
+{
+ if (plat_device_is_coherent(dev))
+ return 1;
+ else
+ return ARCH_DMA_MINALIGN;
+}
+
static const struct dma_map_ops mips_default_dma_map_ops = {
.alloc = mips_dma_alloc_coherent,
.free = mips_dma_free_coherent,
@@ -407,7 +415,8 @@ static const struct dma_map_ops mips_default_dma_map_ops = {
.sync_sg_for_cpu = mips_dma_sync_sg_for_cpu,
.sync_sg_for_device = mips_dma_sync_sg_for_device,
.mapping_error = mips_dma_mapping_error,
- .dma_supported = mips_dma_supported
+ .dma_supported = mips_dma_supported,
+ .get_cache_alignment = mips_dma_get_cache_alignment
};
const struct dma_map_ops *mips_dma_map_ops = &mips_default_dma_map_ops;
diff --git a/arch/mips/netlogic/common/nlm-dma.c b/arch/mips/netlogic/common/nlm-dma.c
index 0ec9d9d..e9a9ddc 100644
--- a/arch/mips/netlogic/common/nlm-dma.c
+++ b/arch/mips/netlogic/common/nlm-dma.c
@@ -79,7 +79,8 @@ const struct dma_map_ops nlm_swiotlb_dma_ops = {
.sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
.sync_sg_for_device = swiotlb_sync_sg_for_device,
.mapping_error = swiotlb_dma_mapping_error,
- .dma_supported = swiotlb_dma_supported
+ .dma_supported = swiotlb_dma_supported,
+ .get_cache_alignment = mips_dma_get_cache_alignment
};
void __init plat_swiotlb_setup(void)
--
2.7.0
^ permalink raw reply related
* [PATCH V8 1/5] dma-mapping: Rework dma_get_cache_alignment()
From: Huacai Chen @ 2017-10-17 8:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Marek Szyprowski, Robin Murphy, Andrew Morton, Fuxin Zhang,
linux-kernel, Ralf Baechle, James Hogan, linux-mips,
James E . J . Bottomley, Martin K . Petersen, linux-scsi,
Tejun Heo, linux-ide, Huacai Chen, stable, Michael S . Tsirkin,
Pawel Osciak, Kyungmin Park, Michael Chan, Benjamin Herrenschmidt,
Ivan Mikhaylov <ivan@
Make dma_get_cache_alignment() to accept a 'dev' argument. As a result,
it can return different alignments due to different devices' I/O cache
coherency.
Currently, ARM/ARM64 and MIPS support coherent & noncoherent devices
co-exist. This may be extended in the future, so add a new function
pointer (i.e, get_cache_alignment) in 'struct dma_map_ops' as a generic
solution.
Cc: stable@vger.kernel.org
Cc: Michael S. Tsirkin <mst@mellanox.co.il>
Cc: Pawel Osciak <pawel@osciak.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ivan Mikhaylov <ivan@ru.ibm.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Andy Gross <agross@codeaurora.org>
Cc: Mark A. Greer <mgreer@animalcreek.com>
Cc: Robert Baldyga <r.baldyga@hackerion.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
drivers/infiniband/hw/mthca/mthca_main.c | 2 +-
drivers/media/v4l2-core/videobuf2-dma-contig.c | 2 +-
drivers/net/ethernet/broadcom/b44.c | 8 +++----
drivers/net/ethernet/ibm/emac/core.c | 22 ++++++++++-------
drivers/net/ethernet/ibm/emac/core.h | 6 ++---
drivers/net/ethernet/mellanox/mlx4/main.c | 2 +-
drivers/spi/spi-qup.c | 4 ++--
drivers/tty/serial/mpsc.c | 33 ++++++++++++++++++--------
drivers/tty/serial/samsung.c | 14 +++++------
include/linux/dma-mapping.h | 17 +++++++++----
10 files changed, 68 insertions(+), 42 deletions(-)
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index e36a9bc..078fe8d 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -416,7 +416,7 @@ static int mthca_init_icm(struct mthca_dev *mdev,
/* CPU writes to non-reserved MTTs, while HCA might DMA to reserved mtts */
mdev->limits.reserved_mtts = ALIGN(mdev->limits.reserved_mtts * mdev->limits.mtt_seg_size,
- dma_get_cache_alignment()) / mdev->limits.mtt_seg_size;
+ dma_get_cache_alignment(&mdev->pdev->dev)) / mdev->limits.mtt_seg_size;
mdev->mr_table.mtt_table = mthca_alloc_icm_table(mdev, init_hca->mtt_base,
mdev->limits.mtt_seg_size,
diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c
index 9f389f3..1f6a9b7 100644
--- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
@@ -484,7 +484,7 @@ static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr,
int ret = 0;
struct sg_table *sgt;
unsigned long contig_size;
- unsigned long dma_align = dma_get_cache_alignment();
+ unsigned long dma_align = dma_get_cache_alignment(dev);
/* Only cache aligned DMA transfers are reliable */
if (!IS_ALIGNED(vaddr | size, dma_align)) {
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index a1125d1..2f6ffe5 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -2344,6 +2344,10 @@ static int b44_init_one(struct ssb_device *sdev,
struct net_device *dev;
struct b44 *bp;
int err;
+ unsigned int dma_desc_align_size = dma_get_cache_alignment(sdev->dma_dev);
+
+ /* Setup paramaters for syncing RX/TX DMA descriptors */
+ dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
instance++;
@@ -2587,12 +2591,8 @@ static inline void b44_pci_exit(void)
static int __init b44_init(void)
{
- unsigned int dma_desc_align_size = dma_get_cache_alignment();
int err;
- /* Setup paramaters for syncing RX/TX DMA descriptors */
- dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
-
err = b44_pci_init();
if (err)
return err;
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index 7feff24..b0c5319 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -1030,8 +1030,9 @@ static int emac_set_mac_address(struct net_device *ndev, void *sa)
static int emac_resize_rx_ring(struct emac_instance *dev, int new_mtu)
{
- int rx_sync_size = emac_rx_sync_size(new_mtu);
- int rx_skb_size = emac_rx_skb_size(new_mtu);
+ struct device *dma_dev = &dev->ofdev->dev;
+ int rx_skb_size = emac_rx_skb_size(dma_dev, new_mtu);
+ int rx_sync_size = emac_rx_sync_size(dma_dev, new_mtu);
int i, ret = 0;
int mr1_jumbo_bit_change = 0;
@@ -1115,20 +1116,21 @@ static int emac_resize_rx_ring(struct emac_instance *dev, int new_mtu)
static int emac_change_mtu(struct net_device *ndev, int new_mtu)
{
struct emac_instance *dev = netdev_priv(ndev);
+ struct device *dma_dev = &dev->ofdev->dev;
int ret = 0;
DBG(dev, "change_mtu(%d)" NL, new_mtu);
if (netif_running(ndev)) {
/* Check if we really need to reinitialize RX ring */
- if (emac_rx_skb_size(ndev->mtu) != emac_rx_skb_size(new_mtu))
+ if (emac_rx_skb_size(dma_dev, ndev->mtu) != emac_rx_skb_size(dma_dev, new_mtu))
ret = emac_resize_rx_ring(dev, new_mtu);
}
if (!ret) {
ndev->mtu = new_mtu;
- dev->rx_skb_size = emac_rx_skb_size(new_mtu);
- dev->rx_sync_size = emac_rx_sync_size(new_mtu);
+ dev->rx_skb_size = emac_rx_skb_size(dma_dev, new_mtu);
+ dev->rx_sync_size = emac_rx_sync_size(dma_dev, new_mtu);
}
return ret;
@@ -1171,6 +1173,7 @@ static void emac_clean_rx_ring(struct emac_instance *dev)
static inline int emac_alloc_rx_skb(struct emac_instance *dev, int slot,
gfp_t flags)
{
+ struct device *dma_dev = &dev->ofdev->dev;
struct sk_buff *skb = alloc_skb(dev->rx_skb_size, flags);
if (unlikely(!skb))
return -ENOMEM;
@@ -1649,11 +1652,12 @@ static inline void emac_recycle_rx_skb(struct emac_instance *dev, int slot,
int len)
{
struct sk_buff *skb = dev->rx_skb[slot];
+ struct device *dma_dev = &dev->ofdev->dev;
DBG2(dev, "recycle %d %d" NL, slot, len);
if (len)
- dma_map_single(&dev->ofdev->dev, skb->data - 2,
+ dma_map_single(dma_dev, skb->data - 2,
EMAC_DMA_ALIGN(len + 2), DMA_FROM_DEVICE);
dev->rx_desc[slot].data_len = 0;
@@ -1727,6 +1731,7 @@ static int emac_poll_rx(void *param, int budget)
{
struct emac_instance *dev = param;
int slot = dev->rx_slot, received = 0;
+ struct device *dma_dev = &dev->ofdev->dev;
DBG2(dev, "poll_rx(%d)" NL, budget);
@@ -2998,6 +3003,7 @@ static int emac_probe(struct platform_device *ofdev)
struct emac_instance *dev;
struct device_node *np = ofdev->dev.of_node;
struct device_node **blist = NULL;
+ struct device *dma_dev = &ofdev->dev;
int err, i;
/* Skip unused/unwired EMACS. We leave the check for an unused
@@ -3077,8 +3083,8 @@ static int emac_probe(struct platform_device *ofdev)
np, dev->mal_dev->dev.of_node);
goto err_rel_deps;
}
- dev->rx_skb_size = emac_rx_skb_size(ndev->mtu);
- dev->rx_sync_size = emac_rx_sync_size(ndev->mtu);
+ dev->rx_skb_size = emac_rx_skb_size(dma_dev, ndev->mtu);
+ dev->rx_sync_size = emac_rx_sync_size(dma_dev, ndev->mtu);
/* Get pointers to BD rings */
dev->tx_desc =
diff --git a/drivers/net/ethernet/ibm/emac/core.h b/drivers/net/ethernet/ibm/emac/core.h
index 369de2c..68548a0 100644
--- a/drivers/net/ethernet/ibm/emac/core.h
+++ b/drivers/net/ethernet/ibm/emac/core.h
@@ -68,20 +68,20 @@ static inline int emac_rx_size(int mtu)
return mal_rx_size(ETH_DATA_LEN + EMAC_MTU_OVERHEAD);
}
-#define EMAC_DMA_ALIGN(x) ALIGN((x), dma_get_cache_alignment())
+#define EMAC_DMA_ALIGN(x) ALIGN((x), dma_get_cache_alignment(dma_dev))
#define EMAC_RX_SKB_HEADROOM \
EMAC_DMA_ALIGN(CONFIG_IBM_EMAC_RX_SKB_HEADROOM)
/* Size of RX skb for the given MTU */
-static inline int emac_rx_skb_size(int mtu)
+static inline int emac_rx_skb_size(struct device *dma_dev, int mtu)
{
int size = max(mtu + EMAC_MTU_OVERHEAD, emac_rx_size(mtu));
return EMAC_DMA_ALIGN(size + 2) + EMAC_RX_SKB_HEADROOM;
}
/* RX DMA sync size */
-static inline int emac_rx_sync_size(int mtu)
+static inline int emac_rx_sync_size(struct device *dma_dev, int mtu)
{
return EMAC_DMA_ALIGN(emac_rx_size(mtu) + 2);
}
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index e61c99e..bc146dd 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1660,7 +1660,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap,
*/
dev->caps.reserved_mtts =
ALIGN(dev->caps.reserved_mtts * dev->caps.mtt_entry_sz,
- dma_get_cache_alignment()) / dev->caps.mtt_entry_sz;
+ dma_get_cache_alignment(&dev->persist->pdev->dev)) / dev->caps.mtt_entry_sz;
err = mlx4_init_icm_table(dev, &priv->mr_table.mtt_table,
init_hca->mtt_base,
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 974a8ce..e6da66e 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -862,7 +862,7 @@ static bool spi_qup_can_dma(struct spi_master *master, struct spi_device *spi,
struct spi_transfer *xfer)
{
struct spi_qup *qup = spi_master_get_devdata(master);
- size_t dma_align = dma_get_cache_alignment();
+ size_t dma_align = dma_get_cache_alignment(qup->dev);
int n_words;
if (xfer->rx_buf) {
@@ -1038,7 +1038,7 @@ static int spi_qup_probe(struct platform_device *pdev)
master->transfer_one = spi_qup_transfer_one;
master->dev.of_node = pdev->dev.of_node;
master->auto_runtime_pm = true;
- master->dma_alignment = dma_get_cache_alignment();
+ master->dma_alignment = dma_get_cache_alignment(dev);
master->max_dma_len = SPI_MAX_XFER;
platform_set_drvdata(pdev, master);
diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c
index 67ffecc..c708457 100644
--- a/drivers/tty/serial/mpsc.c
+++ b/drivers/tty/serial/mpsc.c
@@ -81,19 +81,19 @@
* Number of Tx & Rx descriptors must be powers of 2.
*/
#define MPSC_RXR_ENTRIES 32
-#define MPSC_RXRE_SIZE dma_get_cache_alignment()
+#define MPSC_RXRE_SIZE dma_get_cache_alignment(dma_dev)
#define MPSC_RXR_SIZE (MPSC_RXR_ENTRIES * MPSC_RXRE_SIZE)
-#define MPSC_RXBE_SIZE dma_get_cache_alignment()
+#define MPSC_RXBE_SIZE dma_get_cache_alignment(dma_dev)
#define MPSC_RXB_SIZE (MPSC_RXR_ENTRIES * MPSC_RXBE_SIZE)
#define MPSC_TXR_ENTRIES 32
-#define MPSC_TXRE_SIZE dma_get_cache_alignment()
+#define MPSC_TXRE_SIZE dma_get_cache_alignment(dma_dev)
#define MPSC_TXR_SIZE (MPSC_TXR_ENTRIES * MPSC_TXRE_SIZE)
-#define MPSC_TXBE_SIZE dma_get_cache_alignment()
+#define MPSC_TXBE_SIZE dma_get_cache_alignment(dma_dev)
#define MPSC_TXB_SIZE (MPSC_TXR_ENTRIES * MPSC_TXBE_SIZE)
#define MPSC_DMA_ALLOC_SIZE (MPSC_RXR_SIZE + MPSC_RXB_SIZE + MPSC_TXR_SIZE \
- + MPSC_TXB_SIZE + dma_get_cache_alignment() /* for alignment */)
+ + MPSC_TXB_SIZE + dma_get_cache_alignment(dma_dev) /* for alignment */)
/* Rx and Tx Ring entry descriptors -- assume entry size is <= cacheline size */
struct mpsc_rx_desc {
@@ -520,6 +520,7 @@ static uint mpsc_sdma_tx_active(struct mpsc_port_info *pi)
static void mpsc_sdma_start_tx(struct mpsc_port_info *pi)
{
struct mpsc_tx_desc *txre, *txre_p;
+ struct device *dma_dev = pi->port.dev;
/* If tx isn't running & there's a desc ready to go, start it */
if (!mpsc_sdma_tx_active(pi)) {
@@ -738,7 +739,7 @@ static void mpsc_init_hw(struct mpsc_port_info *pi)
mpsc_brg_init(pi, pi->brg_clk_src);
mpsc_brg_enable(pi);
- mpsc_sdma_init(pi, dma_get_cache_alignment()); /* burst a cacheline */
+ mpsc_sdma_init(pi, dma_get_cache_alignment(pi->port.dev)); /* burst a cacheline */
mpsc_sdma_stop(pi);
mpsc_hw_init(pi);
}
@@ -746,6 +747,7 @@ static void mpsc_init_hw(struct mpsc_port_info *pi)
static int mpsc_alloc_ring_mem(struct mpsc_port_info *pi)
{
int rc = 0;
+ struct device *dma_dev = pi->port.dev;
pr_debug("mpsc_alloc_ring_mem[%d]: Allocating ring mem\n",
pi->port.line);
@@ -769,6 +771,8 @@ static int mpsc_alloc_ring_mem(struct mpsc_port_info *pi)
static void mpsc_free_ring_mem(struct mpsc_port_info *pi)
{
+ struct device *dma_dev = pi->port.dev;
+
pr_debug("mpsc_free_ring_mem[%d]: Freeing ring mem\n", pi->port.line);
if (pi->dma_region) {
@@ -784,6 +788,7 @@ static void mpsc_init_rings(struct mpsc_port_info *pi)
{
struct mpsc_rx_desc *rxre;
struct mpsc_tx_desc *txre;
+ struct device *dma_dev = pi->port.dev;
dma_addr_t dp, dp_p;
u8 *bp, *bp_p;
int i;
@@ -798,8 +803,8 @@ static void mpsc_init_rings(struct mpsc_port_info *pi)
* Descriptors & buffers are multiples of cacheline size and must be
* cacheline aligned.
*/
- dp = ALIGN((u32)pi->dma_region, dma_get_cache_alignment());
- dp_p = ALIGN((u32)pi->dma_region_p, dma_get_cache_alignment());
+ dp = ALIGN((u32)pi->dma_region, dma_get_cache_alignment(dma_dev));
+ dp_p = ALIGN((u32)pi->dma_region_p, dma_get_cache_alignment(dma_dev));
/*
* Partition dma region into rx ring descriptor, rx buffers,
@@ -936,6 +941,7 @@ static int serial_polled;
static int mpsc_rx_intr(struct mpsc_port_info *pi, unsigned long *flags)
{
struct mpsc_rx_desc *rxre;
+ struct device *dma_dev = pi->port.dev;
struct tty_port *port = &pi->port.state->port;
u32 cmdstat, bytes_in, i;
int rc = 0;
@@ -1091,6 +1097,7 @@ static int mpsc_rx_intr(struct mpsc_port_info *pi, unsigned long *flags)
static void mpsc_setup_tx_desc(struct mpsc_port_info *pi, u32 count, u32 intr)
{
struct mpsc_tx_desc *txre;
+ struct device *dma_dev = pi->port.dev;
txre = (struct mpsc_tx_desc *)(pi->txr
+ (pi->txr_head * MPSC_TXRE_SIZE));
@@ -1113,6 +1120,7 @@ static void mpsc_setup_tx_desc(struct mpsc_port_info *pi, u32 count, u32 intr)
static void mpsc_copy_tx_data(struct mpsc_port_info *pi)
{
+ struct device *dma_dev = pi->port.dev;
struct circ_buf *xmit = &pi->port.state->xmit;
u8 *bp;
u32 i;
@@ -1166,6 +1174,7 @@ static void mpsc_copy_tx_data(struct mpsc_port_info *pi)
static int mpsc_tx_intr(struct mpsc_port_info *pi)
{
struct mpsc_tx_desc *txre;
+ struct device *dma_dev = pi->port.dev;
int rc = 0;
unsigned long iflags;
@@ -1360,6 +1369,7 @@ static int mpsc_startup(struct uart_port *port)
{
struct mpsc_port_info *pi =
container_of(port, struct mpsc_port_info, port);
+ struct device *dma_dev = pi->port.dev;
u32 flag = 0;
int rc;
@@ -1555,9 +1565,10 @@ static void mpsc_put_poll_char(struct uart_port *port,
static int mpsc_get_poll_char(struct uart_port *port)
{
+ struct mpsc_rx_desc *rxre;
struct mpsc_port_info *pi =
container_of(port, struct mpsc_port_info, port);
- struct mpsc_rx_desc *rxre;
+ struct device *dma_dev = pi->port.dev;
u32 cmdstat, bytes_in, i;
u8 *bp;
@@ -1706,6 +1717,7 @@ static const struct uart_ops mpsc_pops = {
static void mpsc_console_write(struct console *co, const char *s, uint count)
{
struct mpsc_port_info *pi = &mpsc_ports[co->index];
+ struct device *dma_dev = pi->port.dev;
u8 *bp, *dp, add_cr = 0;
int i;
unsigned long iflags;
@@ -2024,7 +2036,8 @@ static void mpsc_drv_unmap_regs(struct mpsc_port_info *pi)
static void mpsc_drv_get_platform_data(struct mpsc_port_info *pi,
struct platform_device *pd, int num)
{
- struct mpsc_pdata *pdata;
+ struct mpsc_pdata *pdata;
+ struct device *dma_dev = pi->port.dev;
pdata = dev_get_platdata(&pd->dev);
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 8aca18c..9df918e5 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -241,7 +241,7 @@ static void enable_tx_dma(struct s3c24xx_uart_port *ourport)
/* Enable tx dma mode */
ucon = rd_regl(port, S3C2410_UCON);
ucon &= ~(S3C64XX_UCON_TXBURST_MASK | S3C64XX_UCON_TXMODE_MASK);
- ucon |= (dma_get_cache_alignment() >= 16) ?
+ ucon |= (dma_get_cache_alignment(port->dev) >= 16) ?
S3C64XX_UCON_TXBURST_16 : S3C64XX_UCON_TXBURST_1;
ucon |= S3C64XX_UCON_TXMODE_DMA;
wr_regl(port, S3C2410_UCON, ucon);
@@ -292,7 +292,7 @@ static int s3c24xx_serial_start_tx_dma(struct s3c24xx_uart_port *ourport,
if (ourport->tx_mode != S3C24XX_TX_DMA)
enable_tx_dma(ourport);
- dma->tx_size = count & ~(dma_get_cache_alignment() - 1);
+ dma->tx_size = count & ~(dma_get_cache_alignment(port->dev) - 1);
dma->tx_transfer_addr = dma->tx_addr + xmit->tail;
dma_sync_single_for_device(ourport->port.dev, dma->tx_transfer_addr,
@@ -332,7 +332,7 @@ static void s3c24xx_serial_start_next_tx(struct s3c24xx_uart_port *ourport)
if (!ourport->dma || !ourport->dma->tx_chan ||
count < ourport->min_dma_size ||
- xmit->tail & (dma_get_cache_alignment() - 1))
+ xmit->tail & (dma_get_cache_alignment(port->dev) - 1))
s3c24xx_serial_start_tx_pio(ourport);
else
s3c24xx_serial_start_tx_dma(ourport, count);
@@ -718,8 +718,8 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
if (ourport->dma && ourport->dma->tx_chan &&
count >= ourport->min_dma_size) {
- int align = dma_get_cache_alignment() -
- (xmit->tail & (dma_get_cache_alignment() - 1));
+ int align = dma_get_cache_alignment(port->dev) -
+ (xmit->tail & (dma_get_cache_alignment(port->dev) - 1));
if (count-align >= ourport->min_dma_size) {
dma_count = count-align;
count = align;
@@ -870,7 +870,7 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p)
dma->tx_conf.direction = DMA_MEM_TO_DEV;
dma->tx_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
dma->tx_conf.dst_addr = p->port.mapbase + S3C2410_UTXH;
- if (dma_get_cache_alignment() >= 16)
+ if (dma_get_cache_alignment(p->port.dev) >= 16)
dma->tx_conf.dst_maxburst = 16;
else
dma->tx_conf.dst_maxburst = 1;
@@ -1849,7 +1849,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
* so find minimal transfer size suitable for DMA mode
*/
ourport->min_dma_size = max_t(int, ourport->port.fifosize,
- dma_get_cache_alignment());
+ dma_get_cache_alignment(ourport->port.dev));
dbg("%s: initialising port %p...\n", __func__, ourport);
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 29ce981..1326023 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -131,6 +131,7 @@ struct dma_map_ops {
#ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
u64 (*get_required_mask)(struct device *dev);
#endif
+ int (*get_cache_alignment)(struct device *dev);
int is_phys;
};
@@ -697,12 +698,18 @@ static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
}
#ifdef CONFIG_HAS_DMA
-static inline int dma_get_cache_alignment(void)
-{
-#ifdef ARCH_DMA_MINALIGN
- return ARCH_DMA_MINALIGN;
+
+#ifndef ARCH_DMA_MINALIGN
+#define ARCH_DMA_MINALIGN 1
#endif
- return 1;
+
+static inline int dma_get_cache_alignment(struct device *dev)
+{
+ const struct dma_map_ops *ops = get_dma_ops(dev);
+ if (dev && ops && ops->get_cache_alignment)
+ return ops->get_cache_alignment(dev);
+
+ return ARCH_DMA_MINALIGN; /* compatible behavior */
}
#endif
--
2.7.0
^ permalink raw reply related
* [PATCH V8 4/5] libsas: Align SMP req/resp to dma_get_cache_alignment()
From: Huacai Chen @ 2017-10-17 8:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Marek Szyprowski, Robin Murphy, Andrew Morton, Fuxin Zhang,
linux-kernel, Ralf Baechle, James Hogan, linux-mips,
James E . J . Bottomley, Martin K . Petersen, linux-scsi,
Tejun Heo, linux-ide, Huacai Chen, stable
In-Reply-To: <1508227542-13165-1-git-send-email-chenhc@lemote.com>
In non-coherent DMA mode, kernel uses cache flushing operations to
maintain I/O coherency, so libsas's SMP request/response should be
aligned to ARCH_DMA_MINALIGN. Otherwise, If a DMA buffer and a kernel
structure share a same cache line, and if the kernel structure has
dirty data, cache_invalidate (no writeback) will cause data corruption.
Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
drivers/scsi/libsas/sas_expander.c | 93 +++++++++++++++++++++++---------------
1 file changed, 57 insertions(+), 36 deletions(-)
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 6b4fd23..124a44b 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -164,17 +164,17 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
/* ---------- Allocations ---------- */
-static inline void *alloc_smp_req(int size)
+static inline void *alloc_smp_req(int size, int align)
{
- u8 *p = kzalloc(size, GFP_KERNEL);
+ u8 *p = kzalloc(ALIGN(size, align), GFP_KERNEL);
if (p)
p[0] = SMP_REQUEST;
return p;
}
-static inline void *alloc_smp_resp(int size)
+static inline void *alloc_smp_resp(int size, int align)
{
- return kzalloc(size, GFP_KERNEL);
+ return kzalloc(ALIGN(size, align), GFP_KERNEL);
}
static char sas_route_char(struct domain_device *dev, struct ex_phy *phy)
@@ -403,15 +403,17 @@ static int sas_ex_phy_discover_helper(struct domain_device *dev, u8 *disc_req,
int sas_ex_phy_discover(struct domain_device *dev, int single)
{
struct expander_device *ex = &dev->ex_dev;
- int res = 0;
+ int res = 0, align;
u8 *disc_req;
u8 *disc_resp;
- disc_req = alloc_smp_req(DISCOVER_REQ_SIZE);
+ align = dma_get_cache_alignment(&dev->phy->dev);
+
+ disc_req = alloc_smp_req(DISCOVER_REQ_SIZE, align);
if (!disc_req)
return -ENOMEM;
- disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE);
+ disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE, align);
if (!disc_resp) {
kfree(disc_req);
return -ENOMEM;
@@ -480,14 +482,15 @@ static int sas_ex_general(struct domain_device *dev)
{
u8 *rg_req;
struct smp_resp *rg_resp;
- int res;
- int i;
+ int i, res, align;
- rg_req = alloc_smp_req(RG_REQ_SIZE);
+ align = dma_get_cache_alignment(&dev->phy->dev);
+
+ rg_req = alloc_smp_req(RG_REQ_SIZE, align);
if (!rg_req)
return -ENOMEM;
- rg_resp = alloc_smp_resp(RG_RESP_SIZE);
+ rg_resp = alloc_smp_resp(RG_RESP_SIZE, align);
if (!rg_resp) {
kfree(rg_req);
return -ENOMEM;
@@ -552,13 +555,15 @@ static int sas_ex_manuf_info(struct domain_device *dev)
{
u8 *mi_req;
u8 *mi_resp;
- int res;
+ int res, align;
- mi_req = alloc_smp_req(MI_REQ_SIZE);
+ align = dma_get_cache_alignment(&dev->phy->dev);
+
+ mi_req = alloc_smp_req(MI_REQ_SIZE, align);
if (!mi_req)
return -ENOMEM;
- mi_resp = alloc_smp_resp(MI_RESP_SIZE);
+ mi_resp = alloc_smp_resp(MI_RESP_SIZE, align);
if (!mi_resp) {
kfree(mi_req);
return -ENOMEM;
@@ -593,13 +598,15 @@ int sas_smp_phy_control(struct domain_device *dev, int phy_id,
{
u8 *pc_req;
u8 *pc_resp;
- int res;
+ int res, align;
+
+ align = dma_get_cache_alignment(&dev->phy->dev);
- pc_req = alloc_smp_req(PC_REQ_SIZE);
+ pc_req = alloc_smp_req(PC_REQ_SIZE, align);
if (!pc_req)
return -ENOMEM;
- pc_resp = alloc_smp_resp(PC_RESP_SIZE);
+ pc_resp = alloc_smp_resp(PC_RESP_SIZE, align);
if (!pc_resp) {
kfree(pc_req);
return -ENOMEM;
@@ -664,17 +671,19 @@ static int sas_dev_present_in_domain(struct asd_sas_port *port,
#define RPEL_RESP_SIZE 32
int sas_smp_get_phy_events(struct sas_phy *phy)
{
- int res;
+ int res, align;
u8 *req;
u8 *resp;
struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent);
struct domain_device *dev = sas_find_dev_by_rphy(rphy);
- req = alloc_smp_req(RPEL_REQ_SIZE);
+ align = dma_get_cache_alignment(&phy->dev);
+
+ req = alloc_smp_req(RPEL_REQ_SIZE, align);
if (!req)
return -ENOMEM;
- resp = alloc_smp_resp(RPEL_RESP_SIZE);
+ resp = alloc_smp_resp(RPEL_RESP_SIZE, align);
if (!resp) {
kfree(req);
return -ENOMEM;
@@ -709,7 +718,8 @@ int sas_get_report_phy_sata(struct domain_device *dev, int phy_id,
struct smp_resp *rps_resp)
{
int res;
- u8 *rps_req = alloc_smp_req(RPS_REQ_SIZE);
+ int align = dma_get_cache_alignment(&dev->phy->dev);
+ u8 *rps_req = alloc_smp_req(RPS_REQ_SIZE, align);
u8 *resp = (u8 *)rps_resp;
if (!rps_req)
@@ -1398,7 +1408,7 @@ static int sas_check_parent_topology(struct domain_device *child)
static int sas_configure_present(struct domain_device *dev, int phy_id,
u8 *sas_addr, int *index, int *present)
{
- int i, res = 0;
+ int i, res = 0, align;
struct expander_device *ex = &dev->ex_dev;
struct ex_phy *phy = &ex->ex_phy[phy_id];
u8 *rri_req;
@@ -1406,12 +1416,13 @@ static int sas_configure_present(struct domain_device *dev, int phy_id,
*present = 0;
*index = 0;
+ align = dma_get_cache_alignment(&dev->phy->dev);
- rri_req = alloc_smp_req(RRI_REQ_SIZE);
+ rri_req = alloc_smp_req(RRI_REQ_SIZE, align);
if (!rri_req)
return -ENOMEM;
- rri_resp = alloc_smp_resp(RRI_RESP_SIZE);
+ rri_resp = alloc_smp_resp(RRI_RESP_SIZE, align);
if (!rri_resp) {
kfree(rri_req);
return -ENOMEM;
@@ -1472,15 +1483,17 @@ static int sas_configure_present(struct domain_device *dev, int phy_id,
static int sas_configure_set(struct domain_device *dev, int phy_id,
u8 *sas_addr, int index, int include)
{
- int res;
+ int res, align;
u8 *cri_req;
u8 *cri_resp;
- cri_req = alloc_smp_req(CRI_REQ_SIZE);
+ align = dma_get_cache_alignment(&dev->phy->dev);
+
+ cri_req = alloc_smp_req(CRI_REQ_SIZE, align);
if (!cri_req)
return -ENOMEM;
- cri_resp = alloc_smp_resp(CRI_RESP_SIZE);
+ cri_resp = alloc_smp_resp(CRI_RESP_SIZE, align);
if (!cri_resp) {
kfree(cri_req);
return -ENOMEM;
@@ -1689,10 +1702,12 @@ int sas_discover_root_expander(struct domain_device *dev)
static int sas_get_phy_discover(struct domain_device *dev,
int phy_id, struct smp_resp *disc_resp)
{
- int res;
+ int res, align;
u8 *disc_req;
- disc_req = alloc_smp_req(DISCOVER_REQ_SIZE);
+ align = dma_get_cache_alignment(&dev->phy->dev);
+
+ disc_req = alloc_smp_req(DISCOVER_REQ_SIZE, align);
if (!disc_req)
return -ENOMEM;
@@ -1715,10 +1730,12 @@ static int sas_get_phy_discover(struct domain_device *dev,
static int sas_get_phy_change_count(struct domain_device *dev,
int phy_id, int *pcc)
{
- int res;
+ int res, align;
struct smp_resp *disc_resp;
- disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE);
+ align = dma_get_cache_alignment(&dev->phy->dev);
+
+ disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE, align);
if (!disc_resp)
return -ENOMEM;
@@ -1733,11 +1750,13 @@ static int sas_get_phy_change_count(struct domain_device *dev,
static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id,
u8 *sas_addr, enum sas_device_type *type)
{
- int res;
+ int res, align;
struct smp_resp *disc_resp;
struct discover_resp *dr;
- disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE);
+ align = dma_get_cache_alignment(&dev->phy->dev);
+
+ disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE, align);
if (!disc_resp)
return -ENOMEM;
dr = &disc_resp->disc;
@@ -1787,15 +1806,17 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
static int sas_get_ex_change_count(struct domain_device *dev, int *ecc)
{
- int res;
+ int res, align;
u8 *rg_req;
struct smp_resp *rg_resp;
- rg_req = alloc_smp_req(RG_REQ_SIZE);
+ align = dma_get_cache_alignment(&dev->phy->dev);
+
+ rg_req = alloc_smp_req(RG_REQ_SIZE, align);
if (!rg_req)
return -ENOMEM;
- rg_resp = alloc_smp_resp(RG_RESP_SIZE);
+ rg_resp = alloc_smp_resp(RG_RESP_SIZE, align);
if (!rg_resp) {
kfree(rg_req);
return -ENOMEM;
--
2.7.0
^ permalink raw reply related
* Re: [PATCH] ahci: Add support for Cavium's fifth generation SATA controller
From: Christoph Hellwig @ 2017-10-17 6:58 UTC (permalink / raw)
To: Radha Mohan Chintakuntla
Cc: tj, linux-ide, linux-kernel, Radha Mohan Chintakuntla
In-Reply-To: <1507700271-12910-1-git-send-email-mohun106@gmail.com>
On Tue, Oct 10, 2017 at 10:37:51PM -0700, Radha Mohan Chintakuntla wrote:
> From: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
>
> This patch adds support for Cavium's fifth generation SATA controller.
> It is an on-chip controller and complies with AHCI 1.3.1. As the
> controller uses 64-bit addresses it cannot use the standard AHCI BAR5
> and so uses BAR4.
Looks like it isn't actually AHCI 1.3.1 compliant after all then :)
^ permalink raw reply
* [PATCH] ahci: Convert timers to use timer_setup()
From: Kees Cook @ 2017-10-16 21:56 UTC (permalink / raw)
To: linux-kernel; +Cc: Tejun Heo, linux-ide
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. Adds a pointer back to link
structure.
Cc: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Tejun Heo <tj@kernel.org>
---
Tejun asked that this go via the timer tree...
---
drivers/ata/ahci.h | 1 +
drivers/ata/libahci.c | 11 ++++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 8b61123d2c3c..749fd94441b0 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -303,6 +303,7 @@ struct ahci_em_priv {
unsigned long saved_activity;
unsigned long activity;
unsigned long led_state;
+ struct ata_link *link;
};
struct ahci_port_priv {
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 3e286d86ab42..a0de7a38430c 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -968,12 +968,12 @@ static void ahci_sw_activity(struct ata_link *link)
mod_timer(&emp->timer, jiffies + msecs_to_jiffies(10));
}
-static void ahci_sw_activity_blink(unsigned long arg)
+static void ahci_sw_activity_blink(struct timer_list *t)
{
- struct ata_link *link = (struct ata_link *)arg;
+ struct ahci_em_priv *emp = from_timer(emp, t, timer);
+ struct ata_link *link = emp->link;
struct ata_port *ap = link->ap;
- struct ahci_port_priv *pp = ap->private_data;
- struct ahci_em_priv *emp = &pp->em_priv[link->pmp];
+
unsigned long led_message = emp->led_state;
u32 activity_led_state;
unsigned long flags;
@@ -1020,7 +1020,8 @@ static void ahci_init_sw_activity(struct ata_link *link)
/* init activity stats, setup timer */
emp->saved_activity = emp->activity = 0;
- setup_timer(&emp->timer, ahci_sw_activity_blink, (unsigned long)link);
+ emp->link = link;
+ timer_setup(&emp->timer, ahci_sw_activity_blink, 0);
/* check our blink policy and set flag for link if it's enabled */
if (emp->blink_policy)
--
2.7.4
--
Kees Cook
Pixel Security
^ permalink raw reply related
* [PATCH] libata: Convert timers to use timer_setup()
From: Kees Cook @ 2017-10-16 21:56 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: Tejun Heo, linux-ide
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.
Cc: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Tejun Heo <tj@kernel.org>
---
Tejun asked that this go via the timer tree...
---
drivers/ata/libata-core.c | 5 ++---
drivers/ata/libata-eh.c | 4 ++--
drivers/ata/libata.h | 2 +-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 29e351669353..112350bbe645 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5980,9 +5980,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
INIT_LIST_HEAD(&ap->eh_done_q);
init_waitqueue_head(&ap->eh_wait_q);
init_completion(&ap->park_req_pending);
- setup_deferrable_timer(&ap->fastdrain_timer,
- ata_eh_fastdrain_timerfn,
- (unsigned long)ap);
+ timer_setup(&ap->fastdrain_timer, ata_eh_fastdrain_timerfn,
+ TIMER_DEFERRABLE);
ap->cbl = ATA_CBL_NONE;
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 49b3745d2c1f..b58f52d8b6b3 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -879,9 +879,9 @@ static int ata_eh_nr_in_flight(struct ata_port *ap)
return nr;
}
-void ata_eh_fastdrain_timerfn(unsigned long arg)
+void ata_eh_fastdrain_timerfn(struct timer_list *t)
{
- struct ata_port *ap = (void *)arg;
+ struct ata_port *ap = from_timer(ap, t, fastdrain_timer);
unsigned long flags;
int cnt;
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 18bf1e995a18..f953cb4bb1ba 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -154,7 +154,7 @@ extern void ata_internal_cmd_timed_out(struct ata_device *dev, u8 cmd);
extern void ata_eh_acquire(struct ata_port *ap);
extern void ata_eh_release(struct ata_port *ap);
extern void ata_scsi_error(struct Scsi_Host *host);
-extern void ata_eh_fastdrain_timerfn(unsigned long arg);
+extern void ata_eh_fastdrain_timerfn(struct timer_list *t);
extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc);
extern void ata_dev_disable(struct ata_device *dev);
extern void ata_eh_detach_dev(struct ata_device *dev);
--
2.7.4
--
Kees Cook
Pixel Security
^ permalink raw reply related
* [PATCH] ata: sata_mv: remove a redundant assignment to pointer ehi
From: Colin King @ 2017-10-16 11:00 UTC (permalink / raw)
To: Tejun Heo, linux-ide; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The pointer ehi is being assigned to a value that is never read
and is redundant. Clean up the code and move the ehi declaration
and initialization to the code block where it is used. Cleans up
clang warning: Value stored to 'ehi' is never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/ata/sata_mv.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 3b2246dded74..dbb62b508213 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2478,20 +2478,18 @@ static unsigned int mv_get_err_pmp_map(struct ata_port *ap)
static void mv_pmp_eh_prep(struct ata_port *ap, unsigned int pmp_map)
{
- struct ata_eh_info *ehi;
unsigned int pmp;
/*
* Initialize EH info for PMPs which saw device errors
*/
- ehi = &ap->link.eh_info;
for (pmp = 0; pmp_map != 0; pmp++) {
unsigned int this_pmp = (1 << pmp);
if (pmp_map & this_pmp) {
struct ata_link *link = &ap->pmp_link[pmp];
+ struct ata_eh_info *ehi = &link->eh_info;
pmp_map &= ~this_pmp;
- ehi = &link->eh_info;
ata_ehi_clear_desc(ehi);
ata_ehi_push_desc(ehi, "dev err");
ehi->err_mask |= AC_ERR_DEV;
--
2.14.1
^ permalink raw reply related
* Re: [PATCH 1/2] dt-bindings: add binding for Allwinner R40 SATA AHCI controller
From: Rob Herring @ 2017-10-13 19:42 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Tejun Heo, Maxime Ripard, Chen-Yu Tsai,
linux-ide-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <20171008043541.48564-1-icenowy-h8G6r0blFSE@public.gmane.org>
On Sun, Oct 08, 2017 at 12:35:40PM +0800, Icenowy Zheng wrote:
> The Allwinner R40 SoC contains a SATA AHCI controller like the one in
> A10/A20 SoCs, however a reset control and two power supplies are added
> to it.
>
> Add a binding document for it.
>
> As a dedicated binding document is needed now for the A10/A20/R40 AHCI
> controller, drop the A10 compatible line from generic platform AHCI
> controller binding document.
>
> Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
> ---
> .../devicetree/bindings/ata/ahci-platform.txt | 1 -
> .../bindings/ata/allwinner,sun4i-a10-ahci.txt | 40 ++++++++++++++++++++++
> 2 files changed, 40 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/devicetree/bindings/ata/allwinner,sun4i-a10-ahci.txt
>
> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
> index fedc213b5f1a..da6818b2c204 100644
> --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
> @@ -9,7 +9,6 @@ PHYs.
>
> Required properties:
> - compatible : compatible string, one of:
> - - "allwinner,sun4i-a10-ahci"
> - "brcm,iproc-ahci"
> - "hisilicon,hisi-ahci"
> - "cavium,octeon-7130-ahci"
> diff --git a/Documentation/devicetree/bindings/ata/allwinner,sun4i-a10-ahci.txt b/Documentation/devicetree/bindings/ata/allwinner,sun4i-a10-ahci.txt
> new file mode 100644
> index 000000000000..0eea78c14ad3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ata/allwinner,sun4i-a10-ahci.txt
> @@ -0,0 +1,40 @@
> +Allwinner A10/A20/R40 SoC SATA AHCI Controller
> +
> +Required properties:
> +- compatible : compatible string, one of:
> + - "allwinner,sun4i-a10-ahci"
> + - "allwinner,sun8i-r40-ahci"
> +- interrupts : the SATA IRQ
> +- reg : the register mapping
> +- clocks : the clocks needed by SATA controller, usually contains
> + an AHB clock and a mod clock
> +
> +Optional properties:
> +- target-supply : regulator for SATA target power
> +
> +Required properties for the following compatibles:
> + - "allwinner,sun8i-r40-ahci"
> +- resets : the reset control needed by SATA controller
> +- vdd1v2-supply : regulator for SATA controller's 1.2V VDD
> +- vdd2v5-supply : regulator for SATA controller's 2.5V VDD
I have to wonder, are these really for the controller and not the phy?
You don't have any phy?
Rob
^ permalink raw reply
* [PATCH] ata: mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2017-10-12 19:19 UTC (permalink / raw)
To: Hans de Goede, Tejun Heo, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-kernel, Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
In cases where a "drop through" comment was already in place, I replaced
it with a proper "fall through" comment, which is what GCC is expecting
to find.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
This code was tested by compilation only (GCC 7.2.0 was used).
Please, double check if the actual intention of the code is to
fall through.
drivers/ata/libahci_platform.c | 1 +
drivers/ata/libata-core.c | 3 +++
drivers/ata/libata-eh.c | 2 ++
drivers/ata/pata_atp867x.c | 2 ++
drivers/ata/sata_mv.c | 4 ++--
5 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index a270a11..341d0ef 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -295,6 +295,7 @@ static int ahci_platform_get_phy(struct ahci_host_priv *hpriv, u32 port,
node->name);
break;
}
+ /* fall through */
case -ENODEV:
/* continue normally */
hpriv->phys[port] = NULL;
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 29e3516..5b18510 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1879,6 +1879,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
switch (class) {
case ATA_DEV_SEMB:
class = ATA_DEV_ATA; /* some hard drives report SEMB sig */
+ /* fall through */
case ATA_DEV_ATA:
case ATA_DEV_ZAC:
tf.command = ATA_CMD_ID_ATA;
@@ -2975,6 +2976,7 @@ int ata_bus_probe(struct ata_port *ap)
case -ENODEV:
/* give it just one more chance */
tries[dev->devno] = min(tries[dev->devno], 1);
+ /* fall through */
case -EIO:
if (tries[dev->devno] == 1) {
/* This is the last chance, better to slow
@@ -3462,6 +3464,7 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
case ATA_DNXFER_FORCE_PIO0:
pio_mask &= 1;
+ /* fall through */
case ATA_DNXFER_FORCE_PIO:
mwdma_mask = 0;
udma_mask = 0;
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 49b3745..e070fe8 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -3711,9 +3711,11 @@ static int ata_eh_handle_dev_fail(struct ata_device *dev, int err)
case -ENODEV:
/* device missing or wrong IDENTIFY data, schedule probing */
ehc->i.probe_mask |= (1 << dev->devno);
+ /* fall through */
case -EINVAL:
/* give it just one more chance */
ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1);
+ /* fall through */
case -EIO:
if (ehc->tries[dev->devno] == 1) {
/* This is the last chance, better to slow
diff --git a/drivers/ata/pata_atp867x.c b/drivers/ata/pata_atp867x.c
index 3ea50dc..3729e24 100644
--- a/drivers/ata/pata_atp867x.c
+++ b/drivers/ata/pata_atp867x.c
@@ -171,6 +171,7 @@ static int atp867x_get_active_clocks_shifted(struct ata_port *ap,
default:
printk(KERN_WARNING "ATP867X: active %dclk is invalid. "
"Using 12clk.\n", clk);
+ /* fall through */
case 9 ... 12:
clocks = 7; /* 12 clk */
break;
@@ -203,6 +204,7 @@ static int atp867x_get_recover_clocks_shifted(unsigned int clk)
default:
printk(KERN_WARNING "ATP867X: recover %dclk is invalid. "
"Using default 12clk.\n", clk);
+ /* fall through */
case 12: /* default 12 clk */
clocks = 0;
break;
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 3b2246d..03f5301 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2387,7 +2387,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
": attempting PIO w/multiple DRQ: "
"this may fail due to h/w errata\n");
}
- /* drop through */
+ /* fall through */
case ATA_PROT_NODATA:
case ATAPI_PROT_PIO:
case ATAPI_PROT_NODATA:
@@ -3877,7 +3877,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
" and avoid the final two gigabytes on"
" all RocketRAID BIOS initialized drives.\n");
}
- /* drop through */
+ /* fall through */
case chip_6042:
hpriv->ops = &mv6xxx_ops;
hp_flags |= MV_HP_GEN_IIE;
--
2.7.4
^ permalink raw reply related
* Re: [PATCH] documentation: Update ide-cd documentation to reflect CONFIG_BLK_DEV_HD_IDE removal
From: Jonathan Corbet @ 2017-10-12 17:25 UTC (permalink / raw)
To: Finn Thain; +Cc: linux-ide, linux-doc, linux-kernel
In-Reply-To: <alpine.LNX.2.00.1710121439020.3@nippy.intranet>
On Thu, 12 Oct 2017 15:00:06 +1100 (AEDT)
Finn Thain <fthain@telegraphics.com.au> wrote:
> CONFIG_BLK_DEV_HD_IDE was removed in commit 80aa31cb460d ("ide:
> remove CONFIG_BLK_DEV_HD_IDE config option (take 2)") but the ide-cd
> documentation was not updated and still asks users to disable it,
> which is misleading and involves a fruitless search.
>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Applied to the docs tree, thanks.
jon
^ permalink raw reply
* [PATCH] documentation: Update ide-cd documentation to reflect CONFIG_BLK_DEV_HD_IDE removal
From: Finn Thain @ 2017-10-12 4:00 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: linux-ide, linux-doc, linux-kernel
CONFIG_BLK_DEV_HD_IDE was removed in commit 80aa31cb460d ("ide:
remove CONFIG_BLK_DEV_HD_IDE config option (take 2)") but the ide-cd
documentation was not updated and still asks users to disable it,
which is misleading and involves a fruitless search.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd
index f4dc9de2694e..a5f2a7f1ff46 100644
--- a/Documentation/cdrom/ide-cd
+++ b/Documentation/cdrom/ide-cd
@@ -55,13 +55,9 @@ This driver provides the following features:
(to compile support as a module which can be loaded and unloaded)
to the options:
- Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
+ ATA/ATAPI/MFM/RLL support
Include IDE/ATAPI CDROM support
- and `no' to
-
- Use old disk-only driver on primary interface
-
Depending on what type of IDE interface you have, you may need to
specify additional configuration options. See
Documentation/ide/ide.txt.
^ permalink raw reply related
* Re: [PATCH] ahci: Add support for Cavium's fifth generation SATA controller
From: Tejun Heo @ 2017-10-11 14:09 UTC (permalink / raw)
To: Radha Mohan Chintakuntla
Cc: linux-ide, linux-kernel, Radha Mohan Chintakuntla
In-Reply-To: <1507700271-12910-1-git-send-email-mohun106@gmail.com>
On Tue, Oct 10, 2017 at 10:37:51PM -0700, Radha Mohan Chintakuntla wrote:
> From: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
>
> This patch adds support for Cavium's fifth generation SATA controller.
> It is an on-chip controller and complies with AHCI 1.3.1. As the
> controller uses 64-bit addresses it cannot use the standard AHCI BAR5
> and so uses BAR4.
>
> Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
Applied to libata/for-4.15.
Thanks.
--
tejun
^ permalink raw reply
* [PATCH] ahci: Add support for Cavium's fifth generation SATA controller
From: Radha Mohan Chintakuntla @ 2017-10-11 5:37 UTC (permalink / raw)
To: tj, linux-ide, linux-kernel; +Cc: Radha Mohan Chintakuntla
From: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
This patch adds support for Cavium's fifth generation SATA controller.
It is an on-chip controller and complies with AHCI 1.3.1. As the
controller uses 64-bit addresses it cannot use the standard AHCI BAR5
and so uses BAR4.
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
---
drivers/ata/ahci.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 9f78bb0..5443cb7 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -57,6 +57,7 @@ enum {
AHCI_PCI_BAR_STA2X11 = 0,
AHCI_PCI_BAR_CAVIUM = 0,
AHCI_PCI_BAR_ENMOTUS = 2,
+ AHCI_PCI_BAR_CAVIUM_GEN5 = 4,
AHCI_PCI_BAR_STANDARD = 5,
};
@@ -1570,8 +1571,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
ahci_pci_bar = AHCI_PCI_BAR_STA2X11;
else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000)
ahci_pci_bar = AHCI_PCI_BAR_ENMOTUS;
- else if (pdev->vendor == 0x177d && pdev->device == 0xa01c)
- ahci_pci_bar = AHCI_PCI_BAR_CAVIUM;
+ else if (pdev->vendor == PCI_VENDOR_ID_CAVIUM) {
+ if (pdev->device == 0xa01c)
+ ahci_pci_bar = AHCI_PCI_BAR_CAVIUM;
+ if (pdev->device == 0xa084)
+ ahci_pci_bar = AHCI_PCI_BAR_CAVIUM_GEN5;
+ }
/* acquire resources */
rc = pcim_enable_device(pdev);
--
1.7.1
^ permalink raw reply related
* Re: [PATCH 2/2] ata: ahci_sunxi: add support for R40 SATA controller
From: Maxime Ripard @ 2017-10-10 10:03 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Tejun Heo, Chen-Yu Tsai, linux-ide-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <20171008043541.48564-2-icenowy-h8G6r0blFSE@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3220 bytes --]
On Sun, Oct 08, 2017 at 04:35:41AM +0000, Icenowy Zheng wrote:
> Allwinner R40 SoC has an AHCI SATA controller like the one in A10/A20,
> but with a reset control and two dedicated VDD pins for this controller
> (one 1.2v and one 2.5v).
>
> Add support for it.
>
> Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
> ---
> drivers/ata/ahci_sunxi.c | 118 +++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 115 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
> index b26437430163..a650fd6508be 100644
> --- a/drivers/ata/ahci_sunxi.c
> +++ b/drivers/ata/ahci_sunxi.c
> @@ -25,6 +25,7 @@
> #include <linux/of_device.h>
> #include <linux/platform_device.h>
> #include <linux/regulator/consumer.h>
> +#include <linux/reset.h>
> #include "ahci.h"
>
> #define DRV_NAME "ahci-sunxi"
> @@ -58,6 +59,19 @@ MODULE_PARM_DESC(enable_pmp,
> #define AHCI_P0PHYCR 0x0178
> #define AHCI_P0PHYSR 0x017c
>
> +struct ahci_sunxi_quirks {
> + bool has_reset;
> + bool has_vdd1v2;
> + bool has_vdd2v5;
> +};
> +
> +struct ahci_sunxi_data {
> + const struct ahci_sunxi_quirks *quirks;
> + struct reset_control *reset;
> + struct regulator *vdd1v2;
> + struct regulator *vdd2v5;
> +};
> +
> static void sunxi_clrbits(void __iomem *reg, u32 clr_val)
> {
> u32 reg_val;
> @@ -179,17 +193,69 @@ static int ahci_sunxi_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct ahci_host_priv *hpriv;
> + struct ahci_sunxi_data *data;
> int rc;
>
> + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> + if (!data)
> + return -ENOMEM;
> +
> + data->quirks = of_device_get_match_data(dev);
> + if (!data->quirks)
> + return -EINVAL;
> +
> + if (data->quirks->has_reset) {
> + data->reset = devm_reset_control_get(dev, NULL);
> + if (IS_ERR(data->reset)) {
> + dev_err(dev, "Failed to get reset\n");
> + return PTR_ERR(data->reset);
> + }
> + }
> +
> + if (data->quirks->has_vdd1v2) {
> + data->vdd1v2 = devm_regulator_get(dev, "vdd1v2");
> + if (IS_ERR(data->vdd1v2)) {
> + dev_err(dev, "Failed to get 1.2v VDD regulator\n");
> + return PTR_ERR(data->vdd1v2);
> + }
> + }
> +
> + if (data->quirks->has_vdd2v5) {
> + data->vdd2v5 = devm_regulator_get(dev, "vdd2v5");
> + if (IS_ERR(data->vdd2v5)) {
> + dev_err(dev, "Failed to get 2.5v VDD regulator\n");
> + return PTR_ERR(data->vdd2v5);
> + }
> + }
> +
> hpriv = ahci_platform_get_resources(pdev);
> if (IS_ERR(hpriv))
> return PTR_ERR(hpriv);
>
> + hpriv->plat_data = data;
> hpriv->start_engine = ahci_sunxi_start_engine;
>
> + if (data->quirks->has_vdd1v2) {
> + rc = regulator_enable(data->vdd1v2);
> + if (rc)
> + return rc;
> + }
> +
> + if (data->quirks->has_vdd2v5) {
> + rc = regulator_enable(data->vdd2v5);
> + if (rc)
> + goto disable_vdd1v2;
> + }
> +
> + if (data->quirks->has_reset) {
> + rc = reset_control_deassert(data->reset);
> + if (rc)
> + goto disable_vdd2v5;
> + }
> +
This should all be dealt with the AHCI platform layer, just like the
clocks, and well some regulators already.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* Re: [PATCH 1/2] dt-bindings: add binding for Allwinner R40 SATA AHCI controller
From: Maxime Ripard @ 2017-10-10 9:58 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Tejun Heo, Chen-Yu Tsai, linux-ide-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <20171008043541.48564-1-icenowy-h8G6r0blFSE@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 555 bytes --]
On Sun, Oct 08, 2017 at 04:35:40AM +0000, Icenowy Zheng wrote:
> The Allwinner R40 SoC contains a SATA AHCI controller like the one in
> A10/A20 SoCs, however a reset control and two power supplies are added
> to it.
>
> Add a binding document for it.
>
> As a dedicated binding document is needed now for the A10/A20/R40 AHCI
> controller, drop the A10 compatible line from generic platform AHCI
> controller binding document.
Why is it needed?
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* IRREVOCABLE PAYMENT ORDER.pdf
From: Dr. Owen Douglas @ 2017-10-09 0:12 UTC (permalink / raw)
In-Reply-To: <34be7bb2e296579de8756eb7e5261ca2@incoming.mhcable.com>
[-- Attachment #1: IRREVOCABLE PAYMENT ORDER.pdf --]
[-- Type: application/pdf, Size: 181455 bytes --]
^ permalink raw reply
* Re: Marvell 88SE9480 Port Multiplier Support
From: Andrew Ryder @ 2017-10-08 23:20 UTC (permalink / raw)
To: James Bottomley, linux-ide
In-Reply-To: <1507481144.3150.4.camel@HansenPartnership.com>
I guess I'll just bite the bullet and switch over. It's too bad there
isn't much of an alternative to HighPoints cards though, the sata pmp
has worked well though aside from HighPoints buggyness.
Thanks
Andrew
On 10/08/2017 12:45 PM, James Bottomley wrote:
> On Sun, 2017-10-08 at 00:12 -0400, Andrew Ryder wrote:
>> Hello,
>>
>> Does the mvsas support port multiplier for the marvell 88SE9480 chip?
>
> Not at the present time. The code to handle SATA port multipliers is
> stubbed out in libsas/sas_ata.c
>
> The reason is fairly simple: usually if you're connecting drives via a
> SAS host adapter, you want to use SAS expanders because they're way
> more featureful and performant than SATA port multipliers, so there's
> not much customer pull for support.
>
>> I purchased an Addonics http://addonics.com/products/ad2ms6gpx8-e.php
>> but the card fails to see any of the attached drives.
>>
>> I found an old message saying it might support sata pmp?
>> https://lkml.org/lkml/2014/4/24/413
>
> This patch set was never merged. There were significant problems with
> the EH portion, which Dan Williams reviewed and sent a load of feedback
> for but no future patch set incorporating the modifications was ever
> forthcoming.
>
> James
>
>
>> I've attached a dmesg output also and I'm running kernel 4.9.36 if
>> that
>> helps.
>>
>> Andrew
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: Marvell 88SE9480 Port Multiplier Support
From: James Bottomley @ 2017-10-08 16:45 UTC (permalink / raw)
To: Andrew Ryder, linux-ide
In-Reply-To: <c93b6306-2e82-8a63-e909-f82641b0215b@shaw.ca>
On Sun, 2017-10-08 at 00:12 -0400, Andrew Ryder wrote:
> Hello,
>
> Does the mvsas support port multiplier for the marvell 88SE9480 chip?
Not at the present time. The code to handle SATA port multipliers is
stubbed out in libsas/sas_ata.c
The reason is fairly simple: usually if you're connecting drives via a
SAS host adapter, you want to use SAS expanders because they're way
more featureful and performant than SATA port multipliers, so there's
not much customer pull for support.
> I purchased an Addonics http://addonics.com/products/ad2ms6gpx8-e.php
> but the card fails to see any of the attached drives.
>
> I found an old message saying it might support sata pmp?
> https://lkml.org/lkml/2014/4/24/413
This patch set was never merged. There were significant problems with
the EH portion, which Dan Williams reviewed and sent a load of feedback
for but no future patch set incorporating the modifications was ever
forthcoming.
James
> I've attached a dmesg output also and I'm running kernel 4.9.36 if
> that
> helps.
>
> Andrew
^ permalink raw reply
* [PATCH 1/2] dt-bindings: add binding for Allwinner R40 SATA AHCI controller
From: Icenowy Zheng @ 2017-10-08 4:35 UTC (permalink / raw)
To: Tejun Heo, Maxime Ripard, Chen-Yu Tsai
Cc: linux-ide, devicetree, linux-kernel, linux-arm-kernel,
linux-sunxi, Icenowy Zheng
The Allwinner R40 SoC contains a SATA AHCI controller like the one in
A10/A20 SoCs, however a reset control and two power supplies are added
to it.
Add a binding document for it.
As a dedicated binding document is needed now for the A10/A20/R40 AHCI
controller, drop the A10 compatible line from generic platform AHCI
controller binding document.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
.../devicetree/bindings/ata/ahci-platform.txt | 1 -
.../bindings/ata/allwinner,sun4i-a10-ahci.txt | 40 ++++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/ata/allwinner,sun4i-a10-ahci.txt
diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index fedc213b5f1a..da6818b2c204 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -9,7 +9,6 @@ PHYs.
Required properties:
- compatible : compatible string, one of:
- - "allwinner,sun4i-a10-ahci"
- "brcm,iproc-ahci"
- "hisilicon,hisi-ahci"
- "cavium,octeon-7130-ahci"
diff --git a/Documentation/devicetree/bindings/ata/allwinner,sun4i-a10-ahci.txt b/Documentation/devicetree/bindings/ata/allwinner,sun4i-a10-ahci.txt
new file mode 100644
index 000000000000..0eea78c14ad3
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/allwinner,sun4i-a10-ahci.txt
@@ -0,0 +1,40 @@
+Allwinner A10/A20/R40 SoC SATA AHCI Controller
+
+Required properties:
+- compatible : compatible string, one of:
+ - "allwinner,sun4i-a10-ahci"
+ - "allwinner,sun8i-r40-ahci"
+- interrupts : the SATA IRQ
+- reg : the register mapping
+- clocks : the clocks needed by SATA controller, usually contains
+ an AHB clock and a mod clock
+
+Optional properties:
+- target-supply : regulator for SATA target power
+
+Required properties for the following compatibles:
+ - "allwinner,sun8i-r40-ahci"
+- resets : the reset control needed by SATA controller
+- vdd1v2-supply : regulator for SATA controller's 1.2V VDD
+- vdd2v5-supply : regulator for SATA controller's 2.5V VDD
+
+
+Examples for A10:
+ ahci: sata@1c18000 {
+ compatible = "allwinner,sun4i-a10-ahci";
+ reg = <0x01c18000 0x1000>;
+ interrupts = <56>;
+ clocks = <&pll6 0>, <&ahb_gates 25>;
+ target-supply = <®_ahci_5v>;
+ };
+
+Examples for R40:
+ ahci: sata@1c18000 {
+ compatible = "allwinner,sun8i-r40-ahci";
+ reg = <0x01c18000 0x1000>;
+ interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_SATA>, <&ccu CLK_BUS_SATA>;
+ resets = <&ccu RST_BUS_SATA>;
+ vdd1v2-supply = <®_eldo3>;
+ vdd2v5-supply = <®_dldo4>;
+ };
--
2.13.6
^ permalink raw reply related
* [PATCH 2/2] ata: ahci_sunxi: add support for R40 SATA controller
From: Icenowy Zheng @ 2017-10-08 4:35 UTC (permalink / raw)
To: Tejun Heo, Maxime Ripard, Chen-Yu Tsai
Cc: linux-ide-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Icenowy Zheng
In-Reply-To: <20171008043541.48564-1-icenowy-h8G6r0blFSE@public.gmane.org>
Allwinner R40 SoC has an AHCI SATA controller like the one in A10/A20,
but with a reset control and two dedicated VDD pins for this controller
(one 1.2v and one 2.5v).
Add support for it.
Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
---
drivers/ata/ahci_sunxi.c | 118 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 115 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
index b26437430163..a650fd6508be 100644
--- a/drivers/ata/ahci_sunxi.c
+++ b/drivers/ata/ahci_sunxi.c
@@ -25,6 +25,7 @@
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
+#include <linux/reset.h>
#include "ahci.h"
#define DRV_NAME "ahci-sunxi"
@@ -58,6 +59,19 @@ MODULE_PARM_DESC(enable_pmp,
#define AHCI_P0PHYCR 0x0178
#define AHCI_P0PHYSR 0x017c
+struct ahci_sunxi_quirks {
+ bool has_reset;
+ bool has_vdd1v2;
+ bool has_vdd2v5;
+};
+
+struct ahci_sunxi_data {
+ const struct ahci_sunxi_quirks *quirks;
+ struct reset_control *reset;
+ struct regulator *vdd1v2;
+ struct regulator *vdd2v5;
+};
+
static void sunxi_clrbits(void __iomem *reg, u32 clr_val)
{
u32 reg_val;
@@ -179,17 +193,69 @@ static int ahci_sunxi_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ahci_host_priv *hpriv;
+ struct ahci_sunxi_data *data;
int rc;
+ data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->quirks = of_device_get_match_data(dev);
+ if (!data->quirks)
+ return -EINVAL;
+
+ if (data->quirks->has_reset) {
+ data->reset = devm_reset_control_get(dev, NULL);
+ if (IS_ERR(data->reset)) {
+ dev_err(dev, "Failed to get reset\n");
+ return PTR_ERR(data->reset);
+ }
+ }
+
+ if (data->quirks->has_vdd1v2) {
+ data->vdd1v2 = devm_regulator_get(dev, "vdd1v2");
+ if (IS_ERR(data->vdd1v2)) {
+ dev_err(dev, "Failed to get 1.2v VDD regulator\n");
+ return PTR_ERR(data->vdd1v2);
+ }
+ }
+
+ if (data->quirks->has_vdd2v5) {
+ data->vdd2v5 = devm_regulator_get(dev, "vdd2v5");
+ if (IS_ERR(data->vdd2v5)) {
+ dev_err(dev, "Failed to get 2.5v VDD regulator\n");
+ return PTR_ERR(data->vdd2v5);
+ }
+ }
+
hpriv = ahci_platform_get_resources(pdev);
if (IS_ERR(hpriv))
return PTR_ERR(hpriv);
+ hpriv->plat_data = data;
hpriv->start_engine = ahci_sunxi_start_engine;
+ if (data->quirks->has_vdd1v2) {
+ rc = regulator_enable(data->vdd1v2);
+ if (rc)
+ return rc;
+ }
+
+ if (data->quirks->has_vdd2v5) {
+ rc = regulator_enable(data->vdd2v5);
+ if (rc)
+ goto disable_vdd1v2;
+ }
+
+ if (data->quirks->has_reset) {
+ rc = reset_control_deassert(data->reset);
+ if (rc)
+ goto disable_vdd2v5;
+ }
+
rc = ahci_platform_enable_resources(hpriv);
if (rc)
- return rc;
+ goto assert_reset;
rc = ahci_sunxi_phy_init(dev, hpriv->mmio);
if (rc)
@@ -215,6 +281,35 @@ static int ahci_sunxi_probe(struct platform_device *pdev)
disable_resources:
ahci_platform_disable_resources(hpriv);
+assert_reset:
+ if (data->quirks->has_reset)
+ reset_control_assert(data->reset);
+disable_vdd2v5:
+ if (data->quirks->has_vdd2v5)
+ regulator_disable(data->vdd2v5);
+disable_vdd1v2:
+ if (data->quirks->has_vdd1v2)
+ regulator_disable(data->vdd1v2);
+ return rc;
+}
+
+static int ahci_sunxi_remove(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct ata_host *host = dev_get_drvdata(dev);
+ struct ahci_host_priv *hpriv = host->private_data;
+ struct ahci_sunxi_data *data = hpriv->plat_data;
+ int rc;
+
+ rc = ata_platform_remove_one(pdev);
+
+ if (data->quirks->has_reset)
+ reset_control_assert(data->reset);
+ if (data->quirks->has_vdd2v5)
+ regulator_disable(data->vdd2v5);
+ if (data->quirks->has_vdd1v2)
+ regulator_disable(data->vdd1v2);
+
return rc;
}
@@ -248,15 +343,32 @@ static int ahci_sunxi_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, ahci_platform_suspend,
ahci_sunxi_resume);
+static const struct ahci_sunxi_quirks sun4i_a10_ahci_quirks = {
+ /* Nothing special */
+};
+
+static const struct ahci_sunxi_quirks sun8i_r40_ahci_quirks = {
+ .has_reset = true,
+ .has_vdd1v2 = true,
+ .has_vdd2v5 = true,
+};
+
static const struct of_device_id ahci_sunxi_of_match[] = {
- { .compatible = "allwinner,sun4i-a10-ahci", },
+ {
+ .compatible = "allwinner,sun4i-a10-ahci",
+ .data = &sun4i_a10_ahci_quirks,
+ },
+ {
+ .compatible = "allwinner,sun8i-r40-ahci",
+ .data = &sun8i_r40_ahci_quirks,
+ },
{ },
};
MODULE_DEVICE_TABLE(of, ahci_sunxi_of_match);
static struct platform_driver ahci_sunxi_driver = {
.probe = ahci_sunxi_probe,
- .remove = ata_platform_remove_one,
+ .remove = ahci_sunxi_remove,
.driver = {
.name = DRV_NAME,
.of_match_table = ahci_sunxi_of_match,
--
2.13.6
^ permalink raw reply related
* Marvell 88SE9480 Port Multiplier Support
From: Andrew Ryder @ 2017-10-08 4:12 UTC (permalink / raw)
To: linux-ide
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
Hello,
Does the mvsas support port multiplier for the marvell 88SE9480 chip?
I purchased an Addonics http://addonics.com/products/ad2ms6gpx8-e.php
but the card fails to see any of the attached drives.
I found an old message saying it might support sata pmp?
https://lkml.org/lkml/2014/4/24/413
I've attached a dmesg output also and I'm running kernel 4.9.36 if that
helps.
Andrew
[-- Attachment #2: dmesg.txt --]
[-- Type: text/plain, Size: 53930 bytes --]
[ 26.552948] Adding 10485756k swap on /dev/sde2. Priority:-1 extents:1 across:10485756k
[ 27.340199] XFS (md2): Mounting V5 Filesystem
[ 27.353218] drivers/scsi/mvsas/mv_sas.c 1084:phy 0 attach dev info is 0
[ 27.353220] drivers/scsi/mvsas/mv_sas.c 1086:phy 0 attach sas addr is 0
[ 27.457219] drivers/scsi/mvsas/mv_sas.c 1084:phy 1 attach dev info is 0
[ 27.457223] drivers/scsi/mvsas/mv_sas.c 1086:phy 1 attach sas addr is 0
[ 27.561228] drivers/scsi/mvsas/mv_sas.c 1084:phy 2 attach dev info is 0
[ 27.561232] drivers/scsi/mvsas/mv_sas.c 1086:phy 2 attach sas addr is 0
[ 27.624964] XFS (md2): Ending clean mount
[ 27.665276] drivers/scsi/mvsas/mv_sas.c 1084:phy 3 attach dev info is 0
[ 27.665279] drivers/scsi/mvsas/mv_sas.c 1086:phy 3 attach sas addr is 0
[ 28.499361] XFS (md4): Mounting V5 Filesystem
[ 28.699789] XFS (md4): Ending clean mount
[ 29.606690] dmesg (4463) used greatest stack depth: 12336 bytes left
[ 30.458029] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 0
[ 30.458033] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 0
[ 30.561104] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 0
[ 30.561108] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 0
[ 30.665101] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 0
[ 30.665104] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 0
[ 30.769103] drivers/scsi/mvsas/mv_sas.c 1084:phy 7 attach dev info is 0
[ 30.769106] drivers/scsi/mvsas/mv_sas.c 1086:phy 7 attach sas addr is 0
[ 30.769119] scsi host7: mvsas
[ 33.661237] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 35.766389] igb 0000:02:00.1 eth1: igb: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
[ 35.873087] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 42.371349] RPC: Registered named UNIX socket transport module.
[ 42.371351] RPC: Registered udp transport module.
[ 42.371352] RPC: Registered tcp transport module.
[ 42.371353] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 42.741605] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[ 42.886122] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[ 42.886130] NFSD: starting 90-second grace period (net ffffffff81cc6480)
[ 125.862821] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[ 125.862840] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000081
[ 125.894065] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[ 125.894076] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00000081
[ 125.911934] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[ 125.911950] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00000081
[ 126.375437] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[ 126.375453] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00010000
[ 126.375456] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[ 126.395462] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 126.395464] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 126.515497] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 20001
[ 126.515499] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 6
[ 126.515510] drivers/scsi/mvsas/mv_sas.c 277:phy 6 byte dmaded.
[ 126.515523] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[ 126.515526] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00010000
[ 126.515543] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[ 126.515670] sas: phy-7:6 added to port-7:0, phy_mask:0x4 ( 600000000000000)
[ 126.535548] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 126.535551] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 126.655587] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 20001
[ 126.655590] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 4
[ 126.655595] drivers/scsi/mvsas/mv_sas.c 277:phy 4 byte dmaded.
[ 126.655599] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[ 126.655601] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00010000
[ 126.655606] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[ 126.675610] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 126.675612] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 126.795625] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 20001
[ 126.795627] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 5
[ 126.795631] drivers/scsi/mvsas/mv_sas.c 277:phy 5 byte dmaded.
[ 126.795768] sas: phy-7:4 added to port-7:1, phy_mask:0x1 ( 400000000000000)
[ 126.795847] sas: phy-7:5 added to port-7:2, phy_mask:0x2 ( 500000000000000)
[ 126.795865] sas: DOING DISCOVERY on port 0, pid:3059
[ 126.795869] sas: DONE DISCOVERY on port 0, pid:3059, result:0
[ 126.795880] sas: DOING DISCOVERY on port 1, pid:3059
[ 126.795884] sas: DONE DISCOVERY on port 1, pid:3059, result:0
[ 126.795895] sas: DOING DISCOVERY on port 2, pid:3059
[ 126.795898] sas: DONE DISCOVERY on port 2, pid:3059, result:0
[ 126.796008] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[ 126.796111] sas: ata7: end_device-7:0: dev error handler
[ 132.291272] ata7.00: qc timeout (cmd 0xec)
[ 132.291279] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f12df00 slot=ffff880c2c7a3578 slot_idx=x0
[ 132.291285] ata7.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 132.301383] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[ 132.301401] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000081
[ 132.811124] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[ 132.811140] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00010000
[ 132.811142] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[ 132.831148] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 132.831149] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 132.951183] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 20001
[ 132.951185] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 6
[ 132.951191] drivers/scsi/mvsas/mv_sas.c 277:phy 6 byte dmaded.
[ 134.531175] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[ 145.090588] ata7.00: qc timeout (cmd 0xec)
[ 145.090594] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f12df00 slot=ffff880c2c7a3578 slot_idx=x0
[ 145.090599] ata7.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 145.100626] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00000000.
[ 145.100631] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000001
[ 145.100667] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[ 145.100668] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000081
[ 145.610419] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[ 145.610437] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00010000
[ 145.610450] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[ 145.630455] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 145.630457] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 145.750510] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 20001
[ 145.750512] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 6
[ 145.750514] drivers/scsi/mvsas/mv_sas.c 277:phy 6 byte dmaded.
[ 147.330440] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[ 177.856715] ata7.00: qc timeout (cmd 0xec)
[ 177.856720] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f084d00 slot=ffff880c2c7a3578 slot_idx=x0
[ 177.856725] ata7.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 177.866859] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[ 177.866878] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000081
[ 178.376583] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[ 178.376599] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00010000
[ 178.376602] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[ 178.396608] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 178.396609] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 178.516629] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 20001
[ 178.516631] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 6
[ 178.516633] drivers/scsi/mvsas/mv_sas.c 277:phy 6 byte dmaded.
[ 180.096568] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[ 180.248660] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[ 180.261085] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[ 180.261113] sas: ata7: end_device-7:0: dev error handler
[ 180.261124] sas: ata8: end_device-7:1: dev error handler
[ 185.536256] ata8.00: qc timeout (cmd 0xec)
[ 185.536262] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f1c0700 slot=ffff880c2c7a3578 slot_idx=x0
[ 185.536266] ata8.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 185.546364] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[ 185.546382] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00000081
[ 186.052216] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[ 186.052232] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00010000
[ 186.052235] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[ 186.072245] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 186.072247] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 186.192266] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 20001
[ 186.192268] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 4
[ 186.192275] drivers/scsi/mvsas/mv_sas.c 277:phy 4 byte dmaded.
[ 187.776119] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[ 198.335558] ata8.00: qc timeout (cmd 0xec)
[ 198.335564] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f1c0e00 slot=ffff880c2c7a3578 slot_idx=x0
[ 198.335568] ata8.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 198.345665] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[ 198.345684] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00000081
[ 198.851516] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[ 198.851532] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00010000
[ 198.851535] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[ 198.871541] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 198.871542] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 198.991581] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 20001
[ 198.991583] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 4
[ 198.991585] drivers/scsi/mvsas/mv_sas.c 277:phy 4 byte dmaded.
[ 200.575392] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[ 231.101649] ata8.00: qc timeout (cmd 0xec)
[ 231.101655] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082edf2200 slot=ffff880c2c7a3578 slot_idx=x0
[ 231.101659] ata8.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 231.111758] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[ 231.111776] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00000081
[ 231.617609] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[ 231.617625] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00010000
[ 231.617628] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[ 231.637634] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 231.637635] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 231.757678] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 20001
[ 231.757680] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 4
[ 231.757682] drivers/scsi/mvsas/mv_sas.c 277:phy 4 byte dmaded.
[ 233.341539] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[ 233.493621] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[ 233.504698] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[ 233.504726] sas: ata7: end_device-7:0: dev error handler
[ 233.504740] sas: ata8: end_device-7:1: dev error handler
[ 233.504743] sas: ata9: end_device-7:2: dev error handler
[ 238.781244] ata9.00: qc timeout (cmd 0xec)
[ 238.781250] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f7fbf00 slot=ffff880c2c7a3578 slot_idx=x0
[ 238.781254] ata9.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 238.791351] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[ 238.791369] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00000081
[ 239.309356] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[ 239.309372] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00010000
[ 239.309375] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[ 239.329381] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 239.329383] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 239.449404] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 20001
[ 239.449406] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 5
[ 239.449413] drivers/scsi/mvsas/mv_sas.c 277:phy 5 byte dmaded.
[ 241.021079] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[ 251.580497] ata9.00: qc timeout (cmd 0xec)
[ 251.580505] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f7fb300 slot=ffff880c2c7a3578 slot_idx=x0
[ 251.580512] ata9.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 251.590631] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[ 251.590651] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00000081
[ 252.108620] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[ 252.108637] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00010000
[ 252.108639] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[ 252.128646] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 252.128648] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 252.248724] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 20001
[ 252.248726] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 5
[ 252.248728] drivers/scsi/mvsas/mv_sas.c 277:phy 5 byte dmaded.
[ 253.820395] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[ 284.346600] ata9.00: qc timeout (cmd 0xec)
[ 284.346608] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88083e208d00 slot=ffff880c2c7a3578 slot_idx=x0
[ 284.346615] ata9.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 284.356719] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[ 284.356739] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00000081
[ 284.874707] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[ 284.874723] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00010000
[ 284.874725] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[ 284.894731] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 284.894733] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 285.014761] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 20001
[ 285.014763] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 5
[ 285.014766] drivers/scsi/mvsas/mv_sas.c 277:phy 5 byte dmaded.
[ 286.586504] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[ 286.738590] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[ 286.749813] sas: sas_form_port: phy2 belongs to port0 already(1)!
[ 286.749817] sas: sas_form_port: phy0 belongs to port1 already(1)!
[ 286.749820] sas: sas_form_port: phy1 belongs to port2 already(1)!
[ 379.595104] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00000000.
[ 379.595123] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x01001001
[ 380.095195] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00000000.
[ 380.095198] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x01001001
[ 380.595234] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00000000.
[ 380.595236] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x01001001
[ 382.069021] drivers/scsi/mvsas/mv_sas.c 1918:phy2 Removed Device
[ 382.069246] ------------[ cut here ]------------
[ 382.069261] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 382.069262] sysfs group 'power' not found for kobject 'end_device-7:0'
[ 382.069264] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 382.069299] CPU: 23 PID: 3059 Comm: kworker/u64:1 Not tainted 4.9.36 #2
[ 382.069301] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 382.069313] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 382.069316] ffffc90009d33c58 ffffffff812f25d6 ffffc90009d33ca8 0000000000000000
[ 382.069322] ffffc90009d33c98 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 382.069326] ffffffff81ca0240 ffff88083f85a410 ffff880c2c701fa8 ffff880c2c701f78
[ 382.069331] Call Trace:
[ 382.069339] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 382.069344] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 382.069347] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 382.069352] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 382.069356] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 382.069361] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 382.069365] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 382.069369] [<ffffffff8143ffed>] device_unregister+0xd/0x20
[ 382.069374] [<ffffffff812e8709>] bsg_unregister_queue+0x59/0xa0
[ 382.069379] [<ffffffff8147a609>] sas_rphy_remove+0x49/0x80
[ 382.069383] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 382.069391] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 382.069396] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 382.069400] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 382.069403] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 382.069408] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 382.069412] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 382.069418] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 382.069420] ---[ end trace 5c901a33e742b9c5 ]---
[ 382.069519] ------------[ cut here ]------------
[ 382.069525] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 382.069526] sysfs group 'power' not found for kobject 'end_device-7:0'
[ 382.069527] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 382.069551] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 382.069553] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 382.069559] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 382.069562] ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[ 382.069566] ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 382.069571] ffffffff81ca0240 ffff880c3f851c38 ffff880c2c701fa8 ffff880c2c701f78
[ 382.069575] Call Trace:
[ 382.069579] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 382.069583] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 382.069586] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 382.069590] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 382.069594] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 382.069598] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 382.069601] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 382.069604] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 382.069607] [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[ 382.069612] [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[ 382.069615] [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[ 382.069619] [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[ 382.069622] [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[ 382.069626] [<ffffffff81448570>] transport_remove_device+0x10/0x20
[ 382.069629] [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[ 382.069633] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 382.069641] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 382.069644] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 382.069648] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 382.069652] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 382.069656] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 382.069660] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 382.069663] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 382.069666] ---[ end trace 5c901a33e742b9c6 ]---
[ 382.069684] ------------[ cut here ]------------
[ 382.069688] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 382.069690] sysfs group 'power' not found for kobject 'end_device-7:0'
[ 382.069691] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 382.069715] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 382.069716] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 382.069722] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 382.069725] ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[ 382.069729] ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 382.069733] ffffffff81ca0240 ffff880c3f851438 ffff880c2c701fa8 ffff880c2c701f78
[ 382.069737] Call Trace:
[ 382.069741] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 382.069744] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 382.069748] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 382.069751] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 382.069755] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 382.069759] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 382.069762] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 382.069765] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 382.069768] [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[ 382.069772] [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[ 382.069776] [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[ 382.069779] [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[ 382.069783] [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[ 382.069786] [<ffffffff81448570>] transport_remove_device+0x10/0x20
[ 382.069790] [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[ 382.069794] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 382.069801] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 382.069805] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 382.069808] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 382.069812] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 382.069816] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 382.069820] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 382.069824] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 382.069826] ---[ end trace 5c901a33e742b9c7 ]---
[ 382.069842] ------------[ cut here ]------------
[ 382.069846] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 382.069848] sysfs group 'power' not found for kobject 'end_device-7:0'
[ 382.069849] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 382.069872] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 382.069873] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 382.069880] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 382.069882] ffffc90009d33c88 ffffffff812f25d6 ffffc90009d33cd8 0000000000000000
[ 382.069886] ffffc90009d33cc8 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 382.069890] ffffffff81ca0240 ffff880c2f4e5810 ffff880c2c701fa8 ffff880c2c701f78
[ 382.069894] Call Trace:
[ 382.069898] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 382.069901] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 382.069905] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 382.069908] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 382.069912] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 382.069916] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 382.069919] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 382.069922] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 382.069926] [<ffffffff8147a619>] sas_rphy_remove+0x59/0x80
[ 382.069930] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 382.069937] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 382.069941] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 382.069948] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 382.069951] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 382.069955] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 382.069972] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 382.069987] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 382.070021] ---[ end trace 5c901a33e742b9c8 ]---
[ 382.070032] drivers/scsi/mvsas/mv_sas.c 1262:found dev[0:5] is gone.
[ 382.645025] drivers/scsi/mvsas/mv_sas.c 1918:phy0 Removed Device
[ 382.645239] ------------[ cut here ]------------
[ 382.645248] WARNING: CPU: 18 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 382.645250] sysfs group 'power' not found for kobject 'end_device-7:1'
[ 382.645251] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 382.645281] CPU: 18 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 382.645282] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 382.645291] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 382.645294] ffffc90009d33c58 ffffffff812f25d6 ffffc90009d33ca8 0000000000000000
[ 382.645300] ffffc90009d33c98 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 382.645304] ffffffff81ca0240 ffff88083f849410 ffff880c2c702268 ffff880c2c702238
[ 382.645309] Call Trace:
[ 382.645315] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 382.645319] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 382.645322] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 382.645326] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 382.645330] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 382.645334] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 382.645337] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 382.645341] [<ffffffff8143ffed>] device_unregister+0xd/0x20
[ 382.645345] [<ffffffff812e8709>] bsg_unregister_queue+0x59/0xa0
[ 382.645350] [<ffffffff8147a609>] sas_rphy_remove+0x49/0x80
[ 382.645354] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 382.645361] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 382.645366] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 382.645369] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 382.645373] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 382.645377] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 382.645381] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 382.645386] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 382.645388] ---[ end trace 5c901a33e742b9c9 ]---
[ 382.645462] ------------[ cut here ]------------
[ 382.645468] WARNING: CPU: 18 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 382.645469] sysfs group 'power' not found for kobject 'end_device-7:1'
[ 382.645470] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 382.645495] CPU: 18 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 382.645496] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 382.645503] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 382.645506] ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[ 382.645510] ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 382.645515] ffffffff81ca0240 ffff880c2f4e7438 ffff880c2c702268 ffff880c2c702238
[ 382.645519] Call Trace:
[ 382.645524] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 382.645527] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 382.645530] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 382.645534] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 382.645538] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 382.645542] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 382.645544] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 382.645548] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 382.645551] [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[ 382.645555] [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[ 382.645559] [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[ 382.645562] [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[ 382.645566] [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[ 382.645569] [<ffffffff81448570>] transport_remove_device+0x10/0x20
[ 382.645573] [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[ 382.645576] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 382.645584] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 382.645588] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 382.645591] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 382.645595] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 382.645599] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 382.645603] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 382.645607] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 382.645609] ---[ end trace 5c901a33e742b9ca ]---
[ 382.645626] ------------[ cut here ]------------
[ 382.645631] WARNING: CPU: 18 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 382.645632] sysfs group 'power' not found for kobject 'end_device-7:1'
[ 382.645633] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 382.645657] CPU: 18 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 382.645659] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 382.645665] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 382.645667] ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[ 382.645672] ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 382.645676] ffffffff81ca0240 ffff880c2f4e7038 ffff880c2c702268 ffff880c2c702238
[ 382.645680] Call Trace:
[ 382.645684] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 382.645687] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 382.645691] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 382.645694] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 382.645698] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 382.645702] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 382.645705] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 382.645708] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 382.645711] [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[ 382.645715] [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[ 382.645719] [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[ 382.645722] [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[ 382.645746] [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[ 382.645758] [<ffffffff81448570>] transport_remove_device+0x10/0x20
[ 382.645768] [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[ 382.645778] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 382.645789] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 382.645800] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 382.645811] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 382.645820] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 382.645829] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 382.645839] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 382.645850] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 382.645857] ---[ end trace 5c901a33e742b9cb ]---
[ 382.645879] ------------[ cut here ]------------
[ 382.645883] WARNING: CPU: 18 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 382.645898] sysfs group 'power' not found for kobject 'end_device-7:1'
[ 382.645898] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 382.645929] CPU: 18 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 382.645931] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 382.645939] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 382.645942] ffffc90009d33c88 ffffffff812f25d6 ffffc90009d33cd8 0000000000000000
[ 382.645947] ffffc90009d33cc8 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 382.645952] ffffffff81ca0240 ffff880c3f851810 ffff880c2c702268 ffff880c2c702238
[ 382.645958] Call Trace:
[ 382.645963] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 382.645967] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 382.645971] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 382.645975] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 382.645978] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 382.645982] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 382.645985] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 382.645988] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 382.645992] [<ffffffff8147a619>] sas_rphy_remove+0x59/0x80
[ 382.645996] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 382.646003] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 382.646007] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 382.646010] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 382.646013] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 382.646017] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 382.646021] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 382.646025] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 382.646027] ---[ end trace 5c901a33e742b9cc ]---
[ 382.646037] drivers/scsi/mvsas/mv_sas.c 1262:found dev[1:5] is gone.
[ 383.156972] drivers/scsi/mvsas/mv_sas.c 1918:phy1 Removed Device
[ 383.157173] ------------[ cut here ]------------
[ 383.157183] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 383.157184] sysfs group 'power' not found for kobject 'end_device-7:2'
[ 383.157185] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 383.157214] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 383.157216] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 383.157225] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 383.157228] ffffc90009d33c58 ffffffff812f25d6 ffffc90009d33ca8 0000000000000000
[ 383.157233] ffffc90009d33c98 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 383.157237] ffffffff81ca0240 ffff88082f541410 ffff880c2c702528 ffff880c2c7024f8
[ 383.157242] Call Trace:
[ 383.157247] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 383.157251] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 383.157255] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 383.157259] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 383.157263] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 383.157266] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 383.157270] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 383.157273] [<ffffffff8143ffed>] device_unregister+0xd/0x20
[ 383.157278] [<ffffffff812e8709>] bsg_unregister_queue+0x59/0xa0
[ 383.157282] [<ffffffff8147a609>] sas_rphy_remove+0x49/0x80
[ 383.157286] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 383.157294] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 383.157298] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 383.157301] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 383.157305] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 383.157309] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 383.157313] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 383.157317] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 383.157320] ---[ end trace 5c901a33e742b9cd ]---
[ 383.157405] ------------[ cut here ]------------
[ 383.157410] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 383.157411] sysfs group 'power' not found for kobject 'end_device-7:2'
[ 383.157412] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 383.157437] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 383.157438] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 383.157445] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 383.157447] ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[ 383.157452] ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 383.157456] ffffffff81ca0240 ffff880c2e0dcc38 ffff880c2c702528 ffff880c2c7024f8
[ 383.157460] Call Trace:
[ 383.157464] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 383.157468] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 383.157471] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 383.157475] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 383.157479] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 383.157482] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 383.157485] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 383.157489] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 383.157492] [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[ 383.157496] [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[ 383.157499] [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[ 383.157503] [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[ 383.157506] [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[ 383.157509] [<ffffffff81448570>] transport_remove_device+0x10/0x20
[ 383.157513] [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[ 383.157517] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 383.157524] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 383.157528] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 383.157531] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 383.157535] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 383.157539] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 383.157543] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 383.157547] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 383.157549] ---[ end trace 5c901a33e742b9ce ]---
[ 383.157566] ------------[ cut here ]------------
[ 383.157571] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 383.157572] sysfs group 'power' not found for kobject 'end_device-7:2'
[ 383.157573] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 383.157597] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 383.157598] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 383.157605] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 383.157607] ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[ 383.157611] ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 383.157615] ffffffff81ca0240 ffff880c2e0dc438 ffff880c2c702528 ffff880c2c7024f8
[ 383.157619] Call Trace:
[ 383.157623] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 383.157626] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 383.157629] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 383.157633] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 383.157637] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 383.157640] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 383.157643] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 383.157647] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 383.157650] [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[ 383.157653] [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[ 383.157657] [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[ 383.157660] [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[ 383.157664] [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[ 383.157667] [<ffffffff81448570>] transport_remove_device+0x10/0x20
[ 383.157671] [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[ 383.157675] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 383.157682] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 383.157686] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 383.157689] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 383.157693] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 383.157697] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 383.157701] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 383.157704] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 383.157706] ---[ end trace 5c901a33e742b9cf ]---
[ 383.157726] ------------[ cut here ]------------
[ 383.157731] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[ 383.157732] sysfs group 'power' not found for kobject 'end_device-7:2'
[ 383.157733] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[ 383.157756] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G W 4.9.36 #2
[ 383.157757] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5 11/25/2013
[ 383.157764] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[ 383.157766] ffffc90009d33c88 ffffffff812f25d6 ffffc90009d33cd8 0000000000000000
[ 383.157770] ffffc90009d33cc8 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[ 383.157774] ffffffff81ca0240 ffff880c3f83f810 ffff880c2c702528 ffff880c2c7024f8
[ 383.157778] Call Trace:
[ 383.157782] [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[ 383.157785] [<ffffffff81058b0e>] __warn+0xde/0x100
[ 383.157789] [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[ 383.157792] [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[ 383.157796] [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[ 383.157800] [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[ 383.157802] [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[ 383.157806] [<ffffffff8143fdc3>] device_del+0x53/0x270
[ 383.157810] [<ffffffff8147a619>] sas_rphy_remove+0x59/0x80
[ 383.157814] [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[ 383.157821] [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[ 383.157824] [<ffffffff8107114f>] process_one_work+0x14f/0x400
[ 383.157828] [<ffffffff81071766>] worker_thread+0x46/0x470
[ 383.157831] [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[ 383.157835] [<ffffffff81076662>] kthread+0xd2/0xf0
[ 383.157839] [<ffffffff81076590>] ? kthread_park+0x70/0x70
[ 383.157843] [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[ 383.157845] ---[ end trace 5c901a33e742b9d0 ]---
[ 383.157875] drivers/scsi/mvsas/mv_sas.c 1262:found dev[2:5] is gone.
[ 387.738726] drivers/scsi/mvsas/mv_sas.c 1980:phy 1 ctrl sts=0x00111000.
[ 387.738743] drivers/scsi/mvsas/mv_sas.c 1982:phy 1 irq sts = 0x00000081
[ 387.755992] drivers/scsi/mvsas/mv_sas.c 1980:phy 2 ctrl sts=0x00111000.
[ 387.756008] drivers/scsi/mvsas/mv_sas.c 1982:phy 2 irq sts = 0x00000081
[ 387.773626] drivers/scsi/mvsas/mv_sas.c 1980:phy 0 ctrl sts=0x00111000.
[ 387.773642] drivers/scsi/mvsas/mv_sas.c 1982:phy 0 irq sts = 0x00000081
[ 388.256644] drivers/scsi/mvsas/mv_sas.c 1980:phy 1 ctrl sts=0x00111000.
[ 388.256660] drivers/scsi/mvsas/mv_sas.c 1982:phy 1 irq sts = 0x00010000
[ 388.256663] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[ 388.276669] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 388.276670] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 388.396709] drivers/scsi/mvsas/mv_sas.c 1084:phy 1 attach dev info is 20001
[ 388.396711] drivers/scsi/mvsas/mv_sas.c 1086:phy 1 attach sas addr is 1
[ 388.396717] drivers/scsi/mvsas/mv_sas.c 277:phy 1 byte dmaded.
[ 388.396730] drivers/scsi/mvsas/mv_sas.c 1980:phy 0 ctrl sts=0x00111000.
[ 388.396732] drivers/scsi/mvsas/mv_sas.c 1982:phy 0 irq sts = 0x00010000
[ 388.396734] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[ 388.396906] sas: phy-7:1 added to port-7:0, phy_mask:0x2 ( 100000000000000)
[ 388.416741] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 388.416743] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 388.536759] drivers/scsi/mvsas/mv_sas.c 1084:phy 0 attach dev info is 20001
[ 388.536761] drivers/scsi/mvsas/mv_sas.c 1086:phy 0 attach sas addr is 0
[ 388.536772] drivers/scsi/mvsas/mv_sas.c 277:phy 0 byte dmaded.
[ 388.536778] drivers/scsi/mvsas/mv_sas.c 1980:phy 2 ctrl sts=0x00111000.
[ 388.536780] drivers/scsi/mvsas/mv_sas.c 1982:phy 2 irq sts = 0x00010000
[ 388.536783] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[ 388.556788] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 388.556790] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 388.676820] drivers/scsi/mvsas/mv_sas.c 1084:phy 2 attach dev info is 20001
[ 388.676822] drivers/scsi/mvsas/mv_sas.c 1086:phy 2 attach sas addr is 2
[ 388.676830] drivers/scsi/mvsas/mv_sas.c 277:phy 2 byte dmaded.
[ 388.676936] sas: phy-7:0 added to port-7:1, phy_mask:0x1 ( 0)
[ 388.677006] sas: phy-7:2 added to port-7:2, phy_mask:0x4 ( 200000000000000)
[ 388.677031] sas: DOING DISCOVERY on port 0, pid:3059
[ 388.677037] sas: DONE DISCOVERY on port 0, pid:3059, result:0
[ 388.677050] sas: DOING DISCOVERY on port 1, pid:3059
[ 388.677054] sas: DONE DISCOVERY on port 1, pid:3059, result:0
[ 388.677068] sas: DOING DISCOVERY on port 2, pid:3059
[ 388.677072] sas: DONE DISCOVERY on port 2, pid:3059, result:0
[ 388.677182] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[ 388.677284] sas: ata10: end_device-7:0: dev error handler
[ 393.908358] ata10.00: qc timeout (cmd 0xec)
[ 393.908364] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082dc81000 slot=ffff880c2c723578 slot_idx=x0
[ 393.908370] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 393.918467] drivers/scsi/mvsas/mv_sas.c 1980:phy 1 ctrl sts=0x00111000.
[ 393.918485] drivers/scsi/mvsas/mv_sas.c 1982:phy 1 irq sts = 0x00000081
[ 394.436442] drivers/scsi/mvsas/mv_sas.c 1980:phy 1 ctrl sts=0x00111000.
[ 394.436458] drivers/scsi/mvsas/mv_sas.c 1982:phy 1 irq sts = 0x00010000
[ 394.436461] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[ 394.456467] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[ 394.456468] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[ 394.576513] drivers/scsi/mvsas/mv_sas.c 1084:phy 1 attach dev info is 20001
[ 394.576514] drivers/scsi/mvsas/mv_sas.c 1086:phy 1 attach sas addr is 1
[ 394.576520] drivers/scsi/mvsas/mv_sas.c 277:phy 1 byte dmaded.
[ 396.148223] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[ 406.707696] ata10.00: qc timeout (cmd 0xec)
[ 406.707702] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082eb44500 slot=ffff880c2c723578 slot_idx=x0
[ 406.707707] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 408.947530] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[ 439.473756] ata10.00: qc timeout (cmd 0xec)
[ 439.473762] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082eb44500 slot=ffff880c2c723578 slot_idx=x0
[ 439.473767] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 441.713616] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[ 441.865725] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[ 441.878091] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[ 441.878251] sas: ata10: end_device-7:0: dev error handler
[ 441.878260] sas: ata11: end_device-7:1: dev error handler
[ 447.153287] ata11.00: qc timeout (cmd 0xec)
[ 447.153292] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082ecf4a00 slot=ffff880c2c723578 slot_idx=x0
[ 447.153297] ata11.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 449.393185] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[ 459.952593] ata11.00: qc timeout (cmd 0xec)
[ 459.952599] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082ecf4e00 slot=ffff880c2c723578 slot_idx=x0
[ 459.952603] ata11.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 462.192479] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[ 492.718726] ata11.00: qc timeout (cmd 0xec)
[ 492.718733] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082ecf4000 slot=ffff880c2c723578 slot_idx=x0
[ 492.718740] ata11.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 494.958613] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[ 495.110598] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[ 495.111738] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[ 495.111759] sas: ata10: end_device-7:0: dev error handler
[ 495.111767] sas: ata11: end_device-7:1: dev error handler
[ 495.111779] sas: ata12: end_device-7:2: dev error handler
[ 500.398282] ata12.00: qc timeout (cmd 0xec)
[ 500.398288] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff880c2e10d300 slot=ffff880c2c723578 slot_idx=x0
[ 500.398294] ata12.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 502.638139] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[ 513.197557] ata12.00: qc timeout (cmd 0xec)
[ 513.197564] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff880c2e10d300 slot=ffff880c2c723578 slot_idx=x0
[ 513.197571] ata12.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 515.437417] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[ 545.963605] ata12.00: qc timeout (cmd 0xec)
[ 545.963612] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff880c2ec65000 slot=ffff880c2c723578 slot_idx=x0
[ 545.963619] ata12.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[ 548.203465] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[ 548.355561] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[ 548.366827] sas: sas_form_port: phy1 belongs to port0 already(1)!
[ 795.861515] kworker/dying (6598) used greatest stack depth: 11896 bytes left
[ 805.021010] kworker/dying (1153) used greatest stack depth: 11824 bytes left
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox