2019-06-27 16:15:13

by Konstantin Khorenko

[permalink] [raw]
Subject: [PATCH 1/1] scsi: aacraid: resurrect correct arc ctrl checks for Series-6

This partially reverts ms commit
395e5df79a95 ("scsi: aacraid: Remove reference to Series-9")

The patch above not only drops Series-9 cards checks but also
changes logic for Series-6 controllers which leads to controller
hangs/resets under high io load.

So revert to original arc ctrl checks for Series-6 controllers.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777586
https://bugzilla.redhat.com/show_bug.cgi?id=1724077
https://jira.sw.ru/browse/PSBM-95736

Fixes: 395e5df79a95 ("scsi: aacraid: Remove reference to Series-9")
Cc: [email protected]

Signed-off-by: Konstantin Khorenko <[email protected]>
---
drivers/scsi/aacraid/aacraid.h | 11 -----------
drivers/scsi/aacraid/comminit.c | 14 ++++++++++----
drivers/scsi/aacraid/commsup.c | 4 +++-
drivers/scsi/aacraid/linit.c | 7 +++++--
4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 3fa03230f6ba..b674fb645523 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -2729,17 +2729,6 @@ int _aac_rx_init(struct aac_dev *dev);
int aac_rx_select_comm(struct aac_dev *dev, int comm);
int aac_rx_deliver_producer(struct fib * fib);

