Re: [PATCH 12/13] PCI: dwc: Move dw_pcie_setup_rc() to DWC common code

2020-10-29 Thread Jingoo Han
On 10/28/20, 4:47 PM, Rob Herring wrote:
> 
> All RC complex drivers must call dw_pcie_setup_rc(). The ordering of the
> call shouldn't be too important other than being after any RC resets.
>
> There's a few calls of dw_pcie_setup_rc() left as drivers implementing
> suspend/resume need it.
>
> Cc: Kishon Vijay Abraham I 
> Cc: Lorenzo Pieralisi 
> Cc: Bjorn Helgaas 
> Cc: Jingoo Han 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> Cc: Kukjin Kim 
> Cc: Krzysztof Kozlowski 
> Cc: Richard Zhu 
> Cc: Lucas Stach 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> Cc: NXP Linux Team 
> Cc: Murali Karicheri 
> Cc: Minghuan Lian 
> Cc: Mingkai Hu 
> Cc: Roy Zang 
> Cc: Yue Wang 
> Cc: Kevin Hilman 
> Cc: Neil Armstrong 
> Cc: Jerome Brunet 
> Cc: Martin Blumenstingl 
> Cc: Thomas Petazzoni 
> Cc: Jesper Nilsson 
> Cc: Gustavo Pimentel 
> Cc: Xiaowei Song 
> Cc: Binghui Wang 
> Cc: Andy Gross 
> Cc: Bjorn Andersson 
> Cc: Stanimir Varbanov 
> Cc: Pratyush Anand 
> Cc: Kunihiko Hayashi 
> Cc: Masahiro Yamada 
> Cc: linux-o...@vger.kernel.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-amlo...@lists.infradead.org
> Cc: linux-arm-ker...@axis.com
> Cc: linux-arm-...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/pci/controller/dwc/pci-dra7xx.c   | 1 -
>  drivers/pci/controller/dwc/pci-exynos.c   | 1 -
>  drivers/pci/controller/dwc/pci-imx6.c | 1 -
>  drivers/pci/controller/dwc/pci-keystone.c | 2 --
>  drivers/pci/controller/dwc/pci-layerscape.c   | 2 --
>  drivers/pci/controller/dwc/pci-meson.c| 2 --
>  drivers/pci/controller/dwc/pcie-armada8k.c| 2 --
>  drivers/pci/controller/dwc/pcie-artpec6.c | 1 -
>  drivers/pci/controller/dwc/pcie-designware-host.c | 1 +
>  drivers/pci/controller/dwc/pcie-designware-plat.c | 8 
>  drivers/pci/controller/dwc/pcie-histb.c   | 3 ---
>  drivers/pci/controller/dwc/pcie-kirin.c   | 2 --
>  drivers/pci/controller/dwc/pcie-qcom.c| 1 -
>  drivers/pci/controller/dwc/pcie-spear13xx.c   | 2 --
>  drivers/pci/controller/dwc/pcie-uniphier.c| 2 --
>  15 files changed, 1 insertion(+), 30 deletions(-)

[...]


Re: [PATCH 11/13] PCI: dwc: Move dw_pcie_msi_init() into core

2020-10-29 Thread Jingoo Han
On 10/28/20, 4:47 PM, Rob Herring wrote:
> 
> The host drivers which call dw_pcie_msi_init() are all the ones using
> the built-in MSI controller, so let's move it into the common DWC code.
>
> Cc: Kishon Vijay Abraham I 
> Cc: Lorenzo Pieralisi 
> Cc: Bjorn Helgaas 
> Cc: Jingoo Han 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> Cc: Kukjin Kim 
> Cc: Krzysztof Kozlowski 
> Cc: Richard Zhu 
> Cc: Lucas Stach 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> Cc: NXP Linux Team 
> Cc: Yue Wang 
> Cc: Kevin Hilman 
> Cc: Neil Armstrong 
> Cc: Jerome Brunet 
> Cc: Martin Blumenstingl 
> Cc: Jesper Nilsson 
> Cc: Gustavo Pimentel 
> Cc: Xiaowei Song 
> Cc: Binghui Wang 
> Cc: Stanimir Varbanov 
> Cc: Andy Gross 
> Cc: Bjorn Andersson 
> Cc: Pratyush Anand 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Kunihiko Hayashi 
> Cc: Masahiro Yamada 
> Cc: linux-o...@vger.kernel.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: linux-amlo...@lists.infradead.org
> Cc: linux-arm-ker...@axis.com
> Cc: linux-arm-...@vger.kernel.org
> Cc: linux-te...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/pci/controller/dwc/pci-dra7xx.c   |  2 --
>  drivers/pci/controller/dwc/pci-exynos.c   |  4 
>  drivers/pci/controller/dwc/pci-imx6.c |  1 -
>  drivers/pci/controller/dwc/pci-meson.c|  1 -
>  drivers/pci/controller/dwc/pcie-artpec6.c |  1 -
>  drivers/pci/controller/dwc/pcie-designware-host.c |  8 +---
>  drivers/pci/controller/dwc/pcie-designware-plat.c |  1 -
>  drivers/pci/controller/dwc/pcie-designware.h  | 10 --
>  drivers/pci/controller/dwc/pcie-histb.c   |  2 --
>  drivers/pci/controller/dwc/pcie-kirin.c   |  1 -
>  drivers/pci/controller/dwc/pcie-qcom.c|  2 --
>  drivers/pci/controller/dwc/pcie-spear13xx.c   |  6 +-
>  drivers/pci/controller/dwc/pcie-tegra194.c|  2 --
>  drivers/pci/controller/dwc/pcie-uniphier.c|  1 -
>  14 files changed, 6 insertions(+), 36 deletions(-)

[...]


Re: [PATCH 10/13] PCI: dwc: Move link handling into common code

