Subject: Re: [patch 1/5][RFC] NET: Change pci_enable_device topci_reenable_device to keep device enable balance

From: "Kok, Auke" <[email-masked]>
Date: Thu, 09 Aug 2007 13:49:20 -0700

Brandon Philips wrote:
> On 17:30 Wed 08 Aug 2007, Ramkrishna Vepa wrote:
>> Before slot_reset event is called io_error_detected could be called
>> (where pci_disable_device() is called), right? 
> 
> Oops!  Right, the documentation says .error_detected is _always_ called
> before .slot_reset.  So, this patch is not correct.  Please don't merge
> this.
> 
> From Documentation/pci-error-recovery.txt:
> 
> STEP 1: Notification
> --------------------
> Platform calls the error_detected() callback on every instance of
> every driver affected by the error.
> ...
> 
> If any driver requested a slot reset (by returning PCI_ERS_RESULT_NEED_RESET),
> then recovery proceeds to STEP 4 (Slot Reset).
> 
>> The pci_reenable_device() will call enable only if the device was
>> enabled before and would not be enabled if the device were disabled. Is
>> this the intended behavior?
> 
> Yes, you are right.  And no it isn't.

it would be great if you can convince Linas Vepstas to review and ack your patch 
- he's the one who knows the error handling code the best.

Auke