stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Brian King <brking@linux.vnet.ibm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [ 65/79] powerpc/pseries: Make 32-bit MSI quirk work on systems lacking firmware support
Date: Wed, 12 Jun 2013 14:19:38 -0300	[thread overview]
Message-ID: <51B8ADAA.2080404@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130611195324.600483375@linuxfoundation.org>

On 06/11/2013 05:03 PM, Greg Kroah-Hartman wrote:
> 3.9-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Brian King <brking@linux.vnet.ibm.com>
> 
> commit f1dd153121dcb872ae6cba8d52bec97519eb7d97 upstream.
> 
> Recent commit e61133dda480062d221f09e4fc18f66763f8ecd0 added support
> for a new firmware feature to force an adapter to use 32 bit MSIs.
> However, this firmware is not available for all systems. The hack below
> allows devices needing 32 bit MSIs to work on these systems as well.
> It is careful to only enable this on Gen2 slots, which should limit
> this to configurations where this hack is needed and tested to work.
> 
> [Small change to factor out the hack into a separate function -- BenH]
> 
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> ---
>   arch/powerpc/platforms/pseries/msi.c |   40 ++++++++++++++++++++++++++++++++---
>   1 file changed, 37 insertions(+), 3 deletions(-)
> 
> --- a/arch/powerpc/platforms/pseries/msi.c
> +++ b/arch/powerpc/platforms/pseries/msi.c
> @@ -394,6 +394,23 @@ static int check_msix_entries(struct pci
>   	return 0;
>   }
> 
> +static void rtas_hack_32bit_msi_gen2(struct pci_dev *pdev)
> +{
> +	u32 addr_hi, addr_lo;
> +
> +	/*
> +	 * We should only get in here for IODA1 configs. This is based on the
> +	 * fact that we using RTAS for MSIs, we don't have the 32 bit MSI RTAS
> +	 * support, and we are in a PCIe Gen2 slot.
> +	 */
> +	dev_info(&pdev->dev,
> +		 "rtas_msi: No 32 bit MSI firmware support, forcing 32 bit MSI\n");
> +	pci_read_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_HI, &addr_hi);
> +	addr_lo = 0xffff0000 | ((addr_hi >> (48 - 32)) << 4);
> +	pci_write_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_LO, addr_lo);
> +	pci_write_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_HI, 0);
> +}
> +
>   static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)
>   {
>   	struct pci_dn *pdn;
> @@ -401,6 +418,7 @@ static int rtas_setup_msi_irqs(struct pc
>   	struct msi_desc *entry;
>   	struct msi_msg msg;
>   	int nvec = nvec_in;
> +	int use_32bit_msi_hack = 0;
> 
>   	pdn = get_pdn(pdev);
>   	if (!pdn)
> @@ -428,15 +446,31 @@ static int rtas_setup_msi_irqs(struct pc
>   	 */
>   again:
>   	if (type == PCI_CAP_ID_MSI) {
> -		if (pdn->force_32bit_msi)
> +		if (pdn->force_32bit_msi) {
>   			rc = rtas_change_msi(pdn, RTAS_CHANGE_32MSI_FN, nvec);
> -		else
> +			if (rc < 0) {
> +				/*
> +				 * We only want to run the 32 bit MSI hack below if
> +				 * the max bus speed is Gen2 speed
> +				 */
> +				if (pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT)
> +					return rc;
> +
> +				use_32bit_msi_hack = 1;
> +			}
> +		} else
> +			rc = -1;
> +
> +		if (rc < 0)
>   			rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec);
> 
> -		if (rc < 0 && !pdn->force_32bit_msi) {
> +		if (rc < 0) {
>   			pr_debug("rtas_msi: trying the old firmware call.\n");
>   			rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec);
>   		}
> +
> +		if (use_32bit_msi_hack && rc > 0)
> +			rtas_hack_32bit_msi_gen2(pdev);
>   	} else
>   		rc = rtas_change_msi(pdn, RTAS_CHANGE_MSIX_FN, nvec);
> 
> 
> 

Greg,

This change depends on upstream commit e375b561817d9ae098cc4296a729fc88924a0159 to work, since this is when the msi_cap field was added to struct pci_dev. e375b561 was applied on 3.10-rc1 and it seems it is not on the stable tree, so in my request for the stable tree I sent a patch backported to 3.9.y with a modified version of rtas_hack_32bit_msi_gen2(). If e375b561 is not being brought to the stable tree as well, please consider the code I sent to the stable list on June/06, or else it will break the build for ppc.


Thank you,

-- 
Kleber Sacilotto de Souza
IBM Linux Technology Center


  reply	other threads:[~2013-06-12 17:19 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 20:02 [ 00/79] 3.9.6-stable review Greg Kroah-Hartman
2013-06-11 20:02 ` [ 01/79] USB: serial: Add Option GTM681W to qcserial device table Greg Kroah-Hartman
2013-06-11 20:02 ` [ 02/79] USB: option: blacklist network interface on Huawei E1820 Greg Kroah-Hartman
2013-06-11 20:02 ` [ 03/79] USB: option,zte_ev: move most ZTE CDMA devices to zte_ev Greg Kroah-Hartman
2013-06-11 20:02 ` [ 04/79] usb: dwc3: pci: PHY should be deleted later than dwc3 core Greg Kroah-Hartman
2013-06-11 20:02 ` [ 05/79] xhci - correct comp_mode_recovery_timer on return from hibernate Greg Kroah-Hartman
2013-06-11 20:02 ` [ 06/79] xhci-mem: init list heads at the beginning of init Greg Kroah-Hartman
2013-06-11 20:02 ` [ 07/79] xhci: fix list access before init Greg Kroah-Hartman
2013-06-11 20:02 ` [ 08/79] xhci: Disable D3cold for buggy TI redrivers Greg Kroah-Hartman
2013-06-11 20:02 ` [ 09/79] x86/PCI: Map PCI setup data with ioremap() so it can be in highmem Greg Kroah-Hartman
2013-06-11 20:02 ` [ 10/79] usb: musb: make use_sg flag URB specific Greg Kroah-Hartman
2013-06-11 20:02 ` [ 11/79] ALSA: usb-audio: fix Roland/Cakewalk UM-3G support Greg Kroah-Hartman
2013-06-11 20:02 ` [ 12/79] ALSA: usb-audio - Apply Logitech QuickCam Pro 9000 quirk only to audio iface Greg Kroah-Hartman
2013-06-11 20:02 ` [ 13/79] ALSA: usb-audio - Fix invalid volume resolution on Logitech HD webcam c270 Greg Kroah-Hartman
2013-06-11 20:02 ` [ 14/79] USB: iuu_phoenix: fix bulk-message timeout Greg Kroah-Hartman
2013-06-11 20:02 ` [ 15/79] USB: keyspan: fix bogus array index Greg Kroah-Hartman
2013-06-11 20:02 ` [ 16/79] USB: ark3116: fix control-message timeout Greg Kroah-Hartman
2013-06-11 20:02 ` [ 17/79] USB: visor: fix initialisation of Treo/Kyocera devices Greg Kroah-Hartman
2013-06-11 20:02 ` [ 18/79] USB: zte_ev: fix control-message timeouts Greg Kroah-Hartman
2013-06-11 20:02 ` [ 19/79] USB: zte_ev: fix broken open Greg Kroah-Hartman
2013-06-11 20:02 ` [ 20/79] USB: Serial: cypress_M8: Enable FRWD Dongle hidcom device Greg Kroah-Hartman
2013-06-11 20:02 ` [ 21/79] USB: whiteheat: fix broken port configuration Greg Kroah-Hartman
2013-06-11 20:02 ` [ 22/79] USB: serial: fix Treo/Kyocera interrrupt-in urb context Greg Kroah-Hartman
2013-06-11 20:02 ` [ 23/79] USB: revert periodic scheduling bugfix Greg Kroah-Hartman
2013-06-11 20:02 ` [ 24/79] USB: mos7840: fix DMA to stack Greg Kroah-Hartman
2013-06-11 20:02 ` [ 25/79] USB: mos7720: " Greg Kroah-Hartman
2013-06-11 20:02 ` [ 26/79] USB: mos7720: fix message timeouts Greg Kroah-Hartman
2013-06-11 20:02 ` [ 27/79] USB: mos7720: fix hardware flow control Greg Kroah-Hartman
2013-06-11 20:02 ` [ 28/79] acpi-cpufreq: set current frequency based on target P-State Greg Kroah-Hartman
2013-06-11 20:02 ` [ 29/79] ACPI / video: ignore BIOS initial backlight value for HP m4 Greg Kroah-Hartman
2013-06-11 20:02 ` [ 30/79] ACPI / video: ignore BIOS initial backlight value for HP Pavilion g6 Greg Kroah-Hartman
2013-06-11 20:02 ` [ 31/79] ACPI / scan: do not match drivers against objects having scan handlers Greg Kroah-Hartman
2013-06-11 20:02 ` [ 32/79] ACPI / PM: Do not execute _PS0 for devices without _PSC during initialization Greg Kroah-Hartman
2013-06-11 20:02 ` [ 33/79] x86 / platform / hp_wmi: Fix bluetooth_rfkill misuse in hp_wmi_rfkill_setup() Greg Kroah-Hartman
2013-06-11 20:03 ` [ 34/79] ALSA: hda/via - Disable broken dynamic power control Greg Kroah-Hartman
2013-06-11 20:03 ` [ 35/79] ALSA: hda/via - Fix wrongly cleared pins after suspend on VT1802 Greg Kroah-Hartman
2013-06-11 20:03 ` [ 36/79] ALSA: hda - Allow setting automute/automic hooks after parsing Greg Kroah-Hartman
2013-06-11 20:03 ` [ 37/79] ALSA: hda - Add keep_eapd_on flag to generic parser Greg Kroah-Hartman
2013-06-11 20:03 ` [ 38/79] ARM: Kirkwood: TS219: Fix crash by double PCIe instantiation Greg Kroah-Hartman
2013-06-11 20:03 ` [ 39/79] ARM: 7742/1: topology: export cpu_topology Greg Kroah-Hartman
2013-06-11 20:03 ` [ 40/79] ARM: 7743/1: compressed/head.S: work around new binutils warning Greg Kroah-Hartman
2013-06-11 20:03 ` [ 41/79] ARM: 7747/1: pcpu: ensure __my_cpu_offset cannot be re-ordered across barrier() Greg Kroah-Hartman
2013-06-11 20:03 ` [ 42/79] powerpc/eeh: Dont check RTAS token to get PE addr Greg Kroah-Hartman
2013-06-11 20:03 ` [ 43/79] powerpc/hw_breakpoints: Add DABRX cpu feature to fix 32-bit regression Greg Kroah-Hartman
2013-06-11 20:03 ` [ 44/79] powerpc/perf: Fix deadlock caused by calling printk() in PMU exception Greg Kroah-Hartman
2013-06-11 20:03 ` [ 45/79] dmaengine: ste_dma40: fix pm runtime ref counting Greg Kroah-Hartman
2013-06-11 20:03 ` [ 46/79] radeon: Fix system hang issue when using KMS with older cards Greg Kroah-Hartman
2013-06-11 20:03 ` [ 47/79] drm/radeon: dont allow audio on DCE6 Greg Kroah-Hartman
2013-06-11 20:03 ` [ 48/79] hpfs: fix warnings when the filesystem fills up Greg Kroah-Hartman
2013-06-11 20:03 ` [ 49/79] cifs: fix off-by-one bug in build_unc_path_to_root Greg Kroah-Hartman
2013-06-11 20:03 ` [ 50/79] ecryptfs: fixed msync to flush data Greg Kroah-Hartman
2013-06-11 20:03 ` [ 51/79] eCryptfs: Check return of filemap_write_and_wait during fsync Greg Kroah-Hartman
2013-06-11 20:03 ` [ 52/79] hwmon: (adm1021) Strengthen chip detection for ADM1021, LM84 and MAX1617 Greg Kroah-Hartman
2013-06-11 20:03 ` [ 53/79] drm/mgag200: Add missing write to index before accessing data register Greg Kroah-Hartman
2013-06-11 20:03 ` [ 54/79] drm: fix a use-after-free when GPU acceleration disabled Greg Kroah-Hartman
2013-06-11 20:03 ` [ 55/79] drm/i915/sdvo: Use &intel_sdvo->ddc instead of intel_sdvo->i2c for DDC Greg Kroah-Hartman
2013-06-11 20:03 ` [ 56/79] drm/i915: no lvds quirk for hp t5740 Greg Kroah-Hartman
2013-06-11 20:03 ` [ 57/79] drm/i915: Fix spurious -EIO/SIGBUS on wedged gpus Greg Kroah-Hartman
2013-06-11 20:03 ` [ 58/79] Revert "ACPI / scan: do not match drivers against objects having scan handlers" Greg Kroah-Hartman
2013-06-11 20:03 ` [ 59/79] powerpc: Fix build error in stable/3.9 Greg Kroah-Hartman
2013-06-11 20:03 ` [ 60/79] usb: dwc3: gadget: free trb pool only from epnum 2 Greg Kroah-Hartman
2013-06-11 20:03 ` [ 61/79] drm/gma500: Increase max resolution for mode setting Greg Kroah-Hartman
2013-06-11 20:03 ` [ 62/79] pci: Set dev->dev.type in alloc_pci_dev Greg Kroah-Hartman
2013-06-11 20:03 ` [ 63/79] powerpc: Set default VGA device Greg Kroah-Hartman
2013-06-11 20:03 ` [ 64/79] powerpc/pseries: Force 32 bit MSIs for devices that require it Greg Kroah-Hartman
2013-06-11 20:03 ` [ 65/79] powerpc/pseries: Make 32-bit MSI quirk work on systems lacking firmware support Greg Kroah-Hartman
2013-06-12 17:19   ` Kleber Sacilotto de Souza [this message]
2013-06-11 20:03 ` [ 66/79] powerpc/pseries: Perform proper max_bus_speed detection Greg Kroah-Hartman
2013-06-11 20:03 ` [ 67/79] radeon: use max_bus_speed to activate gen2 speeds Greg Kroah-Hartman
2013-06-11 20:03 ` [ 68/79] iio:inkern: Fix typo/bug in convert raw to processed Greg Kroah-Hartman
2013-06-11 20:03 ` [ 69/79] iio: frequency: ad4350: Fix bug / typo in mask Greg Kroah-Hartman
2013-06-11 20:03 ` [ 70/79] drm/i915: force full modeset if the connector is in DPMS OFF mode Greg Kroah-Hartman
2013-06-11 20:03 ` [ 71/79] USB: serial: add wait_until_sent operation Greg Kroah-Hartman
2013-06-11 20:03 ` [ 72/79] USB: serial: add generic wait_until_sent implementation Greg Kroah-Hartman
2013-06-11 20:03 ` [ 73/79] USB: ftdi_sio: clean up get_modem_status Greg Kroah-Hartman
2013-06-11 20:03 ` [ 74/79] USB: ftdi_sio: fix chars_in_buffer overhead Greg Kroah-Hartman
2013-06-11 20:03 ` [ 75/79] USB: io_ti: " Greg Kroah-Hartman
2013-06-11 20:03 ` [ 76/79] Fix lockup related to stop_machine being stuck in __do_softirq Greg Kroah-Hartman
2013-06-11 20:03 ` [ 77/79] xen/smp: Fixup NOHZ per cpu data when onlining an offline CPU Greg Kroah-Hartman
2013-06-11 20:03 ` [ 78/79] timekeeping: Correct run-time detection of persistent_clock Greg Kroah-Hartman
2013-06-11 20:03 ` [ 79/79] s390: Add pgste to ptep_modify_prot_start() Greg Kroah-Hartman
2013-06-12 14:06 ` [ 00/79] 3.9.6-stable review Guenter Roeck
2013-06-12 14:15   ` Josh Boyer
2013-06-12 14:21     ` Guenter Roeck
2013-06-12 15:49 ` Shuah Khan
2013-06-12 16:58   ` Greg Kroah-Hartman
2013-06-12 20:29 ` Guenter Roeck
2013-06-12 20:34   ` Guenter Roeck
2013-06-12 20:53     ` Kleber Sacilotto de Souza
2013-06-13 17:41       ` Greg Kroah-Hartman
2013-06-13 17:45         ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51B8ADAA.2080404@linux.vnet.ibm.com \
    --to=klebers@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=brking@linux.vnet.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).