All of lore.kernel.org
 help / color / mirror / Atom feed
* [stable-4.19 0/2] 2 stable fix for pm80xx
@ 2020-03-09 10:17 Jack Wang
  2020-03-09 10:17 ` [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log Jack Wang
  2020-03-09 10:17 ` [stable-4.19 2/2] scsi: pm80xx: Fixed kernel panic during error recovery for SATA drive Jack Wang
  0 siblings, 2 replies; 7+ messages in thread
From: Jack Wang @ 2020-03-09 10:17 UTC (permalink / raw)
  To: gregkh, sashal, stable

Hi Greg, hi Sasha,

Please consider to apply both fixes to stable 4.19 tree.

Both apply cleanly to 4.19 stable queue.

Deepak Ukey (1):
  scsi: pm80xx: Fixed kernel panic during error recovery for SATA drive

Viswas G (1):
  scsi: pm80xx: panic on ncq error cleaning up the read log.

 drivers/scsi/pm8001/pm8001_sas.c | 6 +++++-
 drivers/scsi/pm8001/pm80xx_hwi.c | 7 ++++---
 drivers/scsi/pm8001/pm80xx_hwi.h | 2 ++
 3 files changed, 11 insertions(+), 4 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log.
  2020-03-09 10:17 [stable-4.19 0/2] 2 stable fix for pm80xx Jack Wang
@ 2020-03-09 10:17 ` Jack Wang
  2020-03-10 11:41   ` Greg KH
  2020-03-10 11:41   ` Greg KH
  2020-03-09 10:17 ` [stable-4.19 2/2] scsi: pm80xx: Fixed kernel panic during error recovery for SATA drive Jack Wang
  1 sibling, 2 replies; 7+ messages in thread
From: Jack Wang @ 2020-03-09 10:17 UTC (permalink / raw)
  To: gregkh, sashal, stable; +Cc: Viswas G, Deepak Ukey, Martin K . Petersen

From: Viswas G <Viswas.G@microsemi.com>

commit 0b6df110b3d0c12562011fcd032cfb6ff16b6d56 upstream

