All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Zhu <hongxing.zhu@nxp.com>
To: Lucas Stach <l.stach@pengutronix.de>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Cc: "lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
	"tharvey@gateworks.com" <tharvey@gateworks.com>,
	"patchwork-lst@pengutronix.de" <patchwork-lst@pengutronix.de>,
	Peter Senna Tschudin <peter.senna@collabora.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH] PCI: imx6: fix downstream bus scanning
Date: Thu, 11 May 2017 02:00:43 +0000	[thread overview]
Message-ID: <AM5PR0402MB28506F261345166D313D50F88CED0@AM5PR0402MB2850.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20170510175752.6519-1-l.stach@pengutronix.de>


> -----Original Message-----
> From: Lucas Stach [mailto:l.stach@pengutronix.de]
> Sent: Thursday, May 11, 2017 1:58 AM
> To: linux-pci@vger.kernel.org
> Cc: Peter Senna Tschudin <peter.senna@collabora.com>; Richard Zhu
> <hongxing.zhu@nxp.com>; festevam@gmail.com; bhelgaas@google.com;
> tharvey@gateworks.com; lorenzo.pieralisi@arm.com; linux-arm-
> kernel@lists.infradead.org; kernel@pengutronix.de; patchwork-
> lst@pengutronix.de
> Subject: [PATCH] PCI: imx6: fix downstream bus scanning
> 
> The change in Linux 4.12 to make PCI configuartion requests non-posted
> means that we are now getting a synchronous abort when the CFG space
> read to probe for downstream devices times out.
> 
> Synchronous aborts need to be handled differently from the async aborts we
> were getting before, in particular the PC needs to be advanced when
> resolving the abort. This is mostly a copy of what other PCI drivers do on ARM
> to handle those aborts.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Thanks lot for your great help at first.
Only one little spell comment, "configuartion" in the commit message should be "configuration",
 the others are okay.
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>

> ---
> This is a fix that needs to go in for 4.12, but I would hope to get some
> thorough testing before.
> ---
>  drivers/pci/dwc/pci-imx6.c | 33 ++++++++++++++++++++++++++++++---
>  1 file changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pci-imx6.c b/drivers/pci/dwc/pci-imx6.c index
> a98cba55c7f0..19a289b8cc94 100644
> --- a/drivers/pci/dwc/pci-imx6.c
> +++ b/drivers/pci/dwc/pci-imx6.c
> @@ -252,7 +252,34 @@ static void imx6_pcie_reset_phy(struct imx6_pcie
> *imx6_pcie)  static int imx6q_pcie_abort_handler(unsigned long addr,
>  		unsigned int fsr, struct pt_regs *regs)  {
> -	return 0;
> +	unsigned long pc = instruction_pointer(regs);
> +	unsigned long instr = *(unsigned long *)pc;
> +	int reg = (instr >> 12) & 15;
> +
> +	/*
> +	 * If the instruction being executed was a read,
> +	 * make it look like it read all-ones.
> +	 */
> +	if ((instr & 0x0c100000) == 0x04100000) {
> +		unsigned long val;
> +
> +		if (instr & 0x00400000)
> +			val = 255;
> +		else
> +			val = -1;
> +
> +		regs->uregs[reg] = val;
> +		regs->ARM_pc += 4;
> +		return 0;
> +	}
> +
> +	if ((instr & 0x0e100090) == 0x00100090) {
> +		regs->uregs[reg] = -1;
> +		regs->ARM_pc += 4;
> +		return 0;
> +	}
> +
> +	return 1;
>  }
> 
>  static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie) @@ -
> 819,8 +846,8 @@ static int __init imx6_pcie_init(void)
>  	 * we can install the handler here without risking it
>  	 * accessing some uninitialized driver state.
>  	 */
> -	hook_fault_code(16 + 6, imx6q_pcie_abort_handler, SIGBUS, 0,
> -			"imprecise external abort");
> +	hook_fault_code(8, imx6q_pcie_abort_handler, SIGBUS, 0,
> +			"external abort on non-linefetch");
> 
>  	return platform_driver_register(&imx6_pcie_driver);
>  }
> --
> 2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: hongxing.zhu@nxp.com (Richard Zhu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] PCI: imx6: fix downstream bus scanning
Date: Thu, 11 May 2017 02:00:43 +0000	[thread overview]
Message-ID: <AM5PR0402MB28506F261345166D313D50F88CED0@AM5PR0402MB2850.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20170510175752.6519-1-l.stach@pengutronix.de>


