[PATCH v3 1/7] libsas: Use static sas event pool to appease sas event lost

2017-07-10 Thread Yijing Wang
inally, libsas delete the related sas port and sas devices, but LLDD driver expect libsas add the sas port and devices(last sas event). This patch and use static sas event work pool to appease this issue, since it's static work pool, it won't make memory exhaust. Signed-off-by: Yijing Wang <wangyij

[PATCH v3 6/7] libsas: add wait-complete support to sync discovery event

2017-07-10 Thread Yijing Wang
Introduce a sync flag to tag discovery event whether need to sync execute, per-event wait-complete ensure sync. Signed-off-by: Yijing Wang <wangyij...@huawei.com> CC: John Garry <john.ga...@huawei.com> CC: Johannes Thumshirn <jthumsh...@suse.de> CC: Ewan Milne <emi...@redh

[PATCH v3 5/7] libsas: add a new workqueue to run probe/destruct discovery event

2017-07-10 Thread Yijing Wang
Sometimes, we want sync libsas probe or destruct in sas discovery work, like when libsas revalidate domain. We need to split probe and destruct work from the scsi host workqueue. Signed-off-by: Yijing Wang <wangyij...@huawei.com> CC: John Garry <john.ga...@huawei.com> CC: Johann

[PATCH v3 4/7] libsas: add sas event wait-complete support

2017-07-10 Thread Yijing Wang
Introduce wait-complete for libsas sas event processing, execute sas port create/destruct in sync. Signed-off-by: Yijing Wang <wangyij...@huawei.com> CC: John Garry <john.ga...@huawei.com> CC: Johannes Thumshirn <jthumsh...@suse.de> CC: Ewan Milne <emi...@redhat.com>

[PATCH v3 3/7] libsas: Use new workqueue to run sas event

2017-07-10 Thread Yijing Wang
, it may interrupt by other sas event works, like PHYE_LOSS_OF_SIGNAL. Finally, we would found lots unexpected errors. This patch is preparation of execute libsas sas event in sync. Signed-off-by: Yijing Wang <wangyij...@huawei.com> CC: John Garry <john.ga...@huawei.com> CC: Johann

[PATCH v3 2/7] libsas: remove unused port_gone_completion

2017-07-10 Thread Yijing Wang
No one uses the port_gone_completion in struct asd_sas_port, clean it out. Signed-off-by: Yijing Wang <wangyij...@huawei.com> --- include/scsi/libsas.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index c41328d..628f48b 100644 --- a/i

[PATCH v3 7/7] libsas: release disco mutex during waiting in sas_ex_discover_end_dev

2017-07-10 Thread Yijing Wang
revalidata domain happen during ata error handler, it should be safe to release disco mutex when sync probe, because no new revalidate domain event would be process until the sync return, and the current sas revalidate domain finish. Signed-off-by: Yijing Wang <wangyij...@huawei.com> CC: John Garry &l

[PATCH v3 0/7] Enhance libsas hotplug feature

2017-07-10 Thread Yijing Wang
ccur. The first patch fix the sas events lost, and the second one introudce wait-complete to fix the hotplug order issues. v2->v3: some code improvements suggested by Johannes and John, split v2 patch 2 into several small pathes. v1->v2: some code improvements suggested by John

[Resend][PATCH v2 2/2] libsas: Enhance libsas hotplug

2017-06-14 Thread Yijing Wang
plete we use former wait-complete to achieve a sas event atomic process and use latter to make a sas discovery sync. 4. remove disco_mutex in sas_revalidate_domain, since now sas_revalidate_domain sync the destruct discovery event execution, it's no need to lock disco mutex there. Signed

[Resend][PATCH v2 1/2] libsas: Don't process sas events in static works

2017-06-14 Thread Yijing Wang
sas devices, but LLDD driver expect libsas add the sas port and devices(last sas event). This patch remove the static defined hotplug work, and use dynamic work to avoid missing hotplug events. Signed-off-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yousong He <heyous...@huawei.

