From patchwork Wed Sep 18 08:20:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 2904911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A11A7BFF05 for ; Wed, 18 Sep 2013 08:21:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7C2B20204 for ; Wed, 18 Sep 2013 08:21:01 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6EDA9201FD for ; Wed, 18 Sep 2013 08:21:00 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VMD0B-0004KC-5b; Wed, 18 Sep 2013 08:20:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VMD08-0002gY-Ol; Wed, 18 Sep 2013 08:20:44 +0000 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VMD04-0002eF-Ug for linux-arm-kernel@lists.infradead.org; Wed, 18 Sep 2013 08:20:42 +0000 Received: by mail-ee0-f52.google.com with SMTP id c41so3297065eek.11 for ; Wed, 18 Sep 2013 01:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=x7oswqCTgTvd6Ir06Jf+HvKU7+4OPCvSPlCVp79UHyU=; b=SmO7glt639Ttg4emPIP+pWNr9DBD1gge8CmY2Ux6GdmO5irL2McN+QysUaMQNyK75g 1+0n39UAu3QnU8WTWfVU4RoDLGonoC+TUlUH8vZqmjIaYJPSaZlPMCqKCKI2x3/Pnrfv Mi9p2UU3jw6UBZ+tNL71UFyi3/1I02qcTYPcsE5x6bAwQN7wF07r8R+J5CWp5wQM5NQh yyIHM1/QroCn79a2uPEIR/PDN3OqzUnGP3jC81AMaWkeIvRc2yl9u1bGnabXOCiixAlt 5W3RpStt87TUpL8C+deNfGcp65OvtyWq+bDQLsOehebo05pPoibXOwvyEEd17tr523vw AaIw== X-Received: by 10.14.8.72 with SMTP id 48mr58273981eeq.25.1379492417432; Wed, 18 Sep 2013 01:20:17 -0700 (PDT) Received: from pali-elitebook.localnet ([2001:718:1e03:a01::1ca]) by mx.google.com with ESMTPSA id a43sm803631eep.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 01:20:16 -0700 (PDT) From: Pali =?utf-8?q?Roh=C3=A1r?= To: balbi@ti.com, Tony Lindgren , Anton Vorontsov , Russell King , David Woodhouse , "Greg Kroah-Hartman" , freemangordon@abv.bg, aaro.koskinen@iki.fi, pavel@ucw.cz Subject: Re: [PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed Date: Wed, 18 Sep 2013 10:20:14 +0200 User-Agent: KMail/1.13.7 (Linux/3.11.0-1+synaptics-generic; KDE/4.11.1; x86_64; ; ) References: <1378630239-10006-1-git-send-email-pali.rohar@gmail.com> <201309172128.42514@pali> <20130918014942.GD19817@radagast> In-Reply-To: <20130918014942.GD19817@radagast> MIME-Version: 1.0 Message-Id: <201309181020.15245@pali> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130918_042041_231845_2881DBE3 X-CRM114-Status: GOOD ( 34.46 ) X-Spam-Score: 1.6 (+) Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wednesday 18 September 2013 03:49:42 Felipe Balbi wrote: > On Tue, Sep 17, 2013 at 09:28:42PM +0200, Pali Rohár wrote: > > On Tuesday 17 September 2013 18:08:35 Felipe Balbi wrote: > > > On Tue, Sep 17, 2013 at 06:05:15PM +0200, Pali Rohár wrote: > > > > On Tuesday 17 September 2013 17:48:59 you wrote: > > > > > On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: > > > > > > More power supply drivers depends on vbus events and > > > > > > without it they not working. Power supply drivers > > > > > > using usb_register_notifier, so to deliver events > > > > > > it is needed to call atomic_notifier_call_chain. > > > > > > > > > > > > So without atomic notifier power supply driver > > > > > > isp1704 not retrieving vbus status and reporting > > > > > > bogus values to userspace and also to board > > > > > > platform data functions. Without proper data > > > > > > charger drivers trying to charge battery also when > > > > > > charger is disconnected or do not start charging > > > > > > when wallcharger connects. > > > > > > > > > > > > Atomic notifier in musb driver was used before v3.5 > > > > > > and was replaced with omap mailbox. This patch > > > > > > adding atomic_notifier_call_chain call from > > > > > > function omap_musb_set_mailbox. > > > > > > > > > > > > Signed-off-by: Pali Rohár > > > > > > --- > > > > > > > > > > > > drivers/usb/musb/omap2430.c | 3 +++ > > > > > > drivers/usb/phy/phy-twl4030-usb.c | 2 ++ > > > > > > 2 files changed, 5 insertions(+) > > > > > > > > > > > > diff --git a/drivers/usb/musb/omap2430.c > > > > > > b/drivers/usb/musb/omap2430.c index f44e8b5..5c40252 > > > > > > 100644 --- a/drivers/usb/musb/omap2430.c > > > > > > +++ b/drivers/usb/musb/omap2430.c > > > > > > @@ -305,6 +305,9 @@ static void > > > > > > omap_musb_set_mailbox(struct omap2430_glue *glue) > > > > > > > > > > > > default: > > > > > > dev_dbg(dev, "ID float\n"); > > > > > > > > > > > > } > > > > > > > > > > > > + > > > > > > + atomic_notifier_call_chain(&musb->xceiv->notifier, > > > > > > + musb->xceiv->last_event, NULL); > > > > > > > > > > let's add a wrapper for this: > > > > > > > > > > static inline int usb_phy_notify(struct usb phy *x, > > > > > unsigned val, void *v) { > > > > > > > > > > return atomic_notifier_call_chain(&x->notifier, val, > > > > > v); > > > > > > > > > > } > > > > > > > > Where to add this wrapper? To omap2430.c? or some > > > > include file? > > > > > > > > > > > > > On Tuesday 17 September 2013 17:49:17 Felipe Balbi wrote: > > > > > On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: > > > > > > diff --git a/drivers/usb/phy/phy-twl4030-usb.c > > > > > > b/drivers/usb/phy/phy-twl4030-usb.c index > > > > > > 8f78d2d..efe6155 100644 > > > > > > --- a/drivers/usb/phy/phy-twl4030-usb.c > > > > > > +++ b/drivers/usb/phy/phy-twl4030-usb.c > > > > > > @@ -705,6 +705,8 @@ static int > > > > > > twl4030_usb_probe(struct platform_device *pdev) > > > > > > > > > > > > if (device_create_file(&pdev->dev, > > > > > > &dev_attr_vbus)) > > > > > > > > > > > > dev_warn(&pdev->dev, "could not create sysfs > > > > > > file\n"); > > > > > > > > > > > > + ATOMIC_INIT_NOTIFIER_HEAD(&twl->phy.notifier); > > > > > > > > > > BTW, this is a bugfix, send separately. > > > > > > > > What to send separately? > > > > > > > > This full patch 1/4 is bugfix. And I did not understand > > > > what you want. Maybe it could be easier for you to > > > > apply this small 3+2 lines patch how you need. > > > > > > This hunk here (initializaing notifier head) is a separate > > > bug fix and needs its own patch. > > > > So will you do that? Or it is needed to resend this one line > > hunk again in new email again? > > new patch, new email Guys, WHY ARE YOU SO STUPID AND ARROGANT? Sorry but, need to copy full isolated patch/hunk from one mail to another is hassling. So what you want from me? Do all those non sense working only because yesterday you had bad day? Or what? Everything needed with described information was in first mail. Also second hunk has full isolated "git diff" output, so it is for you really big problem to copy it? Or you did not see that patch? I really did not understand what you wanted from me. ====================== ==== END OF PATCH ==== ====================== PS: This is end of email and patch is above ^^^^ ============================ ==== BEGINNING OF PATCH ==== ============================ This is bugfix and sending this patch separately from all other patches. This patch is visibly isolated from all others and could be readable also by disabled people. For other handicapped people I suggest to increase font size and other text settings in program which view this patch. For visually impaired people I suggest to use some text-to-speech software. This is small 2 lines patch, diff starting after next visible break. This patch initializing notifier head in tw4030 usb code which is missing. Initialization code is needed for using any atomic_notifier_* functions. Signed-off-by: Pali Rohár =========================== ==== BEGINNING OF DIFF ==== =========================== diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 8f78d2d..efe6155 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c @@ -705,6 +705,8 @@ static int twl4030_usb_probe(struct platform_device *pdev) if (device_create_file(&pdev->dev, &dev_attr_vbus)) dev_warn(&pdev->dev, "could not create sysfs file\n"); + ATOMIC_INIT_NOTIFIER_HEAD(&twl->phy.notifier); + /* Our job is to use irqs and status from the power module * to keep the transceiver disabled when nothing's connected. *