All of lore.kernel.org
 help / color / mirror / Atom feed
From: Long Li <longli@microsoft.com>
To: Bjorn Helgaas <helgaas@kernel.org>,
	"longli@linuxonhyperv.com" <longli@linuxonhyperv.com>
Cc: KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Sasha Levin <sashal@kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Andrew Murray <andrew.murray@arm.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [Patch v2 1/2] PCI: hv: decouple the func definition in hv_dr_state from VSP message
Date: Sun, 22 Dec 2019 02:47:18 +0000	[thread overview]
Message-ID: <BL0PR2101MB11232C53CC44A092F7B0C7C9CE2F0@BL0PR2101MB1123.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20191210235450.GA177105@google.com>

>Subject: Re: [Patch v2 1/2] PCI: hv: decouple the func definition in
>hv_dr_state from VSP message
>
>Run "git log --oneline drivers/pci/controller/pci-hyperv.c" and make yours
>match.  Capitalize the first word, etc.
>
>On Tue, Dec 03, 2019 at 06:53:36PM -0800, longli@linuxonhyperv.com wrote:
>> From: Long Li <longli@microsoft.com>
>>
>> hv_dr_state is used to find present PCI devices on the bus. The
>> structure reuses struct pci_function_description from VSP message to
>describe a device.
>>
>> To prepare support for pci_function_description v2, we need to
>> decouple this dependence in hv_dr_state so it can work with both v1 and v2
>VSP messages.
>>
>> There is no functionality change.
>>
>> Signed-off-by: Long Li <longli@microsoft.com>
>
>> + * hv_pci_devices_present() - Handles list of new children
>> + * @hbus:	Root PCI bus, as understood by this driver
>> + * @relations:	Packet from host listing children
>> + *
>> + * This function is invoked whenever a new list of devices for
>> + * this bus appears.
>
>The comment should tell us what the function *does*, not when it is called.

I will send v3 to address the comments.

Thanks

Long

>
>> + */
>> +static void hv_pci_devices_present(struct hv_pcibus_device *hbus,
>> +				   struct pci_bus_relations *relations) {
>> +	struct hv_dr_state *dr;
>> +	int i;
>> +
>> +	dr = kzalloc(offsetof(struct hv_dr_state, func) +
>> +		     (sizeof(struct hv_pcidev_description) *
>> +		      (relations->device_count)), GFP_NOWAIT);
>> +
>> +	if (!dr)
>> +		return;
>> +
>> +	dr->device_count = relations->device_count;
>> +	for (i = 0; i < dr->device_count; i++) {
>> +		dr->func[i].v_id = relations->func[i].v_id;
>> +		dr->func[i].d_id = relations->func[i].d_id;
>> +		dr->func[i].rev = relations->func[i].rev;
>> +		dr->func[i].prog_intf = relations->func[i].prog_intf;
>> +		dr->func[i].subclass = relations->func[i].subclass;
>> +		dr->func[i].base_class = relations->func[i].base_class;
>> +		dr->func[i].subsystem_id = relations->func[i].subsystem_id;
>> +		dr->func[i].win_slot = relations->func[i].win_slot;
>> +		dr->func[i].ser = relations->func[i].ser;
>> +	}
>> +
>> +	if (hv_pci_start_relations_work(hbus, dr))
>> +		kfree(dr);
>>  }

      reply	other threads:[~2019-12-22  2:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04  2:53 [Patch v2 1/2] PCI: hv: decouple the func definition in hv_dr_state from VSP message longli
2019-12-04  2:53 ` [Patch v2 2/2] PCI: hv: Add support for protocol 1.3 and support PCI_BUS_RELATIONS2 longli
2019-12-04 19:44   ` Michael Kelley
2019-12-04 19:41 ` [Patch v2 1/2] PCI: hv: decouple the func definition in hv_dr_state from VSP message Michael Kelley
2019-12-10 23:54 ` Bjorn Helgaas
2019-12-22  2:47   ` Long Li [this message]

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=BL0PR2101MB11232C53CC44A092F7B0C7C9CE2F0@BL0PR2101MB1123.namprd21.prod.outlook.com \
    --to=longli@microsoft.com \
    --cc=andrew.murray@arm.com \
    --cc=haiyangz@microsoft.com \
    --cc=helgaas@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=longli@linuxonhyperv.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.