[Resend][PATCH v2 0/2] Enhance libsas hotplug feature

2017-06-14 Thread Yijing Wang
order issues. v1->v2: some code improvements suggested by John Garry Yijing Wang (2): libsas: Don't process sas events in static works libsas: Enhance libsas hotplug drivers/scsi/libsas/sas_discover.c | 58 +--- drivers/scsi/libsas/sas_event.

[PATCH v2 2/2] libsas: Enhance libsas hotplug

2017-06-14 Thread Yijing Wang
plete we use former wait-complete to achieve a sas event atomic process and use latter to make a sas discovery sync. 4. remove disco_mutex in sas_revalidate_domain, since now sas_revalidate_domain sync the destruct discovery event execution, it's no need to lock disco mutex there. Signed

[PATCH v2 0/2] Enhance libsas hotplug feature

2017-06-14 Thread Yijing Wang
order issues. v1->v2: some code improvements suggested by John Garry Yijing Wang (2): libsas: Don't process sas events in static works libsas: Enhance libsas hotplug drivers/scsi/libsas/sas_discover.c | 58 +--- drivers/scsi/libsas/sas_event.

[PATCH v2 1/2] libsas: Don't process sas events in static works

2017-06-14 Thread Yijing Wang
sas devices, but LLDD driver expect libsas add the sas port and devices(last sas event). This patch remove the static defined hotplug work, and use dynamic work to avoid missing hotplug events. Signed-off-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yousong He <heyous...@huawei.

[PATCH 2/2] libsas: Enhance libsas hotplug

2017-05-20 Thread Yijing Wang
r wait-complete to achieve a sas event atomic process and use latter to make a sas discovery sync. 4. remove disco_mutex in sas_revalidate_domain, since now sas_revalidate_domain sync the destruct discovery event execution, it's no need to lock disco mutex there. Signed-off-by: Yijin

[PATCH 1/2] libsas: Don't process sas events in static works

2017-05-20 Thread Yijing Wang
sas devices, but LLDD driver expect libsas add the sas port and devices(last sas event). This patch remove the static defined hotplug work, and use dynamic work to avoid missing hotplug events. Signed-off-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yousong He <heyous...@huawei.

[PATCH 0/2] Enhance libsas hotplug feature

2017-05-20 Thread Yijing Wang
order issues. Yijing Wang (2): libsas: Don't process sas events in static works libsas: Enhance libsas hotplug drivers/scsi/libsas/sas_discover.c | 58 +--- drivers/scsi/libsas/sas_event.c| 90 ++ drivers/scsi/libsas/sas_expander.

[RFC][PATCH v2 1/2] libsas: Alloc dynamic work to avoid missing sas events

2016-09-26 Thread Yijing Wang
d them in kernel. This patch remove the static defined hotplug work, and use dynamic work to avoid missing hotplug events. Signed-off-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yousong He <heyous...@huawei.com> Signed-off-by: Qilin Chen <chenqil...@huawei.com>

[RFC][PATCH v2 0/2] Improve libsas hotplug

2016-09-26 Thread Yijing Wang
v1-v2: Fix memory allocation issue in interrupt context. Yijing Wang (2): libsas: Alloc dynamic work to avoid missing sas events libsas: Fix hotplug issue in libsas drivers/scsi/libsas/sas_ata.c | 34 ++--- drivers/scsi/libsas/sas_discover.c | 245

[RFC][PATCH v2 2/2] libsas: Fix hotplug issue in libsas

2016-09-26 Thread Yijing Wang
ing, the old sas port resource may have not completely deleted, the new sas port resource of the same name will be created, and this will cause calltrace about sysfs device node. Signed-off-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yousong He <heyous...@huawei.com> Signed-off

[RFC][PATCH v1 2/2] libsas: Fix hotplug issue in libsas

