Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp587646pxj; Thu, 20 May 2021 17:06:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPudzb2Yec1ZTIejHnQYJZiSFl0Oxoj/cTxWfiN/riC+4B0wbumyJ5eqyZmzz3ykrb6+aC X-Received: by 2002:a6b:7413:: with SMTP id s19mr7696140iog.151.1621555576558; Thu, 20 May 2021 17:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621555576; cv=none; d=google.com; s=arc-20160816; b=AQEWdizFqB1sY/2JznqirOx+VXlMTnboombmb3hqeMv5ulqvy1nTabDTHhgUBG7vmT R3bq8zCyxs/+EdzALdFwUGB2HqqMPIKPSkcVSW81z8RbiHPEFjWIXIQl3pqZvJnfOBGe 0inDPnMEuOZMZOCv9nUhrzmIEmMPDKEV16Qbs0cVOEfLvwWFMoTZmvVxKtfNNydA1s3h I82CVA/i1y6xmcE9k4Z5Jzrd6/cB2NDyzRleT9txWvLeJxlW5tpxgnNpjMISEA6REL4s /eLabmIHMHUa7Kogr69U3VdyId8fl6q8YqidAMrJD0JvtfApEa59jwWDWeN6GLvart/l THWQ== 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=xwDW/exIjuWtRiI2kzA9NBaMphGeo4kpN1Z1fnOr65o=; b=KEBmbEweu1LAM7BQu5EaBmmMXxJr093QFVUrqlBGTs0sHTKJ7yDQj2OvS8NNrs+8mv T/VA14P6pI3ThgfbiJ1lVdZufb6dO1bUSPZ/rOVnuZ74ZH/GrBo6T65fFSCopl6AEXKz zDavgHv7myMEFlJ5qVXplzF8ODbPa1g50grlTFWkTQjSOACX3KbzSdtUOjhyPCgtlFI1 vvTCPyc0yxbDDzT5xPZ2wu4TATSEDRH00aqxMv1g03R+jLbAUJD3eMuugLwWUihv3ha0 Pbxxm4wfyRX5+N1v2/88s9B7lq9xFWMLsxwxubuthSqFn9fkry3Nn8up8X/rJ7PKLBNq NefA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mJo8A5SK; 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 b26si3725045jap.85.2021.05.20.17.06.03; Thu, 20 May 2021 17:06:16 -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=mJo8A5SK; 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 S240366AbhETLUa (ORCPT + 99 others); Thu, 20 May 2021 07:20:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:57236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239637AbhETLAC (ORCPT ); Thu, 20 May 2021 07:00:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3ADEF61D02; Thu, 20 May 2021 10:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504998; bh=Umgn2PAyD9RUbxja/JXmKFpCaWb1l4D3wphIxd1ySN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mJo8A5SK4DkLPZs2htUnQnhyuwaTGRIsD2vP1ars45dgECjmIleW3KojGBLZlTRto TVRXtH+pN9io8WDo9Cbzzb8shOnGkYsr3QRbxTsJnWfJDFYXS6dCLqN3QVGjVy/F1f S7s5ODIJEwQ5uV6VyiNTKBZET10Cfa5vM6CZnexs= 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 4.9 175/240] ALSA: rme9652: dont disable if not enabled Date: Thu, 20 May 2021 11:22:47 +0200 Message-Id: <20210520092114.534872644@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 a76b1f147660..67bd75fbdc7e 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c @@ -1761,7 +1761,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