Re: [PATCH v3 0/9] PCI/AER: Fix and optimize usage of status clearing api

2022-11-24 Thread Zhuo Chen
Ping. Gentle reminder On 11/5/22 1:20 AM, Zhuo Chen wrote: Hi Bjorn, a gentle reminder. Thanks and regards. On 9/28/22 6:59 PM, Zhuo Chen wrote: Hello. Here comes patch v3, which contains some fixes and optimizations of aer api usage. The v1 and v2 can be found on the mailing list. v3

Re: [PATCH v3 0/9] PCI/AER: Fix and optimize usage of status clearing api

2022-11-04 Thread Zhuo Chen
Hi Bjorn, a gentle reminder. Thanks and regards. On 9/28/22 6:59 PM, Zhuo Chen wrote: Hello. Here comes patch v3, which contains some fixes and optimizations of aer api usage. The v1 and v2 can be found on the mailing list. v3: - Modifications to comments proposed by Sathyanarayanan. Remove

Re: [External] Re: [PATCH v3 0/9] PCI/AER: Fix and optimize usage of status clearing api

2022-09-28 Thread Zhuo Chen
On 9/28/22 7:06 PM, Serge Semin wrote: On Wed, Sep 28, 2022 at 06:59:37PM +0800, Zhuo Chen wrote: Hello. Here comes patch v3, which contains some fixes and optimizations of aer api usage. The v1 and v2 can be found on the mailing list. v3: - Modifications to comments proposed

[PATCH v3 9/9] PCI/AER: Refine status clearing process with api

2022-09-28 Thread Zhuo Chen
tatus"), pci_aer_raw_clear_status() is only used by the EDR path, so we add note in function comment. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/aer.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index a6

[PATCH v3 8/9] PCI/ERR: Clear fatal error status when pci_channel_io_frozen

2022-09-28 Thread Zhuo Chen
When state is pci_channel_io_frozen in pcie_do_recovery(), the severity is fatal and fatal error status should be cleared. So add pci_aer_clear_fatal_status(). Signed-off-by: Zhuo Chen --- drivers/pci/pcie/err.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci

[PATCH v3 7/9] PCI/AER: Use pcie_aer_is_native() to judge whether OS owns AER

2022-09-28 Thread Zhuo Chen
as no functional changes. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/aer.c | 5 ++--- drivers/pci/pcie/portdrv_core.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index e2320ab27a31..a6d29269ccf2 100644 --- a

[PATCH v3 6/9] PCI/AER: Move check inside pcie_clear_device_status().

2022-09-28 Thread Zhuo Chen
calling it. So move the check inside pcie_clear_device_status(). pcie_clear_device_status() and pci_aer_clear_nonfatal_status() both have check internally, so remove check when callers calling them. Signed-off-by: Zhuo Chen --- drivers/pci/pci.c | 7 +-- drivers/pci/pcie/aer.c | 4 ++

[PATCH v3 5/9] PCI/AER: Unexport pci_aer_clear_nonfatal_status()

2022-09-28 Thread Zhuo Chen
Since pci_aer_clear_nonfatal_status() is used only internally, move its declaration to the PCI internal header file. Also, no one cares about return value of pci_aer_clear_nonfatal_status(), so make it void. Signed-off-by: Zhuo Chen --- drivers/pci/pci.h | 2 ++ drivers/pci/pcie/aer.c | 7

[PATCH v3 4/9] scsi: lpfc: Change to use pci_aer_clear_uncorrect_error_status()

2022-09-28 Thread Zhuo Chen
lpfc_aer_cleanup_state() requires clearing both fatal and non-fatal uncorrectable error status. But using pci_aer_clear_nonfatal_status() will only clear non-fatal error status. To clear both fatal and non-fatal error status, use pci_aer_clear_uncorrect_error_status(). Signed-off-by: Zhuo Chen

[PATCH v3 3/9] NTB: Remove pci_aer_clear_nonfatal_status() call

2022-09-28 Thread Zhuo Chen
There is no need to clear error status during init code, so remove it. Signed-off-by: Zhuo Chen --- drivers/ntb/hw/idt/ntb_hw_idt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c index 0ed6f809ff2e..fed03217289d 100644

[PATCH v3 2/9] PCI/DPC: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status