2020-10-29 Thread Jingoo Han
On 10/28/20, 4:47 PM, Rob Herring wrote:
> 
> All the DWC drivers do link setup and checks at roughly the same time.
> Let's use the existing .start_link() hook (currently only used in EP
> mode) and move the link handling to the core code.
>
> The behavior for a link down was inconsistent as some drivers would fail
> probe in that case while others succeed. Let's standardize this to
> succeed as there are usecases where devices (and the link) appear later
> even without hotplug. For example, a reconfigured FPGA device.
>
> Cc: Kishon Vijay Abraham I 
> Cc: Lorenzo Pieralisi 
> Cc: Bjorn Helgaas 
> Cc: Jingoo Han 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> Cc: Kukjin Kim 
> Cc: Krzysztof Kozlowski 
> Cc: Richard Zhu 
> Cc: Lucas Stach 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> Cc: NXP Linux Team 
> Cc: Murali Karicheri 
> Cc: Yue Wang 
> Cc: Kevin Hilman 
> Cc: Neil Armstrong 
> Cc: Jerome Brunet 
> Cc: Martin Blumenstingl 
> Cc: Thomas Petazzoni 
> Cc: Jesper Nilsson 
> Cc: Gustavo Pimentel 
> Cc: Xiaowei Song 
> Cc: Binghui Wang 
> Cc: Andy Gross 
> Cc: Bjorn Andersson 
> Cc: Stanimir Varbanov 
> Cc: Pratyush Anand 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Kunihiko Hayashi 
> Cc: Masahiro Yamada 
> Cc: linux-o...@vger.kernel.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: linux-amlo...@lists.infradead.org
> Cc: linux-arm-ker...@axis.com
> Cc: linux-arm-...@vger.kernel.org
> Cc: linux-te...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/pci/controller/dwc/pci-dra7xx.c   |  2 -
>  drivers/pci/controller/dwc/pci-exynos.c   | 41 +++--
>  drivers/pci/controller/dwc/pci-imx6.c |  9 ++--
>  drivers/pci/controller/dwc/pci-keystone.c |  9 
>  drivers/pci/controller/dwc/pci-meson.c| 24 --
>  drivers/pci/controller/dwc/pcie-armada8k.c| 39 +++-
>  drivers/pci/controller/dwc/pcie-artpec6.c |  2 -
>  .../pci/controller/dwc/pcie-designware-host.c |  9 
>  .../pci/controller/dwc/pcie-designware-plat.c |  3 --
>  drivers/pci/controller/dwc/pcie-histb.c   | 34 +++---
>  drivers/pci/controller/dwc/pcie-kirin.c   | 23 ++
>  drivers/pci/controller/dwc/pcie-qcom.c| 19 ++--
>  drivers/pci/controller/dwc/pcie-spear13xx.c   | 46 ---
>  drivers/pci/controller/dwc/pcie-tegra194.c|  1 -
>  drivers/pci/controller/dwc/pcie-uniphier.c| 13 ++
>  15 files changed, 103 insertions(+), 171 deletions(-)

[...]


Re: [PATCH 09/13] PCI: dwc: Rework MSI initialization

2020-10-29 Thread Jingoo Han
On 10/28/20, 4:47 PM, Rob Herring wrote:
> 
> There are 3 possible MSI implementations for the DWC host. The first is
> using the built-in DWC MSI controller. The 2nd is a custom MSI
> controller as part of the PCI host (keystone only). The 3rd is an
> external MSI controller (typically GICv3 ITS). Currently, the last 2
> are distinguished with a .msi_host_init() hook with the 3rd option using
> an empty function. However we can detect the 3rd case with the presence
> of 'msi-parent' or 'msi-map' properties, so let's do that instead and
> remove the empty functions.
>
> Cc: Murali Karicheri 
> Cc: Lorenzo Pieralisi 
> Cc: Bjorn Helgaas 
> Cc: Minghuan Lian 
> Cc: Mingkai Hu 
> Cc: Roy Zang 
> Cc: Jingoo Han 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> Cc: Gustavo Pimentel 
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/pci/controller/dwc/pci-keystone.c |  9 ---
>  drivers/pci/controller/dwc/pci-layerscape.c   | 25 ---
>  .../pci/controller/dwc/pcie-designware-host.c | 20 +--
>  drivers/pci/controller/dwc/pcie-designware.h  |  1 +
>  drivers/pci/controller/dwc/pcie-intel-gw.c|  9 ---
>  5 files changed, 13 insertions(+), 51 deletions(-)

[...]


Re: [PATCH 08/13] PCI: dwc: Move MSI interrupt setup into DWC common code