-static inline int aac_is_src(struct aac_dev *dev)
-{
- u16 device = dev->pdev->device;
-
- if (device == PMC_DEVICE_S6 ||
- device == PMC_DEVICE_S7 ||
- device == PMC_DEVICE_S8)
- return 1;
- return 0;
-}
-
static inline int aac_supports_2T(struct aac_dev *dev)
{
return (dev->adapter_info.options & AAC_OPT_NEW_COMM_64);
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index d4fcfa1e54e0..b8046b6c1239 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -41,7 +41,9 @@ static inline int aac_is_msix_mode(struct aac_dev *dev)
{
u32 status = 0;

- if (aac_is_src(dev))
+ if (dev->pdev->device == PMC_DEVICE_S6 ||
+ dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8)
status = src_readl(dev, MUnit.OMR);
return (status & AAC_INT_MODE_MSIX);
}
@@ -349,7 +351,8 @@ int aac_send_shutdown(struct aac_dev * dev)
/* FIB should be freed only after getting the response from the F/W */
if (status != -ERESTARTSYS)
aac_fib_free(fibctx);
- if (aac_is_src(dev) &&
+ if ((dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8) &&
dev->msi_enabled)
aac_set_intx_mode(dev);
return status;
@@ -605,7 +608,8 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
dev->max_fib_size = status[1] & 0xFFE0;
host->sg_tablesize = status[2] >> 16;
dev->sg_tablesize = status[2] & 0xFFFF;
- if (aac_is_src(dev)) {
+ if (dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8) {
if (host->can_queue > (status[3] >> 16) -
AAC_NUM_MGT_FIB)
host->can_queue = (status[3] >> 16) -
@@ -624,7 +628,9 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
pr_warn("numacb=%d ignored\n", numacb);
}

- if (aac_is_src(dev))
+ if (dev->pdev->device == PMC_DEVICE_S6 ||
+ dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8)
aac_define_int_mode(dev);
/*
* Ok now init the communication subsystem
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 2142a649e865..705e003caa95 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -2574,7 +2574,9 @@ void aac_free_irq(struct aac_dev *dev)
{
int i;

- if (aac_is_src(dev)) {
+ if (dev->pdev->device == PMC_DEVICE_S6 ||
+ dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8) {
if (dev->max_msix > 1) {
for (i = 0; i < dev->max_msix; i++)
free_irq(pci_irq_vector(dev->pdev, i),
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 644f7f5c61a2..3b7968b17169 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1560,7 +1560,9 @@ static void __aac_shutdown(struct aac_dev * aac)

aac_adapter_disable_int(aac);

- if (aac_is_src(aac)) {
+ if (aac->pdev->device == PMC_DEVICE_S6 ||
+ aac->pdev->device == PMC_DEVICE_S7 ||
+ aac->pdev->device == PMC_DEVICE_S8) {
if (aac->max_msix > 1) {
for (i = 0; i < aac->max_msix; i++) {
free_irq(pci_irq_vector(aac->pdev, i),
@@ -1835,7 +1837,8 @@ static int aac_acquire_resources(struct aac_dev *dev)
aac_adapter_enable_int(dev);


- if (aac_is_src(dev))
+ if (dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8)
aac_define_int_mode(dev);

if (dev->msi_enabled)
--
2.15.1


2019-07-07 12:13:54

by Andrey Melnikov

[permalink] [raw]
Subject: Re: [PATCH 1/1] scsi: aacraid: resurrect correct arc ctrl checks for Series-6

In gmane.linux.scsi Konstantin Khorenko <[email protected]> wrote:
> This partially reverts ms commit
> 395e5df79a95 ("scsi: aacraid: Remove reference to Series-9")

> The patch above not only drops Series-9 cards checks but also
> changes logic for Series-6 controllers which leads to controller
> hangs/resets under high io load.

> So revert to original arc ctrl checks for Series-6 controllers.

> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777586
> https://bugzilla.redhat.com/show_bug.cgi?id=1724077
> https://jira.sw.ru/browse/PSBM-95736

> Fixes: 395e5df79a95 ("scsi: aacraid: Remove reference to Series-9")
> Cc: [email protected]

> Signed-off-by: Konstantin Khorenko <[email protected]>
> ---
> drivers/scsi/aacraid/aacraid.h | 11 -----------
> drivers/scsi/aacraid/comminit.c | 14 ++++++++++----
> drivers/scsi/aacraid/commsup.c | 4 +++-
> drivers/scsi/aacraid/linit.c | 7 +++++--
> 4 files changed, 18 insertions(+), 18 deletions(-)

> diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
> index 3fa03230f6ba..b674fb645523 100644
> --- a/drivers/scsi/aacraid/aacraid.h
> +++ b/drivers/scsi/aacraid/aacraid.h
> @@ -2729,17 +2729,6 @@ int _aac_rx_init(struct aac_dev *dev);
> int aac_rx_select_comm(struct aac_dev *dev, int comm);
> int aac_rx_deliver_producer(struct fib * fib);
>
> -static inline int aac_is_src(struct aac_dev *dev)
> -{
> - u16 device = dev->pdev->device;
> -
> - if (device == PMC_DEVICE_S6 ||
> - device == PMC_DEVICE_S7 ||
> - device == PMC_DEVICE_S8)
> - return 1;
> - return 0;
> -}
> -

Why remove helper?

> static inline int aac_supports_2T(struct aac_dev *dev)
> {
> return (dev->adapter_info.options & AAC_OPT_NEW_COMM_64);
> diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
> index d4fcfa1e54e0..b8046b6c1239 100644
> --- a/drivers/scsi/aacraid/comminit.c
> +++ b/drivers/scsi/aacraid/comminit.c
> @@ -41,7 +41,9 @@ static inline int aac_is_msix_mode(struct aac_dev *dev)
> {
> u32 status = 0;
>
> - if (aac_is_src(dev))
> + if (dev->pdev->device == PMC_DEVICE_S6 ||
> + dev->pdev->device == PMC_DEVICE_S7 ||
> + dev->pdev->device == PMC_DEVICE_S8)
> status = src_readl(dev, MUnit.OMR);
> return (status & AAC_INT_MODE_MSIX);
> }
> @@ -349,7 +351,8 @@ int aac_send_shutdown(struct aac_dev * dev)
> /* FIB should be freed only after getting the response from the F/W */
> if (status != -ERESTARTSYS)
> aac_fib_free(fibctx);
Fix this
> - if (aac_is_src(dev) &&
> + if ((dev->pdev->device == PMC_DEVICE_S7 ||
> + dev->pdev->device == PMC_DEVICE_S8) &&
> dev->msi_enabled)
> aac_set_intx_mode(dev);
> return status;
> @@ -605,7 +608,8 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
> dev->max_fib_size = status[1] & 0xFFE0;
> host->sg_tablesize = status[2] >> 16;
> dev->sg_tablesize = status[2] & 0xFFFF;
this one
> - if (aac_is_src(dev)) {
> + if (dev->pdev->device == PMC_DEVICE_S7 ||
> + dev->pdev->device == PMC_DEVICE_S8) {
> if (host->can_queue > (status[3] >> 16) -
> AAC_NUM_MGT_FIB)
> host->can_queue = (status[3] >> 16) -
> @@ -624,7 +628,9 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
> pr_warn("numacb=%d ignored\n", numacb);
> }
>
> - if (aac_is_src(dev))
> + if (dev->pdev->device == PMC_DEVICE_S6 ||
> + dev->pdev->device == PMC_DEVICE_S7 ||
> + dev->pdev->device == PMC_DEVICE_S8)
> aac_define_int_mode(dev);
> /*
> * Ok now init the communication subsystem
> diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
> index 2142a649e865..705e003caa95 100644
> --- a/drivers/scsi/aacraid/commsup.c
> +++ b/drivers/scsi/aacraid/commsup.c
> @@ -2574,7 +2574,9 @@ void aac_free_irq(struct aac_dev *dev)
> {
> int i;
>
> - if (aac_is_src(dev)) {
> + if (dev->pdev->device == PMC_DEVICE_S6 ||
> + dev->pdev->device == PMC_DEVICE_S7 ||
> + dev->pdev->device == PMC_DEVICE_S8) {
> if (dev->max_msix > 1) {
> for (i = 0; i < dev->max_msix; i++)
> free_irq(pci_irq_vector(dev->pdev, i),
> diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
> index 644f7f5c61a2..3b7968b17169 100644
> --- a/drivers/scsi/aacraid/linit.c
> +++ b/drivers/scsi/aacraid/linit.c
> @@ -1560,7 +1560,9 @@ static void __aac_shutdown(struct aac_dev * aac)
>
> aac_adapter_disable_int(aac);
>
> - if (aac_is_src(aac)) {
> + if (aac->pdev->device == PMC_DEVICE_S6 ||
> + aac->pdev->device == PMC_DEVICE_S7 ||
> + aac->pdev->device == PMC_DEVICE_S8) {
> if (aac->max_msix > 1) {
> for (i = 0; i < aac->max_msix; i++) {
> free_irq(pci_irq_vector(aac->pdev, i),
> @@ -1835,7 +1837,8 @@ static int aac_acquire_resources(struct aac_dev *dev)
> aac_adapter_enable_int(dev);
>
>
and this.
> - if (aac_is_src(dev))
> + if (dev->pdev->device == PMC_DEVICE_S7 ||
> + dev->pdev->device == PMC_DEVICE_S8)
> aac_define_int_mode(dev);
>
> if (dev->msi_enabled)


2019-07-08 03:41:33

by Finn Thain

[permalink] [raw]
Subject: Re: [PATCH 1/1] scsi: aacraid: resurrect correct arc ctrl checks for Series-6

Andrey,

It is helpful to send your review to the patch author. I've added
Konstantin to the Cc list, as well as Raghava (who introduced the
regression addressed by Konstantin's patch).

If I'm not mistaken, your review misunderstands the patch description.

FWIW, Konstantin's patch might have been easier to follow if it was a
simple 'git revert'.

--

On Sun, 7 Jul 2019, Andrey Jr. Melnikov wrote:

> In gmane.linux.scsi Konstantin Khorenko <[email protected]> wrote:
> > This partially reverts ms commit
> > 395e5df79a95 ("scsi: aacraid: Remove reference to Series-9")
>
> > The patch above not only drops Series-9 cards checks but also
> > changes logic for Series-6 controllers which leads to controller
> > hangs/resets under high io load.
>
> > So revert to original arc ctrl checks for Series-6 controllers.
>
> > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777586
> > https://bugzilla.redhat.com/show_bug.cgi?id=1724077
> > https://jira.sw.ru/browse/PSBM-95736
>
> > Fixes: 395e5df79a95 ("scsi: aacraid: Remove reference to Series-9")
> > Cc: [email protected]
>
> > Signed-off-by: Konstantin Khorenko <[email protected]>
> > ---
> > drivers/scsi/aacraid/aacraid.h | 11 -----------
> > drivers/scsi/aacraid/comminit.c | 14 ++++++++++----
> > drivers/scsi/aacraid/commsup.c | 4 +++-
> > drivers/scsi/aacraid/linit.c | 7 +++++--
> > 4 files changed, 18 insertions(+), 18 deletions(-)
>
> > diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
> > index 3fa03230f6ba..b674fb645523 100644
> > --- a/drivers/scsi/aacraid/aacraid.h
> > +++ b/drivers/scsi/aacraid/aacraid.h
> > @@ -2729,17 +2729,6 @@ int _aac_rx_init(struct aac_dev *dev);
> > int aac_rx_select_comm(struct aac_dev *dev, int comm);
> > int aac_rx_deliver_producer(struct fib * fib);
> >
> > -static inline int aac_is_src(struct aac_dev *dev)
> > -{
> > - u16 device = dev->pdev->device;
> > -
> > - if (device == PMC_DEVICE_S6 ||
> > - device == PMC_DEVICE_S7 ||
> > - device == PMC_DEVICE_S8)
> > - return 1;
> > - return 0;
> > -}
> > -
>
> Why remove helper?
>
> > static inline int aac_supports_2T(struct aac_dev *dev)
> > {
> > return (dev->adapter_info.options & AAC_OPT_NEW_COMM_64);
> > diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
> > index d4fcfa1e54e0..b8046b6c1239 100644
> > --- a/drivers/scsi/aacraid/comminit.c
> > +++ b/drivers/scsi/aacraid/comminit.c
> > @@ -41,7 +41,9 @@ static inline int aac_is_msix_mode(struct aac_dev *dev)
> > {
> > u32 status = 0;
> >
> > - if (aac_is_src(dev))
> > + if (dev->pdev->device == PMC_DEVICE_S6 ||
> > + dev->pdev->device == PMC_DEVICE_S7 ||
> > + dev->pdev->device == PMC_DEVICE_S8)
> > status = src_readl(dev, MUnit.OMR);
> > return (status & AAC_INT_MODE_MSIX);
> > }
> > @@ -349,7 +351,8 @@ int aac_send_shutdown(struct aac_dev * dev)
> > /* FIB should be freed only after getting the response from the F/W */
> > if (status != -ERESTARTSYS)
> > aac_fib_free(fibctx);
> Fix this
> > - if (aac_is_src(dev) &&
> > + if ((dev->pdev->device == PMC_DEVICE_S7 ||
> > + dev->pdev->device == PMC_DEVICE_S8) &&
> > dev->msi_enabled)
> > aac_set_intx_mode(dev);
> > return status;
> > @@ -605,7 +608,8 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
> > dev->max_fib_size = status[1] & 0xFFE0;
> > host->sg_tablesize = status[2] >> 16;
> > dev->sg_tablesize = status[2] & 0xFFFF;
> this one
> > - if (aac_is_src(dev)) {
> > + if (dev->pdev->device == PMC_DEVICE_S7 ||
> > + dev->pdev->device == PMC_DEVICE_S8) {
> > if (host->can_queue > (status[3] >> 16) -
> > AAC_NUM_MGT_FIB)
> > host->can_queue = (status[3] >> 16) -
> > @@ -624,7 +628,9 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
> > pr_warn("numacb=%d ignored\n", numacb);
> > }
> >
> > - if (aac_is_src(dev))
> > + if (dev->pdev->device == PMC_DEVICE_S6 ||
> > + dev->pdev->device == PMC_DEVICE_S7 ||
> > + dev->pdev->device == PMC_DEVICE_S8)
> > aac_define_int_mode(dev);
> > /*
> > * Ok now init the communication subsystem
> > diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
> > index 2142a649e865..705e003caa95 100644
> > --- a/drivers/scsi/aacraid/commsup.c
> > +++ b/drivers/scsi/aacraid/commsup.c
> > @@ -2574,7 +2574,9 @@ void aac_free_irq(struct aac_dev *dev)
> > {
> > int i;
> >
> > - if (aac_is_src(dev)) {
> > + if (dev->pdev->device == PMC_DEVICE_S6 ||
> > + dev->pdev->device == PMC_DEVICE_S7 ||
> > + dev->pdev->device == PMC_DEVICE_S8) {
> > if (dev->max_msix > 1) {
> > for (i = 0; i < dev->max_msix; i++)
> > free_irq(pci_irq_vector(dev->pdev, i),
> > diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
> > index 644f7f5c61a2..3b7968b17169 100644
> > --- a/drivers/scsi/aacraid/linit.c
> > +++ b/drivers/scsi/aacraid/linit.c
> > @@ -1560,7 +1560,9 @@ static void __aac_shutdown(struct aac_dev * aac)
> >
> > aac_adapter_disable_int(aac);
> >
> > - if (aac_is_src(aac)) {
> > + if (aac->pdev->device == PMC_DEVICE_S6 ||
> > + aac->pdev->device == PMC_DEVICE_S7 ||
> > + aac->pdev->device == PMC_DEVICE_S8) {
> > if (aac->max_msix > 1) {
> > for (i = 0; i < aac->max_msix; i++) {
> > free_irq(pci_irq_vector(aac->pdev, i),
> > @@ -1835,7 +1837,8 @@ static int aac_acquire_resources(struct aac_dev *dev)
> > aac_adapter_enable_int(dev);
> >
> >
> and this.
> > - if (aac_is_src(dev))
> > + if (dev->pdev->device == PMC_DEVICE_S7 ||
> > + dev->pdev->device == PMC_DEVICE_S8)
> > aac_define_int_mode(dev);
> >
> > if (dev->msi_enabled)
>
>
>

2019-07-10 10:01:20

by Konstantin Khorenko

[permalink] [raw]
Subject: Re: [PATCH 1/1] scsi: aacraid: resurrect correct arc ctrl checks for Series-6

On 07/08/2019 02:49 AM, Finn Thain wrote:
> Andrey,
>
> It is helpful to send your review to the patch author. I've added
> Konstantin to the Cc list, as well as Raghava (who introduced the
> regression addressed by Konstantin's patch).
>
> If I'm not mistaken, your review misunderstands the patch description.
>
> FWIW, Konstantin's patch might have been easier to follow if it was a
> simple 'git revert'.

Hi Finn, Andrey,

Finn,
thank you for putting me back to the thread, appreciated.
And i agree with you, may be git revert followed by independent patch
which removes Series-9 mentions is easier to read, so sending the second
version - in that way.


Andrey,
please take a look at the new version patches, hope it's easier to understand.

And talking about the helper: i thought about leaving it, but we have several places which check for Series 7 and 8 only
and several places which check for Series 6,7,8, so either
- we need 2 helpers
- we have a helper to check for Series 7,8 only and in some places will have a check for Series 6 + helper
- introduce the helper with parameter

Honestly i don't like any of variants above, so just left the code without helper,
not that many checks and easier to read the code IMHO.

Thank you!

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

2019-07-10 10:03:06

by Konstantin Khorenko

[permalink] [raw]
Subject: [PATCH v2 0/2] aacraid: Host adapter Adaptec 6405 constantly resets under high io load

Problem description:
====================
A node with Adaptec 6405 controller, latest BIOS V5.3-0[19204]
A lot of disks attached to the controller.
Simple test: running mkfs.ext4 on many disks on the same controller in
parallel
(mkfs is not important here, any serious io load triggers controller aborts)

Results:
* no problems (controller resets) with kernels prior to
395e5df79a95 ("scsi: aacraid: Remove reference to Series-9")

* latest ms kernel v5.2-rc6-15-g249155c20f9b - mkfs processes are in D state,
lot of complains in logs like:

[ 654.894633] aacraid: Host adapter abort request.
aacraid: Outstanding commands on (0,1,43,0):
[ 699.441034] aacraid: Host adapter abort request.
aacraid: Outstanding commands on (0,1,40,0):
[ 699.442950] aacraid: Host adapter reset request. SCSI hang ?
[ 714.457428] aacraid: Host adapter reset request. SCSI hang ?
...
[ 759.514759] aacraid: Host adapter reset request. SCSI hang ?
[ 759.514869] aacraid 0000:03:00.0: outstanding cmd: midlevel-0
[ 759.514870] aacraid 0000:03:00.0: outstanding cmd: lowlevel-0
[ 759.514872] aacraid 0000:03:00.0: outstanding cmd: error handler-498
[ 759.514873] aacraid 0000:03:00.0: outstanding cmd: firmware-471
[ 759.514875] aacraid 0000:03:00.0: outstanding cmd: kernel-60
[ 759.514912] aacraid 0000:03:00.0: Controller reset type is 3
[ 759.515013] aacraid 0000:03:00.0: Issuing IOP reset
[ 850.296705] aacraid 0000:03:00.0: IOP reset succeeded

Same complains on Ubuntu kernel 4.15.0-50-generic:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777586

Controller:
===========
03:00.0 RAID bus controller: Adaptec Series 6 - 6G SAS/PCIe 2 (rev 01)
Subsystem: Adaptec Series 6 - ASR-6405 - 4 internal 6G SAS ports

Test:
=====
# cat dev.list
/dev/sdq1
/dev/sde1
/dev/sds1
/dev/sdb1
/dev/sdk1
/dev/sdaj1
/dev/sdaf1
/dev/sdd1
/dev/sdac1
/dev/sdai1
/dev/sdz1
/dev/sdj1
/dev/sdy1
/dev/sdn1
/dev/sdae1
/dev/sdg1
/dev/sdi1
/dev/sdc1
/dev/sdf1
/dev/sdl1
/dev/sda1
/dev/sdab1
/dev/sdr1
/dev/sdo1
/dev/sdah1
/dev/sdm1
/dev/sdt1
/dev/sdp1
/dev/sdad1
/dev/sdh1

===========================================
# cat run_mkfs.sh
#!/bin/bash

while read i; do
mkfs.ext4 $i -q -E lazy_itable_init=1 -O uninit_bg -m 0 &
done

=================================
# cat dev.list | ./run_mkfs.sh

The issue is 100% reproducible.

i've bisected to the culprit patch, it's
395e5df79a95 ("scsi: aacraid: Remove reference to Series-9")

it changes arc ctrl checks for Series-6 controllers
and i've checked that resurrection of original logic in arc ctrl checks
eliminates controller hangs/resets.

Konstantin Khorenko (2):
Revert "scsi: aacraid: Remove reference to Series-9"
scsi: aacraid: Remove references to Series-9 (only)

drivers/scsi/aacraid/aacraid.h | 11 -----------
drivers/scsi/aacraid/comminit.c | 15 +++++++++++----
drivers/scsi/aacraid/commsup.c | 4 +++-
drivers/scsi/aacraid/linit.c | 8 +++++---
4 files changed, 19 insertions(+), 19 deletions(-)

--
2.15.1

2019-07-10 10:37:02

by Konstantin Khorenko

[permalink] [raw]
Subject: [PATCH v2 1/2] Revert "scsi: aacraid: Remove reference to Series-9"

This reverts commit 395e5df79a9588abf1099ea746f11872c9086252.

The patch being reverted not only drops Series-9 cards
checks but also changes logic for Series-6 controllers which
lead to controller hungs/resets under high io load.

So revert the original patch, references to Series 9 are to
be removed by next patch.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777586
https://bugzilla.redhat.com/show_bug.cgi?id=1724077
https://jira.sw.ru/browse/PSBM-95736

Signed-off-by: Konstantin Khorenko <[email protected]>
---
drivers/scsi/aacraid/aacraid.h | 12 +-----------
drivers/scsi/aacraid/comminit.c | 18 ++++++++++++++----
drivers/scsi/aacraid/commsup.c | 5 ++++-
drivers/scsi/aacraid/linit.c | 10 +++++++---
4 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 3fa03230f6ba..aef47d0e718c 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -416,6 +416,7 @@ struct aac_ciss_identify_pd {
#define PMC_DEVICE_S6 0x28b
#define PMC_DEVICE_S7 0x28c
#define PMC_DEVICE_S8 0x28d
+#define PMC_DEVICE_S9 0x28f

#define aac_phys_to_logical(x) ((x)+1)
#define aac_logical_to_phys(x) ((x)?(x)-1:0)
@@ -2729,17 +2730,6 @@ int _aac_rx_init(struct aac_dev *dev);
int aac_rx_select_comm(struct aac_dev *dev, int comm);
int aac_rx_deliver_producer(struct fib * fib);

-static inline int aac_is_src(struct aac_dev *dev)
-{
- u16 device = dev->pdev->device;
-
- if (device == PMC_DEVICE_S6 ||
- device == PMC_DEVICE_S7 ||
- device == PMC_DEVICE_S8)
- return 1;
- return 0;
-}
-
static inline int aac_supports_2T(struct aac_dev *dev)
{
return (dev->adapter_info.options & AAC_OPT_NEW_COMM_64);
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index d4fcfa1e54e0..edaa2d53e704 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -41,8 +41,11 @@ static inline int aac_is_msix_mode(struct aac_dev *dev)
{
u32 status = 0;

- if (aac_is_src(dev))
+ if (dev->pdev->device == PMC_DEVICE_S6 ||
+ dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8) {
status = src_readl(dev, MUnit.OMR);
+ }
return (status & AAC_INT_MODE_MSIX);
}

@@ -349,7 +352,9 @@ int aac_send_shutdown(struct aac_dev * dev)
/* FIB should be freed only after getting the response from the F/W */
if (status != -ERESTARTSYS)
aac_fib_free(fibctx);
- if (aac_is_src(dev) &&
+ if ((dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8 ||
+ dev->pdev->device == PMC_DEVICE_S9) &&
dev->msi_enabled)
aac_set_intx_mode(dev);
return status;
@@ -605,7 +610,9 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
dev->max_fib_size = status[1] & 0xFFE0;
host->sg_tablesize = status[2] >> 16;
dev->sg_tablesize = status[2] & 0xFFFF;
- if (aac_is_src(dev)) {
+ if (dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8 ||
+ dev->pdev->device == PMC_DEVICE_S9) {
if (host->can_queue > (status[3] >> 16) -
AAC_NUM_MGT_FIB)
host->can_queue = (status[3] >> 16) -
@@ -624,7 +631,10 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
pr_warn("numacb=%d ignored\n", numacb);
}

- if (aac_is_src(dev))
+ if (dev->pdev->device == PMC_DEVICE_S6 ||
+ dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8 ||
+ dev->pdev->device == PMC_DEVICE_S9)
aac_define_int_mode(dev);
/*
* Ok now init the communication subsystem
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 2142a649e865..b047b1e2215a 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -2574,7 +2574,10 @@ void aac_free_irq(struct aac_dev *dev)
{
int i;

- if (aac_is_src(dev)) {
+ if (dev->pdev->device == PMC_DEVICE_S6 ||
+ dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8 ||
+ dev->pdev->device == PMC_DEVICE_S9) {
if (dev->max_msix > 1) {
for (i = 0; i < dev->max_msix; i++)
free_irq(pci_irq_vector(dev->pdev, i),
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 644f7f5c61a2..f669a4405217 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1559,8 +1559,10 @@ static void __aac_shutdown(struct aac_dev * aac)
aac_send_shutdown(aac);

aac_adapter_disable_int(aac);
-
- if (aac_is_src(aac)) {
+ if (aac->pdev->device == PMC_DEVICE_S6 ||
+ aac->pdev->device == PMC_DEVICE_S7 ||
+ aac->pdev->device == PMC_DEVICE_S8 ||
+ aac->pdev->device == PMC_DEVICE_S9) {
if (aac->max_msix > 1) {
for (i = 0; i < aac->max_msix; i++) {
free_irq(pci_irq_vector(aac->pdev, i),
@@ -1835,7 +1837,9 @@ static int aac_acquire_resources(struct aac_dev *dev)
aac_adapter_enable_int(dev);


- if (aac_is_src(dev))
+ if ((dev->pdev->device == PMC_DEVICE_S7 ||
+ dev->pdev->device == PMC_DEVICE_S8 ||
+ dev->pdev->device == PMC_DEVICE_S9))
aac_define_int_mode(dev);

if (dev->msi_enabled)
--
2.15.1