From patchwork Fri Feb 13 04:44:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5822941 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 744F3BF440 for ; Fri, 13 Feb 2015 04:46:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ABF0A2025B for ; Fri, 13 Feb 2015 04:46:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7E238200F0 for ; Fri, 13 Feb 2015 04:46:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 996682654B0; Fri, 13 Feb 2015 05:46:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C404C26548D; Fri, 13 Feb 2015 05:45:10 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D796B265486; Fri, 13 Feb 2015 05:45:09 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 48E1526549D for ; Fri, 13 Feb 2015 05:44:08 +0100 (CET) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 13 Feb 2015 13:44:07 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id D1063455E1; Fri, 13 Feb 2015 13:44:07 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id B8D38480A3; Fri, 13 Feb 2015 13:44:07 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id B21F748014; Fri, 13 Feb 2015 13:44:07 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id PBJ30187; Fri, 13 Feb 2015 13:44:07 +0900 X-IronPort-AV: E=Sophos;i="5.09,568,1418050800"; d="scan'208";a="179773299" Received: from mail-sg1lp0089.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.89]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 13 Feb 2015 13:44:07 +0900 Received: from remon.renesas.com (211.11.155.132) by SINPR06MB171.apcprd06.prod.outlook.com (10.242.57.18) with Microsoft SMTP Server (TLS) id 15.1.81.19; Fri, 13 Feb 2015 04:44:05 +0000 Message-ID: <87wq3m4dyf.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") To: Mark Brown In-Reply-To: <874mqq5slj.wl%kuninori.morimoto.gx@renesas.com> References: <874mqq5slj.wl%kuninori.morimoto.gx@renesas.com> Date: Fri, 13 Feb 2015 04:44:05 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: HKNPR06CA0039.apcprd06.prod.outlook.com (10.141.16.29) To SINPR06MB171.apcprd06.prod.outlook.com (10.242.57.18) Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB171; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:SINPR06MB171; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(42186005)(86362001)(46102003)(33646002)(23726002)(110136001)(53416004)(54356999)(47776003)(77156002)(62966003)(66066001)(50986999)(76176999)(40100003)(122386002)(2950100001)(77096005)(19580405001)(46406003)(83506001)(92566002)(36756003)(50466002)(229853001)(19580395003); DIR:OUT; SFP:1102; SCL:1; SRVR:SINPR06MB171; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB171; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2015 04:44:05.3550 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SINPR06MB171 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 5/5 v4] ASoC: soc-core: indicate warning for unbind/bind issue X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto We have unbinded_card_list for unbind / bind issue of component. But suspend / resume are called in the order in which the probe functions of devices are called (and succeed). By returning -EPROBE_DEFER in the card driver we make sure that the card's probe function is always called after the probe functions of all the components of the card have run. This again causes the card's suspend function to be called before any suspend function of any of it's components. Now with this unbind / bind fixup it is possible again for a component's probe function to be called after the card's probe function which changes the suspend and resume order and might break things. Ideally the correct fix would somehow make sure that the card itself is unbound and put back onto the probe_defer list in the future. We indicate warning to this issue for now. Reported-by: Lars-Peter Clausen Signed-off-by: Kuninori Morimoto --- v3 -> v4 - new patch sound/soc/soc-core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f04e97d..c286a76 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2719,6 +2719,11 @@ static void snd_soc_component_del_unlocked(struct snd_soc_component *component) /* card is removed temporarily */ if (component->probed && card->instantiated) { + dev_warn(component->dev, + "%s is unbinded. but we recommend you to " + "unbind/bind or rmmod/insmod it by yourself\n", + card->name); + list_add(&card->unbinded_list, &unbinded_card_list); snd_soc_remove_card(card); }