<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpio, branch v4.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-04-30T11:51:59Z</updated>
<entry>
<title>gpiolib-acpi: Duplicate con_id string when adding it to the crs lookup list</title>
<updated>2016-04-30T11:51:59Z</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2016-04-25T13:01:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7df89e92a56a3d2c8f84aa76c61471e4a7bc24f9'/>
<id>urn:sha1:7df89e92a56a3d2c8f84aa76c61471e4a7bc24f9</id>
<content type='text'>
Calling gpiod_get() from a module and then unloading the module leads to an
oops due to acpi_can_fallback_to_crs() storing the pointer to the passed
'con_id' string onto acpi_crs_lookup_list. The next guy to come along will then
try to access the string but the memory may now be gone with the module.
Make a copy of the passed string instead, and store the copy on the list.

BUG: unable to handle kernel paging request at ffffffffa03e7855
IP: [&lt;ffffffff81338322&gt;] strcmp+0x12/0x30
PGD 2a07067 PUD 2a08063 PMD 74720067 PTE 0
Oops: 0000 [#1] PREEMPT SMP
Modules linked in: i915(+) drm_kms_helper drm intel_gtt snd_hda_codec snd_hda_core i2c_algo_bit syscopya
rea sysfillrect sysimgblt fb_sys_fops agpgart snd_soc_sst_bytcr_rt5640 coretemp hwmon intel_rapl intel_soc_dts_thermal
punit_atom_debug snd_soc_rt5640 snd_soc_rl6231 serio snd_intel_sst_acpi snd_intel_sst_core video snd_soc_sst_mfld_platf
orm snd_soc_sst_match backlight int3402_thermal processor_thermal_device int3403_thermal int3400_thermal acpi_thermal_r
el snd_soc_core intel_soc_dts_iosf int340x_thermal_zone snd_compress i2c_hid hid snd_pcm snd_timer snd soundcore evdev
sch_fq_codel efivarfs ipv6 autofs4 [last unloaded: drm]
CPU: 2 PID: 3064 Comm: modprobe Tainted: G     U  W       4.6.0-rc3-ffrd-ipvr+ #302
Hardware name: Intel Corp. VALLEYVIEW C0 PLATFORM/BYT-T FFD8, BIOS BLAKFF81.X64.0088.R10.1403240443 FFD8
_X64_R_2014_13_1_00 03/24/2014
task: ffff8800701cd200 ti: ffff880070034000 task.ti: ffff880070034000
RIP: 0010:[&lt;ffffffff81338322&gt;]  [&lt;ffffffff81338322&gt;] strcmp+0x12/0x30
RSP: 0000:ffff880070037748  EFLAGS: 00010286
RAX: 0000000080000000 RBX: ffff88007a342800 RCX: 0000000000000006
RDX: 0000000000000006 RSI: ffffffffa054f856 RDI: ffffffffa03e7856
RBP: ffff880070037748 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffa054f855
R13: ffff88007281cae0 R14: 0000000000000010 R15: ffffffffffffffea
FS:  00007faa51447700(0000) GS:ffff880079300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffa03e7855 CR3: 0000000041eba000 CR4: 00000000001006e0
Stack:
 ffff880070037770 ffffffff8136ad28 ffffffffa054f855 0000000000000000
 ffff88007a0a2098 ffff8800700377e8 ffffffff8136852e ffff88007a342800
 00000007700377a0 ffff8800700377a0 ffffffff81412442 70672d6c656e6170
Call Trace:
 [&lt;ffffffff8136ad28&gt;] acpi_can_fallback_to_crs+0x88/0x100
 [&lt;ffffffff8136852e&gt;] gpiod_get_index+0x25e/0x310
 [&lt;ffffffff81412442&gt;] ? mipi_dsi_attach+0x22/0x30
 [&lt;ffffffff813685f2&gt;] gpiod_get+0x12/0x20
 [&lt;ffffffffa04fcf41&gt;] intel_dsi_init+0x421/0x480 [i915]
 [&lt;ffffffffa04d3783&gt;] intel_modeset_init+0x853/0x16b0 [i915]
 [&lt;ffffffffa0504864&gt;] ? intel_setup_gmbus+0x214/0x260 [i915]
 [&lt;ffffffffa0510158&gt;] i915_driver_load+0xdc8/0x19b0 [i915]
 [&lt;ffffffff8160fb53&gt;] ? _raw_spin_unlock_irqrestore+0x43/0x70
 [&lt;ffffffffa026b13b&gt;] drm_dev_register+0xab/0xc0 [drm]
 [&lt;ffffffffa026d7b3&gt;] drm_get_pci_dev+0x93/0x1f0 [drm]
 [&lt;ffffffff8160fb53&gt;] ? _raw_spin_unlock_irqrestore+0x43/0x70
 [&lt;ffffffffa043f1f4&gt;] i915_pci_probe+0x34/0x50 [i915]
 [&lt;ffffffff81379751&gt;] pci_device_probe+0x91/0x100
 [&lt;ffffffff8141a75a&gt;] driver_probe_device+0x20a/0x2d0
 [&lt;ffffffff8141a8be&gt;] __driver_attach+0x9e/0xb0
 [&lt;ffffffff8141a820&gt;] ? driver_probe_device+0x2d0/0x2d0
 [&lt;ffffffff81418439&gt;] bus_for_each_dev+0x69/0xa0
 [&lt;ffffffff8141a04e&gt;] driver_attach+0x1e/0x20
 [&lt;ffffffff81419c20&gt;] bus_add_driver+0x1c0/0x240
 [&lt;ffffffff8141b6d0&gt;] driver_register+0x60/0xe0
 [&lt;ffffffff81377d20&gt;] __pci_register_driver+0x60/0x70
 [&lt;ffffffffa026d9f4&gt;] drm_pci_init+0xe4/0x110 [drm]
 [&lt;ffffffff810ce04e&gt;] ? trace_hardirqs_on+0xe/0x10
 [&lt;ffffffffa02f1000&gt;] ? 0xffffffffa02f1000
 [&lt;ffffffffa02f1094&gt;] i915_init+0x94/0x9b [i915]
 [&lt;ffffffff810003bb&gt;] do_one_initcall+0x8b/0x1c0
 [&lt;ffffffff810eb616&gt;] ? rcu_read_lock_sched_held+0x86/0x90
 [&lt;ffffffff811de6d6&gt;] ? kmem_cache_alloc_trace+0x1f6/0x270
 [&lt;ffffffff81183826&gt;] do_init_module+0x60/0x1dc
 [&lt;ffffffff81115a8d&gt;] load_module+0x1d0d/0x2390
 [&lt;ffffffff811120b0&gt;] ? __symbol_put+0x70/0x70
 [&lt;ffffffff811f41b2&gt;] ? kernel_read_file+0x92/0x120
 [&lt;ffffffff811162f4&gt;] SYSC_finit_module+0xa4/0xb0
 [&lt;ffffffff8111631e&gt;] SyS_finit_module+0xe/0x10
 [&lt;ffffffff81001ff3&gt;] do_syscall_64+0x63/0x350
 [&lt;ffffffff816103da&gt;] entry_SYSCALL64_slow_path+0x25/0x25
Code: f7 48 8d 76 01 48 8d 52 01 0f b6 4e ff 84 c9 88 4a ff 75 ed 5d c3 0f 1f 00 55 48 89 e5 eb 04 84 c0
 74 18 48 8d 7f 01 48 8d 76 01 &lt;0f&gt; b6 47 ff 3a 46 ff 74 eb 19 c0 83 c8 01 5d c3 31 c0 5d c3 66
RIP  [&lt;ffffffff81338322&gt;] strcmp+0x12/0x30
 RSP &lt;ffff880070037748&gt;
CR2: ffffffffa03e7855

v2: Make the copied con_id const

Cc: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Cc: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Cc: Alexandre Courbot &lt;gnurou@gmail.com&gt;
Cc: stable@vger.kernel.org
Fixes: 10cf4899f8af ("gpiolib: tighten up ACPI legacy gpio lookups")
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Acked-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Reviewed-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>Revert "gpio: rcar: Fine-grained Runtime PM support"</title>
<updated>2016-04-12T08:05:22Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2016-04-12T08:05:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce0e2c60e69e5f87ab4ac10c935d8bd85d4d11f7'/>
<id>urn:sha1:ce0e2c60e69e5f87ab4ac10c935d8bd85d4d11f7</id>
<content type='text'>
This reverts commit 65194cb174b873448b208eb6e04ecb72237af76e.
</content>
</entry>
<entry>
<title>Revert "gpio: rcar: Add Runtime PM handling for interrupts"</title>
<updated>2016-04-12T08:00:34Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2016-04-12T08:00:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=42c25013ca95ce79b4ed192188ca843ae48f8c71'/>
<id>urn:sha1:42c25013ca95ce79b4ed192188ca843ae48f8c71</id>
<content type='text'>
This reverts commit b26a719bdba9aa926ceaadecc66e07623d2b8a53.
</content>
</entry>
<entry>
<title>gpio: pca953x: Use correct u16 value for register word write</title>
<updated>2016-04-08T09:49:47Z</updated>
<author>
<name>Yong Li</name>
<email>sdliyong@gmail.com</email>
</author>
<published>2016-03-30T06:49:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9b8e3ec34318663affced3c14d960e78d760dd9a'/>
<id>urn:sha1:9b8e3ec34318663affced3c14d960e78d760dd9a</id>
<content type='text'>
The current implementation only uses the first byte in val,
the second byte is always 0. Change it to use cpu_to_le16
to write the two bytes into the register

Cc: stable@vger.kernel.org
Signed-off-by: Yong Li &lt;sdliyong@gmail.com&gt;
Reviewed-by: Phil Reid &lt;preid@electromag.com.au&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: Defer gpio device setup until after gpiolib initialization</title>
<updated>2016-04-08T08:10:09Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-03-31T15:11:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=159f3cd92f17c61a4e2a47456de5865b114ef88e'/>
<id>urn:sha1:159f3cd92f17c61a4e2a47456de5865b114ef88e</id>
<content type='text'>
Since commit ff2b13592299 ("gpio: make the gpiochip a real device"),
attempts to add a gpio chip prior to gpiolib initialization cause
the system to crash. This happens because gpio_bus_type has not been
registered yet. Defer creating gpio devices until after gpiolib has
been initialized to fix the problem.

Cc: Greg Ungerer &lt;gerg@uclinux.org&gt;
Cc: Alexandre Courbot &lt;gnurou@gmail.com&gt;
Fixes: ff2b13592299 ("gpio: make the gpiochip a real device")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: Do not use devm functions when registering gpio chip</title>
<updated>2016-04-08T08:10:09Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-03-31T15:11:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=476e2fc5cd430bbe17598833e79f8e8b9e4bbbc7'/>
<id>urn:sha1:476e2fc5cd430bbe17598833e79f8e8b9e4bbbc7</id>
<content type='text'>
It is possible that a gpio chip is registered before the gpiolib
initialization code has run. This means we can not use devm_ functions
to allocate memory at that time. Do it the old fashioned way.

Cc: Alexandre Courbot &lt;gnurou@gmail.com&gt;
Cc: Greg Ungerer &lt;gerg@uclinux.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: pxa: fix legacy non pinctrl aware builds</title>
<updated>2016-04-08T08:10:08Z</updated>
<author>
<name>Robert Jarzmik</name>
<email>robert.jarzmik@free.fr</email>
</author>
<published>2016-03-29T08:04:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c4e5ffb6f224c1a4a9eaad82b19645ec22d1b24f'/>
<id>urn:sha1:c4e5ffb6f224c1a4a9eaad82b19645ec22d1b24f</id>
<content type='text'>
In legacy pxa builds, ie. non device-tree and platform-data only builds,
pinctrl is not yet available. As a consequence, the pinctrl gpio
direction change function is a stub, returning always success.

In the current state, the gpio driver direction function believes the
pinctrl direction change was successful, and exits without actually
changing the gpio direction.

This patch changes the logic :
 - if the pinctrl direction function fails, gpio direction will report
   that failure
 - if the pinctrl direction function succeeds, gpio direction is changed
   by the gpio driver anyway.
   This is sub optimal in the pinctrl aware case, as the gpio direction
   will be changed twice: once by pinctrl function and another time by
   the gpio direction function.

Yet it should be acceptable in this form, as this is functional for all
pxa platforms (device-tree and platform-data), and moreover changing a
gpio direction is very very seldom, usually in machine initialization,
seldom in drivers probe, and an exception for ac97 reset bug.

Fixes: a770d946371e ("gpio: pxa: add pin control gpio direction and request")
Reported-by: Guenter Roeck &lt;guenter@roeck-us.net&gt;
Tested-by: Guenter Roeck &lt;guenter@roeck-us.net&gt;
Signed-off-by: Robert Jarzmik &lt;robert.jarzmik@free.fr&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio / ACPI: ignore GpioInt() GPIOs when requesting GPIO_OUT_*</title>
<updated>2016-04-08T08:10:08Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@chromium.org</email>
</author>
<published>2016-03-24T17:50:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25487533ff311014b0cc39ed7fd721c114e1b11f'/>
<id>urn:sha1:25487533ff311014b0cc39ed7fd721c114e1b11f</id>
<content type='text'>
When firmware does not use _DSD properties that allow properly name GPIO
resources, the kernel falls back on parsing _CRS resources, and will
return entries described as GpioInt() as general purpose GPIOs even
though they are meant to be used simply as interrupt sources for the
device:

Device (ETSA)
{
	Name (_HID, "ELAN0001")
	...

	Method(_CRS, 0x0, NotSerialized)
	{
		Name(BUF0,ResourceTemplate ()
		{
			I2CSerialBus(
				0x10,                     /* SlaveAddress */
				ControllerInitiated,      /* SlaveMode */
				400000,                   /* ConnectionSpeed */
				AddressingMode7Bit,       /* AddressingMode */
				"\\_SB.I2C1",             /* ResourceSource */
			)
			GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,
				 "\\_SB.GPSW") { BOARD_TOUCH_GPIO_INDEX }
		} )
		Return (BUF0)
	}
...
}