when there's an error in 'ncq mode' the host has to read the ncq error
log (10h) to clear the error state. however, the ccb that is setup for
doing this doesn't setup the ccb so that the previous state is
cleared. if the ccb was previously used for an IO n_elems is set and
pm8001_ccb_task_free() treats this as the signal to go free a
scatter-gather list (that's already been freed).

Signed-off-by: Deepak Ukey <deepak.ukey@microsemi.com>
Signed-off-by: Viswas G <Viswas.G@microsemi.com>
Acked-by: Jack Wang <jinpu.wang@profitbricks.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
 drivers/scsi/pm8001/pm80xx_hwi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 8627feb80261..bd945d832eb8 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -1500,8 +1500,9 @@ static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha,
 	ccb->ccb_tag = ccb_tag;
 	ccb->task = task;
 	ccb->n_elem = 0;
-	pm8001_ha_dev->id |= NCQ_READ_LOG_FLAG;
-	pm8001_ha_dev->id |= NCQ_2ND_RLE_FLAG;
+	pm8001_ha_dev->id |= NCQ_READ_LOG_FLAG;	// set this flag to indicate read log
+	pm8001_ha_dev->id |= NCQ_2ND_RLE_FLAG;	// set this flag to guard against 2nd RLE. Workaround 
+						// till FW fix is available. 
 
 	memset(&sata_cmd, 0, sizeof(sata_cmd));
 	circularQ = &pm8001_ha->inbnd_q_tbl[0];
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [stable-4.19 2/2] scsi: pm80xx: Fixed kernel panic during error recovery for SATA drive
  2020-03-09 10:17 [stable-4.19 0/2] 2 stable fix for pm80xx Jack Wang
  2020-03-09 10:17 ` [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log Jack Wang
@ 2020-03-09 10:17 ` Jack Wang
  2020-03-10 11:42   ` Greg KH
  1 sibling, 1 reply; 7+ messages in thread
From: Jack Wang @ 2020-03-09 10:17 UTC (permalink / raw)
  To: gregkh, sashal, stable; +Cc: Deepak Ukey, Viswas G, Martin K . Petersen

From: Deepak Ukey <deepak.ukey@microchip.com>

commit 196ba6629cf95e51403337235d09742fcdc3febd upstream

Disabling the SATA drive interface cause kernel panic. When the drive
Interface is disabled, device should be deregistered after aborting all
pending I/Os. Also changed the port recovery timeout to 10000 ms for
PM8006 controller.

Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
 drivers/scsi/pm8001/pm8001_sas.c | 6 +++++-
 drivers/scsi/pm8001/pm80xx_hwi.c | 2 +-
 drivers/scsi/pm8001/pm80xx_hwi.h | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 59feda261e08..5be4212312cb 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -866,6 +866,8 @@ static void pm8001_dev_gone_notify(struct domain_device *dev)
 			spin_unlock_irqrestore(&pm8001_ha->lock, flags);
 			pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev ,
 				dev, 1, 0);
+			while (pm8001_dev->running_req)
+				msleep(20);
 			spin_lock_irqsave(&pm8001_ha->lock, flags);
 		}
 		PM8001_CHIP_DISP->dereg_dev_req(pm8001_ha, device_id);
@@ -1238,8 +1240,10 @@ int pm8001_abort_task(struct sas_task *task)
 			PM8001_MSG_DBG(pm8001_ha,
 				pm8001_printk("Waiting for Port reset\n"));
 			wait_for_completion(&completion_reset);
-			if (phy->port_reset_status)
+			if (phy->port_reset_status) {
+				pm8001_dev_gone_notify(dev);
 				goto out;
+			}
 
 			/*
 			 * 4. SATA Abort ALL
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index bd945d832eb8..fd5f9892f3ac 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -604,7 +604,7 @@ static void update_main_config_table(struct pm8001_hba_info *pm8001_ha)
 		pm8001_ha->main_cfg_tbl.pm80xx_tbl.port_recovery_timer &=
 					0x0000ffff;
 		pm8001_ha->main_cfg_tbl.pm80xx_tbl.port_recovery_timer |=
-					0x140000;
+					CHIP_8006_PORT_RECOVERY_TIMEOUT;
 	}
 	pm8001_mw32(address, MAIN_PORT_RECOVERY_TIMER,
 			pm8001_ha->main_cfg_tbl.pm80xx_tbl.port_recovery_timer);
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
index 7dd2699d0efb..bbe1747234ff 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.h
+++ b/drivers/scsi/pm8001/pm80xx_hwi.h
@@ -228,6 +228,8 @@
 #define SAS_MAX_AIP                     0x200000
 #define IT_NEXUS_TIMEOUT       0x7D0
 #define PORT_RECOVERY_TIMEOUT  ((IT_NEXUS_TIMEOUT/100) + 30)
+/* Port recovery timeout, 10000 ms for PM8006 controller */
+#define CHIP_8006_PORT_RECOVERY_TIMEOUT 0x640000
 
 #ifdef __LITTLE_ENDIAN_BITFIELD
 struct sas_identify_frame_local {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log.
  2020-03-09 10:17 ` [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log Jack Wang
@ 2020-03-10 11:41   ` Greg KH
  2020-03-10 11:41   ` Greg KH
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2020-03-10 11:41 UTC (permalink / raw)
  To: Jack Wang; +Cc: sashal, stable, Viswas G, Deepak Ukey, Martin K . Petersen

On Mon, Mar 09, 2020 at 11:17:38AM +0100, Jack Wang wrote:
> From: Viswas G <Viswas.G@microsemi.com>
> 
> commit 0b6df110b3d0c12562011fcd032cfb6ff16b6d56 upstream
> 
> when there's an error in 'ncq mode' the host has to read the ncq error
> log (10h) to clear the error state. however, the ccb that is setup for
> doing this doesn't setup the ccb so that the previous state is
> cleared. if the ccb was previously used for an IO n_elems is set and
> pm8001_ccb_task_free() treats this as the signal to go free a
> scatter-gather list (that's already been freed).
> 
> Signed-off-by: Deepak Ukey <deepak.ukey@microsemi.com>
> Signed-off-by: Viswas G <Viswas.G@microsemi.com>
> Acked-by: Jack Wang <jinpu.wang@profitbricks.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

This commit showed up in 4.15, how can it also go into 4.19 again?

Totally confused,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log.
  2020-03-09 10:17 ` [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log Jack Wang
  2020-03-10 11:41   ` Greg KH
@ 2020-03-10 11:41   ` Greg KH
  2020-03-10 11:47     ` Jinpu Wang
  1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2020-03-10 11:41 UTC (permalink / raw)
  To: Jack Wang; +Cc: sashal, stable, Viswas G, Deepak Ukey, Martin K . Petersen

On Mon, Mar 09, 2020 at 11:17:38AM +0100, Jack Wang wrote:
> From: Viswas G <Viswas.G@microsemi.com>
> 
> commit 0b6df110b3d0c12562011fcd032cfb6ff16b6d56 upstream
> 
> when there's an error in 'ncq mode' the host has to read the ncq error
> log (10h) to clear the error state. however, the ccb that is setup for
> doing this doesn't setup the ccb so that the previous state is
> cleared. if the ccb was previously used for an IO n_elems is set and
> pm8001_ccb_task_free() treats this as the signal to go free a
> scatter-gather list (that's already been freed).
> 
> Signed-off-by: Deepak Ukey <deepak.ukey@microsemi.com>
> Signed-off-by: Viswas G <Viswas.G@microsemi.com>
> Acked-by: Jack Wang <jinpu.wang@profitbricks.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 8627feb80261..bd945d832eb8 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -1500,8 +1500,9 @@ static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha,
>  	ccb->ccb_tag = ccb_tag;
>  	ccb->task = task;
>  	ccb->n_elem = 0;
> -	pm8001_ha_dev->id |= NCQ_READ_LOG_FLAG;
> -	pm8001_ha_dev->id |= NCQ_2ND_RLE_FLAG;
> +	pm8001_ha_dev->id |= NCQ_READ_LOG_FLAG;	// set this flag to indicate read log
> +	pm8001_ha_dev->id |= NCQ_2ND_RLE_FLAG;	// set this flag to guard against 2nd RLE. Workaround 
> +						// till FW fix is available. 

Also, this isn't even the commit id referenced above :(

And there is trailing whitespace :(

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [stable-4.19 2/2] scsi: pm80xx: Fixed kernel panic during error recovery for SATA drive
  2020-03-09 10:17 ` [stable-4.19 2/2] scsi: pm80xx: Fixed kernel panic during error recovery for SATA drive Jack Wang
@ 2020-03-10 11:42   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2020-03-10 11:42 UTC (permalink / raw)
  To: Jack Wang; +Cc: sashal, stable, Deepak Ukey, Viswas G, Martin K . Petersen

On Mon, Mar 09, 2020 at 11:17:39AM +0100, Jack Wang wrote:
> From: Deepak Ukey <deepak.ukey@microchip.com>
> 
> commit 196ba6629cf95e51403337235d09742fcdc3febd upstream
> 
> Disabling the SATA drive interface cause kernel panic. When the drive
> Interface is disabled, device should be deregistered after aborting all
> pending I/Os. Also changed the port recovery timeout to 10000 ms for
> PM8006 controller.
> 
> Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
> Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
>  drivers/scsi/pm8001/pm8001_sas.c | 6 +++++-
>  drivers/scsi/pm8001/pm80xx_hwi.c | 2 +-
>  drivers/scsi/pm8001/pm80xx_hwi.h | 2 ++
>  3 files changed, 8 insertions(+), 2 deletions(-)

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log.
  2020-03-10 11:41   ` Greg KH
@ 2020-03-10 11:47     ` Jinpu Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Jinpu Wang @ 2020-03-10 11:47 UTC (permalink / raw)
  To: Greg KH; +Cc: sashal, stable, Viswas G, Deepak Ukey, Martin K . Petersen

On Tue, Mar 10, 2020 at 12:41 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Mon, Mar 09, 2020 at 11:17:38AM +0100, Jack Wang wrote:
> > From: Viswas G <Viswas.G@microsemi.com>
> >
> > commit 0b6df110b3d0c12562011fcd032cfb6ff16b6d56 upstream
> >
> > when there's an error in 'ncq mode' the host has to read the ncq error
> > log (10h) to clear the error state. however, the ccb that is setup for
> > doing this doesn't setup the ccb so that the previous state is
> > cleared. if the ccb was previously used for an IO n_elems is set and
> > pm8001_ccb_task_free() treats this as the signal to go free a
> > scatter-gather list (that's already been freed).
> >
> > Signed-off-by: Deepak Ukey <deepak.ukey@microsemi.com>
> > Signed-off-by: Viswas G <Viswas.G@microsemi.com>
> > Acked-by: Jack Wang <jinpu.wang@profitbricks.com>
> > Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> > ---
> >  drivers/scsi/pm8001/pm80xx_hwi.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> > index 8627feb80261..bd945d832eb8 100644
> > --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> > +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> > @@ -1500,8 +1500,9 @@ static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha,
> >       ccb->ccb_tag = ccb_tag;
> >       ccb->task = task;
> >       ccb->n_elem = 0;
> > -     pm8001_ha_dev->id |= NCQ_READ_LOG_FLAG;
> > -     pm8001_ha_dev->id |= NCQ_2ND_RLE_FLAG;
> > +     pm8001_ha_dev->id |= NCQ_READ_LOG_FLAG; // set this flag to indicate read log
> > +     pm8001_ha_dev->id |= NCQ_2ND_RLE_FLAG;  // set this flag to guard against 2nd RLE. Workaround
> > +                                             // till FW fix is available.
>
> Also, this isn't even the commit id referenced above :(
>
> And there is trailing whitespace :(
Sorry, I must mess it up, please ignore it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-10 11:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 10:17 [stable-4.19 0/2] 2 stable fix for pm80xx Jack Wang
2020-03-09 10:17 ` [stable-4.19 1/2] scsi: pm80xx: panic on ncq error cleaning up the read log Jack Wang
2020-03-10 11:41   ` Greg KH
2020-03-10 11:41   ` Greg KH
2020-03-10 11:47     ` Jinpu Wang
2020-03-09 10:17 ` [stable-4.19 2/2] scsi: pm80xx: Fixed kernel panic during error recovery for SATA drive Jack Wang
2020-03-10 11:42   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.