2016-09-12 Thread Yijing Wang
ing, the old sas port resource may have not completely deleted, the new sas port resource of the same name will be created, and this will cause calltrace about sysfs device node. Signed-off-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yousong He <heyous...@huawei.com> Signed-off

[RFC][PATCH v1 1/2] libsas: Alloc dynamic work to avoid missing sas events

2016-09-12 Thread Yijing Wang
d them in kernel. This patch remove the static defined hotplug work, and use dynamic work to avoid missing hotplug events. Signed-off-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yousong He <heyous...@huawei.com> Signed-off-by: Qilin Chen <chenqil...@huawei.com>

Re: [PATCH v2 1/6] scsi/bfa: use pcie_set/get_readrq to simplify code

2013-09-08 Thread Yijing Wang
On 2013/9/7 6:14, Bjorn Helgaas wrote: On Thu, Sep 05, 2013 at 03:55:25PM +0800, Yijing Wang wrote: v1-v2: use pcie_get/set_readrq to simplify code a lot suggestd by Bjorn. Use pcie_get_readrq()/pcie_set_readrq() to simplify code. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Jiang

Re: [PATCH 1/7] scsi/bfa: use pcie_capability_xxx to simplify code

2013-09-05 Thread Yijing Wang
@@ -794,10 +793,8 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad) break; } -pcie_cap_reg = pci_find_capability(pdev, PCI_CAP_ID_EXP); -if (mask != 0x pcie_cap_reg) { -pcie_cap_reg += 0x08; -

Re: [PATCH 2/7] scsi/csiostor: use pcie_capability_xxx to simplify code

2013-09-05 Thread Yijing Wang
On 2013/9/4 7:43, Bjorn Helgaas wrote: On Tue, Sep 03, 2013 at 03:35:10PM +0800, Yijing Wang wrote: Pcie_capability_xxx() interfaces were introudced to s/introudced/introduced/ Will update it. simplify code to access PCIe Cap config space. And because PCI core saves the PCIe Cap offset

[PATCH v2 1/6] scsi/bfa: use pcie_set/get_readrq to simplify code

2013-09-05 Thread Yijing Wang
v1-v2: use pcie_get/set_readrq to simplify code a lot suggestd by Bjorn. Use pcie_get_readrq()/pcie_set_readrq() to simplify code. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Jiang Liu jiang@huawei.com Cc: Anil Gurumurthy aguru...@brocade.com Cc: Vijaya Mohan Guvva vmo

[PATCH v2 2/6] scsi/csiostor: use pcie_capability_xxx to simplify code

2013-09-05 Thread Yijing Wang
() when device is enumerated. So we can use pci_is_pcie() instead. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Jiang Liu jiang@huawei.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Naresh Kumar Inna nar...@chelsio.com Cc: David S. Miller da...@davemloft.net Cc: Jesper Juhl j

[PATCH v2 6/6] scsi/qla2xxx: use pcie_is_pcie() to simplify code

2013-09-05 Thread Yijing Wang
Use pci_is_pcie() instead of pci_find_capability to simplify code. Acked-by: Chad Dupuis chad.dup...@qlogic.com Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Andrew Vasquez andrew.vasq...@qlogic.com Cc: linux-dri...@qlogic.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux

[PATCH 2/7] scsi/csiostor: use pcie_capability_xxx to simplify code

2013-09-03 Thread Yijing Wang
Pcie_capability_xxx() interfaces were introudced to simplify code to access PCIe Cap config space. And because PCI core saves the PCIe Cap offset in set_pcie_port_type() when device is enumerated. So we can use pci_is_pcie() instead. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Jiang Liu

[PATCH 7/7] scsi/qla2xxx: use pcie_is_pcie() to simplify code

2013-09-03 Thread Yijing Wang
Use pci_is_pcie() instead of pci_find_capability to simplify code. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Andrew Vasquez andrew.vasq...@qlogic.com Cc: linux-dri...@qlogic.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: linux-ker

[PATCH 1/7] scsi/bfa: use pcie_capability_xxx to simplify code

2013-09-03 Thread Yijing Wang
Pcie_capability_xxx() interfaces were introudced to simplify code to access PCIe Cap config space. And because PCI core saves the PCIe Cap offset in set_pcie_port_type() when device is enumerated. So we can use pci_is_pcie() instead. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Jiang Liu

Re: [PATCH 05/16] megaraid: clean up unnecessary MSI/MSI-X capability find

2013-08-25 Thread Yijing Wang
PCI_MSIX_FLAGS, control ~PCI_MSIX_FLAGS_ENABLE); } -- 1.7.1 Acked-by: Sumit Saxena sumit.sax...@lsi.com Hi James, Can you merge this patch? Thanks! Yijing.

