Re: [PATCH] lpfc: Don't return internal MBXERR_ERROR code from probe function

2017-09-06 Thread Johannes Thumshirn
On Wed, Sep 06, 2017 at 10:32:22AM +0200, Stefano Brivio wrote: > > I didn't get feedback about this patch. Is there any issue with the > submission? > > I think it actually fixes a quite critical issue, if initialization > fails we have crashes on reboot like the one reported below [1], and >

[PATCH v4 05/11] libsas: Use dynamic alloced work to avoid sas event lost

2017-09-06 Thread Jason Yan
Now libsas hotplug work is static, every sas event type has its own static work, LLDD driver queues the hotplug work into shost->work_q. If LLDD driver burst posts lots hotplug events to libsas, the hotplug events may pending in the workqueue like shost->work_q new work[PORTE_BYTES_DMAED] -->

[PATCH v4 10/11] libsas: direct call probe and destruct

2017-09-06 Thread Jason Yan
In commit 87c8331f ([SCSI] libsas: prevent domain rediscovery competing with ata error handling) introduced disco mutex to prevent rediscovery competing with ata error handling and put the whole revalidation in the mutex. But the rphy add/remove needs to wait for the error handling which also

[PATCH v4 08/11] libsas: Use new workqueue to run sas event and disco event

2017-09-06 Thread Jason Yan
Now all libsas works are queued to scsi host workqueue, include sas event work post by LLDD and sas discovery work, and a sas hotplug flow may be divided into several works, e.g libsas receive a PORTE_BYTES_DMAED event, currently we process it as following steps: sas_form_port --- run in work in

[PATCH v4 11/11] libsas: add event to defer list tail instead of head when draining

2017-09-06 Thread Jason Yan
From: chenxiang Events will be added to defer_q list when setting ha->status to SAS_HA_DRAINING. Events will be called after drain workqueue. Those events are added to the head of list, but they are scanned one by one from the head to the tail, which will cause those

[PATCH] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1

2017-09-06 Thread kehuanlin
Since the command type of UTRD in UFS 2.1 specification is the same with UFS 2.0. And it assumes the future UFS specification will follow the same definition. Signed-off-by: kehuanlin --- drivers/scsi/ufs/ufshcd.c | 14 -- 1 file changed, 8 insertions(+), 6

Re: [PATCH] lpfc: Don't return internal MBXERR_ERROR code from probe function

2017-09-06 Thread Stefano Brivio
Hi, On Mon, 28 Aug 2017 15:05:23 +0200 Stefano Brivio wrote: > Internal error codes happen to be positive, thus the PCI driver > core won't treat them as failure, but we do. This would cause a > crash later on as lpfc_pci_remove_one() is called (e.g. as > shutdown function).

[PATCH RESEND] lpfc: Don't return internal MBXERR_ERROR code from probe function

2017-09-06 Thread Stefano Brivio
Internal error codes happen to be positive, thus the PCI driver core won't treat them as failure, but we do. This would cause a crash later on as lpfc_pci_remove_one() is called (e.g. as shutdown function). Fixes: 6d368e532168 ("[SCSI] lpfc 8.3.24: Add resource extent support") Signed-off-by:

Re: [PATCH RESEND] lpfc: Don't return internal MBXERR_ERROR code from probe function

2017-09-06 Thread Johannes Thumshirn
On Wed, Sep 06, 2017 at 11:02:56AM +0200, Stefano Brivio wrote: > Internal error codes happen to be positive, thus the PCI driver > core won't treat them as failure, but we do. This would cause a > crash later on as lpfc_pci_remove_one() is called (e.g. as > shutdown function). > > Fixes:

[PATCH v4 09/11] libsas: libsas: use flush_workqueue to process disco events synchronously

2017-09-06 Thread Jason Yan
Use flush_workqueue to insure the disco and revalidate events processed synchronously. Signed-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC:

[PATCH v4 03/11] libsas: remove unused port_gone_completion and DISCE_PORT_GONE

2017-09-06 Thread Jason Yan
No one uses the port_gone_completion in struct asd_sas_port and DISCE_PORT_GONE in enum disover_event, clean them out. Signed-off-by: Jason Yan CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl

[PATCH v4 01/11] libsas: kill useless ha_event and do some cleanup

2017-09-06 Thread Jason Yan
The ha_event now has only one event HAE_RESET, and this event does nothing. Kill it and do some cleanup. This is a preparation for enhance libsas hotplug feature in the next patches. Signed-off-by: Jason Yan Signed-off-by: John Garry CC: Johannes

Re: [PATCH] lpfc: Don't return internal MBXERR_ERROR code from probe function

