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]
Message-ID: <DC88CAD03C0052499C1907B327FC63229EC5B4@DBDE04.ent.ti.com>
Date:	Tue, 18 Jun 2013 17:19:14 +0000
From:	"J, KEERTHY" <j-keerthy@...com>
To:	Stephen Warren <swarren@...dotorg.org>
CC:	"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
	"broonie@...nel.org" <broonie@...nel.org>,
	"ldewangan@...dia.com" <ldewangan@...dia.com>,
	"sameo@...ux.intel.com" <sameo@...ux.intel.com>,
	"grant.likely@...retlab.ca" <grant.likely@...retlab.ca>,
	"swarren@...dia.com" <swarren@...dia.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"gg@...mlogic.co.uk" <gg@...mlogic.co.uk>
Subject: RE: [PATCH v2 1/4] MFD: Palmas: Check if interrupts property exists
 and then only request irq



> -----Original Message-----
> From: Stephen Warren [mailto:swarren@...dotorg.org]
> Sent: Tuesday, June 18, 2013 10:38 PM
> To: J, KEERTHY
> Cc: linux-omap@...r.kernel.org; broonie@...nel.org;
> ldewangan@...dia.com; sameo@...ux.intel.com; grant.likely@...retlab.ca;
> swarren@...dia.com; linux-kernel@...r.kernel.org; linux-
> doc@...r.kernel.org; gg@...mlogic.co.uk
> Subject: Re: [PATCH v2 1/4] MFD: Palmas: Check if interrupts property
> exists and then only request irq
> 
> On 06/18/2013 10:54 AM, J, KEERTHY wrote:
> > Hi Stephen,
> >
> >> -----Original Message-----
> >> From: Stephen Warren [mailto:swarren@...dotorg.org]
> >> Sent: Tuesday, June 18, 2013 9:22 PM
> >> To: J, KEERTHY
> >> Cc: linux-omap@...r.kernel.org; broonie@...nel.org;
> >> ldewangan@...dia.com; sameo@...ux.intel.com;
> >> grant.likely@...retlab.ca; swarren@...dia.com;
> >> linux-kernel@...r.kernel.org; linux- doc@...r.kernel.org;
> >> gg@...mlogic.co.uk
> >> Subject: Re: [PATCH v2 1/4] MFD: Palmas: Check if interrupts
> property
> >> exists and then only request irq
> >>
> >> On 06/18/2013 04:01 AM, J Keerthy wrote:
> >>> Check if interrupts property exists and then only request irq.
> >>> On some boards INT line might not be connected to a valid irq line
> >>> on the application processor. Hence keeping a check before
> >>> requesting irq.
> >>
> >> When there is no interrupts property, surely i2c->irq == 0, which is
> >> an invalid IRQ, and hence there's no need to check this before
> >> copying the value?
> >
> > The intent here is NOT to request irq with 0 or Invalid IRQ.
> 
> Sure.
> 
> > The board File will not populate the interrupts entry if the INT line
> > is not Connected.
> 
> Do you mean the interrupts DT property won't be present if there is no
> interrupt. If so, sure.

Yes.

> 
> > Hence the patch checks for the 'interrupts' property.
> 
> That shouldn't be necessary; IIRC, the I2C core has already parsed the
> interrupts property if there was one, and if there wasn't, it has set
> i2c->irq to some invalid value already.
> 
> So, you simply need to check the value in i2c->irq, and don't need to
> look at the DT at all.

Instead of checking the Invalid irq value which most likely can be 0.
I am not sure.
I am explicitly checking if the interrupts property exists or not.

If not present then It throws out a warning. Either there is no
Valid INT line connection or the DeviceTree was not populated fully.

This additional piece of information is good to have in the driver
IMHO. Let me know if this is rational enough to have in the driver.

Regards,
Keerthy
--
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