<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/pinctrl/pinctrl-single.c, branch v4.2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>pinctrl: single: ensure pcs irq will not be forced threaded</title>
<updated>2015-07-20T09:01:52+00:00</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2015-07-06T15:13:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c10372e615b8f790d30cbfcf59e43908ca42bf1a'/>
<id>c10372e615b8f790d30cbfcf59e43908ca42bf1a</id>
<content type='text'>
The PSC IRQ is requested using request_irq() API and as result it can
be forced to be threaded IRQ in RT-Kernel if PCS_QUIRK_HAS_SHARED_IRQ
is enabled for pinctrl domain.

As result, following 'possible irq lock inversion dependency' report
can be seen:
=========================================================
[ INFO: possible irq lock inversion dependency detected ]
3.14.43-rt42-00360-g96ff499-dirty #24 Not tainted
---------------------------------------------------------
irq/369-pinctrl/927 just changed the state of lock:
 (&amp;pcs-&gt;lock){+.....}, at: [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
but this lock was taken by another, HARDIRQ-safe lock in the past:
 (&amp;irq_desc_lock_class){-.....}

and interrupts could create inverse lock ordering between them.

other info that might help us debug this:
 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;pcs-&gt;lock);
                               local_irq_disable();
                               lock(&amp;irq_desc_lock_class);
                               lock(&amp;pcs-&gt;lock);
  &lt;Interrupt&gt;
    lock(&amp;irq_desc_lock_class);

 *** DEADLOCK ***

no locks held by irq/369-pinctrl/927.

