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: 2904891 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 85D5C9F1E3 for ; Wed, 18 Sep 2013 08:20:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DEFCB202D1 for ; Wed, 18 Sep 2013 08:20:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9AE8F20256 for ; Wed, 18 Sep 2013 08:20:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751808Ab3IRIUY (ORCPT ); Wed, 18 Sep 2013 04:20:24 -0400 Received: from mail-ee0-f49.google.com ([74.125.83.49]:44392 "EHLO mail-ee0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751658Ab3IRIUT (ORCPT ); Wed, 18 Sep 2013 04:20:19 -0400 Received: by mail-ee0-f49.google.com with SMTP id d41so3233442eek.22 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; ; ) Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org 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> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham 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. *