From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Delvare Subject: Re: [PATCH 1/2] i2c: piix4: Use request_muxed_region Date: Wed, 14 Feb 2018 15:23:05 +0100 Message-ID: <20180214152305.57b76ea5@endymion> References: <1514652658-6228-1-git-send-email-linux@roeck-us.net> <20180212111041.027edd85@endymion> <20180212185152.GA20877@roeck-us.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: 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 In-Reply-To: <20180212185152.GA20877@roeck-us.net> Sender: linux-i2c-owner@vger.kernel.org List-Id: linux-i2c@vger.kernel.org To: Guenter Roeck Cc: Wolfram Sang , =?UTF-8?B?Wm9sdMOhbiBCw7ZzesO2cm0=?= =?UTF-8?B?w6lueWk=?= , linux-i2c@vger.kernel.org, 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