2020-10-29 Thread Jingoo Han
On 10/28/20, 4:47 PM, Rob Herring wrote:
> 
> Platforms using the built-in DWC MSI controller all have a dedicated
> interrupt with "msi" name or at index 0, so let's move setting up the
> interrupt to the common DWC code.
>
> spear13xx and dra7xx are the 2 oddballs with muxed interrupts, so
> we need to prevent configuring the MSI interrupt by setting msi_irq
> to negative.
>
> Cc: Jingoo Han 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> Cc: Lorenzo Pieralisi 
> Cc: Bjorn Helgaas 
> Cc: Kukjin Kim 
> Cc: Krzysztof Kozlowski 
> Cc: Richard Zhu 
> Cc: Lucas Stach 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> Cc: NXP Linux Team 
> Cc: Yue Wang 
> Cc: Kevin Hilman 
> Cc: Neil Armstrong 
> Cc: Jerome Brunet 
> Cc: Martin Blumenstingl 
> Cc: Jesper Nilsson 
> Cc: Gustavo Pimentel 
> Cc: Xiaowei Song 
> Cc: Binghui Wang 
> Cc: Stanimir Varbanov 
> Cc: Andy Gross 
> Cc: Bjorn Andersson 
> Cc: Pratyush Anand 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Kunihiko Hayashi 
> Cc: Masahiro Yamada 
> Cc: linux-samsung-...@vger.kernel.org
> Cc: linux-amlo...@lists.infradead.org
> Cc: linux-arm-ker...@axis.com
> Cc: linux-arm-...@vger.kernel.org
> Cc: linux-te...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/pci/controller/dwc/pci-dra7xx.c   |  3 +++
>  drivers/pci/controller/dwc/pci-exynos.c   |  6 -
>  drivers/pci/controller/dwc/pci-imx6.c |  6 -
>  drivers/pci/controller/dwc/pci-meson.c|  6 -
>  drivers/pci/controller/dwc/pcie-artpec6.c |  6 -
> .../pci/controller/dwc/pcie-designware-host.c | 11 +-
>  .../pci/controller/dwc/pcie-designware-plat.c |  6 -
>  drivers/pci/controller/dwc/pcie-histb.c   |  6 -
>  drivers/pci/controller/dwc/pcie-kirin.c   | 22 ---
>  drivers/pci/controller/dwc/pcie-qcom.c|  8 ---
>  drivers/pci/controller/dwc/pcie-spear13xx.c   |  1 +
>  drivers/pci/controller/dwc/pcie-tegra194.c|  8 ---
>  drivers/pci/controller/dwc/pcie-uniphier.c|  6 -
>  13 files changed, 14 insertions(+), 81 deletions(-)

[...]


Re: [PATCH 07/13] PCI: dwc: Drop the .set_num_vectors() host op

2020-10-29 Thread Jingoo Han
On 10/28/20, 4:47 PM, Rob Herring wrote:
> 
> There's no reason for the .set_num_vectors() host op. Drivers needing a
> non-default value can just initialize pcie_port.num_vectors directly.
>
> Cc: Jingoo Han 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> Cc: Gustavo Pimentel 
> Cc: Lorenzo Pieralisi 
> Cc: Bjorn Helgaas 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: linux-te...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  .../pci/controller/dwc/pcie-designware-host.c | 19 ---
>  .../pci/controller/dwc/pcie-designware-plat.c |  7 +--
>  drivers/pci/controller/dwc/pcie-designware.h  |  1 -
>  drivers/pci/controller/dwc/pcie-tegra194.c|  7 +--
>  4 files changed, 6 insertions(+), 28 deletions(-)

[...]


Re: [PATCH 05/13] PCI: dwc: Ensure all outbound ATU windows are reset

