Re: [PATCH] serial: sh-sci: Use platform_get_irq_optional() for optional interrupts

2019-10-03 Thread Stephen Boyd
Quoting Geert Uytterhoeven (2019-10-01 11:07:43)
> As platform_get_irq() now prints an error when the interrupt does not
> exist, scary warnings may be printed for optional interrupts:
> 
> sh-sci e655.serial: IRQ index 1 not found
> sh-sci e655.serial: IRQ index 2 not found
> sh-sci e655.serial: IRQ index 3 not found
> sh-sci e655.serial: IRQ index 4 not found
> sh-sci e655.serial: IRQ index 5 not found
> 
> Fix this by calling platform_get_irq_optional() instead for all but the
> first interrupts, which are optional.
> 
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to 
> platform_get_irq*()")
> Signed-off-by: Geert Uytterhoeven 
> ---

Reviewed-by: Stephen Boyd 



Re: [kbuild-all] Re: [PATCH] serial: sh-sci: Use platform_get_irq_optional() for optional interrupts

2019-10-02 Thread Chen, Rong A

Hi Geert,

Thanks for your clarification. we are on vacation this week, and we'll 
take a look asap.


Best Regards,
Rong Chen

On 10/2/2019 7:28 PM, Geert Uytterhoeven wrote:

Hi Kbuild test robot,

On Wed, Oct 2, 2019 at 11:53 AM kbuild test robot  wrote:

I love your patch! Yet something to improve:

[auto build test ERROR on tty/tty-testing]
[cannot apply to v5.4-rc1 next-20191001]

Strange, this patch applies to all of v5.4-rc1, tty/tty-testing, and
next-20191001?


url:
https://github.com/0day-ci/linux/commits/Geert-Uytterhoeven/serial-sh-sci-Use-platform_get_irq_optional-for-optional-interrupts/20191002-171547

Oh, this is still the old tty/tty-testing before it was rebased to v5.4-rc1,
i.e. still based on v5.3-rc4.  That explains the build failure.

That does not explain why you couldn't apply this patch to v5.4-rc1 and
next-20191001, though.


base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git 
tty-testing
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
 wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
 chmod +x ~/bin/make.cross
 # save the attached .config to linux build tree
 GCC_VERSION=7.4.0 make.cross ARCH=sparc64

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot 

All errors (new ones prefixed by >>):

drivers/tty/serial/sh-sci.c: In function 'sci_init_single':

drivers/tty/serial/sh-sci.c:2899:24: error: implicit declaration of function 
'platform_get_irq_optional'; did you mean 'platform_get_irq_byname'? 
[-Werror=implicit-function-declaration]

sci_port->irqs[i] = platform_get_irq_optional(dev, i);
^
platform_get_irq_byname
cc1: some warnings being treated as errors

FTR, not reproducible on sparc on v5.4-rc1, current tty/tty-testing, and
next-20191001.

Gr{oetje,eeting}s,

 Geert





Re: [PATCH] serial: sh-sci: Use platform_get_irq_optional() for optional interrupts

2019-10-02 Thread Geert Uytterhoeven
Hi Kbuild test robot,

On Wed, Oct 2, 2019 at 11:53 AM kbuild test robot  wrote:
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on tty/tty-testing]
> [cannot apply to v5.4-rc1 next-20191001]

Strange, this patch applies to all of v5.4-rc1, tty/tty-testing, and
next-20191001?

> url:
> https://github.com/0day-ci/linux/commits/Geert-Uytterhoeven/serial-sh-sci-Use-platform_get_irq_optional-for-optional-interrupts/20191002-171547

Oh, this is still the old tty/tty-testing before it was rebased to v5.4-rc1,
i.e. still based on v5.3-rc4.  That explains the build failure.

That does not explain why you couldn't apply this patch to v5.4-rc1 and
next-20191001, though.

> base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git 
> tty-testing
> config: sparc64-allmodconfig (attached as .config)
> compiler: sparc64-linux-gcc (GCC) 7.4.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=7.4.0 make.cross ARCH=sparc64
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot 
>
> All errors (new ones prefixed by >>):
>
>drivers/tty/serial/sh-sci.c: In function 'sci_init_single':
> >> drivers/tty/serial/sh-sci.c:2899:24: error: implicit declaration of 
> >> function 'platform_get_irq_optional'; did you mean 
> >> 'platform_get_irq_byname'? [-Werror=implicit-function-declaration]
>sci_port->irqs[i] = platform_get_irq_optional(dev, i);
>^
>platform_get_irq_byname
>cc1: some warnings being treated as errors

FTR, not reproducible on sparc on v5.4-rc1, current tty/tty-testing, and
next-20191001.

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Re: [PATCH] serial: sh-sci: Use platform_get_irq_optional() for optional interrupts

2019-10-02 Thread kbuild test robot
Hi Geert,

I love your patch! Yet something to improve:

