Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094AbZK0Pri (ORCPT ); Fri, 27 Nov 2009 10:47:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751818AbZK0Prh (ORCPT ); Fri, 27 Nov 2009 10:47:37 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:38678 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814AbZK0Prg (ORCPT ); Fri, 27 Nov 2009 10:47:36 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ct/Wh3ZM5icjmH7d5H8ChEMefT4eTSqo0YeIz5zHIY0Dc3L20RNystfgIzkT82WN10 bdxzgcPFat/YLhEswzmsLCpGqStvShVZUDcVn5+lMHhDr6KkDu93cQuYniRFN9X9dGPX kNrgw1G6jtpd8M5w0cSkvVX8t/7xFqKG/ckAw= MIME-Version: 1.0 In-Reply-To: <20091127145426.GA6135@oksana.dev.rtsoft.ru> References: <1259333060-24277-1-git-send-email-notasas@gmail.com> <20091127145426.GA6135@oksana.dev.rtsoft.ru> Date: Fri, 27 Nov 2009 17:47:40 +0200 Message-ID: <6ed0b2680911270747k4bd5610eg1e0ef83c41622bba@mail.gmail.com> Subject: Re: [PATCH] power_supply: Add driver for TWL4030/TPS65950 BCI charger From: Grazvydas Ignotas To: avorontsov@ru.mvista.com Cc: linux-kernel@vger.kernel.org, Madhusudhan Chikkature , linux-omap@vger.kernel.org Content-Type: multipart/mixed; boundary=0016e6d7e89a3fe75d04795c366c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 20317 Lines: 302 --0016e6d7e89a3fe75d04795c366c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Nov 27, 2009 at 4:54 PM, Anton Vorontsov wrote: > On Fri, Nov 27, 2009 at 04:44:20PM +0200, Grazvydas Ignotas wrote: >> TWL4030/TPS65950 is a multi-function device with integrated charger, >> which allows charging from AC or USB. This driver enables the >> charger and provides several monitoring functions. >> >> Signed-off-by: Grazvydas Ignotas >> --- > > Thanks for the patch. > > [...] >> +/* >> + * Attend to TWL4030 CHG_PRES (AC charger presence) events >> + */ >> +static irqreturn_t twl4030_charger_interrupt(int irq, void *_di) >> +{ >> + =A0 =A0 struct twl4030_bci_device_info *di =3D _di; >> + >> +#ifdef CONFIG_LOCKDEP >> + =A0 =A0 /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which >> + =A0 =A0 =A0* we don't want and can't tolerate. =A0Although it might be >> + =A0 =A0 =A0* friendlier not to borrow this thread context... >> + =A0 =A0 =A0*/ >> + =A0 =A0 local_irq_enable(); >> +#endif > > Can you explain why the driver can't tolerate disabled irqs? > Calling schedule_delayed_work() from an irq context should be OK. Ah, this is leftover from TI code this driver is based on, which used to do more things directly in interrupt handler. So I guess it can be removed, updated patch attached. > >> + =A0 =A0 schedule_delayed_work(&di->bat_work, msecs_to_jiffies(BCI_DELA= Y)); >> + >> + =A0 =A0 return IRQ_HANDLED; >> +} > > -- > Anton Vorontsov > email: cbouatmailru@gmail.com > irc://irc.freenode.net/bd2 > --0016e6d7e89a3fe75d04795c366c Content-Type: text/x-diff; charset=UTF-8; name="0001-power_supply-Add-driver-for-TWL4030-TPS65950-BCI-cha.patch" Content-Disposition: attachment; filename="0001-power_supply-Add-driver-for-TWL4030-TPS65950-BCI-cha.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g2j4nl0b0 RnJvbSAzMjU1MzQ1YmU3YTY1N2JjZGVmMDI0ZDMyOWI5MjNkYzJiNjRiMGE1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBHcmF6dnlkYXMgSWdub3RhcyA8bm90YXNhc0BnbWFpbC5jb20+ CkRhdGU6IEZyaSwgMjcgTm92IDIwMDkgMTc6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sNDAzMF9iY2lfZHJpdmVyKTsK K30KK21vZHVsZV9pbml0KHR3bDQwMzBfYmNpX2luaXQpOworCitzdGF0aWMgdm9pZCBfX2V4aXQg dHdsNDAzMF9iY2lfZXhpdCh2b2lkKQoreworCXBsYXRmb3JtX2RyaXZlcl91bnJlZ2lzdGVyKCZ0 d2w0MDMwX2JjaV9kcml2ZXIpOworfQorbW9kdWxlX2V4aXQodHdsNDAzMF9iY2lfZXhpdCk7CisK K01PRFVMRV9BVVRIT1IoIkdyYcW+dnlkYXMgSWdub3RhcyIpOworTU9EVUxFX0RFU0NSSVBUSU9O KCJUV0w0MDMwIEJhdHRlcnkgQ2hhcmdlciBJbnRlcmZhY2UgZHJpdmVyIik7CitNT0RVTEVfTElD RU5TRSgiR1BMIik7CitNT0RVTEVfQUxJQVMoInBsYXRmb3JtOnR3bDQwMzBfYmNpIik7Ci0tIAox LjYuMy4zCgo= --0016e6d7e89a3fe75d04795c366c-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/