Re: [PATCH 11/16] pm8001: clean up unnecessary MSI/MSI-X capability find

2013-08-09 Thread Yijing Wang
On 2013/8/9 10:57, lindar_liu wrote: On 08/08/2013 9:10 PM, Yijing Wang wrote: PCI core will initialize device MSI/MSI-X capability in pci_msi_init_pci_dev(). So device driver should use pci_dev- msi_cap/msix_cap to determine whether the device support MSI/MSI-X instead of using

[PATCH 05/16] megaraid: clean up unnecessary MSI/MSI-X capability find

2013-08-08 Thread Yijing Wang
will consume more time. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Neela Syam Kolli megaraidli...@lsi.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org --- drivers/scsi/megaraid/megaraid_sas_base.c |9 - 1 files changed, 4 insertions(+), 5

[PATCH 07/16] mpt3sas: clean up unnecessary MSI/MSI-X capability find

2013-08-08 Thread Yijing Wang
will consume more time. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Nagalakshmi Nandigama nagalakshmi.nandig...@lsi.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com Cc: supp...@lsi.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: dl-mptfusionli...@lsi.com Cc: linux-scsi@vger.kernel.org

[PATCH 04/16] hpsa: clean up unnecessary MSI/MSI-X capability find

2013-08-08 Thread Yijing Wang
will consume more time. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Stephen M. Cameron scame...@beardog.cce.hp.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: iss_storage...@hp.com Cc: linux-scsi@vger.kernel.org --- drivers/scsi/hpsa.c |4 ++-- 1 files changed, 2 insertions(+), 2

[PATCH 12/16] pmcraid: clean up unnecessary MSI/MSI-X capability find

2013-08-08 Thread Yijing Wang
will consume more time. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Anil Ravindranath anil_ravindran...@pmc-sierra.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org --- drivers/scsi/pmcraid.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff

[PATCH 11/16] pm8001: clean up unnecessary MSI/MSI-X capability find

2013-08-08 Thread Yijing Wang
will consume more time. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: xjtu...@gmail.com Cc: lindar_...@usish.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org --- drivers/scsi/pm8001/pm8001_init.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[Resend with Ack][PATCH 8/9] scsi/pm8001: use pdev-pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)

2013-06-27 Thread Yijing Wang
...@usish.com Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: xjtu...@gmail.com Cc: lindar_...@usish.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- drivers/scsi/pm8001/pm8001_init.c |7 +++ 1 files changed, 3

Re: [PATCH 8/9] scsi/pm8001: use pdev-pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)

2013-06-26 Thread Yijing Wang
On 2013/6/26 17:33, Jack Wang wrote: On 06/18/2013 10:23 AM, Yijing Wang wrote: Pci core has been saved pm cap register offset by pdev-pm_cap in pci_pm_init() in init path. So we can use pdev-pm_cap instead of using pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance

Re: [PATCH 8/9] scsi/pm8001: use pdev-pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)

