Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp707397ybh; Wed, 18 Mar 2020 07:43:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtEE8oKRvqKPjAN8MLQr0DhJjEfli+75O860o/77qh2b+vbU8rDb4i9kpmP3ZHxOuuOXhHW X-Received: by 2002:a9d:7859:: with SMTP id c25mr4215539otm.323.1584542617256; Wed, 18 Mar 2020 07:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584542617; cv=none; d=google.com; s=arc-20160816; b=03DCuCwkLEMNh0Rizt2wZdduJ2mOMJgMkg9tjIE+toyqVSILub1QN/OUJmbQpA551m x64iJxGN8b8W2KnBEgNkfb4wAgXBR6ByZHiWtaFdObEcp9s7o4Ww6gv4FNxNejBN4+IF B0VbYGl3IGQxYZcQjebna3Oi24GPIjz/11oglPUHVZPb6jSh5ToSmq0XwbllA+8F3pTC q/Fc6676GmUOeN2oaeEC5OTj/4oFpjvWsiOUzrl3I4QY/fhjhmt9iO/NuA/4klt/0MM2 RwFy3I6GLN+7a0kVnu1eEG0fTzAB+aPHJu8PZXqWSCPVWVaB/NqDU5rnuRqC3uZAw4cv O9fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=glh+neVr3hU2AAir3F/WpKodtMms5/f6uoCBtXe+P8c=; b=JEOedl/vaB9a7pWQJqpClT5tRQZV65kwGLQNAfK5MjZnYCHE1tXG0fw3jPSGOikb9b 3TSqCMQOazZ6eBD0T7GFyjHVdiDjF8pmm4fcohgaOojQ8s13QI8+UUUZcB4CqmzH2ufi suIbfKOnbimFwtW1HrV4mz/jqWEm79CNM9Mfnn28VPmRSUM7zLZSsINcozBe+/TueAV4 rS0hHdcVlZBkXhylzqK7jWPpeBROPf+mv1ucNpszUUPn+hpN9CG6ZcIn083NY3AV/Xsg zHnDoh+2YR5T8ls2e7QMud5KzHnUqlC5h41yhU9TZceTMlSFLB9MGysIrPkj43yUBihq G/dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=ouvh+62O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h203si3392885oif.3.2020.03.18.07.43.23; Wed, 18 Mar 2020 07:43:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=ouvh+62O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726913AbgCROnC (ORCPT + 99 others); Wed, 18 Mar 2020 10:43:02 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:14172 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726647AbgCROnB (ORCPT ); Wed, 18 Mar 2020 10:43:01 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02IEd4n8021917; Wed, 18 Mar 2020 15:41:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=glh+neVr3hU2AAir3F/WpKodtMms5/f6uoCBtXe+P8c=; b=ouvh+62OJe3TfAiCI3m+1utTHcf0+n0+PwUyMaC51xx1MRrpwgRVOZHfFR2ZI2uBDzKX V9TjJMuu1J9syUeui1OAKjBSIran8uX/kpO1GKqA7qs1nmLIeFmBIi7JQzz5pfPpTt3B OtQENCymMCPqevX2g9CP2gWdYZk/oHz9twgDr8FkaHpbEt+voEZDrelvENYyM0/GIwg9 M9GslGgGxm64uH0oo7M9pWaRnapzSDOxKmK4Of1OS3Jd1PXBqDNJf4OO9XMN3U51FQL0 Fvh1ZDoBCXoCVZE2v6ObneNoqAMwNtJp2uox96wATUJjBo5S3DQ9NM5/dNnL4zF1BoGD Vw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2yua4wbscg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Mar 2020 15:41:58 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 56C2510002A; Wed, 18 Mar 2020 15:41:57 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag6node2.st.com [10.75.127.17]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 206962AE6C9; Wed, 18 Mar 2020 15:41:57 +0100 (CET) Received: from localhost (10.75.127.46) by SFHDAG6NODE2.st.com (10.75.127.17) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 18 Mar 2020 15:41:55 +0100 From: Olivier Moysan To: , , , , , CC: , , , Subject: [PATCH 0/3] ASoC: stm32: manage rebind issue Date: Wed, 18 Mar 2020 15:41:22 +0100 Message-ID: <20200318144125.9163-1-olivier.moysan@st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG5NODE3.st.com (10.75.127.15) To SFHDAG6NODE2.st.com (10.75.127.17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.645 definitions=2020-03-18_06:2020-03-18,2020-03-18 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset corrects a rebind issue on STM32 SPDIFRX and I2S drivers. The same correction has already been applied for SAI driver: 0d6defc7e0e4 ("ASoC: stm32: sai: manage rebind issue") The commit e894efef9ac7 ("ASoC: core: add support to card rebind") allows to rebind the sound card after a rebind of one of its component. With this commit, the sound card is actually rebound, but may be no more functional. The following problems have been seen on STM32 drivers. 1) DMA channel is not requested: With the sound card rebind the simplified call sequence is: probe snd_soc_register_component snd_soc_try_rebind_card snd_soc_instantiate_card devm_snd_dmaengine_pcm_register The problem occurs because the pcm must be registered, before snd_soc_instantiate_card() is called. Modify the driver, to change the call sequence as follows: probe devm_snd_dmaengine_pcm_register snd_soc_register_component snd_soc_try_rebind_card 2) DMA channel is not released: dma_release_channel() is not called when devm_dmaengine_pcm_release() is executed. This occurs because SND_DMAENGINE_PCM_DRV_NAME component, has already been released through devm_component_release(). devm_dmaengine_pcm_release() should be called before devm_component_release() to avoid this problem. Call snd_dmaengine_pcm_unregister() and snd_soc_unregister_component() explicitly from the driver, to have the right sequence. Olivier Moysan (3): ASoC: stm32: spdifrx: fix regmap status check ASoC: stm32: spdifrx: manage rebind issue ASoC: stm32: i2s: manage rebind issue sound/soc/stm/stm32_i2s.c | 40 ++++++++++++++++------ sound/soc/stm/stm32_spdifrx.c | 64 +++++++++++++++++++---------------- 2 files changed, 63 insertions(+), 41 deletions(-) -- 2.17.1