GPIO fixes for the v4.14 series:

- Three Kconfig/build warning fixes.
 
 - A fix for lost edge IRQs in the OMAP driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJZ3cfMAAoJEEEQszewGV1zaewP/0c0CGNHzk111V6lDd56wA9L
 Y4oCeAQAxcTtmSaZfVyxBazS2S6r/mSqD5rw3Ji5sjtFu7NzE322bJgzS51Fd4VR
 hoNGkok3AO+QyUXHrkEBjv4S54+AO4kNs0sSes1/kTDGocwm3hGrKBJe5frM+Drf
 zLo1EiDUg9a30tzwEWrDB4auWRXTuMocGNwwqnyFWkXq1Q4Fe6msAsUiF7KTh6Y0
 iE/hkYNIHX65QN2Pln6xEKdqxJWHuiXT82mUC1s6b2OeL7LVwuDJ+Kadzn4gTSOj
 ZGQEYvMTo1/u54paOqZljSkOn4cm+HH1j/4lZ/KMOAFCpgfTMpf76Eu5ArUODfcs
 roulpmZFHBwq854u4Z5L2v7T3lnfW3qurS1G93F0A4RDTHBA+SJUeWBdr1SSpjFY
 Uzwy6L/RV6/BMZorfvam1RUhLfopU2MUQN1Kg4brMz/GFkq+X+93x6i/sVlChyO+
 JbR4eJJIQuoji78QdxHAbD+2sIr4q3zlAi83koMdYn388YdgVFiBY/D84LmC4W++
 LKRD2/gJFHmW8TVuG8rt4xW2OvLWxIWhRc7s0TJlG0EQ5tS8fam5lTpqcEDHW/PD
 1Q25WeRc0z22m1W/ZIL8NKzsXO+xt4NyHp2Lp+iQOANLlDG5N2IRndLbWuAGXlLh
 M+vAz6HY3nUsKLCHF/3Z
 =3jQF
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "Here are some smallish GPIO fixes for v4.14. Like with pin control:
  some build/Kconfig noise and one serious bug in a specific driver.

   - Three Kconfig/build warning fixes

   - A fix for lost edge IRQs in the OMAP driver"

* tag 'gpio-v4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: omap: Fix lost edge interrupts
  gpio: omap: omap_gpio_show_rev is not __init
  gpio: acpi: work around false-positive -Wstring-overflow warning
  gpio: thunderx: select IRQ_DOMAIN_HIERARCHY instead of depends on
This commit is contained in:
Linus Torvalds 2017-10-11 09:16:38 -07:00
commit a0db28909e
3 changed files with 17 additions and 12 deletions

View File

@ -453,7 +453,8 @@ config GPIO_TS4800
config GPIO_THUNDERX
tristate "Cavium ThunderX/OCTEON-TX GPIO"
depends on ARCH_THUNDER || (64BIT && COMPILE_TEST)
depends on PCI_MSI && IRQ_DOMAIN_HIERARCHY
depends on PCI_MSI
select IRQ_DOMAIN_HIERARCHY
select IRQ_FASTEOI_HIERARCHY_HANDLERS
help
Say yes here to support the on-chip GPIO lines on the ThunderX

View File

@ -518,7 +518,13 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
irq_set_handler_locked(d, handle_level_irq);
else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
irq_set_handler_locked(d, handle_edge_irq);
/*
* Edge IRQs are already cleared/acked in irq_handler and
* not need to be masked, as result handle_edge_irq()
* logic is excessed here and may cause lose of interrupts.
* So just use handle_simple_irq.
*/
irq_set_handler_locked(d, handle_simple_irq);
return 0;
@ -678,7 +684,7 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
static irqreturn_t omap_gpio_irq_handler(int irq, void *gpiobank)
{
void __iomem *isr_reg = NULL;
u32 isr;
u32 enabled, isr, level_mask;
unsigned int bit;
struct gpio_bank *bank = gpiobank;
unsigned long wa_lock_flags;
@ -691,23 +697,21 @@ static irqreturn_t omap_gpio_irq_handler(int irq, void *gpiobank)
pm_runtime_get_sync(bank->chip.parent);
while (1) {
u32 isr_saved, level_mask = 0;
u32 enabled;
raw_spin_lock_irqsave(&bank->lock, lock_flags);
enabled = omap_get_gpio_irqbank_mask(bank);
isr_saved = isr = readl_relaxed(isr_reg) & enabled;
isr = readl_relaxed(isr_reg) & enabled;
if (bank->level_mask)
level_mask = bank->level_mask & enabled;
else
level_mask = 0;
/* clear edge sensitive interrupts before handler(s) are
called so that we don't miss any interrupt occurred while
executing them */
omap_disable_gpio_irqbank(bank, isr_saved & ~level_mask);
omap_clear_gpio_irqbank(bank, isr_saved & ~level_mask);
omap_enable_gpio_irqbank(bank, isr_saved & ~level_mask);
if (isr & ~level_mask)
omap_clear_gpio_irqbank(bank, isr & ~level_mask);
raw_spin_unlock_irqrestore(&bank->lock, lock_flags);
@ -1010,7 +1014,7 @@ static void omap_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
/*---------------------------------------------------------------------*/
static void __init omap_gpio_show_rev(struct gpio_bank *bank)
static void omap_gpio_show_rev(struct gpio_bank *bank)
{
static bool called;
u32 rev;

View File

@ -203,7 +203,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
if (pin <= 255) {
char ev_name[5];
sprintf(ev_name, "_%c%02X",
sprintf(ev_name, "_%c%02hhX",
agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',
pin);
if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))