From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DDEAC433EA for ; Sun, 21 Mar 2021 08:35:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC6476193E for ; Sun, 21 Mar 2021 08:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbhCUIQt (ORCPT ); Sun, 21 Mar 2021 04:16:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:40840 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbhCUIQQ (ORCPT ); Sun, 21 Mar 2021 04:16:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D9177AD38; Sun, 21 Mar 2021 08:16:14 +0000 (UTC) Date: Sun, 21 Mar 2021 09:16:14 +0100 Message-ID: From: Takashi Iwai To: Tong Zhang Cc: Jaroslav Kysela , Takashi Iwai , Romain Perier , Allen Pais , Leon Romanovsky , Jasmin Fazlic , Mark Brown , Joe Perches , Tom Rix , Pierre-Louis Bossart , "Gustavo A. R. Silva" , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] ALSA: hdsp and hdspm, don't disable device if not enabled In-Reply-To: <20210320222337.243368-1-ztong0001@gmail.com> References: <20210320222337.243368-1-ztong0001@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 20 Mar 2021 23:23:33 +0100, Tong Zhang wrote: > > This series fixes issues in hdsp and hdspm. The drivers in question want > to disable a device that is not enabled on error path. > > v2: add fix to rme9652 > > Tong Zhang (3): > ALSA: hdsp: don't disable if not enabled > ALSA: hdspm: don't disable if not enabled > ALSA: rme9652: don't disable if not enabled Thanks for the patches. IMO, a safer way for this is to add pci_is_enabled() check in *_free() functions around the call of pci_disable_device(). The point is that *_free() is the sole destructor function that manages all stuff, hence it's better to do all there. And, of course, it'll be less changes. Care to resend v3 patches with that? thanks, Takashi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 331EDC433C1 for ; Sun, 21 Mar 2021 08:17:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39D7561930 for ; Sun, 21 Mar 2021 08:17:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39D7561930 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DAC8874C; Sun, 21 Mar 2021 09:16:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DAC8874C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1616314639; bh=7L3MnYUNgJovclckMN76vaQ7ZBrITPu97t38oQKtPR4=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=t2+Q5lWomiwmsTwlz4unvPCucUOzV05bmTbxauYoBP7H7BUnMPZKk/w6rw4+V6EaW 4GBkgHslKfLBVRuejnVZyiUmUcq2m7rH3XiWzf715zB+EfmBYwt0m8BbyzdmL6QduZ c6wuBsJPtZ1IeZoEdy29WnOVXP0NLPIUudsgBpmA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5126FF80240; Sun, 21 Mar 2021 09:16:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6FCAF80254; Sun, 21 Mar 2021 09:16:27 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 981F4F80155 for ; Sun, 21 Mar 2021 09:16:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 981F4F80155 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D9177AD38; Sun, 21 Mar 2021 08:16:14 +0000 (UTC) Date: Sun, 21 Mar 2021 09:16:14 +0100 Message-ID: From: Takashi Iwai To: Tong Zhang Subject: Re: [PATCH v2 0/3] ALSA: hdsp and hdspm, don't disable device if not enabled In-Reply-To: <20210320222337.243368-1-ztong0001@gmail.com> References: <20210320222337.243368-1-ztong0001@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: Pierre-Louis Bossart , alsa-devel@alsa-project.org, "Gustavo A. R. Silva" , Leon Romanovsky , Tom Rix , Allen Pais , Takashi Iwai , Joe Perches , Mark Brown , Romain Perier , linux-kernel@vger.kernel.org, Jasmin Fazlic X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On Sat, 20 Mar 2021 23:23:33 +0100, Tong Zhang wrote: > > This series fixes issues in hdsp and hdspm. The drivers in question want > to disable a device that is not enabled on error path. > > v2: add fix to rme9652 > > Tong Zhang (3): > ALSA: hdsp: don't disable if not enabled > ALSA: hdspm: don't disable if not enabled > ALSA: rme9652: don't disable if not enabled Thanks for the patches. IMO, a safer way for this is to add pci_is_enabled() check in *_free() functions around the call of pci_disable_device(). The point is that *_free() is the sole destructor function that manages all stuff, hence it's better to do all there. And, of course, it'll be less changes. Care to resend v3 patches with that? thanks, Takashi