From patchwork Sat Mar 20 22:16:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tong Zhang X-Patchwork-Id: 405914 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 AA42FC433C1 for ; Sat, 20 Mar 2021 22:18:28 +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 C25EC61934 for ; Sat, 20 Mar 2021 22:18:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C25EC61934 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 14C04839; Sat, 20 Mar 2021 23:17:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 14C04839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1616278705; bh=WThy46y05IMN3kwEKDzuMtpW35OgqrDGx6DoolEj8oU=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oV/qc+AMoOssLDvCAQCRa97OP49XOrMhK69yZFL5ngxIuDkwjaq7X/flvp+pD+ZsB YtT/wP9tdKLQk1wZjbHjd4Z1ZaVmus/rqFJ4MXpYo/Ne4HTnSc3G3L2XHA9vAe1nZP 2Jhqal60p43AK9Xgdmf1I3UWy4TS+Nw2WeoEX2bc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 76791F80118; Sat, 20 Mar 2021 23:16:46 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E0C9EF800BB; Sat, 20 Mar 2021 23:16:42 +0100 (CET) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3D16FF800BB for ; Sat, 20 Mar 2021 23:16:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3D16FF800BB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="izv0gFXZ" Received: by mail-qk1-x72d.google.com with SMTP id o5so6794047qkb.0 for ; Sat, 20 Mar 2021 15:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Hd04KDAsAoVDrVE+uWlazOzKpC3XA/RFKS+Mgm3wpmw=; b=izv0gFXZvAk9Q6CSBkzd0kTxnkTa76rhfqectkbkVjOrXbA9Ara4WSg2dyjA2/cXmt jbqLKnobebnskosV166Uvt/y4Io4Sobxj7MCKwsueEeiDWHteennFOFwj/JzdYX7d0Bu o6djyWLHDD6Y73bHe+vhutUJIZCuycVDMNC6mkElDTsWEMTkll0NmhNlXqtGFiVGrR0T SsV/uZr7OVAzzyz4fB35n0yrMmjfOVQlMCQ6FjgWlcxGOmHv2hGX+1prjAcnBkDPA1Uv Z8l3Ut7Yk6m3WVWOLRamvfzurPcvCdLWpBi22g9R1Bf3QAc4uHDKdu3p8bSuS78xOgX5 C3Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hd04KDAsAoVDrVE+uWlazOzKpC3XA/RFKS+Mgm3wpmw=; b=qpE1SrkgJARchCfAIw+EhijY9mtkPGmPvc9U+cfxEq0EEM6nIaa8YPtIHmStGIubbY Bd3js90BwM8S7ATZX0lhd2CBKeBUz8Dv+aG/TauoQc//FuDLnj/UJVFHHl5MItG0/a1F 9se7El/CnY8Xig2j3Pyrk6nqDqXtxMDmdj5oNkNd9EyyiD6jG10lP6omh9SVeOTp6np4 vr3qGW+82pd0hbKvPFYsBUPH28mN/qAFJYk3iFME7ORaHB9WLVHeQTradNKEKRjQVNW/ TjA6jMxD/RbE7dRa+lxt040L/AbQTx4BS2UTLDksT0W4Gy1r2PuDRmAlabqi2WjA1LzS QAlQ== X-Gm-Message-State: AOAM531X8pMEdWayb6nU3Y7e4E05zLe+u340WZiwFjsP/Hq4JlKd6McU MLJfzodRaLunhnc4F4nbAMM= X-Google-Smtp-Source: ABdhPJzNmsPAw5Npetn7lsEU78C2q/sjYkDviZYWTzSSfpksjjzxKC/WtEssLP+SHsRTJWlAbkkpNQ== X-Received: by 2002:a37:ef14:: with SMTP id j20mr4740946qkk.471.1616278595941; Sat, 20 Mar 2021 15:16:35 -0700 (PDT) Received: from tong-desktop.local ([2601:5c0:c200:27c6:f925:bb4b:54d2:533]) by smtp.googlemail.com with ESMTPSA id x1sm6223973qtr.97.2021.03.20.15.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Mar 2021 15:16:35 -0700 (PDT) From: Tong Zhang To: Jaroslav Kysela , Takashi Iwai , Jasmin Fazlic , Leon Romanovsky , Tong Zhang , Allen Pais , Mark Brown , "Gustavo A. R. Silva" , Naoki Hayama , Tom Rix , Pierre-Louis Bossart , Joe Perches , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Romain Perier Subject: [PATCH 1/2] ALSA: hdsp: don't disable if not enabled Date: Sat, 20 Mar 2021 18:16:19 -0400 Message-Id: <20210320221620.226155-2-ztong0001@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210320221620.226155-1-ztong0001@gmail.com> References: <20210320221620.226155-1-ztong0001@gmail.com> MIME-Version: 1.0 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" hdsp wants to disable a not enabled pci device, which makes kernel throw a warning. Make sure the device is enabled before calling disable. [ 1.758292] snd_hdsp 0000:00:03.0: disabling already-disabled device [ 1.758327] WARNING: CPU: 0 PID: 180 at drivers/pci/pci.c:2146 pci_disable_device+0x91/0xb0 [ 1.766985] Call Trace: [ 1.767121] snd_hdsp_card_free+0x94/0xf0 [snd_hdsp] [ 1.767388] release_card_device+0x4b/0x80 [snd] [ 1.767639] device_release+0x3b/0xa0 [ 1.767838] kobject_put+0x94/0x1b0 [ 1.768027] put_device+0x13/0x20 [ 1.768207] snd_card_free+0x61/0x90 [snd] [ 1.768430] snd_hdsp_probe+0x524/0x5e0 [snd_hdsp] Signed-off-by: Tong Zhang --- sound/pci/rme9652/hdsp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 4cf879c42dc4..d9879a5bd60e 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -5285,8 +5285,10 @@ static int snd_hdsp_create(struct snd_card *card, pci_set_master(hdsp->pci); - if ((err = pci_request_regions(pci, "hdsp")) < 0) + if ((err = pci_request_regions(pci, "hdsp")) < 0) { + pci_disable_device(pci); return err; + } hdsp->port = pci_resource_start(pci, 0); if ((hdsp->iobase = ioremap(hdsp->port, HDSP_IO_EXTENT)) == NULL) { dev_err(hdsp->card->dev, "unable to remap region 0x%lx-0x%lx\n", @@ -5387,10 +5389,10 @@ static int snd_hdsp_free(struct hdsp *hdsp) vfree(hdsp->fw_uploaded); iounmap(hdsp->iobase); - if (hdsp->port) + if (hdsp->port) { pci_release_regions(hdsp->pci); - - pci_disable_device(hdsp->pci); + pci_disable_device(hdsp->pci); + } return 0; } From patchwork Sat Mar 20 22:16:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tong Zhang X-Patchwork-Id: 405459 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 A4692C433DB for ; Sat, 20 Mar 2021 22:18:31 +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 F076D61930 for ; Sat, 20 Mar 2021 22:18:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F076D61930 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 8638882A; Sat, 20 Mar 2021 23:17:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8638882A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1616278709; bh=aAB7xj0ogiFIczN6zcsNu4n46f/F/P0r1J5LUqDBlzw=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dzRzyLFrgrwhidTnvKNstQ2ALx/VqeUqSi6tfCBfmH1zd0x3VPqBoMXCPaVA/eKfx NZUKotgMeB8NYIpQYm3Dm2sMvqhOLQ0NNQdZSKi9KPdYAGUeHecHWY3JTSyMhNyKMi 12xpnLiEUalZEDMuHh1cnvbZk4AbIYurgtWo1Sug= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 371F3F8029B; Sat, 20 Mar 2021 23:16:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7EB65F8023B; Sat, 20 Mar 2021 23:16:44 +0100 (CET) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8FA1AF80118 for ; Sat, 20 Mar 2021 23:16:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8FA1AF80118 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d3r95KZA" Received: by mail-qk1-x732.google.com with SMTP id q26so1557436qkm.6 for ; Sat, 20 Mar 2021 15:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=vdUN2b328BItSMlcqgEcX36NLs9U//nc/tlpRzp+rh4=; b=d3r95KZAzaVWFbba5YX0MGiTNEyC0n05yuQccHmL/hnIcLcnmvavwoc2hchkpuogQm brHBrUoRXahj9bM2Jb9XjD+7dv1CfcE3uxRgEgWssYdrQsDYHcGEGso3nmKPmNxKaAko C56YvNOjdcpK3xHRZTHlRA6Zi33osXFU1I8RzMFi++HcWvt3cZM65TLcAYJNDAO0MDNk y5PuYVjZ3Mti7MAmK4nb5XRvB+LxQlGXvwMhq3cgwN93ThoJ8Wfnw1sgH7FdFAhZJ6ar e07+LyvghaPo3KhufVvsThyxJvu+wDiWcLhhTffcbFYLF6S9EcpcbnnVNlB1xzEb92s5 /NWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vdUN2b328BItSMlcqgEcX36NLs9U//nc/tlpRzp+rh4=; b=dFM6x5pwGGvXTAZohvTK8N96f3RK5et98PldOicGx0H2jgchmqpfljpgVcf2gfjIdC 0e5y0h9CcRO6r7JdSyDc9LZH1NHqU8puZlkN5/k/swYKnxirIr89dux9Hdrq4TE/ZKbZ R0ziC8Y64O8cLlJnvetWJxNCufuHqcRSp6WTwBfEE/kFRBv7jkSjfm4fRER1+20CGc2J NCeg7CpmW4c/Ozt7HZpv0fJ5BftyVQHdEvI8o+6lgBIvV8rNCZ4gete85neEtJC+n3ds L4d0ra+b8CiKwZQGOt9Dsw1ojh4Jk5uNqymapRdsD0duLNJXWkmSSRf2veMZY8vZ9/od p/tQ== X-Gm-Message-State: AOAM533Z06lki9nJ4UGBHmGFjfFtgFdu+U2cnySdxwaIGubtQEyaeh6K ILyAcng9krOK7HC2eGV353M= X-Google-Smtp-Source: ABdhPJzEBHPUBFlSCzmzBacmrjskEKddtuMTXZl8H3WzpgYvK24Bs6DTijvYjSFvvXWMHVipd6hWqw== X-Received: by 2002:a05:620a:218e:: with SMTP id g14mr4614016qka.111.1616278598478; Sat, 20 Mar 2021 15:16:38 -0700 (PDT) Received: from tong-desktop.local ([2601:5c0:c200:27c6:f925:bb4b:54d2:533]) by smtp.googlemail.com with ESMTPSA id x1sm6223973qtr.97.2021.03.20.15.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Mar 2021 15:16:38 -0700 (PDT) From: Tong Zhang To: Jaroslav Kysela , Takashi Iwai , Jasmin Fazlic , Leon Romanovsky , Tong Zhang , Allen Pais , Mark Brown , "Gustavo A. R. Silva" , Naoki Hayama , Tom Rix , Pierre-Louis Bossart , Joe Perches , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Romain Perier Subject: [PATCH 2/2] ALSA: hdspm: don't disable if not enabled Date: Sat, 20 Mar 2021 18:16:20 -0400 Message-Id: <20210320221620.226155-3-ztong0001@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210320221620.226155-1-ztong0001@gmail.com> References: <20210320221620.226155-1-ztong0001@gmail.com> MIME-Version: 1.0 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" hdspm wants to disable a not enabled pci device, which makes kernel throw a warning. Make sure the device is enabled before calling disable. [ 1.786391] snd_hdspm 0000:00:03.0: disabling already-disabled device [ 1.786400] WARNING: CPU: 0 PID: 182 at drivers/pci/pci.c:2146 pci_disable_device+0x91/0xb0 [ 1.795181] Call Trace: [ 1.795320] snd_hdspm_card_free+0x58/0xa0 [snd_hdspm] [ 1.795595] release_card_device+0x4b/0x80 [snd] [ 1.795860] device_release+0x3b/0xa0 [ 1.796072] kobject_put+0x94/0x1b0 [ 1.796260] put_device+0x13/0x20 [ 1.796438] snd_card_free+0x61/0x90 [snd] [ 1.796659] snd_hdspm_probe+0x97b/0x1440 [snd_hdspm] Signed-off-by: Tong Zhang --- sound/pci/rme9652/hdspm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 8d900c132f0f..af3898c88bba 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -6582,8 +6582,10 @@ static int snd_hdspm_create(struct snd_card *card, pci_set_master(hdspm->pci); err = pci_request_regions(pci, "hdspm"); - if (err < 0) + if (err < 0) { + pci_disable_device(pci); return err; + } hdspm->port = pci_resource_start(pci, 0); io_extent = pci_resource_len(pci, 0); @@ -6880,10 +6882,10 @@ static int snd_hdspm_free(struct hdspm * hdspm) kfree(hdspm->mixer); iounmap(hdspm->iobase); - if (hdspm->port) + if (hdspm->port) { pci_release_regions(hdspm->pci); - - pci_disable_device(hdspm->pci); + pci_disable_device(hdspm->pci); + } return 0; }