lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 14 Jul 2017 10:34:20 +0200
From:   Boszormenyi Zoltan <zboszor@...hu>
To:     linux-kernel@...r.kernel.org
Cc:     linux-usb@...r.kernel.org, linux-watchdog@...r.kernel.org,
        linux-i2c@...r.kernel.org,
        Paul Menzel <paulepanter@...rs.sourceforge.net>,
        Christian Fetzer <fetzer.ch@...il.com>,
        Jean Delvare <jdelvare@...e.com>,
        Nehal Shah <nehal-bakulchandra.shah@....com>,
        Tim Small <tim@...ss.co.uk>,
        Guenter Roeck <linux@...ck-us.net>, kernel@...ss.net,
        wim@...ana.be, jlayton@...chiereds.net, marc.2377@...il.com,
        cshorler@...glemail.com, wsa@...-dreams.de,
        regressions@...mhuis.info,
        Alex Williamson <alex.williamson@...hat.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Toshi Kani <toshi.kani@....com>,
        Jiang Liu <jiang.liu@...ux.intel.com>,
        Jakub Sitnicki <jsitnicki@...il.com>,
        Thierry Reding <treding@...dia.com>,
        Vivek Goyal <vgoyal@...hat.com>,
        Ingo Molnar <mingo@...nel.org>,
        Simon Guinot <simon.guinot@...uanux.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Mike Travis <travis@....com>,
        Daeseok Youn <daeseok.youn@...il.com>,
        Huang Rui <ray.huang@....com>, Andiry Xu <andiry.xu@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alan Cox <gnomes@...rguk.ukuu.org.uk>,
        David Howells <dhowells@...hat.com>,
        Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>,
        Alexandre Desnoyers <alex@...c.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Grygorii Strashko <grygorii.strashko@...com>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Wan ZongShun <Vincent.Wan@....com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Lucas Stach <dev@...xeye.de>,
        Denis Turischev <denis.turischev@...pulab.co.il>
Subject: Re: [PATCH 3/5 v4] usb: pci-quirks: Protect the I/O port pair of
 SB800

2017-06-22 15:21 keltezéssel, Zoltán Böszörményi írta:
> 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,
> so synchronization is necessary. The other drivers will also
> be modified to use the new macro in subsequest patched.
> 
> v1: Started with a common mutex in a C source file.
> 
> v2: Declared the common mutex in drivers/usb/host/pci-quirks.c
>      instead of in a common C file.
> 
> v3: Switched to using the new request_declared_muxed_region
>      macro.
> 
> v4: Fixed checkpatch.pl warnings and use the new
>      release_declared_region() macro.
> 
> Signed-off-by: Zoltán Böszörményi <zboszor@...hu>
> ---
>   drivers/usb/host/pci-quirks.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> index a9a1e4c..593942a 100644
> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -279,6 +279,8 @@ bool usb_amd_prefetch_quirk(void)
>   }
>   EXPORT_SYMBOL_GPL(usb_amd_prefetch_quirk);
>   
> +static struct resource sb800_res = DEFINE_RES_IO_NAMED(0xcd6, 2, "SB800 USB");
> +
>   /*
>    * The hardware normally enables the A-link power management feature, which
>    * lets the system lower the power consumption in idle states.
> @@ -314,11 +316,13 @@ 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) {
> +		request_declared_muxed_region(&sb800_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_declared_region(&sb800_res);
>   
>   		outl_p(0x30, AB_INDX(addr));
>   		outl_p(0x40, AB_DATA(addr));
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