2017-09-06 Thread Stefano Brivio
On Wed, 6 Sep 2017 10:42:35 +0200 Johannes Thumshirn wrote: > On Wed, Sep 06, 2017 at 10:32:22AM +0200, Stefano Brivio wrote: > > > > I didn't get feedback about this patch. Is there any issue with the > > submission? > > > > I think it actually fixes a quite critical

Re: [PATCH] lpfc: Don't return internal MBXERR_ERROR code from probe function

2017-09-06 Thread Johannes Thumshirn
On Wed, Sep 06, 2017 at 10:47:38AM +0200, Stefano Brivio wrote: > The original submission is archived at > https://marc.info/?l=linux-scsi=150392554622786=2. Before I cause > any confusion... do you want me to re-submit this with the same > subject? As v2 with a comment? [PATCH RESEND] should be

[PATCH v4 06/11] libsas: shut down the PHY if events reached the threshold

2017-09-06 Thread Jason Yan
If the PHY burst too many events, we will alloc a lot of events for the worker. This may leads to memory exhaustion. Dan Williams suggested to shut down the PHY if the events reached the threshold, because in this case the PHY may have gone into some erroneous state. Users can re-enable the PHY

[PATCH v4 00/11] Enhance libsas hotplug feature

2017-09-06 Thread Jason Yan
Hello all, Yijing Wang handed over this topic to me. We are working on it the last two months. We have tested the patchset for a long time. Here is the new version. Now the libsas hotplug has some issues, Dan Williams report a similar bug here before

[PATCH v4 07/11] libsas: make the event threshold configurable

2017-09-06 Thread Jason Yan
Add a sysfs attr that LLDD can configure it for every host. We made a example in hisi_sas. Other LLDDs using libsas can implement it if they want. Suggested-by: Hannes Reinecke Signed-off-by: Jason Yan CC: John Garry CC: Johannes

Re: [PATCH RESEND] lpfc: Don't return internal MBXERR_ERROR code from probe function

2017-09-06 Thread Stefano Brivio
On Wed, 6 Sep 2017 11:30:34 +0200 Johannes Thumshirn wrote: > On Wed, Sep 06, 2017 at 11:02:56AM +0200, Stefano Brivio wrote: > > Internal error codes happen to be positive, thus the PCI driver > > core won't treat them as failure, but we do. This would cause a > > crash

Re: [PATCH RESEND] lpfc: Don't return internal MBXERR_ERROR code from probe function