2022-09-28 Thread Zhuo Chen
pci_aer_clear_uncorrect_error_status() clears both fatal and non-fatal errors. So use it in place of pci_aer_clear_nonfatal_status() and pci_aer_clear_fatal_status(). Signed-off-by: Zhuo Chen --- drivers/pci/pcie/dpc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH v3 1/9] PCI/AER: Add pci_aer_clear_uncorrect_error_status() to PCI core

2022-09-28 Thread Zhuo Chen
() function to PCI core and export symbol to other modules which wants to use it. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/aer.c | 16 include/linux/aer.h| 5 + 2 files changed, 21 insertions(+) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index

[PATCH v3 0/9] PCI/AER: Fix and optimize usage of status clearing api

2022-09-28 Thread Zhuo Chen
: - Modifications to comments proposed by Bjorn. Split patch into more obvious parts. Zhuo Chen (9): PCI/AER: Add pci_aer_clear_uncorrect_error_status() to PCI core PCI/DPC: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status NTB: Remove pci_aer_clear_nonfatal_status() call

Re: [PATCH v2 1/9] PCI/AER: Add pci_aer_clear_uncorrect_error_status() to PCI core

2022-09-28 Thread Zhuo Chen
On 9/28/22 3:31 AM, Sathyanarayanan Kuppuswamy wrote: Hi, On 9/27/22 8:35 AM, Zhuo Chen wrote: Sometimes we need to clear aer uncorrectable error status, so we add Adding n actual use case will help. pci_aer_clear_uncorrect_error_status() to PCI core. If possible, try to avoid &qu

Re: [External] Re: [PATCH v2 3/9] NTB: Change to use pci_aer_clear_uncorrect_error_status()

2022-09-27 Thread Zhuo Chen
On 9/28/22 3:39 AM, Sathyanarayanan Kuppuswamy wrote: On 9/27/22 8:35 AM, Zhuo Chen wrote: Status bits for ERR_NONFATAL errors only are cleared in pci_aer_clear_nonfatal_status(), but we want clear uncorrectable error status in idt_init_pci(), so we change to use

[PATCH v2 9/9] PCI/AER: Refine status clearing process with api

2022-09-27 Thread Zhuo Chen
tatus"), pci_aer_raw_clear_status() is only used by the EDR path, so we add note in function comment. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/aer.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index a6

[PATCH v2 8/9] PCI/ERR: Clear fatal status when pci_channel_io_frozen

2022-09-27 Thread Zhuo Chen
When state is pci_channel_io_frozen in pcie_do_recovery(), the severity is fatal and fatal status should be cleared. So we add pci_aer_clear_fatal_status(). Signed-off-by: Zhuo Chen --- drivers/pci/pcie/err.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci

[PATCH v2 7/9] PCI/AER: Use pcie_aer_is_native() to judge whether OS owns AER

2022-09-27 Thread Zhuo Chen
as no functional changes. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/aer.c | 5 ++--- drivers/pci/pcie/portdrv_core.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index e2320ab27a31..a6d29269ccf2 100644 --- a

[PATCH v2 6/9] PCI/AER: Move check inside pcie_clear_device_status().

2022-09-27 Thread Zhuo Chen
re calling it. So we move the check inside pcie_clear_device_status(). Signed-off-by: Zhuo Chen --- drivers/pci/pci.c | 7 +-- drivers/pci/pcie/aer.c | 4 ++-- drivers/pci/pcie/err.c | 14 +++--- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/pci/pci.c

[PATCH v2 5/9] PCI/AER: Unexport pci_aer_clear_nonfatal_status()

2022-09-27 Thread Zhuo Chen
Since pci_aer_clear_nonfatal_status() is used only internally, move its declaration to the PCI internal header file. Also, no one cares about return value of pci_aer_clear_nonfatal_status(), so make it void. Signed-off-by: Zhuo Chen --- drivers/pci/pci.h | 2 ++ drivers/pci/pcie/aer.c | 7

[PATCH v2 4/9] scsi: lpfc: Change to use pci_aer_clear_uncorrect_error_status()

2022-09-27 Thread Zhuo Chen
Status bits for ERR_NONFATAL errors only are cleared in pci_aer_clear_nonfatal_status(), but we want clear uncorrectable error status in lpfc_aer_cleanup_state(), so we change to use pci_aer_clear_uncorrect_error_status(). Signed-off-by: Zhuo Chen --- drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- 1

