From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: sthemmin@microsoft.com, linux-pci@vger.kernel.org,
haiyangz@microsoft.com, linux-kernel@vger.kernel.org,
bhelgaas@google.com, devel@linuxdriverproject.org
Subject: Re: [PATCH 1/2] pci: host: pci-hyperv: Replace GFP_ATOMIC with GFP_KERNEL in hv_pci_onchannelcallback
Date: Mon, 19 Mar 2018 16:53:52 +0800 [thread overview]
Message-ID: <63a95bfd-0199-b935-b8d0-2b73d82e8d46@gmail.com> (raw)
In-Reply-To: <20180319083850.tglknmwwybdhahfl@mwanda>
On 2018/3/19 16:38, Dan Carpenter wrote:
> On Sun, Mar 18, 2018 at 10:53:02PM +0800, Jia-Ju Bai wrote:
>> hv_pci_onchannelcallback() is not called in atomic context.
>>
>> The call chain ending up at hv_pci_onchannelcallback() is:
>> [1] hv_pci_onchannelcallback() <- hv_pci_probe()
>> hv_pci_probe() is only set as ".probe" in hv_driver
>> structure "hv_pci_drv".
>>
> Your static analysis tool is faulty and apparently so is Smatch.
>
> $ smdb function_ptrs hv_pci_onchannelcallback
>
> Says it can't find a caller. When I look for function pointers I get:
>
> $ smdb function_ptr hv_pci_onchannelcallback
> hv_pci_onchannelcallback = 'hv_pci_onchannelcallback' , 'vmbus_open param 5' , '(struct vmbus_channel)->onchannel_callback' , '__read_once_size param 0'
>
> Anyway the call tree is:
>
> vmbus_chan_sched() <-- takes rcu_read_lock();
> -> vmbus_channel_isr()
> -> channel->onchannel_callback() -> which is hv_pci_onchannelcallback(
Thanks for your reply :)
I admit my tool produces a false positive for this code...
Sorry for my incorrect patch.
Anyway, I find that function pointers are quite hard to analyze in the
Linux kernel code, because their usages are often flexible.
Have you found a good way to handle function pointers? Or can you
recommend some good tools to handle them?
Best wishes,
Jia-Ju Bai
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2018-03-19 8:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-18 14:53 Jia-Ju Bai
2018-03-18 22:40 ` Michael Kelley (EOSG)
2018-03-19 2:52 ` KY Srinivasan
2018-03-19 3:44 ` Jia-Ju Bai
2018-03-19 8:38 ` Dan Carpenter
2018-03-19 8:53 ` Jia-Ju Bai [this message]
2018-03-19 10:29 ` Dan Carpenter
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=63a95bfd-0199-b935-b8d0-2b73d82e8d46@gmail.com \
--to=baijiaju1990@gmail.com \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®