> -----Original Message-----
> From: Lucas Stach [mailto:l.stach at pengutronix.de]
> Sent: Thursday, May 11, 2017 1:58 AM
> To: linux-pci at vger.kernel.org
> Cc: Peter Senna Tschudin <peter.senna@collabora.com>; Richard Zhu
> <hongxing.zhu@nxp.com>; festevam at gmail.com; bhelgaas at google.com;
> tharvey at gateworks.com; lorenzo.pieralisi at arm.com; linux-arm-
> kernel at lists.infradead.org; kernel at pengutronix.de; patchwork-
> lst at pengutronix.de
> Subject: [PATCH] PCI: imx6: fix downstream bus scanning
> 
> The change in Linux 4.12 to make PCI configuartion requests non-posted
> means that we are now getting a synchronous abort when the CFG space
> read to probe for downstream devices times out.
> 
> Synchronous aborts need to be handled differently from the async aborts we
> were getting before, in particular the PC needs to be advanced when
> resolving the abort. This is mostly a copy of what other PCI drivers do on ARM
> to handle those aborts.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Thanks lot for your great help at first.
Only one little spell comment, "configuartion" in the commit message should be "configuration",
 the others are okay.
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>

> ---
> This is a fix that needs to go in for 4.12, but I would hope to get some
> thorough testing before.
> ---
>  drivers/pci/dwc/pci-imx6.c | 33 ++++++++++++++++++++++++++++++---
>  1 file changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pci-imx6.c b/drivers/pci/dwc/pci-imx6.c index
> a98cba55c7f0..19a289b8cc94 100644
> --- a/drivers/pci/dwc/pci-imx6.c
> +++ b/drivers/pci/dwc/pci-imx6.c
> @@ -252,7 +252,34 @@ static void imx6_pcie_reset_phy(struct imx6_pcie
> *imx6_pcie)  static int imx6q_pcie_abort_handler(unsigned long addr,
>  		unsigned int fsr, struct pt_regs *regs)  {
> -	return 0;
> +	unsigned long pc = instruction_pointer(regs);
> +	unsigned long instr = *(unsigned long *)pc;
> +	int reg = (instr >> 12) & 15;
> +
> +	/*
> +	 * If the instruction being executed was a read,
> +	 * make it look like it read all-ones.
> +	 */
> +	if ((instr & 0x0c100000) == 0x04100000) {
> +		unsigned long val;
> +
> +		if (instr & 0x00400000)
> +			val = 255;
> +		else
> +			val = -1;
> +
> +		regs->uregs[reg] = val;
> +		regs->ARM_pc += 4;
> +		return 0;
> +	}
> +
> +	if ((instr & 0x0e100090) == 0x00100090) {
> +		regs->uregs[reg] = -1;
> +		regs->ARM_pc += 4;
> +		return 0;
> +	}
> +
> +	return 1;
>  }
> 
>  static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie) @@ -
> 819,8 +846,8 @@ static int __init imx6_pcie_init(void)
>  	 * we can install the handler here without risking it
>  	 * accessing some uninitialized driver state.
>  	 */
> -	hook_fault_code(16 + 6, imx6q_pcie_abort_handler, SIGBUS, 0,
> -			"imprecise external abort");
> +	hook_fault_code(8, imx6q_pcie_abort_handler, SIGBUS, 0,
> +			"external abort on non-linefetch");
> 
>  	return platform_driver_register(&imx6_pcie_driver);
>  }
> --
> 2.11.0

  parent reply	other threads:[~2017-05-11  2:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 17:57 [PATCH] PCI: imx6: fix downstream bus scanning Lucas Stach
2017-05-10 17:57 ` Lucas Stach
2017-05-10 18:35 ` Fabio Estevam
2017-05-10 18:35   ` Fabio Estevam
2017-05-10 19:04   ` Fabio Estevam
2017-05-10 19:04     ` Fabio Estevam
2017-05-10 19:51 ` Peter Senna Tschudin
2017-05-10 19:51   ` Peter Senna Tschudin
2017-05-11  2:00 ` Richard Zhu [this message]
2017-05-11  2:00   ` Richard Zhu
2017-05-22 22:13 ` Bjorn Helgaas
2017-05-22 22:13   ` Bjorn Helgaas
2017-05-23  9:07   ` Lorenzo Pieralisi
2017-05-23  9:07     ` Lorenzo Pieralisi
2017-05-23 22:11   ` Fabio Estevam
2017-05-23 22:11     ` Fabio Estevam
2017-05-24 17:16     ` Bjorn Helgaas
2017-05-24 17:16       ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM5PR0402MB28506F261345166D313D50F88CED0@AM5PR0402MB2850.eurprd04.prod.outlook.com \
    --to=hongxing.zhu@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=patchwork-lst@pengutronix.de \
    --cc=peter.senna@collabora.com \
    --cc=tharvey@gateworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.