[PATCH v2 3/9] NTB: Change to use pci_aer_clear_uncorrect_error_status()

2022-09-27 Thread Zhuo Chen
Status bits for ERR_NONFATAL errors only are cleared in pci_aer_clear_nonfatal_status(), but we want clear uncorrectable error status in idt_init_pci(), so we change to use pci_aer_clear_uncorrect_error_status(). Signed-off-by: Zhuo Chen --- drivers/ntb/hw/idt/ntb_hw_idt.c | 4 ++-- 1 file

[PATCH v2 2/9] PCI/DPC: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status

2022-09-27 Thread Zhuo Chen
Use pci_aer_clear_nonfatal_status() in dpc_process_error(), which has no functional changes. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/dpc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index 3e9afee02e8d..7942073fbb34

[PATCH v2 1/9] PCI/AER: Add pci_aer_clear_uncorrect_error_status() to PCI core

2022-09-27 Thread Zhuo Chen
Sometimes we need to clear aer uncorrectable error status, so we add pci_aer_clear_uncorrect_error_status() to PCI core. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/aer.c | 16 include/linux/aer.h| 5 + 2 files changed, 21 insertions(+) diff --git a/drivers/pci/pcie

[PATCH v2 0/9] PCI/AER: Fix and optimize usage of status clearing api

2022-09-27 Thread Zhuo Chen
Hello. Here comes patch v2, which contains some fixes and optimizations of aer api usage. The original version can be found on the mailing list. Changes since v1: - Modifications to comments proposed by Bjorn. Split patch into more obvious parts. Zhuo Chen (9): PCI/AER: Add

Re: [External] Re: [PATCH 2/3] PCI/ERR: Clear fatal status in pcie_do_recovery()

2022-09-27 Thread Zhuo Chen
On 9/27/22 2:09 AM, Bjorn Helgaas wrote: On Mon, Sep 26, 2022 at 10:01:55PM +0800, Zhuo Chen wrote: On 9/23/22 5:08 AM, Bjorn Helgaas wrote: On Fri, Sep 02, 2022 at 02:16:33AM +0800, Zhuo Chen wrote: When state is pci_channel_io_frozen in pcie_do_recovery(), the severity is fatal and fatal

Re: [PATCH 3/3] PCI/AER: Use pci_aer_raw_clear_status() to clear root port's AER error status

2022-09-26 Thread Zhuo Chen
On 9/23/22 5:50 AM, Bjorn Helgaas wrote: On Fri, Sep 02, 2022 at 02:16:34AM +0800, Zhuo Chen wrote: Statements clearing AER error status in aer_enable_rootport() has the same function as pci_aer_raw_clear_status(). So we replace them, which has no functional changes. Signed-off-by: Zhuo

Re: [PATCH 2/3] PCI/ERR: Clear fatal status in pcie_do_recovery()

2022-09-26 Thread Zhuo Chen
On 9/23/22 5:08 AM, Bjorn Helgaas wrote: On Fri, Sep 02, 2022 at 02:16:33AM +0800, Zhuo Chen wrote: When state is pci_channel_io_frozen in pcie_do_recovery(), the severity is fatal and fatal status should be cleared. So we add pci_aer_clear_fatal_status(). Seems sensible to me. Did you

Re: [PATCH 1/3] PCI/AER: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status

2022-09-26 Thread Zhuo Chen
On 9/23/22 4:02 AM, Bjorn Helgaas wrote: On Mon, Sep 12, 2022 at 01:09:05AM +0800, Zhuo Chen wrote: On 9/12/22 12:22 AM, Serge Semin wrote: On Fri, Sep 02, 2022 at 02:16:32AM +0800, Zhuo Chen wrote: Status bits for ERR_NONFATAL errors only are cleared in pci_aer_clear_nonfatal_status

Re: [External] Re: [PATCH 1/3] PCI/AER: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status

2022-09-11 Thread Zhuo Chen
On 9/12/22 12:22 AM, Serge Semin wrote: Hi Zhuo On Fri, Sep 02, 2022 at 02:16:32AM +0800, Zhuo Chen wrote: Status bits for ERR_NONFATAL errors only are cleared in pci_aer_clear_nonfatal_status(), but we want clear uncorrectable error status in ntb_hw_idt.c and lpfc_attr.c. So we add