the shortest dependencies between 2nd lock and 1st lock:
  -&gt; (&amp;irq_desc_lock_class){-.....} ops: 58724 {
     IN-HARDIRQ-W at:
                       [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                       [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
                       [&lt;c009edac&gt;] handle_fasteoi_irq+0x24/0x15c
                       [&lt;c009abb0&gt;] generic_handle_irq+0x3c/0x4c
                       [&lt;c000f83c&gt;] handle_IRQ+0x50/0xa0
                       [&lt;c0008674&gt;] gic_handle_irq+0x3c/0x6c
                       [&lt;c0707a04&gt;] __irq_svc+0x44/0x8c
                       [&lt;c000fc44&gt;] arch_cpu_idle+0x40/0x4c
                       [&lt;c009aadc&gt;] cpu_startup_entry+0x270/0x2e0
                       [&lt;c06fcbf8&gt;] rest_init+0xd4/0xe4
                       [&lt;c0a44bfc&gt;] start_kernel+0x3d0/0x3dc
                       [&lt;80008084&gt;] 0x80008084
     INITIAL USE at:
                      [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                      [&lt;c070674c&gt;] _raw_spin_lock_irqsave+0x54/0x68
                      [&lt;c009aff8&gt;] __irq_get_desc_lock+0x64/0xa4
                      [&lt;c009e38c&gt;] irq_set_chip+0x30/0x78
                      [&lt;c009ec30&gt;] irq_set_chip_and_handler_name+0x24/0x3c
                      [&lt;c036ca10&gt;] gic_irq_domain_map+0x48/0xb4
                      [&lt;c00a0a80&gt;] irq_domain_associate+0x84/0x1d4
                      [&lt;c00a1154&gt;] irq_create_mapping+0x80/0x11c
                      [&lt;c00a1270&gt;] irq_create_of_mapping+0x80/0x120
                      [&lt;c05cdaa8&gt;] irq_of_parse_and_map+0x34/0x3c
                      [&lt;c0a4ea24&gt;] omap_dm_timer_init_one+0x90/0x30c
                      [&lt;c0a4eef0&gt;] omap5_realtime_timer_init+0x8c/0x48c
                      [&lt;c0a486b0&gt;] time_init+0x28/0x38
                      [&lt;c0a44a6c&gt;] start_kernel+0x240/0x3dc
                      [&lt;80008084&gt;] 0x80008084
   }
   ... key      at: [&lt;c1049ce0&gt;] irq_desc_lock_class+0x0/0x8
   ... acquired at:
   [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
   [&lt;c0375a90&gt;] pcs_irq_unmask+0x58/0xa0
   [&lt;c009ea48&gt;] irq_enable+0x38/0x48
   [&lt;c009ead0&gt;] irq_startup+0x78/0x7c
   [&lt;c009d440&gt;] __setup_irq+0x4a8/0x4f4
   [&lt;c009d5dc&gt;] request_threaded_irq+0xb8/0x138
   [&lt;c0415a5c&gt;] omap_8250_startup+0x4c/0x148
   [&lt;c041276c&gt;] serial8250_startup+0x24/0x30
   [&lt;c040d0ec&gt;] uart_startup.part.9+0x5c/0x1b4
   [&lt;c040dbcc&gt;] uart_open+0xf4/0x16c
   [&lt;c03f0540&gt;] tty_open+0x170/0x61c
   [&lt;c0157028&gt;] chrdev_open+0xbc/0x1b4
   [&lt;c0150494&gt;] do_dentry_open+0x1e8/0x2bc
   [&lt;c0150a84&gt;] finish_open+0x44/0x5c
   [&lt;c0160d50&gt;] do_last.isra.47+0x710/0xca0
   [&lt;c01613a4&gt;] path_openat+0xc4/0x640
   [&lt;c0162904&gt;] do_filp_open+0x3c/0x98
   [&lt;c0151bdc&gt;] do_sys_open+0x114/0x1d8
   [&lt;c0151cc8&gt;] SyS_open+0x28/0x2c
   [&lt;c0a44d70&gt;] kernel_init_freeable+0x168/0x1e4
   [&lt;c06fcc24&gt;] kernel_init+0x1c/0xf8
   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20

-&gt; (&amp;pcs-&gt;lock){+.....} ops: 65 {
   HARDIRQ-ON-W at:
                    [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                    [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
                    [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
                    [&lt;c0375c5c&gt;] pcs_irq_handler+0x1c/0x28
                    [&lt;c009c458&gt;] irq_forced_thread_fn+0x30/0x74
                    [&lt;c009c784&gt;] irq_thread+0x158/0x1c4
                    [&lt;c0063fc4&gt;] kthread+0xd4/0xe8
                    [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20
   INITIAL USE at:
                   [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                   [&lt;c070674c&gt;] _raw_spin_lock_irqsave+0x54/0x68
                   [&lt;c0375344&gt;] pcs_enable+0x7c/0xe8
                   [&lt;c0372a44&gt;] pinmux_enable_setting+0x178/0x220
                   [&lt;c036fecc&gt;] pinctrl_select_state+0x110/0x194
                   [&lt;c04732dc&gt;] pinctrl_bind_pins+0x7c/0x108
                   [&lt;c045853c&gt;] driver_probe_device+0x70/0x254
                   [&lt;c0458810&gt;] __driver_attach+0x9c/0xa0
                   [&lt;c045674c&gt;] bus_for_each_dev+0x78/0xac
                   [&lt;c0458030&gt;] driver_attach+0x2c/0x30
                   [&lt;c0457c78&gt;] bus_add_driver+0x15c/0x204
                   [&lt;c0458ee0&gt;] driver_register+0x88/0x108
                   [&lt;c045a168&gt;] __platform_driver_register+0x64/0x6c
                   [&lt;c0a8170c&gt;] omap_hsmmc_driver_init+0x1c/0x20
                   [&lt;c0008a94&gt;] do_one_initcall+0x110/0x170
                   [&lt;c0a44d48&gt;] kernel_init_freeable+0x140/0x1e4
                   [&lt;c06fcc24&gt;] kernel_init+0x1c/0xf8
                   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20
 }
 ... key      at: [&lt;c1088a8c&gt;] __key.18572+0x0/0x8
 ... acquired at:
   [&lt;c008cdd4&gt;] mark_lock+0x388/0x76c
   [&lt;c008df40&gt;] __lock_acquire+0x6d0/0x1f98
   [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
   [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
   [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
   [&lt;c0375c5c&gt;] pcs_irq_handler+0x1c/0x28
   [&lt;c009c458&gt;] irq_forced_thread_fn+0x30/0x74
   [&lt;c009c784&gt;] irq_thread+0x158/0x1c4
   [&lt;c0063fc4&gt;] kthread+0xd4/0xe8
   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20

stack backtrace:
CPU: 1 PID: 927 Comm: irq/369-pinctrl Not tainted 3.14.43-rt42-00360-g96ff499-dirty #24
[&lt;c00177e0&gt;] (unwind_backtrace) from [&lt;c00130b0&gt;] (show_stack+0x20/0x24)
[&lt;c00130b0&gt;] (show_stack) from [&lt;c0702958&gt;] (dump_stack+0x84/0xd0)
[&lt;c0702958&gt;] (dump_stack) from [&lt;c008bcfc&gt;] (print_irq_inversion_bug+0x1d0/0x21c)
[&lt;c008bcfc&gt;] (print_irq_inversion_bug) from [&lt;c008bf18&gt;] (check_usage_backwards+0xb4/0x11c)
[&lt;c008bf18&gt;] (check_usage_backwards) from [&lt;c008cdd4&gt;] (mark_lock+0x388/0x76c)
[&lt;c008cdd4&gt;] (mark_lock) from [&lt;c008df40&gt;] (__lock_acquire+0x6d0/0x1f98)
[&lt;c008df40&gt;] (__lock_acquire) from [&lt;c0090040&gt;] (lock_acquire+0x9c/0x158)
[&lt;c0090040&gt;] (lock_acquire) from [&lt;c07065c8&gt;] (_raw_spin_lock+0x48/0x58)
[&lt;c07065c8&gt;] (_raw_spin_lock) from [&lt;c0375b54&gt;] (pcs_irq_handle+0x48/0x9c)
[&lt;c0375b54&gt;] (pcs_irq_handle) from [&lt;c0375c5c&gt;] (pcs_irq_handler+0x1c/0x28)
[&lt;c0375c5c&gt;] (pcs_irq_handler) from [&lt;c009c458&gt;] (irq_forced_thread_fn+0x30/0x74)
[&lt;c009c458&gt;] (irq_forced_thread_fn) from [&lt;c009c784&gt;] (irq_thread+0x158/0x1c4)
[&lt;c009c784&gt;] (irq_thread) from [&lt;c0063fc4&gt;] (kthread+0xd4/0xe8)
[&lt;c0063fc4&gt;] (kthread) from [&lt;c000eee8&gt;] (ret_from_fork+0x14/0x20)

To fix it use IRQF_NO_THREAD to ensure that pcs irq will not be forced threaded.

Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The PSC IRQ is requested using request_irq() API and as result it can
be forced to be threaded IRQ in RT-Kernel if PCS_QUIRK_HAS_SHARED_IRQ
is enabled for pinctrl domain.

As result, following 'possible irq lock inversion dependency' report
can be seen:
=========================================================
[ INFO: possible irq lock inversion dependency detected ]
3.14.43-rt42-00360-g96ff499-dirty #24 Not tainted
---------------------------------------------------------
irq/369-pinctrl/927 just changed the state of lock:
 (&amp;pcs-&gt;lock){+.....}, at: [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
but this lock was taken by another, HARDIRQ-safe lock in the past:
 (&amp;irq_desc_lock_class){-.....}

and interrupts could create inverse lock ordering between them.

other info that might help us debug this:
 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;pcs-&gt;lock);
                               local_irq_disable();
                               lock(&amp;irq_desc_lock_class);
                               lock(&amp;pcs-&gt;lock);
  &lt;Interrupt&gt;
    lock(&amp;irq_desc_lock_class);

 *** DEADLOCK ***

no locks held by irq/369-pinctrl/927.

the shortest dependencies between 2nd lock and 1st lock:
  -&gt; (&amp;irq_desc_lock_class){-.....} ops: 58724 {
     IN-HARDIRQ-W at:
                       [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                       [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
                       [&lt;c009edac&gt;] handle_fasteoi_irq+0x24/0x15c
                       [&lt;c009abb0&gt;] generic_handle_irq+0x3c/0x4c
                       [&lt;c000f83c&gt;] handle_IRQ+0x50/0xa0
                       [&lt;c0008674&gt;] gic_handle_irq+0x3c/0x6c
                       [&lt;c0707a04&gt;] __irq_svc+0x44/0x8c
                       [&lt;c000fc44&gt;] arch_cpu_idle+0x40/0x4c
                       [&lt;c009aadc&gt;] cpu_startup_entry+0x270/0x2e0
                       [&lt;c06fcbf8&gt;] rest_init+0xd4/0xe4
                       [&lt;c0a44bfc&gt;] start_kernel+0x3d0/0x3dc
                       [&lt;80008084&gt;] 0x80008084
     INITIAL USE at:
                      [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                      [&lt;c070674c&gt;] _raw_spin_lock_irqsave+0x54/0x68
                      [&lt;c009aff8&gt;] __irq_get_desc_lock+0x64/0xa4
                      [&lt;c009e38c&gt;] irq_set_chip+0x30/0x78
                      [&lt;c009ec30&gt;] irq_set_chip_and_handler_name+0x24/0x3c
                      [&lt;c036ca10&gt;] gic_irq_domain_map+0x48/0xb4
                      [&lt;c00a0a80&gt;] irq_domain_associate+0x84/0x1d4
                      [&lt;c00a1154&gt;] irq_create_mapping+0x80/0x11c
                      [&lt;c00a1270&gt;] irq_create_of_mapping+0x80/0x120
                      [&lt;c05cdaa8&gt;] irq_of_parse_and_map+0x34/0x3c
                      [&lt;c0a4ea24&gt;] omap_dm_timer_init_one+0x90/0x30c
                      [&lt;c0a4eef0&gt;] omap5_realtime_timer_init+0x8c/0x48c
                      [&lt;c0a486b0&gt;] time_init+0x28/0x38
                      [&lt;c0a44a6c&gt;] start_kernel+0x240/0x3dc
                      [&lt;80008084&gt;] 0x80008084
   }
   ... key      at: [&lt;c1049ce0&gt;] irq_desc_lock_class+0x0/0x8
   ... acquired at:
   [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
   [&lt;c0375a90&gt;] pcs_irq_unmask+0x58/0xa0
   [&lt;c009ea48&gt;] irq_enable+0x38/0x48
   [&lt;c009ead0&gt;] irq_startup+0x78/0x7c
   [&lt;c009d440&gt;] __setup_irq+0x4a8/0x4f4
   [&lt;c009d5dc&gt;] request_threaded_irq+0xb8/0x138
   [&lt;c0415a5c&gt;] omap_8250_startup+0x4c/0x148
   [&lt;c041276c&gt;] serial8250_startup+0x24/0x30
   [&lt;c040d0ec&gt;] uart_startup.part.9+0x5c/0x1b4
   [&lt;c040dbcc&gt;] uart_open+0xf4/0x16c
   [&lt;c03f0540&gt;] tty_open+0x170/0x61c
   [&lt;c0157028&gt;] chrdev_open+0xbc/0x1b4
   [&lt;c0150494&gt;] do_dentry_open+0x1e8/0x2bc
   [&lt;c0150a84&gt;] finish_open+0x44/0x5c
   [&lt;c0160d50&gt;] do_last.isra.47+0x710/0xca0
   [&lt;c01613a4&gt;] path_openat+0xc4/0x640
   [&lt;c0162904&gt;] do_filp_open+0x3c/0x98
   [&lt;c0151bdc&gt;] do_sys_open+0x114/0x1d8
   [&lt;c0151cc8&gt;] SyS_open+0x28/0x2c
   [&lt;c0a44d70&gt;] kernel_init_freeable+0x168/0x1e4
   [&lt;c06fcc24&gt;] kernel_init+0x1c/0xf8
   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20

-&gt; (&amp;pcs-&gt;lock){+.....} ops: 65 {
   HARDIRQ-ON-W at:
                    [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                    [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
                    [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
                    [&lt;c0375c5c&gt;] pcs_irq_handler+0x1c/0x28
                    [&lt;c009c458&gt;] irq_forced_thread_fn+0x30/0x74
                    [&lt;c009c784&gt;] irq_thread+0x158/0x1c4
                    [&lt;c0063fc4&gt;] kthread+0xd4/0xe8
                    [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20
   INITIAL USE at:
                   [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                   [&lt;c070674c&gt;] _raw_spin_lock_irqsave+0x54/0x68
                   [&lt;c0375344&gt;] pcs_enable+0x7c/0xe8
                   [&lt;c0372a44&gt;] pinmux_enable_setting+0x178/0x220
                   [&lt;c036fecc&gt;] pinctrl_select_state+0x110/0x194
                   [&lt;c04732dc&gt;] pinctrl_bind_pins+0x7c/0x108
                   [&lt;c045853c&gt;] driver_probe_device+0x70/0x254
                   [&lt;c0458810&gt;] __driver_attach+0x9c/0xa0
                   [&lt;c045674c&gt;] bus_for_each_dev+0x78/0xac
                   [&lt;c0458030&gt;] driver_attach+0x2c/0x30
                   [&lt;c0457c78&gt;] bus_add_driver+0x15c/0x204
                   [&lt;c0458ee0&gt;] driver_register+0x88/0x108
                   [&lt;c045a168&gt;] __platform_driver_register+0x64/0x6c
                   [&lt;c0a8170c&gt;] omap_hsmmc_driver_init+0x1c/0x20
                   [&lt;c0008a94&gt;] do_one_initcall+0x110/0x170
                   [&lt;c0a44d48&gt;] kernel_init_freeable+0x140/0x1e4
                   [&lt;c06fcc24&gt;] kernel_init+0x1c/0xf8
                   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20
 }
 ... key      at: [&lt;c1088a8c&gt;] __key.18572+0x0/0x8
 ... acquired at:
   [&lt;c008cdd4&gt;] mark_lock+0x388/0x76c
   [&lt;c008df40&gt;] __lock_acquire+0x6d0/0x1f98
   [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
   [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
   [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
   [&lt;c0375c5c&gt;] pcs_irq_handler+0x1c/0x28
   [&lt;c009c458&gt;] irq_forced_thread_fn+0x30/0x74
   [&lt;c009c784&gt;] irq_thread+0x158/0x1c4
   [&lt;c0063fc4&gt;] kthread+0xd4/0xe8
   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20

stack backtrace:
CPU: 1 PID: 927 Comm: irq/369-pinctrl Not tainted 3.14.43-rt42-00360-g96ff499-dirty #24
[&lt;c00177e0&gt;] (unwind_backtrace) from [&lt;c00130b0&gt;] (show_stack+0x20/0x24)
[&lt;c00130b0&gt;] (show_stack) from [&lt;c0702958&gt;] (dump_stack+0x84/0xd0)
[&lt;c0702958&gt;] (dump_stack) from [&lt;c008bcfc&gt;] (print_irq_inversion_bug+0x1d0/0x21c)
[&lt;c008bcfc&gt;] (print_irq_inversion_bug) from [&lt;c008bf18&gt;] (check_usage_backwards+0xb4/0x11c)
[&lt;c008bf18&gt;] (check_usage_backwards) from [&lt;c008cdd4&gt;] (mark_lock+0x388/0x76c)
[&lt;c008cdd4&gt;] (mark_lock) from [&lt;c008df40&gt;] (__lock_acquire+0x6d0/0x1f98)
[&lt;c008df40&gt;] (__lock_acquire) from [&lt;c0090040&gt;] (lock_acquire+0x9c/0x158)
[&lt;c0090040&gt;] (lock_acquire) from [&lt;c07065c8&gt;] (_raw_spin_lock+0x48/0x58)
[&lt;c07065c8&gt;] (_raw_spin_lock) from [&lt;c0375b54&gt;] (pcs_irq_handle+0x48/0x9c)
[&lt;c0375b54&gt;] (pcs_irq_handle) from [&lt;c0375c5c&gt;] (pcs_irq_handler+0x1c/0x28)
[&lt;c0375c5c&gt;] (pcs_irq_handler) from [&lt;c009c458&gt;] (irq_forced_thread_fn+0x30/0x74)
[&lt;c009c458&gt;] (irq_forced_thread_fn) from [&lt;c009c784&gt;] (irq_thread+0x158/0x1c4)
[&lt;c009c784&gt;] (irq_thread) from [&lt;c0063fc4&gt;] (kthread+0xd4/0xe8)
[&lt;c0063fc4&gt;] (kthread) from [&lt;c000eee8&gt;] (ret_from_fork+0x14/0x20)

To fix it use IRQF_NO_THREAD to ensure that pcs irq will not be forced threaded.

Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: make pinctrl_register() return proper error code</title>
<updated>2015-06-10T12:49:52+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2015-06-09T04:01:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=323de9efdf3e75d1dfb48003a52e59d6d9d4c7a5'/>
<id>323de9efdf3e75d1dfb48003a52e59d6d9d4c7a5</id>
<content type='text'>
Currently, pinctrl_register() just returns NULL on error, so the
callers can not know the exact reason of the failure.

Some of the pinctrl drivers return -EINVAL, some -ENODEV, and some
-ENOMEM on error of pinctrl_register(), although the error code
might be different from the real cause of the error.

This commit reworks pinctrl_register() to return the appropriate
error code and modifies all of the pinctrl drivers to use IS_ERR()
for the error checking and PTR_ERR() for getting the error code.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Acked-by: Thierry Reding &lt;treding@nvidia.com&gt;
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Tested-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Acked-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Acked-by: Sören Brinkmann &lt;soren.brinkmann@xilinx.com&gt;
Acked-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Ray Jui &lt;rjui@broadcom.com&gt;
Acked-by: Antoine Tenart &lt;antoine.tenart@free-electrons.com&gt;
Acked-by: Hongzhou Yang &lt;hongzhou.yang@mediatek.com&gt;
Acked-by: Wei Chen &lt;Wei.Chen@csr.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, pinctrl_register() just returns NULL on error, so the
callers can not know the exact reason of the failure.

Some of the pinctrl drivers return -EINVAL, some -ENODEV, and some
-ENOMEM on error of pinctrl_register(), although the error code
might be different from the real cause of the error.

This commit reworks pinctrl_register() to return the appropriate
error code and modifies all of the pinctrl drivers to use IS_ERR()
for the error checking and PTR_ERR() for getting the error code.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Acked-by: Thierry Reding &lt;treding@nvidia.com&gt;
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Tested-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Acked-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Acked-by: Sören Brinkmann &lt;soren.brinkmann@xilinx.com&gt;
Acked-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Ray Jui &lt;rjui@broadcom.com&gt;
Acked-by: Antoine Tenart &lt;antoine.tenart@free-electrons.com&gt;
Acked-by: Hongzhou Yang &lt;hongzhou.yang@mediatek.com&gt;
Acked-by: Wei Chen &lt;Wei.Chen@csr.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: single: Constify irq_domain_ops</title>
<updated>2015-05-06T13:32:45+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski.k@gmail.com</email>
</author>
<published>2015-04-27T12:54:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e5b609537616aae7effb6345c78f7a4f00201fd6'/>
<id>e5b609537616aae7effb6345c78f7a4f00201fd6</id>
<content type='text'>
The irq_domain_ops are not modified by the driver and the irqdomain core
code accepts pointer to a const data.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski.k@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The irq_domain_ops are not modified by the driver and the irqdomain core
code accepts pointer to a const data.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski.k@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: constify of_device_id array</title>
<updated>2015-03-27T08:58:35+00:00</updated>
<author>
<name>Fabian Frederick</name>
<email>fabf@skynet.be</email>
</author>
<published>2015-03-16T19:59:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=baa9946e32f9f26e740721c1f972de87c095baa9'/>
<id>baa9946e32f9f26e740721c1f972de87c095baa9</id>
<content type='text'>
of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Acked-by: Jean-Christophe PLAGNIOL-VILLARD &lt;plagnioj@jcrosoft.com&gt;
Acked-by: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Acked-by: Maxime Coquelin &lt;maxime.coquelin@st.com&gt;
Acked-by: Hongzhou Yang &lt;hongzhou.yang@mediatek.com&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Acked-by: Jean-Christophe PLAGNIOL-VILLARD &lt;plagnioj@jcrosoft.com&gt;
Acked-by: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Acked-by: Maxime Coquelin &lt;maxime.coquelin@st.com&gt;
Acked-by: Hongzhou Yang &lt;hongzhou.yang@mediatek.com&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: drop owner assignment from platform_drivers</title>
<updated>2014-10-20T14:21:21+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2014-10-20T14:21:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5c759d73b0228901d0e05e5f02402fb35f5d2263'/>
<id>5c759d73b0228901d0e05e5f02402fb35f5d2263</id>
<content type='text'>
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: single: fix freudian slip</title>
<updated>2014-09-05T08:33:25+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2014-09-05T07:53:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9e3a979f03b37b8502da6cfce8581e28375cf96f'/>
<id>9e3a979f03b37b8502da6cfce8581e28375cf96f</id>
<content type='text'>
commit 03e9f0cac5da6af85758276cb4624caf5911f2b9
"pinctrl: clean up after enable refactoring"
renamed the vtable callback .enable to .set_mux. The
renaming was done manually, and one of the alterations
contained a freudian slip. I confess, I am human.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 03e9f0cac5da6af85758276cb4624caf5911f2b9
"pinctrl: clean up after enable refactoring"
renamed the vtable callback .enable to .set_mux. The
renaming was done manually, and one of the alterations
contained a freudian slip. I confess, I am human.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: clean up after enable refactoring</title>
<updated>2014-09-04T08:05:07+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2014-09-03T11:02:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=03e9f0cac5da6af85758276cb4624caf5911f2b9'/>
<id>03e9f0cac5da6af85758276cb4624caf5911f2b9</id>
<content type='text'>
commit 2243a87d90b42eb38bc281957df3e57c712b5e56
"pinctrl: avoid duplicated calling enable_pinmux_setting for a pin"
removed the .disable callback from the struct pinmux_ops,
making the .enable() callback the only remaining callback.

However .enable() is a bad name as it seems to imply that a
muxing can also be disabled. Rename the callback to .set_mux()
and also take this opportunity to clean out any remaining
mentions of .disable() from the documentation.

Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Acked-by: Fan Wu &lt;fwu@marvell.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2243a87d90b42eb38bc281957df3e57c712b5e56
"pinctrl: avoid duplicated calling enable_pinmux_setting for a pin"
removed the .disable callback from the struct pinmux_ops,
making the .enable() callback the only remaining callback.

However .enable() is a bad name as it seems to imply that a
muxing can also be disabled. Rename the callback to .set_mux()
and also take this opportunity to clean out any remaining
mentions of .disable() from the documentation.

Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Acked-by: Fan Wu &lt;fwu@marvell.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: single: AM437x: Add pinctrl compatibility</title>
<updated>2014-08-29T07:28:35+00:00</updated>
<author>
<name>Keerthy</name>
<email>j-keerthy@ti.com</email>
</author>
<published>2014-08-22T14:01:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=aa2293d82c29309d8399d41941add7af606a4fea'/>
<id>aa2293d82c29309d8399d41941add7af606a4fea</id>
<content type='text'>
AM437x pinctrl definitions now differ from traditional 16 bit OMAP pin
ctrl definitions, in that all 32 bits are used to describe a single pin

Also the location of wakeupenable and event bits have changed.

Signed-off-by: Keerthy &lt;j-keerthy@ti.com&gt;
[nm@ti.com: minor updates]
Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
AM437x pinctrl definitions now differ from traditional 16 bit OMAP pin
ctrl definitions, in that all 32 bits are used to describe a single pin

Also the location of wakeupenable and event bits have changed.

Signed-off-by: Keerthy &lt;j-keerthy@ti.com&gt;
[nm@ti.com: minor updates]
Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: single: Add DRA7 pinctrl compatibility</title>
<updated>2014-08-29T07:27:44+00:00</updated>
<author>
<name>Nishanth Menon</name>
<email>nm@ti.com</email>
</author>
<published>2014-08-22T14:01:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=31320beaa3d3c5190e7db08144f37a2d519f6d6d'/>
<id>31320beaa3d3c5190e7db08144f37a2d519f6d6d</id>
<content type='text'>
DRA7 pinctrl definitions now differ from traditional 16 bit OMAP pin
ctrl definitions, in that all 32 bits are used to describe a single pin

Also the location of wakeupenable and event bits have changed.

Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
DRA7 pinctrl definitions now differ from traditional 16 bit OMAP pin
ctrl definitions, in that all 32 bits are used to describe a single pin

Also the location of wakeupenable and event bits have changed.

Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: pinctrl-single.c: Cleaning up wrong format string usage</title>
<updated>2014-07-11T12:08:35+00:00</updated>
<author>
<name>Rickard Strandqvist</name>
<email>rickard_strandqvist@spectrumdigital.se</email>
</author>
<published>2014-06-26T16:58:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bf4cef6c70258e1f771ebfe08558b77ad24700c2'/>
<id>bf4cef6c70258e1f771ebfe08558b77ad24700c2</id>
<content type='text'>
%d in format string used, but the type is unsigned int

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist &lt;rickard_strandqvist@spectrumdigital.se&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
%d in format string used, but the type is unsigned int

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist &lt;rickard_strandqvist@spectrumdigital.se&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
