RE: [PATCH v1 3/4] arm64: dts: ls1028a: fix little-big endian issue for dcfg

2019-12-09 Thread Y.b. Lu
+ Shawn,

> -Original Message-
> From: Michael Walle 
> Sent: Tuesday, December 10, 2019 8:06 AM
> To: Yinbo Zhu 
> Cc: Ashish Kumar ; Alexandru Marginean
> ; Alison Wang ;
> Amit Jain (aj) ; catalin.horghi...@nxp.com; Claudiu
> Manoil ; devicet...@vger.kernel.org; Jiafei Pan
> ; Leo Li ;
> linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org;
> linuxppc-dev@lists.ozlabs.org; mark.rutl...@arm.com;
> rajat.srivast...@nxp.com; Rajesh Bhagat ;
> robh...@kernel.org; Vabhav Sharma ; Xiaobo Xie
> ; Y.b. Lu ; Michael Walle
> 
> Subject: Re: [PATCH v1 3/4] arm64: dts: ls1028a: fix little-big endian issue 
> for
> dcfg
> 

[Y.b. Lu] Acked-by: Yangbo Lu 

Hi Shawn, could you help to review and merge the two dts patches of this 
patch-set?
Thanks.

> > dcfg use little endian that SoC register value will be correct
> >
> > Signed-off-by: Yinbo Zhu 
> > ---
> >  arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> This patch is still missing. Any news?
> 
> Tested-by: Michael Walle 
> 
> > diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
> b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
> > index b0d4f8916ede..5538e8e354b2 100644
> > --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
> > @@ -162,7 +162,7 @@
> > dcfg: syscon@1e0 {
> > compatible = "fsl,ls1028a-dcfg", "syscon";
> > reg = <0x0 0x1e0 0x0 0x1>;
> > -   big-endian;
> > +   little-endian;
> > };
> >
> > scfg: syscon@1fc {
> > --
> > 2.17.1
> >


RE: [PATCH] soc: fsl: guts: make fsl_guts_get_svr() static

2019-02-22 Thread Y.b. Lu


> -Original Message-
> From: Horia Geantă 
> Sent: Thursday, February 21, 2019 6:38 PM
> To: Leo Li 
> Cc: Y.b. Lu ; linuxppc-dev@lists.ozlabs.org;
> linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org
> Subject: [PATCH] soc: fsl: guts: make fsl_guts_get_svr() static
> 
> The export of fsl_guts_get_svr() is a left-over, it's currently used only 
> internally
> and users needing SoC information should use the generic soc_device
> infrastructure.
> 

[Y.b. Lu] Acked-by: Yangbo Lu 

> Signed-off-by: Horia Geantă 
> ---
>  drivers/soc/fsl/guts.c   | 3 +--
>  include/linux/fsl/guts.h | 2 --
>  2 files changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index
> 4f9655087bd7..63f6df86f9e5 100644
> --- a/drivers/soc/fsl/guts.c
> +++ b/drivers/soc/fsl/guts.c
> @@ -115,7 +115,7 @@ static const struct fsl_soc_die_attr
> *fsl_soc_die_match(
>   return NULL;
>  }
> 
> -u32 fsl_guts_get_svr(void)
> +static u32 fsl_guts_get_svr(void)
>  {
>   u32 svr = 0;
> 
> @@ -129,7 +129,6 @@ u32 fsl_guts_get_svr(void)
> 
>   return svr;
>  }
> -EXPORT_SYMBOL(fsl_guts_get_svr);
> 
>  static int fsl_guts_probe(struct platform_device *pdev)  { diff --git
> a/include/linux/fsl/guts.h b/include/linux/fsl/guts.h index
> 941b11811f85..1fc0edd71c52 100644
> --- a/include/linux/fsl/guts.h
> +++ b/include/linux/fsl/guts.h
> @@ -135,8 +135,6 @@ struct ccsr_guts {
>   u32 srds2cr1;   /* 0x.0f44 - SerDes2 Control Register 0 */
>  } __attribute__ ((packed));
> 
> -u32 fsl_guts_get_svr(void);
> -
>  /* Alternate function signal multiplex control */  #define
> MPC85xx_PMUXCR_QE(x) (0x8000 >> (x))
> 
> --
> 2.16.2



RE: [PATCH 3/3] ptp_qoriq: convert to use module parameters for initialization

2018-08-01 Thread Y.b. Lu
Hi Richard,

> -Original Message-
> From: Richard Cochran [mailto:richardcoch...@gmail.com]
> Sent: Wednesday, August 1, 2018 2:15 PM
> To: Y.b. Lu 
> Cc: net...@vger.kernel.org; Madalin-cristian Bucur
> ; Rob Herring ; Shawn Guo
> ; David S . Miller ;
> devicet...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org
> Subject: Re: [PATCH 3/3] ptp_qoriq: convert to use module parameters for
> initialization
> 
> On Wed, Aug 01, 2018 at 04:36:40AM +, Y.b. Lu wrote:
> 
> > Could I add a function to calculate a set of default register values
> > to initialize ptp timer when dts method failed to get required
> > properties in driver?
> 
> Yes, it would be ideal if the driver can pick correct values automatically.
> 
> However, the frequency on the FIPER outputs can't be configured
> automatically, and we don't have an API for the user to choose this.

[Y.b. Lu] Thanks a lot. Just let me send out the v2 patch for your reviewing.

> 
> > I think this will be useful. The ptp timer on new platforms (you may
> > see two dts patches in this patchset. Many platforms will be
> > affected.) will work without these dts properties. If user want
> > specific setting, they can set dts properties.
> 
> Sure.
> 
> Thanks,
> Richard


RE: [PATCH 3/3] ptp_qoriq: convert to use module parameters for initialization

2018-07-31 Thread Y.b. Lu
Hi David,

> -Original Message-
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Tuesday, July 31, 2018 12:26 AM
> To: Y.b. Lu 
> Cc: net...@vger.kernel.org; Madalin-cristian Bucur
> ; richardcoch...@gmail.com; robh...@kernel.org;
> shawn...@kernel.org; devicet...@vger.kernel.org;
> linuxppc-dev@lists.ozlabs.org; linux-arm-ker...@lists.infradead.org;
> linux-ker...@vger.kernel.org
> Subject: Re: [PATCH 3/3] ptp_qoriq: convert to use module parameters for
> initialization
> 
> From: Yangbo Lu 
> Date: Mon, 30 Jul 2018 18:01:54 +0800
> 
> > +static unsigned int cksel = DEFAULT_CKSEL; module_param(cksel, uint,
> > +0644); MODULE_PARM_DESC(cksel, "Select reference clock");
> > +
> > +static unsigned int clk_src;
> > +module_param(clk_src, uint, 0644);
> > +MODULE_PARM_DESC(clk_src, "Reference clock frequency (if clocks
> > +property not provided in dts)");
> > +
> > +static unsigned int tmr_prsc = 2;
> > +module_param(tmr_prsc, uint, 0644);
> > +MODULE_PARM_DESC(tmr_prsc, "Output clock division/prescale factor");
> > +
> > +static unsigned int tmr_fiper1 = 10; module_param(tmr_fiper1,
> > +uint, 0644); MODULE_PARM_DESC(tmr_fiper1, "Desired fixed interval
> > +pulse period (ns)");
> > +
> > +static unsigned int tmr_fiper2 = 10; module_param(tmr_fiper2,
> > +uint, 0644); MODULE_PARM_DESC(tmr_fiper2, "Desired fixed interval
> > +pulse period (ns)");
> 
> Sorry, there is no way I am every applying something like this.  Module
> parameters are to be avoided at all costs.
> 
> And you don't need it here, you have DTS, please use it.
> 
> You are required to support the existing DTS cases, in order to avoid breaking
> things, anyways.
[Y.b. Lu] I get your point. Will drop module_param method.
Thanks a lot for your suggestion.


RE: [PATCH 3/3] ptp_qoriq: convert to use module parameters for initialization

2018-07-31 Thread Y.b. Lu
Hi Richard,

> -Original Message-
> From: Richard Cochran [mailto:richardcoch...@gmail.com]
> Sent: Monday, July 30, 2018 10:31 PM
> To: Y.b. Lu 
> Cc: net...@vger.kernel.org; Madalin-cristian Bucur
> ; Rob Herring ; Shawn Guo
> ; David S . Miller ;
> devicet...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org
> Subject: Re: [PATCH 3/3] ptp_qoriq: convert to use module parameters for
> initialization
> 
> On Mon, Jul 30, 2018 at 06:01:54PM +0800, Yangbo Lu wrote:
> > The ptp_qoriq driver initialized the 1588 timer with the
> > configurations provided by the properties of device tree node. For
> > example,
> >
> >   fsl,tclk-period = <5>;
> >   fsl,tmr-prsc= <2>;
> >   fsl,tmr-add = <0xaaab>;
> >   fsl,tmr-fiper1  = <5>;
> >   fsl,tmr-fiper2  = <0>;
> >   fsl,max-adj = <4>;
> >
> > These things actually were runtime configurations which were not
> > proper to be put into dts.
> 
> That is debatable.  While I agree that the dts isn't ideal for these, still 
> it is the
> lesser of two or more evils.

[Y.b. Lu] Ok. You're right indeed :)

> 
> > This patch is to convert
> > to use module parameters for 1588 timer initialization, and to support
> > initial register values calculation.
> 
> It is hard for me to understand how using module parameters improves the
> situation.

[Y.b. Lu] Actually I'm not sure whether module_param will be accepted to 
replace dts.
I thought the most possibility would be rejection before sending them out.
Just want suggestion and confirmation whether there is better idea than dts 
from your comments.

Since we should keep the dts, I will drop the module_param.
Could I add a function to calculate a set of default register values to 
initialize ptp timer when dts method failed to get required properties in 
driver?
I think this will be useful. The ptp timer on new platforms (you may see two 
dts patches in this patchset. Many platforms will be affected.) will work 
without these dts properties. If user want specific setting, they can set dts 
properties.


> 
> > If the parameters are not provided, the driver will calculate register
> > values with a set of default parameters. With this patch, those dts
> > properties are no longer needed for new platform to support 1588
> > timer, and many QorIQ DPAA platforms (some P series and T series
> > platforms of PowerPC, and some LS series platforms of ARM64) could use
> > this driver for their fman ptp timer with default module parameters.
> > However, this patch didn't remove the dts method. Because there were
> > still many old platforms using the dts method. We need to clean up
> > their dts files, verify module parameters on them, and convert them to
> > the new method gradually in case of breaking any function.
> 
> In addition, like it or not, because the dts is an ABI, you must continue 
> support
> of the dts values as a legacy option.

[Y.b. Lu] I get your point now. The dts should be kept :)

> 
> Thanks,
> Richard


RE: [v3, 00/10] Support DPAA PTP clock and timestamping

2018-06-07 Thread Y.b. Lu
> -Original Message-
> From: Richard Cochran [mailto:richardcoch...@gmail.com]
> Sent: Friday, June 8, 2018 12:27 PM
> To: Y.b. Lu 
> Cc: net...@vger.kernel.org; Madalin-cristian Bucur
> ; Rob Herring ; Shawn Guo
> ; David S . Miller ;
> devicet...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org
> Subject: Re: [v3, 00/10] Support DPAA PTP clock and timestamping
> 
> On Thu, Jun 07, 2018 at 05:20:40PM +0800, Yangbo Lu wrote:
> > This patchset is to support DPAA FMAN PTP clock and HW timestamping.
> > It had been verified on both ARM platform and PPC platform.
> > - The patch #1 to patch #5 are to support DPAA FMAN 1588 timer in
> >   ptp_qoriq driver.
> > - The patch #6 to patch #10 are to add HW timestamping support in
> >   DPAA ethernet driver.
> 
> Right now, net-next is closed for new stuff.  You will have to post the series
> again after the merge window closes.  You can check the status here:
> 
> 
> https://emea01.safelinks.protection.outlook.com/?url=http:%2F%2Fvger.kern
> el.org%2F~davem%2Fnet-next.html=02%7C01%7Cyangbo.lu%40nxp.co
> m%7Cbaab0b22e7444386c37008d5ccf81b37%7C686ea1d3bc2b4c6fa92cd99
> c5c301635%7C0%7C0%7C636640288347563742=jCmNlwoeWA50PV4
> w3lKZ%2Fs4akPjw0VV2OrJ3t4FizJ0%3D=0
> 
> When you do re-post, you can add my:
> 
> Acked-by: Richard Cochran 

[Y.b. Lu] Get it. And thanks a lot 


RE: [v2, 09/10] dpaa_eth: add support for hardware timestamping

2018-06-07 Thread Y.b. Lu
Hi Madalin,

> -Original Message-
> From: Madalin-cristian Bucur
> Sent: Thursday, June 7, 2018 4:24 PM
> To: Y.b. Lu ; net...@vger.kernel.org; Richard Cochran
> ; Rob Herring ; Shawn
> Guo ; David S . Miller 
> Cc: devicet...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org; Y.b. Lu
> 
> Subject: RE: [v2, 09/10] dpaa_eth: add support for hardware timestamping
> 
> > -Original Message-
> > From: Yangbo Lu [mailto:yangbo...@nxp.com]
> > Sent: Thursday, June 7, 2018 6:23 AM
> > Subject: [v2, 09/10] dpaa_eth: add support for hardware timestamping
> >
> > This patch is to add hardware timestamping support for dpaa_eth. On
> > Rx, timestamping is enabled for all frames. On Tx, we only instruct
> > the hardware to timestamp the frames marked accordingly by the stack.
> >
> > Signed-off-by: Yangbo Lu 
> > ---
> > Changes for v2:
> > - Removed ifdef for timestamp code.
> > - Minor fixes for code style.
> > ---
> >  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c |  101
> > ++-
> >  drivers/net/ethernet/freescale/dpaa/dpaa_eth.h |3 +
> >  2 files changed, 99 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > index fd43f98..bd589ac 100644
> > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > @@ -1168,7 +1168,7 @@ static int dpaa_eth_init_tx_port(struct
> > fman_port *port, struct dpaa_fq *errq,
> > buf_prefix_content.priv_data_size = buf_layout->priv_data_size;
> > buf_prefix_content.pass_prs_result = true;
> > buf_prefix_content.pass_hash_result = true;
> > -   buf_prefix_content.pass_time_stamp = false;
> > +   buf_prefix_content.pass_time_stamp = true;
> > buf_prefix_content.data_align = DPAA_FD_DATA_ALIGNMENT;
> >
> > params.specific_params.non_rx_params.err_fqid = errq->fqid; @@
> > -1210,7 +1210,7 @@ static int dpaa_eth_init_rx_port(struct fman_port
> > *port, struct dpaa_bp **bps,
> > buf_prefix_content.priv_data_size = buf_layout->priv_data_size;
> > buf_prefix_content.pass_prs_result = true;
> > buf_prefix_content.pass_hash_result = true;
> > -   buf_prefix_content.pass_time_stamp = false;
> > +   buf_prefix_content.pass_time_stamp = true;
> > buf_prefix_content.data_align = DPAA_FD_DATA_ALIGNMENT;
> >
> > rx_p = _params.rx_params;
> > @@ -1592,6 +1592,16 @@ static int dpaa_eth_refill_bpools(struct
> > dpaa_priv
> > *priv)
> > return 0;
> >  }
> >
> > +static int dpaa_get_tstamp_ns(struct net_device *net_dev, u64 *ns,
> > + struct fman_port *port, const void *data) {
> > +   if (!fman_port_get_tstamp_field(port, data, ns)) {
> > +   be64_to_cpus(ns);
> 
> Please move this endianness conversion in the fman API.

[Y.b. Lu] Ok. Will move to fman API in next version.

> 
> > +   return 0;
> > +   }
> > +   return -EINVAL;
> > +}
> > +
> >  /* Cleanup function for outgoing frame descriptors that were built on
> > Tx path,
> >   * either contiguous frames or scatter/gather ones.
> >   * Skb freeing is not handled here.
> > @@ -1607,14 +1617,29 @@ static int dpaa_eth_refill_bpools(struct
> > dpaa_priv
> > *priv)
> >  {
> > const enum dma_data_direction dma_dir = DMA_TO_DEVICE;
> > struct device *dev = priv->net_dev->dev.parent;
> > +   struct skb_shared_hwtstamps shhwtstamps;
> > dma_addr_t addr = qm_fd_addr(fd);
> > const struct qm_sg_entry *sgt;
> > struct sk_buff **skbh, *skb;
> > int nr_frags, i;
> > +   u64 ns;
> >
> > skbh = (struct sk_buff **)phys_to_virt(addr);
> > skb = *skbh;
> >
> > +   if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags &
> > SKBTX_HW_TSTAMP) {
> > +   memset(, 0, sizeof(shhwtstamps));
> > +
> > +   if (!dpaa_get_tstamp_ns(priv->net_dev, ,
> > +   priv->mac_dev->port[TX],
> > +   (void *)skbh)) {
> > +   shhwtstamps.hwtstamp = ns_to_ktime(ns);
> > +   skb_tstamp_tx(skb, );
> > +   } else {
> > +   dev_warn(dev, "dpaa_get_tstamp_ns failed!\n");
> > +   }
> > +   }
> > +
> > if (unlikely(qm_fd_get_f

RE: [PATCH 09/10] dpaa_eth: add support for hardware timestamping

2018-06-06 Thread Y.b. Lu
Hi Richard,

> -Original Message-
> From: Richard Cochran [mailto:richardcoch...@gmail.com]
> Sent: Tuesday, June 5, 2018 9:58 PM
> To: Y.b. Lu 
> Cc: net...@vger.kernel.org; Madalin-cristian Bucur
> ; Rob Herring ; Shawn Guo
> ; David S . Miller ;
> devicet...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org
> Subject: Re: [PATCH 09/10] dpaa_eth: add support for hardware timestamping
> 
> On Tue, Jun 05, 2018 at 03:35:28AM +, Y.b. Lu wrote:
> > [Y.b. Lu] Actually these timestamping codes affected DPAA networking
> performance in our previous performance test.
> > That's why we used ifdef for it.
> 
> How much does time stamping hurt performance?
> 
> If the time stamping is compiled in but not enabled at run time, does it still
> affect performace?

[Y.b. Lu] I can't remember and find the old data since it had been a long time.
I just did the iperf test today between two 10G ports. I didn’t see any 
performance changes with timestamping code 
So, let's me remove the ifdef in next version.
Thanks a lot.


> 
> Thanks,
> Richard


RE: [PATCH 09/10] dpaa_eth: add support for hardware timestamping

2018-06-04 Thread Y.b. Lu
Hi Richard,

> -Original Message-
> From: Richard Cochran [mailto:richardcoch...@gmail.com]
> Sent: Monday, June 4, 2018 9:49 PM
> To: Y.b. Lu 
> Cc: net...@vger.kernel.org; Madalin-cristian Bucur
> ; Rob Herring ; Shawn Guo
> ; David S . Miller ;
> devicet...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org
> Subject: Re: [PATCH 09/10] dpaa_eth: add support for hardware timestamping
> 
> On Mon, Jun 04, 2018 at 03:08:36PM +0800, Yangbo Lu wrote:
> 
> > +if FSL_DPAA_ETH
> > +config FSL_DPAA_ETH_TS
> > +   bool "DPAA hardware timestamping support"
> > +   select PTP_1588_CLOCK_QORIQ
> > +   default n
> > +   help
> > + Enable DPAA hardware timestamping support.
> > + This option is useful for applications to get
> > + hardware time stamps on the Ethernet packets
> > + using the SO_TIMESTAMPING API.
> > +endif
> 
> You should drop this #ifdef.  In general, if a MAC supports time stamping and
> PHC, then the driver support should simply be compiled in.
> 
> [ When time stamping incurs a large run time performance penalty to
>   non-PTP users, then it might make sense to have a Kconfig option to
>   disable it, but that doesn't appear to be the case here. ]

[Y.b. Lu] Actually these timestamping codes affected DPAA networking 
performance in our previous performance test.
That's why we used ifdef for it.

> 
> > @@ -1615,6 +1635,24 @@ static int dpaa_eth_refill_bpools(struct
> dpaa_priv *priv)
> > skbh = (struct sk_buff **)phys_to_virt(addr);
> > skb = *skbh;
> >
> > +#ifdef CONFIG_FSL_DPAA_ETH_TS
> > +   if (priv->tx_tstamp &&
> > +   skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) {
> 
> This condition fits on one line easily.

[Y.b. Lu] Right. I will use one line in next version.

> 
> > +   struct skb_shared_hwtstamps shhwtstamps;
> > +   u64 ns;
> 
> Local variables belong at the top of the function.

[Y.b. Lu] Ok, will move them to the top in next verison.

> 
> > +   memset(, 0, sizeof(shhwtstamps));
> > +
> > +   if (!dpaa_get_tstamp_ns(priv->net_dev, ,
> > +   priv->mac_dev->port[TX],
> > +   (void *)skbh)) {
> > +   shhwtstamps.hwtstamp = ns_to_ktime(ns);
> > +   skb_tstamp_tx(skb, );
> > +   } else {
> > +   dev_warn(dev, "dpaa_get_tstamp_ns failed!\n");
> > +   }
> > +   }
> > +#endif
> > if (unlikely(qm_fd_get_format(fd) == qm_fd_sg)) {
> > nr_frags = skb_shinfo(skb)->nr_frags;
> > dma_unmap_single(dev, addr, qm_fd_get_offset(fd) + @@ -2086,6
> > +2124,14 @@ static int dpaa_start_xmit(struct sk_buff *skb, struct
> net_device *net_dev)
> > if (unlikely(err < 0))
> > goto skb_to_fd_failed;
> >
> > +#ifdef CONFIG_FSL_DPAA_ETH_TS
> > +   if (priv->tx_tstamp &&
> > +   skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) {
> 
> One line please.

[Y.b. Lu] No problem.

> 
> > +   fd.cmd |= FM_FD_CMD_UPD;
> > +   skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
> > +   }
> > +#endif
> > +
> > if (likely(dpaa_xmit(priv, percpu_stats, queue_mapping, ) == 0))
> > return NETDEV_TX_OK;
> >
> 
> Thanks,
> Richard


RE: [PATCH] soc/fsl/guts: Add a NULL check for devm_kasprintf()

2018-01-07 Thread Y.b. Lu
> -Original Message-
> From: Fabio Estevam [mailto:feste...@gmail.com]
> Sent: 2018年1月6日 21:23
> To: Leo Li <leoyang...@nxp.com>
> Cc: linuxppc-dev@lists.ozlabs.org; Y.b. Lu <yangbo...@nxp.com>; Fabio
> Estevam <fabio.este...@nxp.com>
> Subject: [PATCH] soc/fsl/guts: Add a NULL check for devm_kasprintf()
> 
> From: Fabio Estevam <fabio.este...@nxp.com>
> 
> devm_kasprintf() may fail, so we should better add a NULL check and
> propagate an error on failure.
> 
> Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>

[Y.b. Lu] It makes sense. 
Acked-by: Yangbo Lu <yangbo...@nxp.com>

> ---
>  drivers/soc/fsl/guts.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index
> d89a6a8..82251b4 100644
> --- a/drivers/soc/fsl/guts.c
> +++ b/drivers/soc/fsl/guts.c
> @@ -167,10 +167,16 @@ static int fsl_guts_probe(struct platform_device
> *pdev)
>   } else {
>   soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL, "QorIQ");
>   }
> + if (!soc_dev_attr.family)
> + return -ENOMEM;
>   soc_dev_attr.soc_id = devm_kasprintf(dev, GFP_KERNEL,
>"svr:0x%08x", svr);
> + if (!soc_dev_attr.soc_id)
> + return -ENOMEM;
>   soc_dev_attr.revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d",
>  (svr >>  4) & 0xf, svr & 0xf);
> + if (!soc_dev_attr.revision)
> + return -ENOMEM;
> 
>   soc_dev = soc_device_register(_dev_attr);
>   if (IS_ERR(soc_dev))
> --
> 2.7.4



RE: [v16, 0/7] Fix eSDHC host version register bug

2016-11-09 Thread Y.B. Lu
> -Original Message-
> From: Y.B. Lu
> Sent: Thursday, November 10, 2016 12:06 PM
> To: 'Scott Wood'; Ulf Hansson
> Cc: linux-mmc; Arnd Bergmann; linuxppc-dev@lists.ozlabs.org;
> devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> ker...@vger.kernel.org; linux-clk; io...@lists.linux-foundation.org;
> net...@vger.kernel.org; Greg Kroah-Hartman; Mark Rutland; Rob Herring;
> Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh
> Sharma; Qiang Zhao; Kumar Gala; Leo Li; X.B. Xie; M.H. Lian
> Subject: RE: [v16, 0/7] Fix eSDHC host version register bug
> 
> > -Original Message-
> > From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> > ow...@vger.kernel.org] On Behalf Of Scott Wood
> > Sent: Thursday, November 10, 2016 11:55 AM
> > To: Ulf Hansson; Y.B. Lu
> > Cc: linux-mmc; Arnd Bergmann; linuxppc-dev@lists.ozlabs.org;
> > devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org;
> > linux- ker...@vger.kernel.org; linux-clk;
> > io...@lists.linux-foundation.org; net...@vger.kernel.org; Greg
> > Kroah-Hartman; Mark Rutland; Rob Herring; Russell King; Jochen
> > Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh Sharma; Qiang Zhao;
> > Kumar Gala; Leo Li; X.B. Xie; M.H. Lian
> > Subject: Re: [v16, 0/7] Fix eSDHC host version register bug
> >
> > On Wed, 2016-11-09 at 19:27 +0100, Ulf Hansson wrote:
> > > - i2c-list
> > >
> > > On 9 November 2016 at 04:14, Yangbo Lu <yangbo...@nxp.com> wrote:
> > > >
> > > > This patchset is used to fix a host version register bug in the
> > > > T4240-
> > > > R1.0-R2.0
> > > > eSDHC controller. To match the SoC version and revision, 15
> > > > previous version patchsets had tried many methods but all of them
> > > > were rejected by reviewers.
> > > > Such as
> > > > - dts compatible method
> > > > - syscon method
> > > > - ifdef PPC method
> > > > - GUTS driver getting SVR method Anrd suggested a
> > > > soc_device_match method in v10, and this is the only available
> > > > method left now. This v11 patchset introduces the soc_device_match
> > > > interface in soc driver.
> > > >
> > > > The first four patches of Yangbo are to add the GUTS driver. This
> > > > is used to register a soc device which contain soc version and
> > > > revision information.
> > > > The other three patches introduce the soc_device_match method in
> > > > soc driver and apply it on esdhc driver to fix this bug.
> > > >
> > > > ---
> > > > Changes for v15:
> > > > - Dropped patch 'dt: bindings: update Freescale DCFG
> > compatible'
> > > >   since the work had been done by below patch on
> > > > ShawnGuo's linux tree.
> > > >   'dt-bindings: fsl: add LS1043A/LS1046A/LS2080A
> > > > compatible for SCFG
> > > >    and DCFG'
> > > > - Fixed error code issue in guts driver Changes for v16:
> > > > - Dropped patch 'powerpc/fsl: move mpc85xx.h to
> > include/linux/fsl'
> > > > - Added a bug-fix patch from Geert
> > > > ---
> > > >
> > > > Arnd Bergmann (1):
> > > >   base: soc: introduce soc_device_match() interface
> > > >
> > > > Geert Uytterhoeven (1):
> > > >   base: soc: Check for NULL SoC device attributes
> > > >
> > > > Yangbo Lu (5):
> > > >   ARM64: dts: ls2080a: add device configuration node
> > > >   dt: bindings: move guts devicetree doc out of powerpc directory
> > > >   soc: fsl: add GUTS driver for QorIQ platforms
> > > >   MAINTAINERS: add entry for Freescale SoC drivers
> > > >   mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0
> > > >
> > > >  .../bindings/{powerpc => soc}/fsl/guts.txt |   3 +
> > > >  MAINTAINERS|  11 +-
> > > >  arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi |   6 +
> > > >  drivers/base/Kconfig   |   1 +
> > > >  drivers/base/soc.c |  70 ++
> > > >  drivers/mmc/host/Kconfig   |   1 +
> > > >  drivers/mmc/host/sdhci-of-esdhc.c  |  20 ++
> > > >  drivers/soc/Kconfig|   3 +-
> > > &

RE: [v16, 0/7] Fix eSDHC host version register bug

2016-11-09 Thread Y.B. Lu
> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Scott Wood
> Sent: Thursday, November 10, 2016 11:55 AM
> To: Ulf Hansson; Y.B. Lu
> Cc: linux-mmc; Arnd Bergmann; linuxppc-dev@lists.ozlabs.org;
> devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> ker...@vger.kernel.org; linux-clk; io...@lists.linux-foundation.org;
> net...@vger.kernel.org; Greg Kroah-Hartman; Mark Rutland; Rob Herring;
> Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh
> Sharma; Qiang Zhao; Kumar Gala; Leo Li; X.B. Xie; M.H. Lian
> Subject: Re: [v16, 0/7] Fix eSDHC host version register bug
> 
> On Wed, 2016-11-09 at 19:27 +0100, Ulf Hansson wrote:
> > - i2c-list
> >
> > On 9 November 2016 at 04:14, Yangbo Lu <yangbo...@nxp.com> wrote:
> > >
> > > This patchset is used to fix a host version register bug in the
> > > T4240-
> > > R1.0-R2.0
> > > eSDHC controller. To match the SoC version and revision, 15 previous
> > > version patchsets had tried many methods but all of them were
> > > rejected by reviewers.
> > > Such as
> > > - dts compatible method
> > > - syscon method
> > > - ifdef PPC method
> > > - GUTS driver getting SVR method Anrd suggested a
> > > soc_device_match method in v10, and this is the only available
> > > method left now. This v11 patchset introduces the soc_device_match
> > > interface in soc driver.
> > >
> > > The first four patches of Yangbo are to add the GUTS driver. This is
> > > used to register a soc device which contain soc version and revision
> > > information.
> > > The other three patches introduce the soc_device_match method in soc
> > > driver and apply it on esdhc driver to fix this bug.
> > >
> > > ---
> > > Changes for v15:
> > > - Dropped patch 'dt: bindings: update Freescale DCFG
> compatible'
> > >   since the work had been done by below patch on ShawnGuo's
> > > linux tree.
> > >   'dt-bindings: fsl: add LS1043A/LS1046A/LS2080A compatible
> > > for SCFG
> > >    and DCFG'
> > > - Fixed error code issue in guts driver Changes for v16:
> > > - Dropped patch 'powerpc/fsl: move mpc85xx.h to
> include/linux/fsl'
> > > - Added a bug-fix patch from Geert
> > > ---
> > >
> > > Arnd Bergmann (1):
> > >   base: soc: introduce soc_device_match() interface
> > >
> > > Geert Uytterhoeven (1):
> > >   base: soc: Check for NULL SoC device attributes
> > >
> > > Yangbo Lu (5):
> > >   ARM64: dts: ls2080a: add device configuration node
> > >   dt: bindings: move guts devicetree doc out of powerpc directory
> > >   soc: fsl: add GUTS driver for QorIQ platforms
> > >   MAINTAINERS: add entry for Freescale SoC drivers
> > >   mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0
> > >
> > >  .../bindings/{powerpc => soc}/fsl/guts.txt |   3 +
> > >  MAINTAINERS|  11 +-
> > >  arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi |   6 +
> > >  drivers/base/Kconfig   |   1 +
> > >  drivers/base/soc.c |  70 ++
> > >  drivers/mmc/host/Kconfig   |   1 +
> > >  drivers/mmc/host/sdhci-of-esdhc.c  |  20 ++
> > >  drivers/soc/Kconfig|   3 +-
> > >  drivers/soc/fsl/Kconfig|  18 ++
> > >  drivers/soc/fsl/Makefile   |   1 +
> > >  drivers/soc/fsl/guts.c | 236
> > > +
> > >  include/linux/fsl/guts.h   | 125
> > > ++-
> > >  include/linux/sys_soc.h|   3 +
> > >  13 files changed, 447 insertions(+), 51 deletions(-)
> > >  rename Documentation/devicetree/bindings/{powerpc =>
> > > soc}/fsl/guts.txt
> > > (91%)
> > >  create mode 100644 drivers/soc/fsl/Kconfig
> > >  create mode 100644 drivers/soc/fsl/guts.c
> > >
> > > --
> > > 2.1.0.27.g96db324
> > >
> > Thanks, applied on my mmc tree for next!
> >
> > I noticed that some DT compatibles weren't documented, according to
> > checkpatch. Please fix that asap!
> 
> They are documente

RE: [v15, 3/7] powerpc/fsl: move mpc85xx.h to include/linux/fsl

2016-11-07 Thread Y.B. Lu
Hi Arnd,


> -Original Message-
> From: Arnd Bergmann [mailto:a...@arndb.de]
> Sent: Tuesday, November 08, 2016 5:20 AM
> To: Y.B. Lu
> Cc: linuxppc-dev@lists.ozlabs.org; linux-...@vger.kernel.org;
> ulf.hans...@linaro.org; Scott Wood; Mark Rutland; Greg Kroah-Hartman; X.B.
> Xie; M.H. Lian; linux-...@vger.kernel.org; linux-...@vger.kernel.org;
> Qiang Zhao; Russell King; Bhupesh Sharma; Joerg Roedel; Claudiu Manoil;
> devicet...@vger.kernel.org; Rob Herring; Santosh Shilimkar; linux-arm-
> ker...@lists.infradead.org; net...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Leo Li; io...@lists.linux-foundation.org; Kumar
> Gala
> Subject: Re: [v15, 3/7] powerpc/fsl: move mpc85xx.h to include/linux/fsl
> 
> On Monday, October 31, 2016 9:35:33 AM CET Y.B. Lu wrote:
> > >
> > > I don't see any of the contents of this header referenced by the soc
> > > driver any more. I think you can just drop this patch.
> > >
> >
> > [Lu Yangbo-B47093] This header file was included by guts.c.
> > The guts driver used macro SVR_MAJ/SVR_MIN for calculation.
> >
> > This header file was for powerpc arch before. And this patch is to
> > made it as common header file for both ARM and PPC.
> > Sooner or later this is needed.
> 
> Let's discuss it once we actually need the header then, ok?

[Lu Yangbo-B47093] As I said, this header file was included by guts.c in patch 
4.
The guts driver used macro SVR_MAJ/SVR_MIN for calculation which were defined 
in this header file.
Did you suggest we dropped this patch and just calculated them in driver?

Thanks :)


> 
>   Arnd


RE: [v15, 0/7] Fix eSDHC host version register bug

2016-10-31 Thread Y.B. Lu
> -Original Message-
> From: Arnd Bergmann [mailto:a...@arndb.de]
> Sent: Friday, October 28, 2016 6:54 PM
> To: linux-arm-ker...@lists.infradead.org
> Cc: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Scott
> Wood; Mark Rutland; Greg Kroah-Hartman; X.B. Xie; M.H. Lian; linux-
> i...@vger.kernel.org; linux-...@vger.kernel.org; Qiang Zhao; Russell King;
> Bhupesh Sharma; Joerg Roedel; Jochen Friedrich; Claudiu Manoil;
> devicet...@vger.kernel.org; Rob Herring; Santosh Shilimkar;
> net...@vger.kernel.org; linux-ker...@vger.kernel.org; Leo Li;
> io...@lists.linux-foundation.org; Kumar Gala; linuxppc-
> d...@lists.ozlabs.org
> Subject: Re: [v15, 0/7] Fix eSDHC host version register bug
> 
> On Friday, October 28, 2016 2:50:11 PM CEST Yangbo Lu wrote:
> > This patchset is used to fix a host version register bug in the
> > T4240-R1.0-R2.0 eSDHC controller. To match the SoC version and
> > revision, 10 previous version patchsets had tried many methods but all
> of them were rejected by reviewers.
> > Such as
> > - dts compatible method
> > - syscon method
> > - ifdef PPC method
> > - GUTS driver getting SVR method Anrd suggested a
> > soc_device_match method in v10, and this is the only available method
> > left now. This v11 patchset introduces the soc_device_match interface
> > in soc driver.
> >
> > The first five patches of Yangbo are to add the GUTS driver. This is
> > used to register a soc device which contain soc version and revision
> information.
> > The other two patches introduce the soc_device_match method in soc
> > driver and apply it on esdhc driver to fix this bug.
> >
> 
> Looks good overall. With patch 3 dropped (or an explanation why it's
> still needed), everything
> 
> Acked-by: Arnd Bergmann <a...@arndb.de>
>
 
[Lu Yangbo-B47093] Thank you very much:) See my explaination in patch 3 email.

>   Arnd



RE: [v15, 3/7] powerpc/fsl: move mpc85xx.h to include/linux/fsl

2016-10-31 Thread Y.B. Lu
> -Original Message-
> From: Arnd Bergmann [mailto:a...@arndb.de]
> Sent: Friday, October 28, 2016 6:53 PM
> To: linuxppc-dev@lists.ozlabs.org
> Cc: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Scott
> Wood; Mark Rutland; Greg Kroah-Hartman; X.B. Xie; M.H. Lian; linux-
> i...@vger.kernel.org; linux-...@vger.kernel.org; Qiang Zhao; Russell King;
> Bhupesh Sharma; Joerg Roedel; Claudiu Manoil; devicet...@vger.kernel.org;
> Rob Herring; Santosh Shilimkar; linux-arm-ker...@lists.infradead.org;
> net...@vger.kernel.org; linux-ker...@vger.kernel.org; Leo Li;
> io...@lists.linux-foundation.org; Kumar Gala
> Subject: Re: [v15, 3/7] powerpc/fsl: move mpc85xx.h to include/linux/fsl
> 
> On Friday, October 28, 2016 2:50:14 PM CEST Yangbo Lu wrote:
> > Move mpc85xx.h to include/linux/fsl and rename it to svr.h as a common
> > header file.  This SVR numberspace is used on some ARM chips as well
> > as PPC, and even to check for a PPC SVR multi-arch drivers would
> > otherwise need to ifdef the header inclusion and all references to the
> SVR symbols.
> >
> >
> 
> I don't see any of the contents of this header referenced by the soc
> driver any more. I think you can just drop this patch.
> 

[Lu Yangbo-B47093] This header file was included by guts.c.
The guts driver used macro SVR_MAJ/SVR_MIN for calculation.

This header file was for powerpc arch before. And this patch is to made it as 
common header file for both ARM and PPC.
Sooner or later this is needed.

>   Arnd



RE: [v15, 6/7] base: soc: introduce soc_device_match() interface

2016-10-31 Thread Y.B. Lu
> -Original Message-
> From: Arnd Bergmann [mailto:a...@arndb.de]
> Sent: Friday, October 28, 2016 6:48 PM
> To: linuxppc-dev@lists.ozlabs.org
> Cc: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Scott
> Wood; Mark Rutland; Greg Kroah-Hartman; X.B. Xie; M.H. Lian; linux-
> i...@vger.kernel.org; linux-...@vger.kernel.org; Qiang Zhao; Russell King;
> Bhupesh Sharma; Joerg Roedel; Claudiu Manoil; devicet...@vger.kernel.org;
> Rob Herring; Santosh Shilimkar; linux-arm-ker...@lists.infradead.org;
> net...@vger.kernel.org; linux-ker...@vger.kernel.org; Leo Li;
> io...@lists.linux-foundation.org; Kumar Gala; Geert Uytterhoeven
> Subject: Re: [v15, 6/7] base: soc: introduce soc_device_match() interface
> 
> On Friday, October 28, 2016 2:50:17 PM CEST Yangbo Lu wrote:
> > +
> > +static int soc_device_match_one(struct device *dev, void *arg) {
> > +   struct soc_device *soc_dev = container_of(dev, struct
> soc_device, dev);
> > +   const struct soc_device_attribute *match = arg;
> > +
> > +   if (match->machine &&
> > +   !glob_match(match->machine, soc_dev->attr->machine))
> > +   return 0;
> > +
> > +   if (match->family &&
> > +   !glob_match(match->family, soc_dev->attr->family))
> > +   return 0;
> > +
> >
> 
> Geert found a bug in my code, and submitted a fix at
> https://patchwork.kernel.org/patch/9361395/
> 
> I think you should include that one in your series.
> 

[Lu Yangbo-B47093] Ok, no problem. Thanks :)

>   Arnd


RE: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-28 Thread Y.B. Lu
> -Original Message-
> From: Y.B. Lu
> Sent: Friday, October 28, 2016 2:06 PM
> To: Y.B. Lu; 'Scott Wood'; 'linux-...@vger.kernel.org';
> 'ulf.hans...@linaro.org'; 'Arnd Bergmann'
> Cc: 'linuxppc-dev@lists.ozlabs.org'; 'devicet...@vger.kernel.org';
> 'linux-arm-ker...@lists.infradead.org'; 'linux-ker...@vger.kernel.org';
> 'linux-...@vger.kernel.org'; 'linux-...@vger.kernel.org';
> 'io...@lists.linux-foundation.org'; 'net...@vger.kernel.org'; 'Greg
> Kroah-Hartman'; 'Mark Rutland'; 'Rob Herring'; 'Russell King'; 'Jochen
> Friedrich'; 'Joerg Roedel'; 'Claudiu Manoil'; 'Bhupesh Sharma'; Qiang
> Zhao; 'Kumar Gala'; 'Santosh Shilimkar'; Leo Li; X.B. Xie; M.H. Lian
> Subject: RE: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
> 
> > -Original Message-
> > From: Y.B. Lu
> > Sent: Friday, October 28, 2016 2:00 PM
> > To: 'Scott Wood'; linux-...@vger.kernel.org; ulf.hans...@linaro.org;
> > Arnd Bergmann
> > Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org;
> > linux-arm- ker...@lists.infradead.org; linux-ker...@vger.kernel.org;
> > linux- c...@vger.kernel.org; linux-...@vger.kernel.org;
> > iommu@lists.linux- foundation.org; net...@vger.kernel.org; Greg
> > Kroah-Hartman; Mark Rutland; Rob Herring; Russell King; Jochen
> > Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh Sharma; Qiang Zhao;
> Kumar Gala; Santosh Shilimkar; Leo Li; X.B.
> > Xie; M.H. Lian
> > Subject: RE: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
> >
> >
> >
> > > -Original Message-
> > > From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> > > ow...@vger.kernel.org] On Behalf Of Scott Wood
> > > Sent: Friday, October 28, 2016 12:46 PM
> > > To: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd
> > > Bergmann
> > > Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org;
> > > linux-arm- ker...@lists.infradead.org; linux-ker...@vger.kernel.org;
> > > linux- c...@vger.kernel.org; linux-...@vger.kernel.org;
> > > iommu@lists.linux- foundation.org; net...@vger.kernel.org; Greg
> > > Kroah-Hartman; Mark Rutland; Rob Herring; Russell King; Jochen
> > > Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh Sharma; Qiang Zhao;
> > Kumar Gala; Santosh Shilimkar; Leo Li; X.B.
> > > Xie; M.H. Lian
> > > Subject: Re: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ
> > > platforms
> > >
> > > On Fri, 2016-10-28 at 11:32 +0800, Yangbo Lu wrote:
> > > > +   guts->regs = of_iomap(np, 0);
> > > > +   if (!guts->regs)
> > > > +   return -ENOMEM;
> > > > +
> > > > +   /* Register soc device */
> > > > +   machine = of_flat_dt_get_machine_name();
> > > > +   if (machine)
> > > > +   soc_dev_attr.machine = devm_kstrdup(dev, machine,
> > > > GFP_KERNEL);
> > > > +
> > > > +   svr = fsl_guts_get_svr();
> > > > +   soc_die = fsl_soc_die_match(svr, fsl_soc_die);
> > > > +   if (soc_die) {
> > > > +   soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
> > > > +    "QorIQ %s", 
> > > > soc_die-
> > > > >die);
> > > > +   } else {
> > > > +   soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
> > > > "QorIQ");
> > > > +   }
> > > > +   soc_dev_attr.soc_id = devm_kasprintf(dev, GFP_KERNEL,
> > > > +    "svr:0x%08x", svr);
> > > > +   soc_dev_attr.revision = devm_kasprintf(dev, GFP_KERNEL,
> "%d.%d",
> > > > +      SVR_MAJ(svr), 
> > > > SVR_MIN(svr));
> > > > +
> > > > +   soc_dev = soc_device_register(_dev_attr);
> > > > +   if (IS_ERR(soc_dev))
> > > > +   return PTR_ERR(soc_dev);
> > >
> > > ioremap leaks on this error path.  Use devm_ioremap_resource().
> > >
> >
> > [Lu Yangbo-B47093] Ok. I have fixed it in v14. Thanks :)
> 
> [Lu Yangbo-B47093] Sorry, used the wrong error code... Will resent it

[Lu Yangbo-B47093] The v15 had been sent. And dropped patch 'dt: bindings: 
update Freescale DCFG compatible',
since that work has been done by below patch on ShawnGuo's linux tree.
'dt-bindings: fsl: add LS1043A/LS1046A/LS2080A compatible for SCFG and DCFG'
https://git.kernel.org/cgit/linux/kernel/git/shawnguo/linux.git/commit/?h=imx/dt64=981034a2bfcaff5c95dafde24d7abfe7f9025c19

Thanks.

> 
> >
> > > -Scott
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-mmc"
> > > in the body of a message to majord...@vger.kernel.org More majordomo
> > > info at http://vger.kernel.org/majordomo-info.html


RE: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-28 Thread Y.B. Lu
> -Original Message-
> From: Y.B. Lu
> Sent: Friday, October 28, 2016 2:00 PM
> To: 'Scott Wood'; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd
> Bergmann
> Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-ker...@vger.kernel.org; linux-
> c...@vger.kernel.org; linux-...@vger.kernel.org; iommu@lists.linux-
> foundation.org; net...@vger.kernel.org; Greg Kroah-Hartman; Mark Rutland;
> Rob Herring; Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil;
> Bhupesh Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B.
> Xie; M.H. Lian
> Subject: RE: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
> 
> 
> 
> > -Original Message-
> > From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> > ow...@vger.kernel.org] On Behalf Of Scott Wood
> > Sent: Friday, October 28, 2016 12:46 PM
> > To: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd
> > Bergmann
> > Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org;
> > linux-arm- ker...@lists.infradead.org; linux-ker...@vger.kernel.org;
> > linux- c...@vger.kernel.org; linux-...@vger.kernel.org;
> > iommu@lists.linux- foundation.org; net...@vger.kernel.org; Greg
> > Kroah-Hartman; Mark Rutland; Rob Herring; Russell King; Jochen
> > Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh Sharma; Qiang Zhao;
> Kumar Gala; Santosh Shilimkar; Leo Li; X.B.
> > Xie; M.H. Lian
> > Subject: Re: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
> >
> > On Fri, 2016-10-28 at 11:32 +0800, Yangbo Lu wrote:
> > > + guts->regs = of_iomap(np, 0);
> > > + if (!guts->regs)
> > > + return -ENOMEM;
> > > +
> > > + /* Register soc device */
> > > + machine = of_flat_dt_get_machine_name();
> > > + if (machine)
> > > + soc_dev_attr.machine = devm_kstrdup(dev, machine,
> > > GFP_KERNEL);
> > > +
> > > + svr = fsl_guts_get_svr();
> > > + soc_die = fsl_soc_die_match(svr, fsl_soc_die);
> > > + if (soc_die) {
> > > + soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
> > > +  "QorIQ %s", soc_die-
> > > >die);
> > > + } else {
> > > + soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
> > > "QorIQ");
> > > + }
> > > + soc_dev_attr.soc_id = devm_kasprintf(dev, GFP_KERNEL,
> > > +  "svr:0x%08x", svr);
> > > + soc_dev_attr.revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d",
> > > +    SVR_MAJ(svr), SVR_MIN(svr));
> > > +
> > > + soc_dev = soc_device_register(_dev_attr);
> > > + if (IS_ERR(soc_dev))
> > > + return PTR_ERR(soc_dev);
> >
> > ioremap leaks on this error path.  Use devm_ioremap_resource().
> >
> 
> [Lu Yangbo-B47093] Ok. I have fixed it in v14. Thanks :)

