Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668690

Re: [PATCH] PCI: Move test of INTx masking to pci_setup_device

From Piotr Gregor <piotrgregor@rsyncme.org>
Newsgroups linux.kernel
Subject Re: [PATCH] PCI: Move test of INTx masking to pci_setup_device
Date 2017-06-19 02:40 +0200
Message-ID <tTSTw-3MS-5@gated-at.bofh.it> (permalink)
References <tLyIi-4Vw-31@gated-at.bofh.it> <tT8nD-6yN-7@gated-at.bofh.it> <tTq1b-1Yp-3@gated-at.bofh.it> <tTx2G-6Ue-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Jun 17, 2017 at 08:14:33PM -0500, Bjorn Helgaas wrote:
> On Sat, Jun 17, 2017 at 06:45:44PM +0100, Piotr Gregor wrote:
> > Hi Bjorn,
> > 
> > The pci_cfg_access_lock is most likely not needed there.
> > The assignment by return type is indeed preferred in this case.
> > 
> > However, you have changed the meaning of returned boolean information
> > by pci_intx_mask_broken leaving pci_intx_mask_supported unchanged.
> > The test should be: 
> > 
> >     if (new != toggle) /* the test failed */
> > 	        return 1;
> > 	return 0;
> 
> Oh, you're absolutely right, thanks for catching that!  I updated my
> pci/enumeration branch.
> 
> > Regarding v2.3 - do you think it is worth to apply the check
> > so we would have something like
> > 
> >     if ((new == toggle) || PCI_VERSION_PRIOR_TO_23) /* test OK or PCI prior to r2.3 */
> > 	        return 0;
> > 	return 1;
> 
> I'm not sure how to test for r2.3 compliance.  But even if we could, I
> guess I think the current code is probably better because it actually
> checks the property we care about, not a spec revision that is one
> step removed from the property.
> 
> Bjorn

Hi Bjorn,

You are right, having

        if ((new == toggle) || PCI_VERSION_PRIOR_TO_23) /* test OK or PCI prior to r2.3 */
		        return 0;
        return 1;

would be incorrect, as if new != toggle then PCI_COMMAND_INTX_DISABLE is not writable
so INTx masking support should be considered broken (regardless of PCI version).

Piotr

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] PCI: Move test of INTx masking to pci_setup_device Bjorn Helgaas <helgaas@kernel.org> - 2017-06-17 01:00 +0200
  Re: [PATCH] PCI: Move test of INTx masking to pci_setup_device Piotr Gregor <piotrgregor@rsyncme.org> - 2017-06-17 19:50 +0200
    Re: [PATCH] PCI: Move test of INTx masking to pci_setup_device Bjorn Helgaas <helgaas@kernel.org> - 2017-06-18 03:20 +0200
      Re: [PATCH] PCI: Move test of INTx masking to pci_setup_device Piotr Gregor <piotrgregor@rsyncme.org> - 2017-06-19 02:40 +0200

csiph-web