This gives troubles with drivers such as Elan Touchscreen driver
(elants_i2c) that uses devm_gpiod_get to look up "reset" GPIO line and
decide whether the driver is responsible for powering up and resetting
the device, or firmware is. In the above case the lookup succeeds, we
map GPIO as output and later fail to request client-&gt;irq interrupt that
is mapped to the same GPIO.

Let's ignore resources described as GpioInt() while parsing _CRS when
requesting output GPIOs (but allow them when requesting GPIOD_ASIS or
GPIOD_IN as some drivers, such as i2c-hid, do request GPIO as input and
then map it to interrupt with gpiod_to_irq).

Acked-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@chromium.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: xgene: Prevent NULL pointer dereference</title>
<updated>2016-03-30T08:39:39Z</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@ingics.com</email>
</author>
<published>2016-03-21T12:03:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d8ee18cc707f498b6dad18915576f23b00bcff8'/>
<id>urn:sha1:8d8ee18cc707f498b6dad18915576f23b00bcff8</id>
<content type='text'>
platform_get_resource() can return NULL, thus add NULL test to prevent NULL
pointer dereference.

Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: menz127: Drop lock field from struct men_z127_gpio</title>
<updated>2016-03-30T08:39:39Z</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@ingics.com</email>
</author>
<published>2016-03-09T12:38:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fd975a7b180c9a8f6e02d2251eaabe9b0dcfeed6'/>
<id>urn:sha1:fd975a7b180c9a8f6e02d2251eaabe9b0dcfeed6</id>
<content type='text'>
Current code uses a uninitialized spin lock.
bgpio_init() already initialized a spin lock, so let's switch to use
&amp;gc-&gt;bgpio_lock instead and remove the lock from struct men_z127_gpio.

Fixes: f436bc2726c6 "gpio: add driver for MEN 16Z127 GPIO controller"
Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