2020-10-29 Thread Jingoo Han
On 10/28/20, 4:47 PM, Rob Herring wrote:
> 
> The Layerscape driver clears the ATU registers which may have been
> configured by the bootloader. Any driver could have the same issue
> and doing it for all drivers doesn't hurt, so let's move it into the
> common DWC code.
>
> Cc: Minghuan Lian 
> Cc: Mingkai Hu 
> Cc: Roy Zang 
> Cc: Lorenzo Pieralisi 
> Cc: Bjorn Helgaas 
> Cc: Jingoo Han 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> Cc: Gustavo Pimentel 
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/pci/controller/dwc/pci-layerscape.c   | 14 --
>  drivers/pci/controller/dwc/pcie-designware-host.c |  5 +
>  2 files changed, 5 insertions(+), 14 deletions(-)
>
>  diff --git a/drivers/pci/controller/dwc/pci-layerscape.c 
> b/drivers/pci/controller/dwc/pci-layerscape.c
>  index f24f79a70d9a..53e56d54c482 100644
>  --- a/drivers/pci/controller/dwc/pci-layerscape.c
>  +++ b/drivers/pci/controller/dwc/pci-layerscape.c
>  @@ -83,14 +83,6 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)
>   iowrite32(val, pci->dbi_base + PCIE_STRFMR1);
>   }
>  
>  -static void ls_pcie_disable_outbound_atus(struct ls_pcie *pcie)
>  -{
>  -int i;
>  -
>  -for (i = 0; i < PCIE_IATU_NUM; i++)
>  -dw_pcie_disable_atu(pcie->pci, i, DW_PCIE_REGION_OUTBOUND);
>  -}
>  -
>   static int ls1021_pcie_link_up(struct dw_pcie *pci)
>   {
>   u32 state;
>  @@ -136,12 +128,6 @@ static int ls_pcie_host_init(struct pcie_port *pp)
>   struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
>   struct ls_pcie *pcie = to_ls_pcie(pci);
>  
>  -/*
>  - * Disable outbound windows configured by the bootloader to avoid
>  - * one transaction hitting multiple outbound windows.
>  - * dw_pcie_setup_rc() will reconfigure the outbound windows.
>  - */
>  -ls_pcie_disable_outbound_atus(pcie);
>   ls_pcie_fix_error_response(pcie);
>  
>   dw_pcie_dbi_ro_wr_en(pci);
>  diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c 
> b/drivers/pci/controller/dwc/pcie-designware-host.c
>  index cde45b2076ee..265a48f1a0ae 100644
>  --- a/drivers/pci/controller/dwc/pcie-designware-host.c
>  +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
>  @@ -534,6 +534,7 @@ static struct pci_ops dw_pcie_ops = {
>  
>   void dw_pcie_setup_rc(struct pcie_port *pp)
>   {
>  +int i;
>   u32 val, ctrl, num_ctrls;
>   struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
>  
>  @@ -583,6 +584,10 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
>   PCI_COMMAND_MASTER | PCI_COMMAND_SERR;
>   dw_pcie_writel_dbi(pci, PCI_COMMAND, val);
>  
>  +/* Ensure all outbound windows are disabled so there are multiple 
> matches */
>  +for (i = 0; i < pci->num_viewport; i++)
>  +dw_pcie_disable_atu(pci, i, DW_PCIE_REGION_OUTBOUND);
>  +
>   /*
>* If the platform provides its own child bus config accesses, it means
>* the platform uses its own address translation component rather than
>  -- 
>  2.25.1



Re: [PATCH 03/13] PCI: dwc: Move "dbi", "dbi2", and "addr_space" resource setup into common code

2020-10-29 Thread Jingoo Han
On 10/28/20, 4:46 PM, Rob Herring wrote:
> 
> Most DWC drivers use the common register resource names "dbi", "dbi2", and
> "addr_space", so let's move their setup into the DWC common code.
>
> This means 'dbi_base' in particular is setup later, but it looks like no
> drivers touch DBI registers before dw_pcie_host_init or dw_pcie_ep_init.
>
> Cc: Kishon Vijay Abraham I 
> Cc: Lorenzo Pieralisi 
> Cc: Bjorn Helgaas 
> Cc: Murali Karicheri 
> Cc: Minghuan Lian 
> Cc: Mingkai Hu 
> Cc: Roy Zang 
> Cc: Jonathan Chocron 
> Cc: Jesper Nilsson 
> Cc: Jingoo Han 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> Cc: Gustavo Pimentel 
> Cc: Xiaowei Song 
> Cc: Binghui Wang 
> Cc: Andy Gross 
> Cc: Bjorn Andersson 
> Cc: Stanimir Varbanov 
> Cc: Pratyush Anand 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Kunihiko Hayashi 
> Cc: Masahiro Yamada 
> Cc: linux-o...@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-arm-ker...@axis.com
> Cc: linux-arm-...@vger.kernel.org
> Cc: linux-te...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  drivers/pci/controller/dwc/pci-dra7xx.c   |  8 
>  drivers/pci/controller/dwc/pci-keystone.c | 29 +---
>  .../pci/controller/dwc/pci-layerscape-ep.c| 37 +--
>  drivers/pci/controller/dwc/pcie-al.c  |  9 +---
>  drivers/pci/controller/dwc/pcie-artpec6.c | 43 ++
>  .../pci/controller/dwc/pcie-designware-ep.c   | 29 ++--
>  .../pci/controller/dwc/pcie-designware-host.c |  7 +++
>  .../pci/controller/dwc/pcie-designware-plat.c | 45 +--
>  drivers/pci/controller/dwc/pcie-intel-gw.c|  4 --
>  drivers/pci/controller/dwc/pcie-kirin.c   |  5 ---
>  drivers/pci/controller/dwc/pcie-qcom.c|  8 
>  drivers/pci/controller/dwc/pcie-spear13xx.c   | 11 +
>  drivers/pci/controller/dwc/pcie-tegra194.c| 22 -
>  drivers/pci/controller/dwc/pcie-uniphier-ep.c | 38 +---
>  drivers/pci/controller/dwc/pcie-uniphier.c|  6 ---
>  15 files changed, 47 insertions(+), 254 deletions(-)

[...]


Re: [PATCH 1/3] PCI: dwc: Handle host_init failures

2017-07-17 Thread Jingoo Han
On Monday, July 17, 2017 7:18 AM, Joao Pinto wrote:
> 
> Hi Bjorn Andersson,
> 
> Às 7:39 AM de 7/16/2017, Bjorn Andersson escreveu:
> > In several dwc based drivers host_init can fail, so make sure to
> > propagate and handle this to avoid continuing operation of a driver or
> > hardware in an invalid state.
> >
> > Signed-off-by: Bjorn Andersson <bjorn.anders...@linaro.org>
> > ---
> >  drivers/pci/dwc/pci-dra7xx.c   |  4 +++-
> >  drivers/pci/dwc/pci-exynos.c   |  4 +++-
> >  drivers/pci/dwc/pci-imx6.c |  4 +++-
> >  drivers/pci/dwc/pci-keystone.c |  4 +++-
> >  drivers/pci/dwc/pci-layerscape.c   | 14 ++
> >  drivers/pci/dwc/pcie-armada8k.c|  4 +++-
> >  drivers/pci/dwc/pcie-artpec6.c |  4 +++-
> >  drivers/pci/dwc/pcie-designware-host.c |  7 +--
> >  drivers/pci/dwc/pcie-designware-plat.c |  4 +++-
> >  drivers/pci/dwc/pcie-designware.h  |  2 +-
> >  drivers/pci/dwc/pcie-kirin.c   |  4 +++-
> >  drivers/pci/dwc/pcie-qcom.c|  6 --
> >  drivers/pci/dwc/pcie-spear13xx.c   |  4 +++-
> >  13 files changed, 47 insertions(+), 18 deletions(-)
> >

[.]

> 
> A step in the right direction :). In the future we should add host init
> validation in the specific SoC drivers, like Layerscape and Qcom have, to
> assure
> that any problem is treated properly in the core driver.

I agree with your opinion.

> 
> Acked-by: Joao Pinto <jpi...@synopsys.com>

Acked-by: Jingoo Han <jingooh...@gmail.com>

Best regards,
Jingoo Han



Re: [PATCH] PCI: dwc: Constify dw_pcie_host_ops structures

2017-06-05 Thread Jingoo Han
On Monday, June 5, 2017 4:54 AM, Jisheng Zhang wrote:
> 
> The dw_pcie_host_ops structures are never modified. Constify these
> structures such that these can be write-protected.
> 
> Signed-off-by: Jisheng Zhang <jszh...@marvell.com>

Acked-by: Jingoo Han <jingooh...@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/pci/dwc/pci-dra7xx.c   | 2 +-
>  drivers/pci/dwc/pci-exynos.c   | 2 +-
>  drivers/pci/dwc/pci-imx6.c | 2 +-
>  drivers/pci/dwc/pci-keystone.c | 2 +-
>  drivers/pci/dwc/pci-layerscape.c   | 6 +++---
>  drivers/pci/dwc/pcie-armada8k.c| 2 +-
>  drivers/pci/dwc/pcie-artpec6.c | 2 +-
>  drivers/pci/dwc/pcie-designware-plat.c | 2 +-
>  drivers/pci/dwc/pcie-designware.h  | 2 +-
>  drivers/pci/dwc/pcie-qcom.c| 2 +-
>  drivers/pci/dwc/pcie-spear13xx.c   | 2 +-
>  11 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
> index 8decf46cf525..e4166032b3c6 100644
> --- a/drivers/pci/dwc/pci-dra7xx.c
> +++ b/drivers/pci/dwc/pci-dra7xx.c
> @@ -208,7 +208,7 @@ static void dra7xx_pcie_host_init(struct pcie_port
*pp)
>   dra7xx_pcie_enable_interrupts(dra7xx);
>  }
> 
> -static struct dw_pcie_host_ops dra7xx_pcie_host_ops = {
> +static const struct dw_pcie_host_ops dra7xx_pcie_host_ops = {
>   .host_init = dra7xx_pcie_host_init,
>  };
> 
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index 546082ad5a3f..c78c06552590 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -590,7 +590,7 @@ static void exynos_pcie_host_init(struct pcie_port
*pp)
>   exynos_pcie_enable_interrupts(ep);
>  }
> 
> -static struct dw_pcie_host_ops exynos_pcie_host_ops = {
> +static const struct dw_pcie_host_ops exynos_pcie_host_ops = {
>   .rd_own_conf = exynos_pcie_rd_own_conf,
>   .wr_own_conf = exynos_pcie_wr_own_conf,
>   .host_init = exynos_pcie_host_init,
> diff --git a/drivers/pci/dwc/pci-imx6.c b/drivers/pci/dwc/pci-imx6.c
> index a98cba55c7f0..fb4816088a7a 100644
> --- a/drivers/pci/dwc/pci-imx6.c
> +++ b/drivers/pci/dwc/pci-imx6.c
> @@ -602,7 +602,7 @@ static int imx6_pcie_link_up(struct dw_pcie *pci)
>   PCIE_PHY_DEBUG_R1_XMLH_LINK_UP;
>  }
> 
> -static struct dw_pcie_host_ops imx6_pcie_host_ops = {
> +static const struct dw_pcie_host_ops imx6_pcie_host_ops = {
>   .host_init = imx6_pcie_host_init,
>  };
> 
> diff --git a/drivers/pci/dwc/pci-keystone.c b/drivers/pci/dwc/pci-
> keystone.c
> index fcc9723bad6e..4783cec1f78d 100644
> --- a/drivers/pci/dwc/pci-keystone.c
> +++ b/drivers/pci/dwc/pci-keystone.c
> @@ -291,7 +291,7 @@ static void __init ks_pcie_host_init(struct pcie_port
> *pp)
>   "Asynchronous external abort");
>  }
> 
> -static struct dw_pcie_host_ops keystone_pcie_host_ops = {
> +static const struct dw_pcie_host_ops keystone_pcie_host_ops = {
>   .rd_other_conf = ks_dw_pcie_rd_other_conf,
>   .wr_other_conf = ks_dw_pcie_wr_other_conf,
>   .host_init = ks_pcie_host_init,
> diff --git a/drivers/pci/dwc/pci-layerscape.c b/drivers/pci/dwc/pci-
> layerscape.c
> index 27d638c4e134..fd861289ad8b 100644
> --- a/drivers/pci/dwc/pci-layerscape.c
> +++ b/drivers/pci/dwc/pci-layerscape.c
> @@ -39,7 +39,7 @@ struct ls_pcie_drvdata {
>   u32 lut_offset;
>   u32 ltssm_shift;
>   u32 lut_dbg;
> - struct dw_pcie_host_ops *ops;
> + const struct dw_pcie_host_ops *ops;
>   const struct dw_pcie_ops *dw_pcie_ops;
>  };
> 
> @@ -185,12 +185,12 @@ static int ls_pcie_msi_host_init(struct pcie_port
> *pp,
>   return 0;
>  }
> 
> -static struct dw_pcie_host_ops ls1021_pcie_host_ops = {
> +static const struct dw_pcie_host_ops ls1021_pcie_host_ops = {
>   .host_init = ls1021_pcie_host_init,
>   .msi_host_init = ls_pcie_msi_host_init,
>  };
> 
> -static struct dw_pcie_host_ops ls_pcie_host_ops = {
> +static const struct dw_pcie_host_ops ls_pcie_host_ops = {
>   .host_init = ls_pcie_host_init,
>   .msi_host_init = ls_pcie_msi_host_init,
>  };
> diff --git a/drivers/pci/dwc/pcie-armada8k.c b/drivers/pci/dwc/pcie-
> armada8k.c
> index 495b023042b3..ea8f34af6a85 100644
> --- a/drivers/pci/dwc/pcie-armada8k.c
> +++ b/drivers/pci/dwc/pcie-armada8k.c
> @@ -160,7 +160,7 @@ static irqreturn_t armada8k_pcie_irq_handler(int irq,
> void *arg)
>   return IRQ_HANDLED;
>  }
> 
> -static struct dw_pcie_host_ops armada8k_pcie_host_ops = {
> +static const struct dw_pcie_host_ops armada8k_pcie_host_ops = {
>   .host_init = armada8k_pcie_host_init,

Re: [PATCH 01/10] PCI: dwc: designware: Move the register defines to designware header file

2017-02-16 Thread Jingoo Han
Wednesday, February 15, 2017 8:18 AM, Kishon Vijay Abraham I wrote:
> 
> No functional change. Move the register defines and other macros from
> pcie-designware.c to pcie-designware.h. This is in preparation to
> split the pcie-designware.c file into designware core file and host
> specific file.
> 
> While at that also fix a checkpatch warning.
> 
> Reviewed-By: Joao Pinto <jpi...@synopsys.com>
> Signed-off-by: Kishon Vijay Abraham I <kis...@ti.com>

Acked-by: Jingoo Han <jingooh...@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/pci/dwc/pcie-designware.c |   70 
> 
>  drivers/pci/dwc/pcie-designware.h |   71
> +
>  2 files changed, 71 insertions(+), 70 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pcie-designware.c b/drivers/pci/dwc/pcie-
> designware.c
> index af8f6e9..d0e4904 100644
> --- a/drivers/pci/dwc/pcie-designware.c
> +++ b/drivers/pci/dwc/pcie-designware.c
> @@ -25,76 +25,6 @@
> 
>  #include "pcie-designware.h"
> 
> -/* Parameters for the waiting for link up routine */
> -#define LINK_WAIT_MAX_RETRIES10
> -#define LINK_WAIT_USLEEP_MIN 9
> -#define LINK_WAIT_USLEEP_MAX 10
> -
> -/* Parameters for the waiting for iATU enabled routine */
> -#define LINK_WAIT_MAX_IATU_RETRIES   5
> -#define LINK_WAIT_IATU_MIN   9000
> -#define LINK_WAIT_IATU_MAX   1
> -
> -/* Synopsys-specific PCIe configuration registers */
> -#define PCIE_PORT_LINK_CONTROL   0x710
> -#define PORT_LINK_MODE_MASK  (0x3f << 16)
> -#define PORT_LINK_MODE_1_LANES   (0x1 << 16)
> -#define PORT_LINK_MODE_2_LANES   (0x3 << 16)
> -#define PORT_LINK_MODE_4_LANES   (0x7 << 16)
> -#define PORT_LINK_MODE_8_LANES   (0xf << 16)
> -
> -#define PCIE_LINK_WIDTH_SPEED_CONTROL0x80C
> -#define PORT_LOGIC_SPEED_CHANGE  (0x1 << 17)
> -#define PORT_LOGIC_LINK_WIDTH_MASK   (0x1f << 8)
> -#define PORT_LOGIC_LINK_WIDTH_1_LANES(0x1 << 8)
> -#define PORT_LOGIC_LINK_WIDTH_2_LANES(0x2 << 8)
> -#define PORT_LOGIC_LINK_WIDTH_4_LANES(0x4 << 8)
> -#define PORT_LOGIC_LINK_WIDTH_8_LANES(0x8 << 8)
> -
> -#define PCIE_MSI_ADDR_LO 0x820
> -#define PCIE_MSI_ADDR_HI 0x824
> -#define PCIE_MSI_INTR0_ENABLE0x828
> -#define PCIE_MSI_INTR0_MASK  0x82C
> -#define PCIE_MSI_INTR0_STATUS0x830
> -
> -#define PCIE_ATU_VIEWPORT0x900
> -#define PCIE_ATU_REGION_INBOUND  (0x1 << 31)
> -#define PCIE_ATU_REGION_OUTBOUND (0x0 << 31)
> -#define PCIE_ATU_REGION_INDEX2   (0x2 << 0)
> -#define PCIE_ATU_REGION_INDEX1   (0x1 << 0)
> -#define PCIE_ATU_REGION_INDEX0   (0x0 << 0)
> -#define PCIE_ATU_CR1 0x904
> -#define PCIE_ATU_TYPE_MEM(0x0 << 0)
> -#define PCIE_ATU_TYPE_IO (0x2 << 0)
> -#define PCIE_ATU_TYPE_CFG0   (0x4 << 0)
> -#define PCIE_ATU_TYPE_CFG1   (0x5 << 0)
> -#define PCIE_ATU_CR2 0x908
> -#define PCIE_ATU_ENABLE  (0x1 << 31)
> -#define PCIE_ATU_BAR_MODE_ENABLE (0x1 << 30)
> -#define PCIE_ATU_LOWER_BASE  0x90C
> -#define PCIE_ATU_UPPER_BASE  0x910
> -#define PCIE_ATU_LIMIT   0x914
> -#define PCIE_ATU_LOWER_TARGET0x918
> -#define PCIE_ATU_BUS(x)  (((x) & 0xff) << 24)
> -#define PCIE_ATU_DEV(x)  (((x) & 0x1f) << 19)
> -#define PCIE_ATU_FUNC(x) (((x) & 0x7) << 16)
> -#define PCIE_ATU_UPPER_TARGET0x91C
> -
> -/*
> - * iATU Unroll-specific register definitions
> - * From 4.80 core version the address translation will be made by unroll
> - */
> -#define PCIE_ATU_UNR_REGION_CTRL10x00
> -#define PCIE_ATU_UNR_REGION_CTRL20x04
> -#define PCIE_ATU_UNR_LOWER_BASE  0x08
> -#define PCIE_ATU_UNR_UPPER_BASE  0x0C
> -#define PCIE_ATU_UNR_LIMIT   0x10
> -#define PCIE_ATU_UNR_LOWER_TARGET0x14
> -#define PCIE_ATU_UNR_UPPER_TARGET0x18
> -
> -/* Register address builder */
> -#define PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(region)  ((0x3 << 20) | (region
> << 9))
> -
>  /* PCIe Port Logic registers */
>  #define PLR_OFFSET   0x700
>  #define PCIE_PHY_DEBUG_R1(PLR_OFFSET + 0x2c)
> diff --git a/drivers/pci/dwc/pcie-designware.h b/drivers

Re: [PATCH 0/2] backlight: remove trivial get_brightness implementations

2014-06-16 Thread Jingoo Han
On Friday, May 30, 2014 7:11 PM, Andrzej Hajda wrote:
 
 This patchset makes get_brightness callback optional
 and removes trivial implementations.
 Driver changes are quite obvious so I have put them into single
 patch.
 
 The patchset is based on the current linux-next branch.
 
 Regards
 Andrzej
 
 Andrzej Hajda (2):
   backlight: show brightness even if get_brightness is not implemented
   backlight: remove trivial get_brightness implementations

These patches look good!
Acked-by: Jingoo Han jg1@samsung.com

Lee Jones,
Would you merge these patches into backlight git?

Best regards,
Jingoo Han

 
  drivers/macintosh/via-pmu-backlight.c  | 6 --
  drivers/platform/x86/samsung-q10.c | 6 --
  drivers/video/backlight/aat2870_bl.c   | 6 --
  drivers/video/backlight/ams369fg06.c   | 6 --
  drivers/video/backlight/backlight.c| 2 ++
  drivers/video/backlight/bd6107.c   | 6 --
  drivers/video/backlight/gpio_backlight.c   | 6 --
  drivers/video/backlight/ld9040.c   | 6 --
  drivers/video/backlight/lp855x_bl.c| 6 --
  drivers/video/backlight/lp8788_bl.c| 6 --
  drivers/video/backlight/lv5207lp.c | 6 --
  drivers/video/backlight/pandora_bl.c   | 6 --
  drivers/video/backlight/pwm_bl.c   | 6 --
  drivers/video/backlight/s6e63m0.c  | 6 --
  drivers/video/backlight/tps65217_bl.c  | 6 --
  drivers/video/fbdev/aty/aty128fb.c | 6 --
  drivers/video/fbdev/aty/atyfb_base.c   | 6 --
  drivers/video/fbdev/aty/radeon_backlight.c | 6 --
  drivers/video/fbdev/exynos/s6e8ax0.c   | 6 --
  drivers/video/fbdev/nvidia/nv_backlight.c  | 6 --
  drivers/video/fbdev/riva/fbdev.c   | 6 --
  21 files changed, 2 insertions(+), 120 deletions(-)
 
 --
 1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] macintosh: ams: replace strict_strtoul() with kstrtoul()