[PATCH 3/3] PCI/AER: Use pci_aer_raw_clear_status() to clear root port's AER error status

2022-09-01 Thread Zhuo Chen
Statements clearing AER error status in aer_enable_rootport() has the same function as pci_aer_raw_clear_status(). So we replace them, which has no functional changes. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/aer.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git

[PATCH 2/3] PCI/ERR: Clear fatal status in pcie_do_recovery()

2022-09-01 Thread Zhuo Chen
->native_aer || pcie_ports_native)', so we move them out of it. Signed-off-by: Zhuo Chen --- drivers/pci/pcie/err.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index 0c5a143025af..e0a8ade4c3fe 100644 --- a/drivers/pci/pcie/er

[PATCH 1/3] PCI/AER: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status

2022-09-01 Thread Zhuo Chen
(), which has no functional changes. Since pci_aer_clear_nonfatal_status() is used only internally, move its declaration to the PCI internal header file. Also, no one cares about return value of pci_aer_clear_nonfatal_status(), so make it void. Signed-off-by: Zhuo Chen --- drivers/ntb/hw/idt

[PATCH 0/3] PCI/AER: Fix and optimize usage of status clear api

2022-09-01 Thread Zhuo Chen
. Thanks, Zhuo Chen Zhuo Chen (3): PCI/AER: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status PCI/ERR: Clear fatal status in pcie_do_recovery() PCI/AER: Use pci_aer_raw_clear_status() to clear root port's AER error status drivers/ntb/hw/idt/ntb_hw_idt.c

Re: [External] Re: [PATCH v3] PCI/ERR: Use pcie_aer_is_native() to judge whether OS owns AER

2022-08-12 Thread Zhuo Chen
On 8/3/22 6:18 AM, Sathyanarayanan Kuppuswamy wrote: On 7/27/22 2:37 AM, Zhuo Chen wrote: Do you mean changing "if ((host->native_aer || pcie_ports_native) && aer)" into "if  (pcie_aer_is_native(dev) && aer)" ? I thought changing into "if (pc

[PATCH v4] PCI/ERR: Use pcie_aer_is_native() to judge whether OS owns AER

2022-08-01 Thread Zhuo Chen
ty() with pcie_aer_is_native(), which has no functional changes. Signed-off-by: Zhuo Chen --- Changelog: v4: - Use pcie_aer_is_native() instead in aer_root_reset(). v3: - Simplify why we use pcie_aer_is_native(). - Revert modification of pci_aer_clear_nonfatal_status() and comments. v2:

Re: [PATCH v3] PCI/ERR: Use pcie_aer_is_native() to judge whether OS owns AER

2022-07-27 Thread Zhuo Chen
On 7/26/22 1:35 PM, Zhuo Chen wrote: On 7/26/22 9:02 PM, Sathyanarayanan Kuppuswamy wrote: On 7/26/22 8:53 PM, Zhuo Chen wrote: Use pcie_aer_is_native() in place of "host->native_aer || pcie_ports_native" to judge whether OS has native control of AER in pcie_do_recovery().

[PATCH v3] PCI/ERR: Use pcie_aer_is_native() to judge whether OS owns AER

2022-07-26 Thread Zhuo Chen
_is_native(), which has no functional changes. Signed-off-by: Zhuo Chen --- Changelog: v3: - Simplify why we use pcie_aer_is_native(). - Revert modification of pci_aer_clear_nonfatal_status() and comments. v2: - Add details and note in commit log. --- drivers/pci/pcie/err.c | 3 +-- drive

[PATCH v2] PCI/ERR: Use pcie_aer_is_native() to judge whether OS owns AER

2022-07-25 Thread Zhuo Chen
. Replace statements that judge whether OS owns AER in get_port_device_capability() with pcie_aer_is_native(), which has no functional changes. Signed-off-by: Zhuo Chen --- v2: - Add details and note in commit log --- drivers/pci/pcie/err.c | 12 ++-- drivers/pci/pcie/portdrv_cor

[PATCH] PCI/ERR: Use pcie_aer_is_native() to judge whether OS owns AER

2022-07-25 Thread Zhuo Chen
h pcie_aer_is_native(). Signed-off-by: Zhuo Chen --- drivers/pci/pcie/err.c | 12 ++-- drivers/pci/pcie/portdrv_core.c | 3 +-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index 0c5a143025af..28339c741555 100644 --- a/dr