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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Nov 2014 23:23:17 +0800
From:	Lyra Zhang <zhang.lyra@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Murali Karicheri <m-karicheri2@...com>,
	Chunyan Zhang <chunyan.zhang@...eadtrum.com>,
	Grant Likely <grant.likely@...aro.org>,
	"robh+dt@...nel.org" <robh+dt@...nel.org>,
	Catalin Marinas <catalin.marinas@....com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
	"jslaby@...e.cz" <jslaby@...e.cz>,
	Kumar Gala <galak@...eaurora.org>,
	Mark Rutland <mark.rutland@....com>,
	Pawel Moll <pawel.moll@....com>,
	Ramkumar Ramachandra <artagnon@...il.com>,
	"rrichter@...ium.com" <rrichter@...ium.com>,
	Will Deacon <will.deacon@....com>,
	"gnomes@...rguk.ukuu.org.uk" <gnomes@...rguk.ukuu.org.uk>,
	Jonathan Corbet <corbet@....net>,
	"jason@...edaemon.net" <jason@...edaemon.net>,
	Mark Brown <broonie@...nel.org>,
	Heiko Stübner <heiko@...ech.de>,
	"florian.vaussard@...l.ch" <florian.vaussard@...l.ch>,
	"andrew@...n.ch" <andrew@...n.ch>,
	Hayato Suzuki <hytszk@...il.com>,
	Orson Zhai <orsonzhai@...il.com>,
	"geng.ren@...eadtrum.com" <geng.ren@...eadtrum.com>,
	"zhizhou.zhang" <zhizhou.zhang@...eadtrum.com>,
	"lanqing.liu@...eadtrum.com" <lanqing.liu@...eadtrum.com>,
	Wei Qiao (乔伟) <wei.qiao@...eadtrum.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"sprdlinux@...elists.org" <sprdlinux@...elists.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
	"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>
Subject: Re: [PATCH v3 5/5] tty/serial: Add Spreadtrum sc9836-uart driver support

2014-11-27 20:57 GMT+08:00 Arnd Bergmann <arnd@...db.de>:
> On Thursday 27 November 2014 19:59:46 Lyra Zhang wrote:
>> 2014-11-27 2:29 GMT+08:00 Murali Karicheri <m-karicheri2@...com>:
>> > On 11/25/2014 07:16 AM, Chunyan Zhang wrote:
>> >>
>> >> Add a full sc9836-uart driver for SC9836 SoC which is based on the
>>
>> >> +#include<linux/clk.h>
>> >
>> > How about sorting this includes? asm/irq.h go first followed linux/ in
>> > alphabatical order?
>>
>> >> +static irqreturn_t sprd_handle_irq(int irq, void *dev_id)
>> >> +{
>> >> +       struct uart_port *port = (struct uart_port *)dev_id;
>> >> +       u32 ims;
>> >> +
>> >> +       ims = serial_in(port, SPRD_IMSR);
>> >> +
>> >> +       serial_out(port, SPRD_ICLR, ~0);
>> >> +
>> >> +       if (ims&  (SPRD_IMSR_RX_FIFO_FULL |
>> >> +               SPRD_IMSR_BREAK_DETECT | SPRD_IMSR_TIMEOUT)) {
>> >> +               sprd_rx(irq, port);
>> >> +       }
>> >> +       if (ims&  SPRD_IMSR_TX_FIFO_EMPTY)
>> >> +               sprd_tx(irq, port);
>> >> +
>> >> +       return IRQ_HANDLED;
>> >
>> > You are always returning IRQ_HANDLED and this is registered as a SHARED irq.
>> > Is there a chance this handler is called and the irq event doesn't
>> > belong to this device?
>> >
>> > Murali
>>
>> You are right, this is not a SHARED irq. I'll pass 0 for irqflags when
>> called 'devm_request_irq' in the next version patch.
>
> I think you could also add
>
>         if (!ims)
>                 return IRQ_NONE;
>
> which would make it work on shared interrupt lines.
>
>         Arnd

Yes, I saw this way in other serial drivers.
But, if then, there are two questions for me:
1. Why did some serial drivers need an UN_SHARED irq?
2. How can we choose a right way?

Thank you!

Best regards,
Chunyan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