[auto build test ERROR on tty/tty-testing]
[cannot apply to v5.4-rc1 next-20191001]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:
https://github.com/0day-ci/linux/commits/Geert-Uytterhoeven/serial-sh-sci-Use-platform_get_irq_optional-for-optional-interrupts/20191002-171547
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git 
tty-testing
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot 

All errors (new ones prefixed by >>):

   drivers/tty/serial/sh-sci.c: In function 'sci_init_single':
>> drivers/tty/serial/sh-sci.c:2899:24: error: implicit declaration of function 
>> 'platform_get_irq_optional'; did you mean 'platform_get_irq_byname'? 
>> [-Werror=implicit-function-declaration]
   sci_port->irqs[i] = platform_get_irq_optional(dev, i);
   ^
   platform_get_irq_byname
   cc1: some warnings being treated as errors

vim +2899 drivers/tty/serial/sh-sci.c

  2874  
  2875  static int sci_init_single(struct platform_device *dev,
  2876 struct sci_port *sci_port, unsigned int 
index,
  2877 const struct plat_sci_port *p, bool early)
  2878  {
  2879  struct uart_port *port = &sci_port->port;
  2880  const struct resource *res;
  2881  unsigned int i;
  2882  int ret;
  2883  
  2884  sci_port->cfg   = p;
  2885  
  2886  port->ops   = &sci_uart_ops;
  2887  port->iotype= UPIO_MEM;
  2888  port->line  = index;
  2889  
  2890  res = platform_get_resource(dev, IORESOURCE_MEM, 0);
  2891  if (res == NULL)
  2892  return -ENOMEM;
  2893  
  2894  port->mapbase = res->start;
  2895  sci_port->reg_size = resource_size(res);
  2896  
  2897  for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i) {
  2898  if (i)
> 2899  sci_port->irqs[i] = 
> platform_get_irq_optional(dev, i);
  2900  else
  2901  sci_port->irqs[i] = platform_get_irq(dev, i);
  2902  }
  2903  
  2904  /* The SCI generates several interrupts. They can be muxed 
together or
  2905   * connected to different interrupt lines. In the muxed case 
only one
  2906   * interrupt resource is specified as there is only one 
interrupt ID.
  2907   * In the non-muxed case, up to 6 interrupt signals might be 
generated
  2908   * from the SCI, however those signals might have their own 
individual
  2909   * interrupt ID numbers, or muxed together with another 
interrupt.
  2910   */
  2911  if (sci_port->irqs[0] < 0)
  2912  return -ENXIO;
  2913  
  2914  if (sci_port->irqs[1] < 0)
  2915  for (i = 1; i < ARRAY_SIZE(sci_port->irqs); i++)
  2916  sci_port->irqs[i] = sci_port->irqs[0];
  2917  
  2918  sci_port->params = sci_probe_regmap(p);
  2919  if (unlikely(sci_port->params == NULL))
  2920  return -EINVAL;
  2921  
  2922  switch (p->type) {
  2923  case PORT_SCIFB:
  2924  sci_port->rx_trigger = 48;
  2925  break;
  2926  case PORT_HSCIF:
  2927  sci_port->rx_trigger = 64;
  2928  break;
  2929  case PORT_SCIFA:
  2930  sci_port->rx_trigger = 32;
  2931  break;
  2932  case PORT_SCIF:
  2933  if (p->regtype == SCIx_SH7705_SCIF_REGTYPE)
  2934  /* RX triggering not implemented for this IP */
  2935  sci_port->rx_trigger = 1;
  2936  else
  2937  sci_port->rx_trigger = 8;
  2938  break;
  2939  default:
  2940  sci_port->rx_trigger = 1;
  2941  break;
  2942  }
  2943  
  2944  sci_port->rx_fifo_timeout = 0;
  2945  sci_port->hscif_tot = 0;
  2946  
  2947  /* SCIFA on sh7723 and sh7724 need a custom sampling rate that 
doesn't
  2948   * match the SoC datasheet, this should be investigated. Let 
platform
  2949   * data override the sampling rate for now.
  2950   */
  29

RE: [PATCH] serial: sh-sci: Use platform_get_irq_optional() for optional interrupts

2019-10-01 Thread Yoshihiro Shimoda
Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Wednesday, October 2, 2019 3:08 AM
> 
> As platform_get_irq() now prints an error when the interrupt does not
> exist, scary warnings may be printed for optional interrupts:
> 
> sh-sci e655.serial: IRQ index 1 not found
> sh-sci e655.serial: IRQ index 2 not found
> sh-sci e655.serial: IRQ index 3 not found
> sh-sci e655.serial: IRQ index 4 not found
> sh-sci e655.serial: IRQ index 5 not found
> 
> Fix this by calling platform_get_irq_optional() instead for all but the
> first interrupts, which are optional.
> 
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to 
> platform_get_irq*()")
> Signed-off-by: Geert Uytterhoeven 
> ---
> This is a fix for v5.4-rc1.

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda 

And, I tested this patch on R-Car H3. So,

Tested-by: Yoshihiro Shimoda 

Best regards,
Yoshihiro Shimoda