2017-09-06 Thread Johannes Thumshirn
On Wed, Sep 06, 2017 at 11:54:15AM +0200, Stefano Brivio wrote: > Thanks for your feedback! > > I considered doing something similar, but there are different error > coded which are set when we reach the label out_free_mbsx. I checked all > of them (and I hope I didn't miss any), but they all

[PATCH v4 02/11] libsas: remove the numbering for each event enum

2017-09-06 Thread Jason Yan
Numbering for each event enum makes no sense. Remove the numbering so that we don't have to calculate the number by hand every time. Signed-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne

[PATCH v4 04/11] libsas: rename notify_port_event() for consistency

2017-09-06 Thread Jason Yan
Rename function notify_port_event() to sas_notify_port_event(), which will be consistent with sas_notify_phy_event(). Signed-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph

Re: [PATCH 1/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout

2017-09-06 Thread Ming Lei
On Wed, Sep 6, 2017 at 6:11 PM, Christoph Hellwig wrote: > bsg-lib now embeddeds the job structure into the request, and req->special > can't be used anymore. > > Signed-off-by: Christoph Hellwig > Cc: sta...@vger.kernel.org > --- > drivers/scsi/scsi_transport_fc.c | 2

two small bsg fixes

2017-09-06 Thread Christoph Hellwig
Two fixups for the recent bsg-lib fixups, should go into 4.13 stable as well.

[PATCH 2/2] bsg-lib: don't free job in bsg_prepare_job

2017-09-06 Thread Christoph Hellwig
The job structure is allocated as part of the request, so we should not free it in the error path of bsg_prepare_job. Signed-off-by: Christoph Hellwig Cc: sta...@vger.kernel.org --- block/bsg-lib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/bsg-lib.c b/block/bsg-lib.c

[PATCH 1/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout

2017-09-06 Thread Christoph Hellwig
bsg-lib now embeddeds the job structure into the request, and req->special can't be used anymore. Signed-off-by: Christoph Hellwig Cc: sta...@vger.kernel.org --- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 1/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout

2017-09-06 Thread Christoph Hellwig
On Wed, Sep 06, 2017 at 06:59:39PM +0800, Ming Lei wrote: > On Wed, Sep 6, 2017 at 6:11 PM, Christoph Hellwig wrote: > > bsg-lib now embeddeds the job structure into the request, and req->special > > can't be used anymore. > > > > Signed-off-by: Christoph Hellwig > >

Re: [PATCH v4 01/11] libsas: kill useless ha_event and do some cleanup

2017-09-06 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

Re: [PATCH v4 02/11] libsas: remove the numbering for each event enum

2017-09-06 Thread Johannes Thumshirn
I guess it boils down to personal preference, but Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF:

Re: [PATCH v4 02/11] libsas: remove the numbering for each event enum

2017-09-06 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH v4 00/11] Enhance libsas hotplug feature

2017-09-06 Thread Christoph Hellwig
On Wed, Sep 06, 2017 at 02:07:57PM +0100, John Garry wrote: > Regardless of the fate of the rest of the patches in this series, I think > patches 1,2,3,4,11/11 can be taken in isolation (subject to review, of > course). It would save maintaining them out-of-tree. I did a quick review of those

[PATCH 2/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout

2017-09-06 Thread Christoph Hellwig
bsg-lib now embeddeds the job structure into the request, and req->special can't be used anymore. Signed-off-by: Christoph Hellwig Cc: sta...@vger.kernel.org --- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 1/2] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-09-06 Thread Christoph Hellwig
From: Benjamin Block Since we split the scsi_request out of struct request bsg fails to provide a reply-buffer for the drivers. This was done via the pointer for sense-data, that is not preallocated anymore. Failing to allocate/assign it results in illegal

two small bsg fixes V2

2017-09-06 Thread Christoph Hellwig
Two fixups for the recent bsg-lib fixes, should go into 4.13 stable as well.

Re: [PATCH v4 03/11] libsas: remove unused port_gone_completion and DISCE_PORT_GONE

2017-09-06 Thread Johannes Thumshirn
Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB

Re: [PATCH v4 04/11] libsas: rename notify_port_event() for consistency

2017-09-06 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH v4 11/11] libsas: add event to defer list tail instead of head when draining

2017-09-06 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH v4 04/11] libsas: rename notify_port_event() for consistency

2017-09-06 Thread Johannes Thumshirn
Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB

Re: [PATCH v4 00/11] Enhance libsas hotplug feature

2017-09-06 Thread John Garry
On 06/09/2017 10:15, Jason Yan wrote: Hello all, Yijing Wang handed over this topic to me. We are working on it the last two months. We have tested the patchset for a long time. Here is the new version. Now the libsas hotplug has some issues, Dan Williams report a similar bug here before

Re: [PATCH v4 01/11] libsas: kill useless ha_event and do some cleanup

2017-09-06 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v4 03/11] libsas: remove unused port_gone_completion and DISCE_PORT_GONE

2017-09-06 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 1/2] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-09-06 Thread Jens Axboe
On 09/06/2017 07:44 AM, Christoph Hellwig wrote: > From: Benjamin Block > > Since we split the scsi_request out of struct request bsg fails to > provide a reply-buffer for the drivers. This was done via the pointer > for sense-data, that is not preallocated anymore.

Re: [PATCH 1/2] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-09-06 Thread Christoph Hellwig
On Wed, Sep 06, 2017 at 04:15:09PM +0200, Benjamin Block wrote: > On Wed, Sep 06, 2017 at 08:07:43AM -0600, Jens Axboe wrote: > > On 09/06/2017 07:44 AM, Christoph Hellwig wrote: > > > From: Benjamin Block > > > > > > Since we split the scsi_request out of struct

Re: [PATCH 1/2] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-09-06 Thread Benjamin Block
On Wed, Sep 06, 2017 at 08:07:43AM -0600, Jens Axboe wrote: > On 09/06/2017 07:44 AM, Christoph Hellwig wrote: > > From: Benjamin Block > > > > Since we split the scsi_request out of struct request bsg fails to > > provide a reply-buffer for the drivers. This was done

LOAN AVAILABLE @3 %

2017-09-06 Thread Mr
LOAN AVAILABLE @3 % Rely mohammedanis...@gmail.com

Re: [PATCH v4 00/11] Enhance libsas hotplug feature

2017-09-06 Thread Jason Yan
On 2017/9/6 21:22, Christoph Hellwig wrote: On Wed, Sep 06, 2017 at 02:07:57PM +0100, John Garry wrote: Regardless of the fate of the rest of the patches in this series, I think patches 1,2,3,4,11/11 can be taken in isolation (subject to review, of course). It would save maintaining them

Re: [PATCH v3 1/5] scsi: ufs: add Hisilicon ufs driver code

2017-09-06 Thread Arnd Bergmann
On Tue, Aug 29, 2017 at 10:41 AM, Li Wei wrote: itel(host, UFS_ARESET, PERRSTDIS3_OFFSET); > + > + /* disable lp_reset_n */ > + ufs_sys_ctrl_set_bits(host, BIT_SYSCTRL_LP_RESET_N, RESET_CTRL_EN); > + mdelay(1); > + > + if