Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3951026pxj; Tue, 8 Jun 2021 02:48:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4i58nTeKV2jMINSb63VAxQvXsA1gR+DLeGAsX7+pNZNNSO3jSITN37UMPQ7fe7qZc6cuH X-Received: by 2002:a50:fd89:: with SMTP id o9mr24639109edt.336.1623145727789; Tue, 08 Jun 2021 02:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623145727; cv=none; d=google.com; s=arc-20160816; b=ncFyIpgXkca9HedfwYCpfd0DqfmCKBarbnqoEkrJYQ2oWoIhvHBXuvTZWaTRPb6rkZ iCoMCBvGJAyOonwcyDwp1IiAP3vkqACZD1Kdx68+B2KxEbw1eTiAfNO20betXlp7oxNP 77OjO6PtQyl3sZuFC5mIqs+gwKVM5PlAj+ZNBQzZYP1u/B9tuWO4ZYKgF+X5vo78GuD2 Q+d5C8KNktEBBic6eWqm2MpD7WEpO+3OMuZBoJ1F33l2aYuaykvTIzFt337JBqbJZe0p 5UuFuXo4ncoZP0BHfZH/aLFh3F1a/2JN/jYzX9QC9/xMR0Ht6Ntzc6+Z7XFtdZ23CxOh ggcQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=g9J+6hkjBnAtWIP22qYek1W/6Pim/qGNQFywvyR4atU=; b=KPhVi1ggiw3MS1W6fbgyVzY0TImCZAoWquEPeblEXCCsb3/oM8dkWuwOBsqmBNxG73 lnXsVM1Oew2zAvluSAP7Clr5wyNBiaBvkXBs5PO1q81qvStsxQJ12poJVW0uc0Lmnv3c 3PPZSlyLUh+XzZnfaAFoCuFAdhAqGobOUmaRUQ1muU6rAmWXFybFHNIzUEEshqjuLeHn Xs8OV5m01Zg3mdve9b87a2SArLw16nR+LFVrq97lkMHYKD2DiDow3tbc9nFvEd5GNpPK byTo6Vz0VfvBrSqX3oHF6YBXSba/qrdbQ+hr39ago0Oqkz/7bPvs753gzrSK4l0Jv7Zc s6Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Bm7yiSW7; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Bm7yiSW7; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la15si14916528ejb.724.2021.06.08.02.48.24; Tue, 08 Jun 2021 02:48:47 -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=@suse.de header.s=susede2_rsa header.b=Bm7yiSW7; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Bm7yiSW7; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbhFHJsb (ORCPT + 99 others); Tue, 8 Jun 2021 05:48:31 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:56790 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhFHJsb (ORCPT ); Tue, 8 Jun 2021 05:48:31 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 247AC1FD4B; Tue, 8 Jun 2021 09:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623145597; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g9J+6hkjBnAtWIP22qYek1W/6Pim/qGNQFywvyR4atU=; b=Bm7yiSW77lrruY58r+eFwBR5tUFiJQI4lpjW9CAawaJBScjzrnMZBCe6i4sTMG3xtKTQlO KPlSm5C01RLaOhFK27G6522egTzF+z8RRO2E1vcVQ/YyJQJPEBuOPatvPI2qHilmYpKyCq 7Is2cHoW5FESr4mbehPV89TGrVjAsDY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623145597; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g9J+6hkjBnAtWIP22qYek1W/6Pim/qGNQFywvyR4atU=; b=ig7kYgerxLTHJhE7eCz8mTw1My3J3pvWUZ+XfeRt8/gMblTEjYE8HrLC4QWNWHLv59d7me 0098P9rgDvYe31Aw== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id DD034118DD; Tue, 8 Jun 2021 09:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623145597; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g9J+6hkjBnAtWIP22qYek1W/6Pim/qGNQFywvyR4atU=; b=Bm7yiSW77lrruY58r+eFwBR5tUFiJQI4lpjW9CAawaJBScjzrnMZBCe6i4sTMG3xtKTQlO KPlSm5C01RLaOhFK27G6522egTzF+z8RRO2E1vcVQ/YyJQJPEBuOPatvPI2qHilmYpKyCq 7Is2cHoW5FESr4mbehPV89TGrVjAsDY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623145597; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g9J+6hkjBnAtWIP22qYek1W/6Pim/qGNQFywvyR4atU=; b=ig7kYgerxLTHJhE7eCz8mTw1My3J3pvWUZ+XfeRt8/gMblTEjYE8HrLC4QWNWHLv59d7me 0098P9rgDvYe31Aw== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id l890M3w8v2CKaAAALh3uQQ (envelope-from ); Tue, 08 Jun 2021 09:46:36 +0000 Date: Tue, 8 Jun 2021 11:46:36 +0200 From: Jean Delvare To: Zou Wei Cc: , Subject: Re: [PATCH -next] i2c: Fix missing pci_disable_device() on error in ali1535_setup() Message-ID: <20210608114636.65512e28@endymion> In-Reply-To: <1623036068-30668-1-git-send-email-zou_wei@huawei.com> References: <1623036068-30668-1-git-send-email-zou_wei@huawei.com> Organization: SUSE Linux X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wei, On Mon, 07 Jun 2021 11:21:08 +0800, Zou Wei wrote: > Fix the missing pci_disable_device() before return > from ali1535_setup() in the error handling case. > > Reported-by: Hulk Robot > Signed-off-by: Zou Wei > --- > drivers/i2c/busses/i2c-ali1535.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c > index fb93152..bdbaf79 100644 > --- a/drivers/i2c/busses/i2c-ali1535.c > +++ b/drivers/i2c/busses/i2c-ali1535.c > @@ -206,6 +206,7 @@ static int ali1535_setup(struct pci_dev *dev) > exit_free: > release_region(ali1535_smba, ALI1535_SMB_IOSIZE); > exit: > + pci_disable_device(dev); > return retval; > } > We don't actually want to disable the PCI device. Maybe it was already enabled before the driver was loaded, and maybe the BIOS needs the device when the system is being shut down. You'll notice that we do not call pci_disable_device(dev) in ali1535_remove(), so there's no reason to do it in the error path. As a matter of fact the i2c-i801 driver, which is used on the same kind of hardware, has the following note in its remove function: /* * do not call pci_disable_device(dev) since it can cause hard hangs on * some systems during power-off (eg. Fujitsu-Siemens Lifebook E8010) */ So this is a nack from me, sorry. -- Jean Delvare SUSE L3 Support