[Lu Yangbo-B47093] Sorry, used the wrong error code... Will resent it

> 
> > -Scott
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-mmc"
> > in the body of a message to majord...@vger.kernel.org More majordomo
> > info at http://vger.kernel.org/majordomo-info.html


RE: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-28 Thread Y.B. Lu


> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Scott Wood
> Sent: Friday, October 28, 2016 12:46 PM
> To: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd
> Bergmann
> Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-ker...@vger.kernel.org; linux-
> c...@vger.kernel.org; linux-...@vger.kernel.org; iommu@lists.linux-
> foundation.org; net...@vger.kernel.org; Greg Kroah-Hartman; Mark Rutland;
> Rob Herring; Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil;
> Bhupesh Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B.
> Xie; M.H. Lian
> Subject: Re: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
> 
> On Fri, 2016-10-28 at 11:32 +0800, Yangbo Lu wrote:
> > +   guts->regs = of_iomap(np, 0);
> > +   if (!guts->regs)
> > +   return -ENOMEM;
> > +
> > +   /* Register soc device */
> > +   machine = of_flat_dt_get_machine_name();
> > +   if (machine)
> > +   soc_dev_attr.machine = devm_kstrdup(dev, machine,
> > GFP_KERNEL);
> > +
> > +   svr = fsl_guts_get_svr();
> > +   soc_die = fsl_soc_die_match(svr, fsl_soc_die);
> > +   if (soc_die) {
> > +   soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
> > +    "QorIQ %s", soc_die-
> > >die);
> > +   } else {
> > +   soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
> > "QorIQ");
> > +   }
> > +   soc_dev_attr.soc_id = devm_kasprintf(dev, GFP_KERNEL,
> > +    "svr:0x%08x", svr);
> > +   soc_dev_attr.revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d",
> > +      SVR_MAJ(svr), SVR_MIN(svr));
> > +
> > +   soc_dev = soc_device_register(_dev_attr);
> > +   if (IS_ERR(soc_dev))
> > +   return PTR_ERR(soc_dev);
> 
> ioremap leaks on this error path.  Use devm_ioremap_resource().
> 

