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


Groups > linux.kernel > #1670991

Re: [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_pci_mem_access_direct

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_pci_mem_access_direct
Date 2017-06-20 19:40 +0200
Message-ID <tUvia-3ak-31@gated-at.bofh.it> (permalink)
References <tTUVj-56V-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Jia-Ju Bai <baijiaju1990@163.com>
Date: Mon, 19 Jun 2017 10:48:53 +0800

> The driver may sleep under a spin lock, and the function call path is:
> netxen_nic_pci_mem_access_direct (acquire the lock by spin_lock)
>   ioremap --> may sleep
> 
> To fix it, the lock is released before "ioremap", and the lock is 
> acquired again after this function.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>

This style of change you are making is really starting to be a
problem.

You can't just drop locks like this, especially without explaining
why it's ok, and why the mutual exclusion this code was trying to
achieve is still going to be OK afterwards.

In fact, I see zero analysis of the locking situation here, why
it was needed in the first place, and why your change is OK in
that context.

Any locking change is delicate, and you must put the greatest of
care and consideration into it.

Just putting "unlock/lock" around the sleeping operation shows a
very low level of consideration for the implications of the change
you are making.

This isn't like making whitespace fixes, sorry...

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


Thread

Re: [PATCH] netxen: Fix a sleep-in-atomic bug in  netxen_nic_pci_mem_access_direct David Miller <davem@davemloft.net> - 2017-06-20 19:40 +0200
  Re: [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_pci_mem_access_direct Kalle Valo <kvalo@codeaurora.org> - 2017-06-21 08:20 +0200
    Re: [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_pci_mem_access_direct Jia-Ju Bai <baijiaju1990@163.com> - 2017-06-21 08:40 +0200
      Re: [PATCH] netxen: Fix a sleep-in-atomic bug in  netxen_nic_pci_mem_access_direct Bo Yu <tsu.yubo@gmail.com> - 2017-06-21 11:50 +0200
      Re: [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_pci_mem_access_direct Kalle Valo <kvalo@codeaurora.org> - 2017-06-21 15:50 +0200
        Re: [PATCH] netxen: Fix a sleep-in-atomic bug in  netxen_nic_pci_mem_access_direct Jia-Ju Bai <baijiaju1990@163.com> - 2017-06-21 16:40 +0200
        Re: [PATCH] netxen: Fix a sleep-in-atomic bug in  netxen_nic_pci_mem_access_direct Dan Carpenter <dan.carpenter@oracle.com> - 2017-06-22 08:10 +0200
          Re: [PATCH] netxen: Fix a sleep-in-atomic bug in  netxen_nic_pci_mem_access_direct Jia-Ju Bai <baijiaju1990@163.com> - 2017-06-22 13:00 +0200

csiph-web