Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2792567rdb; Tue, 12 Sep 2023 12:11:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELzzOn0DbIwL+Wz5aHRKXzcozaJYIZHeH2eJDwe2oZhOiIfYWxIqx1pQPnAxvRx/jnrU3X X-Received: by 2002:a17:90a:6504:b0:267:fb26:32bd with SMTP id i4-20020a17090a650400b00267fb2632bdmr204190pjj.7.1694545907805; Tue, 12 Sep 2023 12:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694545907; cv=none; d=google.com; s=arc-20160816; b=vvLAjsCO+o7H0SMSPebd/AUHSBtdlThsAGRkOBln1yKT9j5YwUH3UXSUe2lrtJ4pER gQ7Hz0cG8am3pQklPB6vfl/pY6bVl6jb+Yy+LGodr/AiaCm0lDQJryJc6owcmaHR9IfI eL6lWYCm4NTNoirvj8JEsP7jhuOYxkqC8EGGk8k2B3HxWiWVZTBNR0G3gim5U+B05aT3 9ZVsILuYRWY6Qbx7kcVlpZw1AiuJHbwaE7IWkyGLoJ7cnzLPNKdBzRi7Nt/itTOrhpfq 4rulrmpiW6/acOAr9HOCVJL8MB8839cOgZlHfvqw6Xgf69Hosr6Qyyk3cV4YHY9NnJSJ KWiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=H2HdSE76dyz/3D/Ncvz5ZL2hWLNUF7zltOEScETfjso=; fh=obXCZ3/meZ/qVnyAjqK1Qu8U5as3quxkMbo01Y613cY=; b=Iw/UJ1PNP4H5RK3EqPCAHn2Rv8w5xGd6RfXayIPKfrs9953x6avxEYQwfn4oK2bCUi cH4xiaQZdeQopZElBlq4YIKNER9tKlshu5VdVExISBljrUeNGZO2nwQhPuuslT89UYNw sgUIUAI1oQTqWUpY3biji0FystHbZc3EomwkEw0CM906/j/l7IeFvD2Ckjw/OZ+mJPtW E1Y7dO/SnAaz3Qdwd2veuPrDS5QLiSc0ZGZC7nOawuCfxMBp6lOXSUaRAcc0eRgL48Re 1qUnZ5sy9CMGSS8fy7sGa0E456aybQxsOfyNH2cUmDbjxDT6sBYEmM+yEWrM9vVas44b QFPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hsEm2V16; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id gm7-20020a17090b100700b0026cab818aa2si10102547pjb.100.2023.09.12.12.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 12:11:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hsEm2V16; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0D8558364D72; Mon, 11 Sep 2023 21:47:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236410AbjILCRX (ORCPT + 99 others); Mon, 11 Sep 2023 22:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236151AbjILCQA (ORCPT ); Mon, 11 Sep 2023 22:16:00 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B9E21B883E for ; Mon, 11 Sep 2023 18:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694481145; x=1726017145; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=NT0igPUaqXUrlEzLPjsu0IEnx8SqEPXynrBlbgMaU38=; b=hsEm2V16Gh2iIXNKqA+U13U1xmLLXleU7AplJXiKfrOOWMtXfmZwZdxs gBLQUTdtt5UqKE56Hj2HszI6sw+9vGMEjRxnSIho4uI3jW1tVXNqdBknh mOAZdTeuMvlUrpjgx0njQW6fw2J84IqW52kbByZ9X/GtF52GCxnUiCeNd opHsSKt8LKiZvqJR2xjbwXGr122zIPqYxdppznJap7LEKX+/hvCsyoduT /0U3qE2W8wQSLydyKAx3pv7AUq3KS2Wanh+R2vZQN95dQOB1y3HkYA+V4 BK0AYIStl+NfcNvpP6bB6Hp+cRZhTSOhfpCP0JnvlxmzDgOOH+Ym5tsD0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="357676956" X-IronPort-AV: E=Sophos;i="6.02,244,1688454000"; d="scan'208";a="357676956" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 17:29:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="886739584" X-IronPort-AV: E=Sophos;i="6.02,244,1688454000"; d="scan'208";a="886739584" Received: from sbeyer-mobl.amr.corp.intel.com (HELO [10.212.76.33]) ([10.212.76.33]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 17:29:05 -0700 Message-ID: <34d34e99-c6a3-2d08-2c4b-c548b6b87e9a@linux.intel.com> Date: Mon, 11 Sep 2023 20:25:28 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.15.0 Subject: Re: [PATCH v4 01/11] ASoC: SOF: core: add 'no_wq' probe and remove callbacks Content-Language: en-US To: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= , Kai Vehmanen , Maarten Lankhorst Cc: alsa-devel@alsa-project.org, Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , Liam Girdwood , Bard Liao , Ranjani Sridharan , Mark Brown , Daniel Baluta , linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org References: <20230830153652.217855-1-maarten.lankhorst@linux.intel.com> <20230830153652.217855-2-maarten.lankhorst@linux.intel.com> <4252a4dc-0cf3-4ff2-aa55-c03e56345276@linux.intel.com> <4d84a799-c07e-e917-7c82-2f24456e3ac2@linux.intel.com> <6d39eac7-06c7-45f0-0318-72be1753641f@linux.intel.com> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 11 Sep 2023 21:47:19 -0700 (PDT) > What we have atm: > snd_sof_probe - might be called from wq > snd_sof_remove - might be called from wq (cleans up the snd_sof_probe > step) I don't think it's correct, snd_sof_remove cannot be called from a wq. The device core knows nothing about workqueues. > We want a callbacks for hardware/device probing, right, split the > snd_sof_probe (and remove) to be able to support a sane level of > deferred probing support. > > With that in mind: > snd_sof_device_probe - Not called from wq (to handle deferred probing) > snd_sof_probe - might be called from wq > > snd_sof_remove - might be called from wq (cleans up the snd_sof_probe > step) > snd_sof_device_remove - Not called from wq (to up the > snd_sof_device_probe step) > > Naming option: s/device/hardware I like the 'device' hint since it's directly related to the device (or subsystem) callbacks. > However, I think the snd_sof_device_remove itself is redundant and we > might not need it at all as in case we have wq and there is a failure in > there we do want to release resources as much as possible. The module > will be kept loaded (no deferred handling in wq) and that might block > PM, other devices to behave correctly. Iow, if the wq has failure we > should do a cleanup to the best effort to reach a level like the driver > is not even loaded. If we have a failure in a workqueue used for probe, then we have to clean-up everything since nothing in the device core will do so for us.