[Lu Yangbo-B47093] Ok. I have fixed it in v14. Thanks :)

> -Scott
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majord...@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html


RE: [v12, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-26 Thread Y.B. Lu
Hi Scott,


> -Original Message-
> From: Scott Wood [mailto:o...@buserror.net]
> Sent: Thursday, October 27, 2016 1:06 AM
> To: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd
> Bergmann
> Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-ker...@vger.kernel.org; linux-
> c...@vger.kernel.org; linux-...@vger.kernel.org; iommu@lists.linux-
> foundation.org; net...@vger.kernel.org; Mark Rutland; Rob Herring;
> Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh
> Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B. Xie; M.H.
> Lian
> Subject: Re: [v12, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
> 
> On Wed, 2016-09-21 at 14:57 +0800, Yangbo Lu wrote:
> > diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig new
> > file mode 100644 index 000..b99764c
> > --- /dev/null
> > +++ b/drivers/soc/fsl/Kconfig
> > @@ -0,0 +1,19 @@
> > +#
> > +# Freescale SOC drivers
> > +#
> > +
> > +source "drivers/soc/fsl/qe/Kconfig"
> > +
> > +config FSL_GUTS
> > +   bool "Freescale QorIQ GUTS driver"
> > +   select SOC_BUS
> > +   help
> > +     The global utilities block controls power management, I/O device
> > +     enabling, power-onreset(POR) configuration monitoring, alternate
> > +     function selection for multiplexed signals,and clock control.
> > +     This driver is to manage and access global utilities block.
> > +     Initially only reading SVR and registering soc device are
> > supported.
> > +     Other guts accesses, such as reading RCW, should eventually be
> > moved
> > +     into this driver as well.
> > +
> > +     If you want GUTS driver support, you should say Y here.
> 
> This is user-enablable without dependencies, which means it will break
> some randconfigs.  If this is to be enabled via select then remove the
> text after "bool".

[Lu Yangbo-B47093] Will enable it via select and remove text after 'bool'.
 
> 
> > +/* SoC die attribute definition for QorIQ platform */ static const
> > +struct fsl_soc_die_attr fsl_soc_die[] = { #ifdef CONFIG_PPC
> > +   /*
> > +    * Power Architecture-based SoCs T Series
> > +    */
> > +
> > +   /* Die: T4240, SoC: T4240/T4160/T4080 */
> > +   { .die  = "T4240",
> > +     .svr  = 0x8240,
> > +     .mask = 0xfff0,
> > +   },
> > +   /* Die: T1040, SoC: T1040/T1020/T1042/T1022 */
> > +   { .die  = "T1040",
> > +     .svr  = 0x8520,
> > +     .mask = 0xfff0,
> > +   },
> > +   /* Die: T2080, SoC: T2080/T2081 */
> > +   { .die  = "T2080",
> > +     .svr  = 0x8530,
> > +     .mask = 0xfff0,
> > +   },
> > +   /* Die: T1024, SoC: T1024/T1014/T1023/T1013 */
> > +   { .die  = "T1024",
> > +     .svr  = 0x8540,
> > +     .mask = 0xfff0,
> > +   },
> > +#endif /* CONFIG_PPC */
> > +#if defined(CONFIG_ARCH_MXC) || defined(CONFIG_ARCH_LAYERSCAPE)
> 
> Will this driver ever be probed on MXC?  Why do we need these ifdefs at
> all?

[Lu Yangbo-B47093] Will remove them. In the previous version, we use too many 
members for soc definition, so I add #ifdef for ARCH. 
CONFIG_ARCH_MXC was for ls1021a.

> 
> 
> > +   /*
> > +    * ARM-based SoCs LS Series
> > +    */
> > +
> > +   /* Die: LS1043A, SoC: LS1043A/LS1023A */
> > +   { .die  = "LS1043A",
> > +     .svr  = 0x8792,
> > +     .mask = 0x,
> > +   },
> > +   /* Die: LS2080A, SoC: LS2080A/LS2040A/LS2085A */
> > +   { .die  = "LS2080A",
> > +     .svr  = 0x8701,
> > +     .mask = 0xff3f,
> > +   },
> > +   /* Die: LS1088A, SoC: LS1088A/LS1048A/LS1084A/LS1044A */
> > +   { .die  = "LS1088A",
> > +     .svr  = 0x8703,
> > +     .mask = 0xff3f,
> > +   },
> > +   /* Die: LS1012A, SoC: LS1012A */
> > +   { .die  = "LS1012A",
> > +     .svr  = 0x8704,
> > +     .mask = 0x,
> > +   },
> > +   /* Die: LS1046A, SoC: LS1046A/LS1026A */
> > +   { .die  = "LS1046A",
> > +     .svr  = 0x8707,
> > +     .mask = 0x,
> > +   },
> > +   /* Die: LS2088A, SoC: LS2088A/LS2048A/LS2084A/LS2044A */
> > +   { .die  = 

RE: [v12, 0/8] Fix eSDHC host version register bug

2016-10-18 Thread Y.B. Lu
+ Greg

Hi Greg,

I submitted this patchset for a MMC bug fix, and introduce the below patch 
which needs your ACK.
> > Arnd Bergmann (1):
> >   base: soc: introduce soc_device_match() interface
https://patchwork.kernel.org/patch/9342913/

Could you help to review it and give some comments or ACK.
Thank you very much.



Best regards,
Yangbo Lu


> -Original Message-
> From: Ulf Hansson [mailto:ulf.hans...@linaro.org]
> Sent: Tuesday, October 18, 2016 6:48 PM
> To: Y.B. Lu
> Cc: linux-mmc; Scott Wood; Arnd Bergmann; linuxppc-dev@lists.ozlabs.org;
> devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> ker...@vger.kernel.org; linux-clk; linux-...@vger.kernel.org;
> io...@lists.linux-foundation.org; net...@vger.kernel.org; Mark Rutland;
> Rob Herring; Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil;
> Bhupesh Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B.
> Xie; M.H. Lian
> Subject: Re: [v12, 0/8] Fix eSDHC host version register bug
> 
> On 21 September 2016 at 08:57, Yangbo Lu <yangbo...@nxp.com> wrote:
> > This patchset is used to fix a host version register bug in the
> > T4240-R1.0-R2.0 eSDHC controller. To match the SoC version and
> > revision, 10 previous version patchsets had tried many methods but all
> of them were rejected by reviewers.
> > Such as
> > - dts compatible method
> > - syscon method
> > - ifdef PPC method
> > - GUTS driver getting SVR method Anrd suggested a
> > soc_device_match method in v10, and this is the only available method
> > left now. This v11 patchset introduces the soc_device_match interface
> > in soc driver.
> >
> > The first six patches of Yangbo are to add the GUTS driver. This is
> > used to register a soc device which contain soc version and revision
> information.
> > The other two patches introduce the soc_device_match method in soc
> > driver and apply it on esdhc driver to fix this bug.
> >
> > Arnd Bergmann (1):
> >   base: soc: introduce soc_device_match() interface
> >
> > Yangbo Lu (7):
> >   dt: bindings: update Freescale DCFG compatible
> >   ARM64: dts: ls2080a: add device configuration node
> >   dt: bindings: move guts devicetree doc out of powerpc directory
> >   powerpc/fsl: move mpc85xx.h to include/linux/fsl
> >   soc: fsl: add GUTS driver for QorIQ platforms
> >   MAINTAINERS: add entry for Freescale SoC drivers
> >   mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0
> >
> >  Documentation/devicetree/bindings/arm/fsl.txt  |   6 +-
> >  .../bindings/{powerpc => soc}/fsl/guts.txt |   3 +
> >  MAINTAINERS|  11 +-
> >  arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi |   6 +
> >  arch/powerpc/kernel/cpu_setup_fsl_booke.S  |   2 +-
> >  arch/powerpc/sysdev/fsl_pci.c  |   2 +-
> >  drivers/base/Kconfig   |   1 +
> >  drivers/base/soc.c |  66 ++
> >  drivers/clk/clk-qoriq.c|   3 +-
> >  drivers/i2c/busses/i2c-mpc.c   |   2 +-
> >  drivers/iommu/fsl_pamu.c   |   3 +-
> >  drivers/mmc/host/Kconfig   |   1 +
> >  drivers/mmc/host/sdhci-of-esdhc.c  |  20 ++
> >  drivers/net/ethernet/freescale/gianfar.c   |   2 +-
> >  drivers/soc/Kconfig|   2 +-
> >  drivers/soc/fsl/Kconfig|  19 ++
> >  drivers/soc/fsl/Makefile   |   1 +
> >  drivers/soc/fsl/guts.c | 257
> +
> >  include/linux/fsl/guts.h   | 125 ++
> >  .../asm/mpc85xx.h => include/linux/fsl/svr.h   |   4 +-
> >  include/linux/sys_soc.h|   3 +
> >  21 files changed, 478 insertions(+), 61 deletions(-)  rename
> > Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt (91%)
> > create mode 100644 drivers/soc/fsl/Kconfig  create mode 100644
> > drivers/soc/fsl/guts.c  rename arch/powerpc/include/asm/mpc85xx.h =>
> > include/linux/fsl/svr.h (97%)
> >
> > --
> > 2.1.0.27.g96db324
> >
> 
> This looks good to me! I am not sure which tree you want this to be
> picked up through, but unless no other volunteers I can take it through
> my mmc tree.
> 
> Although, before considering to apply, I need an ack from Scott/Arnd for
> the guts driver in patch 5/8 and I need an ack from Greg for patch 7/8,
> where the soc_device_match() interface is added (seems like you didn't
> add him on cc/to).
> 
> Kind regards
> Uffe


RE: [v12, 0/8] Fix eSDHC host version register bug

2016-10-18 Thread Y.B. Lu
> -Original Message-
> From: Ulf Hansson [mailto:ulf.hans...@linaro.org]
> Sent: Tuesday, October 18, 2016 6:48 PM
> To: Y.B. Lu
> Cc: linux-mmc; Scott Wood; Arnd Bergmann; linuxppc-dev@lists.ozlabs.org;
> devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> ker...@vger.kernel.org; linux-clk; linux-...@vger.kernel.org;
> io...@lists.linux-foundation.org; net...@vger.kernel.org; Mark Rutland;
> Rob Herring; Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil;
> Bhupesh Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B.
> Xie; M.H. Lian
> Subject: Re: [v12, 0/8] Fix eSDHC host version register bug
> 
> On 21 September 2016 at 08:57, Yangbo Lu <yangbo...@nxp.com> wrote:
> > This patchset is used to fix a host version register bug in the
> > T4240-R1.0-R2.0 eSDHC controller. To match the SoC version and
> > revision, 10 previous version patchsets had tried many methods but all
> of them were rejected by reviewers.
> > Such as
> > - dts compatible method
> > - syscon method
> > - ifdef PPC method
> > - GUTS driver getting SVR method Anrd suggested a
> > soc_device_match method in v10, and this is the only available method
> > left now. This v11 patchset introduces the soc_device_match interface
> > in soc driver.
> >
> > The first six patches of Yangbo are to add the GUTS driver. This is
> > used to register a soc device which contain soc version and revision
> information.
> > The other two patches introduce the soc_device_match method in soc
> > driver and apply it on esdhc driver to fix this bug.
> >
> > Arnd Bergmann (1):
> >   base: soc: introduce soc_device_match() interface
> >
> > Yangbo Lu (7):
> >   dt: bindings: update Freescale DCFG compatible
> >   ARM64: dts: ls2080a: add device configuration node
> >   dt: bindings: move guts devicetree doc out of powerpc directory
> >   powerpc/fsl: move mpc85xx.h to include/linux/fsl
> >   soc: fsl: add GUTS driver for QorIQ platforms
> >   MAINTAINERS: add entry for Freescale SoC drivers
> >   mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0
> >
> >  Documentation/devicetree/bindings/arm/fsl.txt  |   6 +-
> >  .../bindings/{powerpc => soc}/fsl/guts.txt |   3 +
> >  MAINTAINERS|  11 +-
> >  arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi |   6 +
> >  arch/powerpc/kernel/cpu_setup_fsl_booke.S  |   2 +-
> >  arch/powerpc/sysdev/fsl_pci.c  |   2 +-
> >  drivers/base/Kconfig   |   1 +
> >  drivers/base/soc.c |  66 ++
> >  drivers/clk/clk-qoriq.c|   3 +-
> >  drivers/i2c/busses/i2c-mpc.c   |   2 +-
> >  drivers/iommu/fsl_pamu.c   |   3 +-
> >  drivers/mmc/host/Kconfig   |   1 +
> >  drivers/mmc/host/sdhci-of-esdhc.c  |  20 ++
> >  drivers/net/ethernet/freescale/gianfar.c   |   2 +-
> >  drivers/soc/Kconfig|   2 +-
> >  drivers/soc/fsl/Kconfig|  19 ++
> >  drivers/soc/fsl/Makefile   |   1 +
> >  drivers/soc/fsl/guts.c | 257
> +
> >  include/linux/fsl/guts.h   | 125 ++
> >  .../asm/mpc85xx.h => include/linux/fsl/svr.h   |   4 +-
> >  include/linux/sys_soc.h|   3 +
> >  21 files changed, 478 insertions(+), 61 deletions(-)  rename
> > Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt (91%)
> > create mode 100644 drivers/soc/fsl/Kconfig  create mode 100644
> > drivers/soc/fsl/guts.c  rename arch/powerpc/include/asm/mpc85xx.h =>
> > include/linux/fsl/svr.h (97%)
> >
> > --
> > 2.1.0.27.g96db324
> >
> 
> This looks good to me! I am not sure which tree you want this to be
> picked up through, but unless no other volunteers I can take it through
> my mmc tree.
> 
> Although, before considering to apply, I need an ack from Scott/Arnd for
> the guts driver in patch 5/8 and I need an ack from Greg for patch 7/8,
> where the soc_device_match() interface is added (seems like you didn't
> add him on cc/to).
> 

[Lu Yangbo-B47093] Thanks a lot for your clarifying, Uffe.
This patchset was based on mmc tree, and needed your picking up.
But I think it needs to be rebased now since I saw qbman driver was in 
drivers/soc/fsl/ now.
I will do that after collecting others' ACKs or comments.

Hi Scott and Arnd,
Could I get your ACTs if there're no other changes needed?
Thanks a lot.

> Kind regards
> Uffe


RE: [v12, 0/8] Fix eSDHC host version register bug

2016-10-07 Thread Y.B. Lu
Hi Uffe, Arnd and Scott,

Any comments on this latest patcheset?
Could we consider to merge it if no any other changes needed?
:)


Thanks.

Best regards,
Yangbo Lu

> -Original Message-
> From: Y.B. Lu
> Sent: Monday, September 26, 2016 11:15 AM
> To: linux-...@vger.kernel.org; ulf.hans...@linaro.org; Scott Wood; Arnd
> Bergmann
> Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-ker...@vger.kernel.org; linux-
> c...@vger.kernel.org; linux-...@vger.kernel.org; iommu@lists.linux-
> foundation.org; net...@vger.kernel.org; Mark Rutland; Rob Herring;
> Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh
> Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B. Xie; M.H.
> Lian
> Subject: RE: [v12, 0/8] Fix eSDHC host version register bug
> 
> Any comments about this version patchset ?
> 
> :)
> 
> 
> > -Original Message-
> > From: Yangbo Lu [mailto:yangbo...@nxp.com]
> > Sent: Wednesday, September 21, 2016 2:57 PM
> > To: linux-...@vger.kernel.org; ulf.hans...@linaro.org; Scott Wood;
> > Arnd Bergmann
> > Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org;
> > linux-arm- ker...@lists.infradead.org; linux-ker...@vger.kernel.org;
> > linux- c...@vger.kernel.org; linux-...@vger.kernel.org;
> > iommu@lists.linux- foundation.org; net...@vger.kernel.org; Mark
> > Rutland; Rob Herring; Russell King; Jochen Friedrich; Joerg Roedel;
> > Claudiu Manoil; Bhupesh Sharma; Qiang Zhao; Kumar Gala; Santosh
> Shilimkar; Leo Li; X.B. Xie; M.H.
> > Lian; Y.B. Lu
> > Subject: [v12, 0/8] Fix eSDHC host version register bug
> >
> > This patchset is used to fix a host version register bug in the T4240-
> > R1.0-R2.0 eSDHC controller. To match the SoC version and revision, 10
> > previous version patchsets had tried many methods but all of them were
> > rejected by reviewers.
> > Such as
> > - dts compatible method
> > - syscon method
> > - ifdef PPC method
> > - GUTS driver getting SVR method
> > Anrd suggested a soc_device_match method in v10, and this is the only
> > available method left now. This v11 patchset introduces the
> > soc_device_match interface in soc driver.
> >
> > The first six patches of Yangbo are to add the GUTS driver. This is
> > used to register a soc device which contain soc version and revision
> > information.
> > The other two patches introduce the soc_device_match method in soc
> > driver and apply it on esdhc driver to fix this bug.
> >
> > Arnd Bergmann (1):
> >   base: soc: introduce soc_device_match() interface
> >
> > Yangbo Lu (7):
> >   dt: bindings: update Freescale DCFG compatible
> >   ARM64: dts: ls2080a: add device configuration node
> >   dt: bindings: move guts devicetree doc out of powerpc directory
> >   powerpc/fsl: move mpc85xx.h to include/linux/fsl
> >   soc: fsl: add GUTS driver for QorIQ platforms
> >   MAINTAINERS: add entry for Freescale SoC drivers
> >   mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0
> >
> >  Documentation/devicetree/bindings/arm/fsl.txt  |   6 +-
> >  .../bindings/{powerpc => soc}/fsl/guts.txt |   3 +
> >  MAINTAINERS|  11 +-
> >  arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi |   6 +
> >  arch/powerpc/kernel/cpu_setup_fsl_booke.S  |   2 +-
> >  arch/powerpc/sysdev/fsl_pci.c  |   2 +-
> >  drivers/base/Kconfig   |   1 +
> >  drivers/base/soc.c |  66 ++
> >  drivers/clk/clk-qoriq.c|   3 +-
> >  drivers/i2c/busses/i2c-mpc.c   |   2 +-
> >  drivers/iommu/fsl_pamu.c   |   3 +-
> >  drivers/mmc/host/Kconfig   |   1 +
> >  drivers/mmc/host/sdhci-of-esdhc.c  |  20 ++
> >  drivers/net/ethernet/freescale/gianfar.c   |   2 +-
> >  drivers/soc/Kconfig|   2 +-
> >  drivers/soc/fsl/Kconfig|  19 ++
> >  drivers/soc/fsl/Makefile   |   1 +
> >  drivers/soc/fsl/guts.c | 257
> > +
> >  include/linux/fsl/guts.h   | 125 ++
> >  .../asm/mpc85xx.h => include/linux/fsl/svr.h   |   4 +-
> >  include/linux/sys_soc.h|   3 +
> >  21 files changed, 478 insertions(+), 61 deletions(-)  rename
> > Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt (91%)
> > create mode 100644 drivers/soc/fsl/Kconfig  create mode 100644
> > drivers/soc/fsl/guts.c  rename arch/powerpc/include/asm/mpc85xx.h =>
> > include/linux/fsl/svr.h (97%)
> >
> > --
> > 2.1.0.27.g96db324



RE: [v12, 0/8] Fix eSDHC host version register bug

2016-09-25 Thread Y.B. Lu
Any comments about this version patchset ?

:)


> -Original Message-
> From: Yangbo Lu [mailto:yangbo...@nxp.com]
> Sent: Wednesday, September 21, 2016 2:57 PM
> To: linux-...@vger.kernel.org; ulf.hans...@linaro.org; Scott Wood; Arnd
> Bergmann
> Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-ker...@vger.kernel.org; linux-
> c...@vger.kernel.org; linux-...@vger.kernel.org; iommu@lists.linux-
> foundation.org; net...@vger.kernel.org; Mark Rutland; Rob Herring;
> Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh
> Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B. Xie; M.H.
> Lian; Y.B. Lu
> Subject: [v12, 0/8] Fix eSDHC host version register bug
> 
> This patchset is used to fix a host version register bug in the T4240-
> R1.0-R2.0 eSDHC controller. To match the SoC version and revision, 10
> previous version patchsets had tried many methods but all of them were
> rejected by reviewers.
> Such as
>   - dts compatible method
>   - syscon method
>   - ifdef PPC method
>   - GUTS driver getting SVR method
> Anrd suggested a soc_device_match method in v10, and this is the only
> available method left now. This v11 patchset introduces the
> soc_device_match interface in soc driver.
> 
> The first six patches of Yangbo are to add the GUTS driver. This is used
> to register a soc device which contain soc version and revision
> information.
> The other two patches introduce the soc_device_match method in soc driver
> and apply it on esdhc driver to fix this bug.
> 
> Arnd Bergmann (1):
>   base: soc: introduce soc_device_match() interface
> 
> Yangbo Lu (7):
>   dt: bindings: update Freescale DCFG compatible
>   ARM64: dts: ls2080a: add device configuration node
>   dt: bindings: move guts devicetree doc out of powerpc directory
>   powerpc/fsl: move mpc85xx.h to include/linux/fsl
>   soc: fsl: add GUTS driver for QorIQ platforms
>   MAINTAINERS: add entry for Freescale SoC drivers
>   mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0
> 
>  Documentation/devicetree/bindings/arm/fsl.txt  |   6 +-
>  .../bindings/{powerpc => soc}/fsl/guts.txt |   3 +
>  MAINTAINERS|  11 +-
>  arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi |   6 +
>  arch/powerpc/kernel/cpu_setup_fsl_booke.S  |   2 +-
>  arch/powerpc/sysdev/fsl_pci.c  |   2 +-
>  drivers/base/Kconfig   |   1 +
>  drivers/base/soc.c |  66 ++
>  drivers/clk/clk-qoriq.c|   3 +-
>  drivers/i2c/busses/i2c-mpc.c   |   2 +-
>  drivers/iommu/fsl_pamu.c   |   3 +-
>  drivers/mmc/host/Kconfig   |   1 +
>  drivers/mmc/host/sdhci-of-esdhc.c  |  20 ++
>  drivers/net/ethernet/freescale/gianfar.c   |   2 +-
>  drivers/soc/Kconfig|   2 +-
>  drivers/soc/fsl/Kconfig|  19 ++
>  drivers/soc/fsl/Makefile   |   1 +
>  drivers/soc/fsl/guts.c | 257
> +
>  include/linux/fsl/guts.h   | 125 ++
>  .../asm/mpc85xx.h => include/linux/fsl/svr.h   |   4 +-
>  include/linux/sys_soc.h|   3 +
>  21 files changed, 478 insertions(+), 61 deletions(-)  rename
> Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt (91%)
> create mode 100644 drivers/soc/fsl/Kconfig  create mode 100644
> drivers/soc/fsl/guts.c  rename arch/powerpc/include/asm/mpc85xx.h =>
> include/linux/fsl/svr.h (97%)
> 
> --
> 2.1.0.27.g96db324



RE: [v11, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-09-13 Thread Y.B. Lu
> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Scott Wood
> Sent: Tuesday, September 13, 2016 7:25 AM
> To: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd
> Bergmann
> Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-ker...@vger.kernel.org; linux-
> c...@vger.kernel.org; linux-...@vger.kernel.org; iommu@lists.linux-
> foundation.org; net...@vger.kernel.org; Mark Rutland; Rob Herring;
> Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh
> Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B. Xie
> Subject: Re: [v11, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
> 
> On Mon, 2016-09-12 at 06:39 +, Y.B. Lu wrote:
> > Hi Scott,
> >
> > Thanks for your review :)
> > See my comment inline.
> >
> > >
> > > -Original Message-
> > > From: Scott Wood [mailto:o...@buserror.net]
> > > Sent: Friday, September 09, 2016 11:47 AM
> > > To: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd
> > > Bergmann
> > > Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org;
> > > linux-arm- ker...@lists.infradead.org; linux-ker...@vger.kernel.org;
> > > linux- c...@vger.kernel.org; linux-...@vger.kernel.org;
> > > iommu@lists.linux- foundation.org; net...@vger.kernel.org; Mark
> > > Rutland; Rob Herring; Russell King; Jochen Friedrich; Joerg Roedel;
> > > Claudiu Manoil; Bhupesh Sharma; Qiang Zhao; Kumar Gala; Santosh
> > > Shilimkar; Leo Li; X.B. Xie
> > > Subject: Re: [v11, 5/8] soc: fsl: add GUTS driver for QorIQ
> > > platforms
> > >
> > > On Tue, 2016-09-06 at 16:28 +0800, Yangbo Lu wrote:
> > > >
> > > > The global utilities block controls power management, I/O device
> > > > enabling, power-onreset(POR) configuration monitoring, alternate
> > > > function selection for multiplexed signals,and clock control.
> > > >
> > > > This patch adds a driver to manage and access global utilities
> block.
> > > > Initially only reading SVR and registering soc device are supported.
> > > > Other guts accesses, such as reading RCW, should eventually be
> > > > moved into this driver as well.
> > > >
> > > > Signed-off-by: Yangbo Lu <yangbo...@nxp.com>
> > > > Signed-off-by: Scott Wood <o...@buserror.net>
> > > Don't put my signoff on patches that I didn't put it on myself.
> > > Definitely don't put mine *after* yours on patches that were last
> > > modified by you.
> > >
> > > If you want to mention that the soc_id encoding was my suggestion,
> > > then do so explicitly.
> > >
> > [Lu Yangbo-B47093] I found your 'signoff' on this patch at below link.
> > http://patchwork.ozlabs.org/patch/649211/
> >
> > So, let me just change the order in next version ?
> > Signed-off-by: Scott Wood <o...@buserror.net>
> > Signed-off-by: Yangbo Lu <yangbo...@nxp.com>
> 
> No.  This isn't my patch so my signoff shouldn't be on it.

[Lu Yangbo-B47093] Ok, will remove it.

> 
> > [Lu Yangbo-B47093] It's a good idea to move die into .family I think.
> > In my opinion, it's better to keep svr and name in soc_id just like
> > your suggestion above.
> > >
> > >   {
> > >   .soc_id = "svr:0x85490010,name:T1023E,",
> > >   .family = "QorIQ T1024",
> > >   }
> > The user probably don’t like to learn the svr value. What they want is
> > just to match the soc they use.
> > It's convenient to use name+rev for them to match a soc.
> 
> What the user should want 99% of the time is to match the die (plus
> revision), not the soc.
> 
> > Regarding shrinking the table, I think it's hard to use svr+mask.
> > Because I find many platforms use different masks.
> > We couldn’t know the mask according svr value.
> 
> The mask would be part of the table:
> 
> {
>   {
>   .die = "T1024",
>   .svr = 0x8540,
>   .mask = 0xfff0,
>   },
>   {
>   .die = "T1040",
>   .svr = 0x8520,
>   .mask = 0xfff0,
>   },
>   {
>   .die = "LS1088A",
>   .svr = 0x8703,
>   .mask = 0x,
>   },
>   ...
> }
> 
> There's a small risk that we get the mask wrong and a different die 

RE: [v11, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-09-12 Thread Y.B. Lu
Hi Scott,

Thanks for your review :)
See my comment inline.

> -Original Message-
> From: Scott Wood [mailto:o...@buserror.net]
> Sent: Friday, September 09, 2016 11:47 AM
> To: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd
> Bergmann
> Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-ker...@vger.kernel.org; linux-
> c...@vger.kernel.org; linux-...@vger.kernel.org; iommu@lists.linux-
> foundation.org; net...@vger.kernel.org; Mark Rutland; Rob Herring;
> Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil; Bhupesh
> Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B. Xie
> Subject: Re: [v11, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
> 
> On Tue, 2016-09-06 at 16:28 +0800, Yangbo Lu wrote:
> > The global utilities block controls power management, I/O device
> > enabling, power-onreset(POR) configuration monitoring, alternate
> > function selection for multiplexed signals,and clock control.
> >
> > This patch adds a driver to manage and access global utilities block.
> > Initially only reading SVR and registering soc device are supported.
> > Other guts accesses, such as reading RCW, should eventually be moved
> > into this driver as well.
> >
> > Signed-off-by: Yangbo Lu <yangbo...@nxp.com>
> > Signed-off-by: Scott Wood <o...@buserror.net>
> 
> Don't put my signoff on patches that I didn't put it on
> myself.  Definitely don't put mine *after* yours on patches that were
> last modified by you.
> 
> If you want to mention that the soc_id encoding was my suggestion, then
> do so explicitly.
> 

[Lu Yangbo-B47093] I found your 'signoff' on this patch at below link.
http://patchwork.ozlabs.org/patch/649211/

So, let me just change the order in next version ?
Signed-off-by: Scott Wood <o...@buserror.net>
Signed-off-by: Yangbo Lu <yangbo...@nxp.com>

> > +/* SoC attribute definition for QorIQ platform */ static const struct
> > +soc_device_attribute qoriq_soc[] = { #ifdef CONFIG_PPC
> > +   /*
> > +    * Power Architecture-based SoCs T Series
> > +    */
> > +
> > +   /* SoC: T1024/T1014/T1023/T1013 Rev: 1.0 */
> > +   { .soc_id   = "svr:0x85400010,name:T1024,die:T1024",
> > +     .revision = "1.0",
> > +   },
> > +   { .soc_id   = "svr:0x85480010,name:T1024E,die:T1024",
> > +     .revision = "1.0",
> > +   },
> 
> Revision could be computed from the low 8 bits of SVR (just as you do for
> unknown SVRs).
>
 
[Lu Yangbo-B47093] Yes, you're right. Will remove it here.

> We could move the die name into .family:
> 
>   {
>   .soc_id = "svr:0x85490010,name:T1023E,",
>   .family = "QorIQ T1024",
>   }
> 
> I see you dropped svre (and the trailing comma), though I guess the vast
> majority of potential users will be looking at .family.  In which case do
> we even need name?  If we just make the soc_id be "svr:0x" then
> we could shrink the table to an svr+mask that identifies each die.  I'd
> still want to keep the "svr:" even if we're giving up on the general
> tagging system, to make it clear what the number refers to, and to
> provide some defense against users who match only against soc_id rather
> than soc_id+family.  Or we could go further and format soc_id as "QorIQ
> SVR 0x" so that soc_id-only matches are fully acceptable rather
> than just less dangerous.

[Lu Yangbo-B47093] It's a good idea to move die into .family I think.
In my opinion, it's better to keep svr and name in soc_id just like your 
suggestion above.
>   {
>   .soc_id = "svr:0x85490010,name:T1023E,",
>   .family = "QorIQ T1024",
>   }
The user probably don’t like to learn the svr value. What they want is just to 
match the soc they use.
It's convenient to use name+rev for them to match a soc.

Regarding shrinking the table, I think it's hard to use svr+mask. Because I 
find many platforms use different masks.
We couldn’t know the mask according svr value.

> 
> > +static const struct soc_device_attribute *fsl_soc_device_match(
> > +   unsigned int svr, const struct soc_device_attribute *matches) {
> > +   char svr_match[50];
> > +   int n;
> > +
> > +   n = sprintf(svr_match, "*%08x*", svr);
> 
> n = sprintf(svr_match, "svr:0x%08x,*", svr);
> 
> (according to the current encoding)
> 

[Lu Yangbo-B47093] Ok. Will do that.

> > +
> > +   do {
> > +   if (!matches->soc_id)
> > +   ret

RE: [v11, 7/8] base: soc: introduce soc_device_match() interface

2016-09-06 Thread Y.B. Lu
Hi Anrd and Uffe,

Thank you for your comment.
Please see my comment inline.



Best regards,
Yangbo Lu

> -Original Message-
> From: Arnd Bergmann [mailto:a...@arndb.de]
> Sent: Tuesday, September 06, 2016 8:46 PM
> To: Ulf Hansson
> Cc: Y.B. Lu; linux-mmc; Scott Wood; linuxppc-dev@lists.ozlabs.org;
> devicet...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> ker...@vger.kernel.org; linux-clk; linux-...@vger.kernel.org;
> io...@lists.linux-foundation.org; net...@vger.kernel.org; Mark Rutland;
> Rob Herring; Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil;
> Bhupesh Sharma; Qiang Zhao; Kumar Gala; Santosh Shilimkar; Leo Li; X.B.
> Xie
> Subject: Re: [v11, 7/8] base: soc: introduce soc_device_match() interface
> 
> On Tuesday, September 6, 2016 1:44:23 PM CEST Ulf Hansson wrote:
> > On 6 September 2016 at 10:28, Yangbo Lu <yangbo...@nxp.com> wrote:
> > > We keep running into cases where device drivers want to know the
> > > exact version of the a SoC they are currently running on. In the
> > > past, this has usually been done through a vendor specific API that
> > > can be called by a driver, or by directly accessing some kind of
> > > version register that is not part of the device itself but that
> > > belongs to a global register area of the chip.
> 
> Please add "From: Arnd Bergmann <a...@arndb.de>" as the first line, to
> preserve authorship. If you use "git send-email" or "git format-patch",
> that should happen automatically if the author field is set right (if not,
> use 'git commit --amend --author="Arnd Bergmann <a...@arndb.de>"'
> to fix it).
> 

[Lu Yangbo-B47093] Oh, I'm sorry for my careless. Will correct it in next 
version.

> > > +
> > > +/*
> > > + * soc_device_match - identify the SoC in the machine
> > > + * @matches: zero-terminated array of possible matches
> >
> > Perhaps also express the constraint on the matching entries. As you
> > need at least one of the ->machine(), ->family(), ->revision() or
> > ->soc_id() callbacks implemented, right!?
> 
> They are not callbacks, just strings. Having an empty entry indicates the
> end of the array, and this is not called.
> 
> > > + *
> > > + * returns the first matching entry of the argument array, or NULL
> > > + * if none of them match.
> > > + *
> > > + * This function is meant as a helper in place of of_match_node()
> > > + * in cases where either no device tree is available or the
> > > + information
> > > + * in a device node is insufficient to identify a particular
> > > + variant
> > > + * by its compatible strings or other properties. For new devices,
> > > + * the DT binding should always provide unique compatible strings
> > > + * that allow the use of of_match_node() instead.
> > > + *
> > > + * The calling function can use the .data entry of the
> > > + * soc_device_attribute to pass a structure or function pointer for
> > > + * each entry.
> >
> > I don't get the use case behind this, could you elaborate?
> >
> > Perhaps we should postpone adding the .data entry until we actually
> > see a need for it?
> 
> I think the interface is rather useless without a way to figure out which
> entry you got. Almost all users of of_match_node() actually use the
> returned ->data field, and I expect this to be the same here.
> 
> > > + */
> > > +const struct soc_device_attribute *soc_device_match(
> > > +   const struct soc_device_attribute *matches) {
> > > +   struct device *dev;
> > > +   int ret;
> > > +
> > > +   for (ret = 0; ret == 0; matches++) {
> >
> > This loop looks a bit weird and unsafe.
> 
> Ah, and I thought I was being clever ;-)
> 
> > 1) Perhaps using a while loop makes this more readable?
> > 2) As this is an exported API, I guess validation of the ->matches
> > pointer needs to be done before accessing it.
> 
> Sounds fine.

[Lu Yangbo-B47093] Ok, Will change this according to Uffe. 
And actually there is issue with this for() when I verified it again this 
morning.
We will get matches++ rather than matches which is correct finally :)

> 
> > > +   if (!(matches->machine || matches->family ||
> > > + matches->revision || matches->soc_id))
> > > +   return NULL;
> > > +   dev = NULL;
> >
> > There's no need to use a struct device just to assign it to NULL.
> > Instead just provide the function below with NULL.
> >
> > > +   ret = bus_for_each_dev(_bus_type, dev, (void
> *)matches,
> > > +  soc_device_match_one);
> 
> 
> I don't remember what led to this, I think you are right, we should just
> pass NULL as most other callers.

[Lu Yangbo-B47093] Will correct it. Thanks. :)

> 
> Thanks for the review.
> 
>   ARnd