2013-06-25 Thread Yijing Wang
Hi, Any comments? On 2013/6/18 16:23, Yijing Wang wrote: Pci core has been saved pm cap register offset by pdev-pm_cap in pci_pm_init() in init path. So we can use pdev-pm_cap instead of using pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code. Signed

[PATCH 8/9] scsi/pm8001: use pdev-pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)

2013-06-25 Thread Yijing Wang
Pci core has been saved pm cap register offset by pdev-pm_cap in pci_pm_init() in init path. So we can use pdev-pm_cap instead of using pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: xjtu...@gmail.com Cc

[PATCH 6/9] hpsa: rework pci pm related code for simplification

2013-06-18 Thread Yijing Wang
Use pci core pm interface to simplify code. Signed-off-by: Yijing Wang wangyij...@huawei.com Cc: Stephen M. Cameron scame...@beardog.cce.hp.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: iss_storage...@hp.com Cc: linux-scsi@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- drivers

Re: Fail to probe qla2xxx fiber channel card while doing pci hotplug

2012-09-20 Thread Yijing Wang
On 2012/9/20 9:47, Yijing Wang wrote: We compared the two situations after BIOS initialization, and found Max Payload Size in DEVCTRL is 256B if FC card had been installed, if the slot is empty, Max Payload Size is 128B. We force it to be 128B when FC card installed when system boot up

Re: Fail to probe qla2xxx fiber channel card while doing pci hotplug

2012-09-19 Thread Yijing Wang
On 2012/9/19 7:49, Giridhar Malavali wrote: On 9/18/12 10:54 AM, Bjorn Helgaas bhelg...@google.com wrote: On Mon, Sep 17, 2012 at 6:06 AM, Yijing Wang wangyij...@huawei.com wrote: On 2012/9/16 11:30, Bjorn Helgaas wrote: On Sat, Sep 15, 2012 at 4:22 AM, Yijing Wang wangyij...@huawei.com

Re: Fail to probe qla2xxx fiber channel card while doing pci hotplug

2012-09-19 Thread Yijing Wang
On 2012/9/19 23:31, Jiang Liu wrote: On 09/19/2012 09:39 PM, Bjorn Helgaas wrote: On Tue, Sep 18, 2012 at 7:50 PM, Yijing Wang wangyij...@huawei.com wrote: On 2012/9/19 1:54, Bjorn Helgaas wrote: On Mon, Sep 17, 2012 at 6:06 AM, Yijing Wang wangyij...@huawei.com wrote: On 2012/9/16 11:30

Re: Fail to probe qla2xxx fiber channel card while doing pci hotplug

2012-09-18 Thread Yijing Wang
On 2012/9/19 1:54, Bjorn Helgaas wrote: On Mon, Sep 17, 2012 at 6:06 AM, Yijing Wang wangyij...@huawei.com wrote: On 2012/9/16 11:30, Bjorn Helgaas wrote: On Sat, Sep 15, 2012 at 4:22 AM, Yijing Wang wangyij...@huawei.com wrote: Hi all, I encountered a very strange problem when I hot plug

Re: Fail to probe qla2xxx fiber channel card while doing pci hotplug

2012-09-17 Thread Yijing Wang
On 2012/9/18 2:15, Giridhar Malavali wrote: On 9/17/12 5:06 AM, Yijing Wang wangyij...@huawei.com wrote: [ 769.531289] qla2xxx [:08:00.0]-001d: : Found an ISP2532 irq 32 iobase 0xc90016bcc000. [ 769.531748] qla2xxx :08:00.0: irq 91 for MSI/MSI-X [ 769.531768] qla2xxx

Fail to probe qla2xxx fiber channel card while doing pci hotplug

2012-09-15 Thread Yijing Wang
Hi all, I encountered a very strange problem when I hot plug a fiber channel card(using qla2xxx driver). I did the hotplug in arch x86 machine, using pciehp driver for hotplug, this platform supports pci hot-plug triggering from both sysfs and attention button. If a hot-plug slot is empty