lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <59AFC126.30909@nxp.com>
Date:   Wed, 6 Sep 2017 09:34:31 +0000
From:   Laurentiu Tudor <laurentiu.tudor@....com>
To:     Michael Ellerman <mpe@...erman.id.au>,
        Gregory Fong <gregory.0xf0@...il.com>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: mpic IRQ_TYPE_BOTH handling



On 08/31/2017 01:52 AM, Michael Ellerman wrote:
> Hi Gregory,
>
> Gregory Fong <gregory.0xf0@...il.com> writes:
>> Hi all,
>>
>> In arch/powerpc/sysdev/mpic.c , it looks like IRQ_TYPE_EDGE_BOTH is
>> handled the same way as IRQ_TYPE_EDGE_FALLING:
>>
>> static unsigned int mpic_type_to_vecpri(struct mpic *mpic, unsigned int type)
>> {
>>          /* Now convert sense value */
>>          switch(type & IRQ_TYPE_SENSE_MASK) {
>>          case IRQ_TYPE_EDGE_RISING:
>>                  return MPIC_INFO(VECPRI_SENSE_EDGE) |
>>                         MPIC_INFO(VECPRI_POLARITY_POSITIVE);
>>          case IRQ_TYPE_EDGE_FALLING:
>>          case IRQ_TYPE_EDGE_BOTH:
>>                  return MPIC_INFO(VECPRI_SENSE_EDGE) |
>>                         MPIC_INFO(VECPRI_POLARITY_NEGATIVE);
>>          case IRQ_TYPE_LEVEL_HIGH:
>>                  return MPIC_INFO(VECPRI_SENSE_LEVEL) |
>>                         MPIC_INFO(VECPRI_POLARITY_POSITIVE);
>>          case IRQ_TYPE_LEVEL_LOW:
>>          default:
>>                  return MPIC_INFO(VECPRI_SENSE_LEVEL) |
>>                         MPIC_INFO(VECPRI_POLARITY_NEGATIVE);
>>          }
>> }
>>
>> If IRQ_TYPE_EDGE_BOTH is unsupported, shouldn't we be returning an
>> error, instead of silently setting to use IRQ_TYPE_EDGE_FALLING?
>> Something like the following (sorry if the diff wraps weirdly, on
>> webmail at the moment):
>
> I don't know this code so I asked Ben and he said something like
> "PowerMacs never use BOTH, so it hasn't mattered, but Freescale machines
> might".

IIRC, the mpic in freescale MPICs the interrupts are either low or high, 
so not both. There's a bit which controls the interrupt polarity which 
selects if the interrupt triggers on high-to-low or low-to-high.
So i guess it doesn't matter on freescale machines too.

---
Best Regards, Laurentiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