2013-07-19 Thread Jingoo Han
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.

Signed-off-by: Jingoo Han jg1@samsung.com
---
 drivers/macintosh/ams/ams-input.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/macintosh/ams/ams-input.c 
b/drivers/macintosh/ams/ams-input.c
index b27e530..2edae7d 100644
--- a/drivers/macintosh/ams/ams-input.c
+++ b/drivers/macintosh/ams/ams-input.c
@@ -118,8 +118,12 @@ static ssize_t ams_input_store_joystick(struct device *dev,
 {
unsigned long enable;
int error = 0;
+   int ret;
 
-   if (strict_strtoul(buf, 0, enable) || enable  1)
+   ret = kstrtoul(buf, 0, enable);
+   if (ret)
+   return ret;
+   if (enable  1)
return -EINVAL;
 
mutex_lock(ams_input_mutex);
-- 
1.7.10.4


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 158/493] video: remove use of __devinit

2012-11-19 Thread Jingoo Han
On Tuesday, November 20, 2012 3:22 AM, Bill Pemberton wrote
 
 CONFIG_HOTPLUG is going away as an option so __devinit is no longer
 needed.
 
 Signed-off-by: Bill Pemberton wf...@virginia.edu
 Cc: Florian Tobias Schandinat florianschandi...@gmx.de
 Cc: Jaya Kumar jay...@intworks.biz
 Cc: Paul Mackerras pau...@samba.org
 Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Jingoo Han jg1@samsung.com
 Cc: Ferenc Bakonyi f...@drama.obuda.kando.hu
 Cc: Antonino Daplas adap...@gmail.com
 Cc: Maik Broemme mbroe...@plusserver.de
 Cc: David Brown dav...@codeaurora.org
 Cc: Daniel Walker dwal...@fifo99.com
 Cc: Bryan Huntsman bry...@codeaurora.org
 Cc: Wan ZongShun mcuos@gmail.com
 Cc: Tomi Valkeinen tomi.valkei...@ti.com
 Cc: Geoff Levand ge...@infradead.org
 Cc: Kristoffer Ericson kristoffer.eric...@gmail.com
 Cc: Ben Dooks ben-li...@fluff.org
 Cc: Kukjin Kim kgene@samsung.com
 Cc: Thomas Winischhofer tho...@winischhofer.net
 Cc: Michal Januszewski sp...@gentoo.org
 Cc: Tony Prisk li...@prisktech.co.nz
 Cc: linux-fb...@vger.kernel.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ge...@lists.infradead.org
 Cc: linux-nvi...@lists.surfsouth.com
 Cc: linux-arm-...@vger.kernel.org
 Cc: linux-o...@vger.kernel.org
 Cc: linuxppc-dev@lists.ozlabs.org
 Cc: cbe-oss-...@lists.ozlabs.org
 Cc: linux-samsung-...@vger.kernel.org
 Cc: xen-de...@lists.xensource.com
 Cc: virtualizat...@lists.linux-foundation.org
 ---
  drivers/video/acornfb.c| 14 ++--
  drivers/video/arcfb.c  |  2 +-
  drivers/video/arkfb.c  |  2 +-
  drivers/video/asiliantfb.c |  6 +-
  drivers/video/aty/aty128fb.c   | 22 +++---
  drivers/video/aty/atyfb_base.c | 22 +++---
  drivers/video/aty/mach64_ct.c  |  4 +-
  drivers/video/aty/mach64_cursor.c  |  2 +-
  drivers/video/aty/radeon_base.c| 14 ++--
  drivers/video/aty/radeon_monitor.c | 16 ++---
  drivers/video/au1100fb.c   |  2 +-
  drivers/video/au1200fb.c   |  2 +-
  drivers/video/auo_k1900fb.c|  2 +-
  drivers/video/auo_k1901fb.c|  2 +-
  drivers/video/auo_k190x.c  |  2 +-
  drivers/video/bf537-lq035.c|  6 +-
  drivers/video/bf54x-lq043fb.c  |  2 +-
  drivers/video/bfin-lq035q1-fb.c|  6 +-
  drivers/video/bfin-t350mcqb-fb.c   |  2 +-
  drivers/video/bfin_adv7393fb.c |  2 +-
  drivers/video/broadsheetfb.c   |  8 +--
  drivers/video/bw2.c|  6 +-
  drivers/video/carminefb.c  |  4 +-
  drivers/video/cg14.c   |  4 +-
  drivers/video/cg3.c|  8 +--
  drivers/video/cg6.c|  8 +--
  drivers/video/chipsfb.c|  4 +-
  drivers/video/cirrusfb.c   | 10 +--
  drivers/video/cobalt_lcdfb.c   |  2 +-
  drivers/video/console/sticore.c| 47 ++---
  drivers/video/cyber2000fb.c| 12 ++--
  drivers/video/da8xx-fb.c   |  2 +-
  drivers/video/dnfb.c   |  2 +-
  drivers/video/ep93xx-fb.c  |  4 +-
  drivers/video/exynos/exynos_dp_core.c  |  2 +-
  drivers/video/ffb.c|  2 +-
  drivers/video/fm2fb.c  |  4 +-
  drivers/video/fsl-diu-fb.c |  4 +-
  drivers/video/gbefb.c  |  4 +-
  drivers/video/geode/gx1fb_core.c   |  6 +-
  drivers/video/geode/gxfb_core.c| 10 +--
  drivers/video/geode/lxfb_core.c| 10 +--
  drivers/video/grvga.c  |  4 +-
  drivers/video/gxt4500.c|  4 +-
  drivers/video/hecubafb.c   |  2 +-
  drivers/video/hgafb.c  |  4 +-
  drivers/video/hitfb.c  |  2 +-
  drivers/video/hpfb.c   |  4 +-
  drivers/video/i740fb.c |  4 +-
  drivers/video/i810/i810_main.c | 26 +++
  drivers/video/i810/i810_main.h |  2 +-
  drivers/video/imsttfb.c|  4 +-
  drivers/video/intelfb/intelfbdrv.c | 16 ++---
  drivers/video/jz4740_fb.c  |  2 +-
  drivers/video/kyro/fbdev.c |  2 +-
  drivers/video/leo.c|  2 +-
  drivers/video/mb862xx/mb862xxfbdrv.c   |  6

RE: [PATCH] radeonfb: Add quirk for the graphics adapter in some JSxx

2012-07-18 Thread Jingoo Han
On Thursday, July 19, 2012 1:49 AM, o...@aepfle.de wrote:
 From: Tony Breeds t...@bakeyournoodle.com
 
 These devices are set to 640x480 by firmware, switch them to 800x600@60
 so that the graphical installer can run on remote console.
 
 Reported by IBM during SLES10 SP2 beta testing:
 
 https://bugzilla.novell.com/show_bug.cgi?id=461002
 LTC50817
 
 Signed-off-by: Olaf Hering o...@aepfle.de

If the author is Tony Breeds, please add 'Signed-off-by: Tony Breeds 
t...@bakeyournoodle.com'.

Best regards,
Jingoo Han

 
 diff --git a/drivers/video/aty/radeon_monitor.c 
 b/drivers/video/aty/radeon_monitor.c
 index 9261c91..5c23eac 100644
 --- a/drivers/video/aty/radeon_monitor.c
 +++ b/drivers/video/aty/radeon_monitor.c
 @@ -730,6 +730,25 @@ static void radeon_videomode_to_var(struct 
 fb_var_screeninfo *var,
   var-vmode = mode-vmode;
  }
 
 +#ifdef CONFIG_PPC_PSERIES
 +static int is_powerblade(const char *model)
 +{
 + struct device_node *root;
 + const char* cp;
 + int len, l, rc = 0;
 +
 + root = of_find_node_by_path(/);
 + if (root  model) {
 + l = strlen(model);
 + cp = of_get_property(root, model, len);
 + if (cp)
 + rc = memcmp(model, cp, min(len, l)) == 0;
 + of_node_put(root);
 + }
 + return rc;
 +}
 +#endif
 +
  /*
   * Build the modedb for head 1 (head 2 will come later), check panel infos
   * from either BIOS or EDID, and pick up the default mode
 @@ -865,6 +884,22 @@ void __devinit radeon_check_modes(struct radeonfb_info 
 *rinfo, const char *mode_
   has_default_mode = 1;
   }
 
 +#ifdef CONFIG_PPC_PSERIES
 + if (!has_default_mode  (
 + is_powerblade(IBM,8842) || /* JS20 */
 + is_powerblade(IBM,8844) || /* JS21 */
 + is_powerblade(IBM,7998) || /* JS12/JS21/JS22 */
 + is_powerblade(IBM,0792) || /* QS21 */
 + is_powerblade(IBM,0793)/* QS22 */
 + )) {
 + printk(Falling back to 800x600 on JSxx hardware\n);
 + if (fb_find_mode(info-var, info, 800x600@60,
 +  info-monspecs.modedb,
 +  info-monspecs.modedb_len, NULL, 8) != 0)
 + has_default_mode = 1;
 + }
 +#endif
 +
   /*
* Still no mode, let's pick up a default from the db
*/
 --
 1.7.10.4
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-fbdev in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev