qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/7] msi: Guard msi/msix_write_config with msi_p


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 2/7] msi: Guard msi/msix_write_config with msi_present
Date: Wed, 08 Jun 2011 14:33:17 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2011-06-08 14:28, Gerd Hoffmann wrote:
>> @@ -1173,12 +1173,8 @@ static int intel_hda_exit(PCIDevice *pci)
>>   static void intel_hda_write_config(PCIDevice *pci, uint32_t addr,
>>                                      uint32_t val, int len)
>>   {
>> -    IntelHDAState *d = DO_UPCAST(IntelHDAState, pci, pci);
>> -
>>       pci_default_write_config(pci, addr, val, len);
>> -    if (d->msi) {
>> -        msi_write_config(pci, addr, val, len);
>> -    }
>> +    msi_write_config(pci, addr, val, len);
>>   }
> 
> Nothing device specific left in there now.  If msi_write_config() checks 
> itself whenever msi is enabled or not we could call it from 
> pci_default_write_config(), then zap this function altogether, no?

Well, we could put those helpers (msi_write_config, msi_reset, maybe
more) into generic PCI code. Then device will only have to overload the
handlers if they do something in addition. Haven't checked the details
yet, though.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux



reply via email to

[Prev in Thread] Current Thread [Next in Thread]