Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751921AbdDAQcA (ORCPT ); Sat, 1 Apr 2017 12:32:00 -0400 Received: from mail7.pr.hu ([87.242.0.7]:56337 "EHLO mail7.pr.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbdDAQb6 (ORCPT ); Sat, 1 Apr 2017 12:31:58 -0400 Subject: Re: [Regression] Changes to i2c-piix4.c initialisation prevent loading of sp5100_tco watchdog driver on AMD SB800 chipset To: Guenter Roeck References: <1485728348.3220.10.camel@googlemail.com> <1488530782.2457.41.camel@users.sourceforge.net> <20170303101702.GA1669@katana> <1490944639.2653.182.camel@users.sourceforge.net> <585a27fb-be15-df9f-00a9-bd4c3a654142@roeck-us.net> <20170331150524.GA31555@roeck-us.net> <0b32728a-f545-be43-2870-94688f1f9da5@roeck-us.net> <14472f36-3c8d-e77d-4077-bd0db3587281@pr.hu> Cc: Paul Menzel , Wolfram Sang , Christian Fetzer , Jean Delvare , linux-i2c@vger.kernel.org, linux-watchdog@vger.kernel.org, 853122@bugs.debian.org, Wim Van Sebroeck , Tim Small , Nehal Shah , Mika Westerberg , Andy Shevchenko , Thomas Brandon , Eddi De Pieri , linux-kernel@vger.kernel.org, Greg KH , Alan Stern From: Boszormenyi Zoltan Message-ID: Date: Sat, 1 Apr 2017 18:31:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <14472f36-3c8d-e77d-4077-bd0db3587281@pr.hu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.7 (/) X-Scan-Signature: e081fa8d8559a8dbbf6ac9ab9b6e2a4c X-Spam-Tracer: backend.mail.pr.hu 0.7 20170401163148Z Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1723 Lines: 35 2017-04-01 18:20 keltezéssel, Boszormenyi Zoltan írta: > The best clean alternative would be add new resource handling infrastructure. > * Expose the currently static alloc_resource() in kernel/resource.c > With this, driver initialization can allocate the resource once > for the lifetime of the driver and it it fails, (unfinished sentence) then the failure is during driver initialization, not during runtime, possibly days or weeks later. > * Add a new insert_muxed_region() / __insert_muxed_region() function with > different semantics from request_muxed_region() / __request_region(): > 1 Accept a pointer to already allocated resource. > 2 If the conflicting resource doesn't have IORESOURCE_MUXED set, > complain loudly in the syslog but still go into the wait queue. > The conflicting resource also has the name which can be printed > so the inconsistent resource / region usage can be fixed. > We can also just modify the __request_region() semantics, so: > 1 It accepts a pointer to an allocated resource or NULL. > In the second case, the resource is allocated internally and can > still fail. > 2 The above second point. But this may cause an error in code that > expects the old semantics. > > The window for request_muxed_region()+release_region() is so short > that the requested I/O port range would not show up in /proc/ioports. > > All this would be to fix only 3 drivers in a no-error scenario and only > achieving the functionality of a mutex seems to be overkill. > > Another alternative is to revert commit 2fee61d22e606fc99ade9079fda15fdee83ec33e > that caused the regression in sp5100_tco in the first place. > > Best regards, > Zoltán Böszörményi >