Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766AbdFUEET (ORCPT ); Wed, 21 Jun 2017 00:04:19 -0400 Received: from mail7.pr.hu ([87.242.0.7]:38119 "EHLO mail7.pr.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752542AbdFUEEQ (ORCPT ); Wed, 21 Jun 2017 00:04:16 -0400 From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= To: linux-kernel@vger.kernel.org Cc: linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-i2c@vger.kernel.org, Paul Menzel , Christian Fetzer , Jean Delvare , Nehal Shah , Tim Small , Guenter Roeck , kernel@ekass.net, wim@iguana.be, jlayton@poochiereds.net, marc.2377@gmail.com, cshorler@googlemail.com, wsa@the-dreams.de, regressions@leemhuis.info, =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= Subject: [PATCH 3/5] usb: pci-quirks: Protect the I/O port pair of SB800 Date: Wed, 21 Jun 2017 05:53:47 +0200 Message-Id: <20170621035349.4125-4-zboszor@pr.hu> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170621035349.4125-1-zboszor@pr.hu> References: <20170403075133.12343-1-zboszor@pr.hu> <20170621035349.4125-1-zboszor@pr.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.2 (++) X-Spam-Report: Spam detection software, running on the system "prspamd3.pr.hu", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This patch uses the previously introduced macro called request_declared_muxed_region() to synchronize access to the I/O port pair 0xcd6 / 0xcd7 on SB800. These I/O ports are also used by i2c-piix4 and sp5100_tco, the next two patches port these drivers to use the new macro. [...] Content analysis details: (2.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.2 ALL_TRUSTED Passed through trusted hosts only via SMTP 3.5 BAYES_99 BODY: Bayes spam probability is 99 to 100% [score: 1.0000] 0.2 BAYES_999 BODY: Bayes spam probability is 99.9 to 100% [score: 1.0000] -1.3 AWL AWL: Adjusted score from AWL reputation of From: address X-Scan-Signature: f0c4dd17e446f11bd1554530b2f50cce X-Spam-Tracer: backend.mail.pr.hu 2.2 20170621035418Z Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1208 Lines: 33 This patch uses the previously introduced macro called request_declared_muxed_region() to synchronize access to the I/O port pair 0xcd6 / 0xcd7 on SB800. These I/O ports are also used by i2c-piix4 and sp5100_tco, the next two patches port these drivers to use the new macro. Signed-off-by: Zoltán Böszörményi --- drivers/usb/host/pci-quirks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index a9a1e4c..703eb65 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -314,11 +314,14 @@ static void usb_amd_quirk_pll(int disable) if (amd_chipset.sb_type.gen == AMD_CHIPSET_SB800 || amd_chipset.sb_type.gen == AMD_CHIPSET_HUDSON2 || amd_chipset.sb_type.gen == AMD_CHIPSET_BOLTON) { + struct resource res = DEFINE_RES_IO_NAMED(0xcd6, 2, "USB host SB800/HUDSON2/BOLTON"); + request_declared_muxed_region(&res); outb_p(AB_REG_BAR_LOW, 0xcd6); addr_low = inb_p(0xcd7); outb_p(AB_REG_BAR_HIGH, 0xcd6); addr_high = inb_p(0xcd7); addr = addr_high << 8 | addr_low; + release_region(0xcd6, 2); outl_p(0x30, AB_INDX(addr)); outl_p(0x40, AB_DATA(addr)); -- 2.9.4