RE: [PATCH 4/4] Hyper-V vPCI: use vPCI protocol version 1.2

Jork Loeser
2017-05-24T15:07:12Z

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Friday, May 19, 2017 04:27
> To: Jork Loeser <Jork.Loeser@microsoft.com>
> Cc: helgaas@kernel.org; linux-pci@vger.kernel.org; linux-
> kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; vkuznets@redhat.com; jasowang@redhat.com;
> leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen
> Hemminger <sthemmin@microsoft.com>
> Subject: Re: [PATCH 4/4] Hyper-V vPCI: use vPCI protocol version 1.2
>
> Minor nits only.

> > +#define HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED (1 << 11)
>
> Use BIT(11). I thought checkpatch.pl complains about this but I guess that's only
> with the --strict option.

Not addressing here as per Stephen's comment - this use is prevalent in the current code.

> > @@ -900,36 +1074,42 @@ static void hv_compose_msi_msg(struct irq_data
[...]
> > + switch (pci_protocol_version) {
> > + case PCI_PROTOCOL_VERSION_1_1:
[...]
> > + default:
> > + /* As we only negotiate protocol versions known to this driver,
> > + * this path should never hit. However, this is it not a hot
> > + * path so we print a message to aid future updates.
> > + */
> > + dev_err(&hbus->hdev->device,
> > + "Unexpected vPCI protocol, update driver.");
>
> We should check the protocol version in probe() instead of here.

It is checked in probe(). The catch-all is merely a helper in case future updates miss adapting.

Regards,
Jork