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

From: Jork Loeser
Date: Wed May 24 2017 - 11:07:16 EST


> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx]
> Sent: Friday, May 19, 2017 04:27
> To: Jork Loeser <Jork.Loeser@xxxxxxxxxxxxx>
> Cc: helgaas@xxxxxxxxxx; linux-pci@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; devel@xxxxxxxxxxxxxxxxxxxxxx; olaf@xxxxxxxxx;
> apw@xxxxxxxxxxxxx; vkuznets@xxxxxxxxxx; jasowang@xxxxxxxxxx;
> leann.ogasawara@xxxxxxxxxxxxx; marcelo.cerri@xxxxxxxxxxxxx; Stephen
> Hemminger <sthemmin@xxxxxxxxxxxxx>
> 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