Received: by 10.223.185.116 with SMTP id b49csp743679wrg; Wed, 14 Feb 2018 06:24:04 -0800 (PST) X-Google-Smtp-Source: AH8x226lGdlTqCs20FGaTACgd6bGz6ALsyEkEaVPDkPNmdiaM9IdsNOy1CtkAnRfrO7fUIZxeaTC X-Received: by 2002:a17:902:2881:: with SMTP id f1-v6mr4600014plb.439.1518618244016; Wed, 14 Feb 2018 06:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518618243; cv=none; d=google.com; s=arc-20160816; b=RuUaWIEWaUiTNuurkdC/qAE1bmIdjlpqBkaCmrOzIAdBhsiLFXZNDpGLaySqX9LiIY 3giiqfqxpD1Znxj05XdsojRZi7dA98I+5n0ajWXeg8igYiYZow4ifrZgalNKFpwCmRBN uUVd4VsWdIunRD2wWGR26YfH7AZVFrtYzBauIT3yz22zSfCcxkthhRnIsZJqTfnX+G6z 01p0wOICRScF0xx+7gTXlpHLE+5PXiPoWnj1VI+7qTt7nTbtYmwE4Dk5KdLjrgsDUv6B m2XfC/tan7Y+Fmbn19B4sbBZ0+uqo8Zvkg3zW+yE/VSjiJWV5Vm/aAMgH0rN1gHPnhP4 zAyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=4uMMtjoGGYzPNeO9IC4q/KyODKz2jiO3JhaIX6E3+TQ=; b=REeTP2DPzUpNJxovgGkv2v9a30aGDrS9BNVSz4uL0NzQqa2DLB3SbZnoIz8nI/wG3O s4msRthANgqJmTP3dIs+wrjT/u+4WQDHUYm69j7HcqAJsjYHI5eQB4paVl5EbIK0qcwG deS1E8Cpw0qKX2nkTZ1vB2ypkA7uuUy/ILDl10aJtavmv234PBpyzgmUZB2dQEu/VTIC nh6aRujKzjGo3CClA/8z6rknQUAIbgsJauemwTXsW49rPEnvBn0gZCDQI5TQI7ZPugkk IvdC/ex4h3aedjbAO3AWNQkzh/svCtK/ypWjYAyAVdEnSO4JGDVjnCJsJmYdo04IlE26 K1rA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n129si1146459pga.260.2018.02.14.06.23.49; Wed, 14 Feb 2018 06:24:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030648AbeBNOXK (ORCPT + 99 others); Wed, 14 Feb 2018 09:23:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:33119 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030363AbeBNOXJ (ORCPT ); Wed, 14 Feb 2018 09:23:09 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AA13BADB6; Wed, 14 Feb 2018 14:23:07 +0000 (UTC) Date: Wed, 14 Feb 2018 15:23:05 +0100 From: Jean Delvare To: Guenter Roeck Cc: Wolfram Sang , =?UTF-8?B?Wm9sdMOhbiBCw7ZzesO2cm0=?= =?UTF-8?B?w6lueWk=?= , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] i2c: piix4: Use request_muxed_region Message-ID: <20180214152305.57b76ea5@endymion> In-Reply-To: <20180212185152.GA20877@roeck-us.net> References: <1514652658-6228-1-git-send-email-linux@roeck-us.net> <20180212111041.027edd85@endymion> <20180212185152.GA20877@roeck-us.net> Organization: SUSE Linux X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Feb 2018 10:51:52 -0800, Guenter Roeck wrote: > On Mon, Feb 12, 2018 at 11:10:41AM +0100, Jean Delvare wrote: > > On Sat, 30 Dec 2017 08:50:57 -0800, Guenter Roeck wrote: > > > @@ -298,12 +295,15 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev, > > > else > > > smb_en = (aux) ? 0x28 : 0x2c; > > > > > > - mutex_lock(&piix4_mutex_sb800); > > > + if (!request_muxed_region(SB800_PIIX4_SMB_IDX, 2, "sb800_piix4_smb")) > > > + return -EBUSY; > > > > This would happen if and only if another driver has requested the > > region already but without IORESOURCE_MUXED, right? Don't you want to > > Or if its call to alloc_resource() fails. OK, two things which are not supposed to happen, so failing is the right thing to do. > > write an error message then? I don't think request_muxed_region() will > > do, and probe failing with -EBUSY but no error message logged would be > > hard to diagnose. > > NP, though the analysis is quite simple - /proc/iomem will show the culprit. I'm confused. How would the user know what to look for in /proc/iomem (or, I believe, /proc/ioports actually) if the driver does not print which resource allocation failed? If the information is already printed somewhere, then I agree there's no point adding a message. But from the code I could not find it. -- Jean Delvare SUSE L3 Support