Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2981605pxj; Mon, 17 May 2021 14:48:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaqy9VoT4DNP+AcDkkMh0iwQ70j447tQ+tEyivWdlaip3D0BiEnFMrvD0JM8PG+wJ0bFho X-Received: by 2002:a5e:dd47:: with SMTP id u7mr1612604iop.62.1621288122307; Mon, 17 May 2021 14:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621288122; cv=none; d=google.com; s=arc-20160816; b=JWgYxJC6Vsio0rN0zTglNe6ewGaxQsmVMxJvuo5zhNiqpTGi8p2fwpyPcvttaPD6kI jYzXzT5F17fI3RQJkMKI2wBKzYD0VXJRi1YmjKhDtRO7ixSsbyXcXZC1D5QWeatFiSWF cTtCcjxdeUCTBH7yDYFzUSFQiLsfqoKtEU6DAHBHsBya2nu8SyIEH2bw0llQgPvG7zRR ry9iGplHcJYdMff3lp+LN56yTD3sXtvj1cXoOLZlBeh3UvEIuUgYmXoTAPfHH/4AGkCF RXpDsuL9otlZ5mPrS+3oMgAIzcGxzJxJXEklGQjDRlEA3maTFopaYqcnTePV2+Ka2633 zgTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+71qPnwMSnohwQyjaDLptpvB3cvhLQuDiDYoYJ7/CZ4=; b=qkmDafstTfgbDv4skwOkYGJGbXtdvBek9tTKaQZZJf0tSpbDSjHwWfs+TNKZOG6Y+v rPmV8+EiCQQ/to/ofUVd+jk5ROVRKfZIzpLbvr6INsPEoCFqEfeN0LdQ0Kw8g2fXYFHR HjId5ZuevaWzNrv/mqA8oCxbqWg/r121wvM/LNJeZGr/+jvEyy94yiwDfGJqwiB38ISi K7fGokSDsxM8b+tOTKUhbNcQOgjpFXSRufD6cU9SclSU8P08hPX7r9jvb2ddecdBR29C QDV35LTmJCBrVMwfuhE7IaWBTD5QQd9IVZCapoCc1COH+eSceKSM001HLSRbPZ78LYwI KA9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EaGRP7xQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si4895987jam.114.2021.05.17.14.48.10; Mon, 17 May 2021 14:48:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EaGRP7xQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238599AbhEQOLV (ORCPT + 99 others); Mon, 17 May 2021 10:11:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:59640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238057AbhEQOJd (ORCPT ); Mon, 17 May 2021 10:09:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 888A661244; Mon, 17 May 2021 14:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260405; bh=1wfURT9zmqs91sKt7fkJZ39sFRMSJnSbKetAtpigyw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EaGRP7xQiyw5Dt3YAcb6Iu1qGUliQcvGCRy5x+jLCv1R1Lx3As240DE73vb0qDcYY lBmuB8T0KGkZvwBVCi91qIlRqqu6JhN9ARKaQyt//yhOVWFAfPhuNiOV/qZSVA7iYp eyB5yXjwdo97e2d50Fdbx/Qb5ySMEjd1ymgzuuy8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Tong Zhang , Sasha Levin Subject: [PATCH 5.12 031/363] ALSA: rme9652: dont disable if not enabled Date: Mon, 17 May 2021 15:58:17 +0200 Message-Id: <20210517140303.646426310@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tong Zhang [ Upstream commit f57a741874bb6995089020e97a1dcdf9b165dcbe ] rme9652 wants to disable a not enabled pci device, which makes kernel throw a warning. Make sure the device is enabled before calling disable. [ 1.751595] snd_rme9652 0000:00:03.0: disabling already-disabled device [ 1.751605] WARNING: CPU: 0 PID: 174 at drivers/pci/pci.c:2146 pci_disable_device+0x91/0xb0 [ 1.759968] Call Trace: [ 1.760145] snd_rme9652_card_free+0x76/0xa0 [snd_rme9652] [ 1.760434] release_card_device+0x4b/0x80 [snd] [ 1.760679] device_release+0x3b/0xa0 [ 1.760874] kobject_put+0x94/0x1b0 [ 1.761059] put_device+0x13/0x20 [ 1.761235] snd_card_free+0x61/0x90 [snd] [ 1.761454] snd_rme9652_probe+0x3be/0x700 [snd_rme9652] Suggested-by: Takashi Iwai Signed-off-by: Tong Zhang Link: https://lore.kernel.org/r/20210321153840.378226-4-ztong0001@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/rme9652/rme9652.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index 4df992e846f2..7a4d395abcee 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c @@ -1731,7 +1731,8 @@ static int snd_rme9652_free(struct snd_rme9652 *rme9652) if (rme9652->port) pci_release_regions(rme9652->pci); - pci_disable_device(rme9652->pci); + if (pci_is_enabled(rme9652->pci)) + pci_disable_device(rme9652->pci); return 0; } -- 2.30.2