mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 13:30:31 +00:00
Kernel: Clear pending interrupts before enabling IRQs of IDE Channel
Calling detect_disks() can generate interrupts, so we must clear it to allow proper function when booting with kernel argument smp=on.
This commit is contained in:
parent
f2faf11d61
commit
865aade42b
Notes:
sideshowbarker
2024-07-18 22:35:17 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/865aade42b4 Pull-request: https://github.com/SerenityOS/serenity/pull/5236 Issue: https://github.com/SerenityOS/serenity/issues/5229
2 changed files with 10 additions and 0 deletions
|
@ -142,9 +142,17 @@ IDEChannel::IDEChannel(const IDEController& controller, IOAddressGroup io_group,
|
|||
|
||||
initialize(force_pio);
|
||||
detect_disks();
|
||||
|
||||
// Note: calling to detect_disks could generate an interrupt, clear it if that's the case
|
||||
clear_pending_interrupts();
|
||||
enable_irq();
|
||||
}
|
||||
|
||||
void IDEChannel::clear_pending_interrupts() const
|
||||
{
|
||||
m_io_group.io_base().offset(ATA_REG_STATUS).in<u8>();
|
||||
}
|
||||
|
||||
IDEChannel::~IDEChannel()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -138,6 +138,8 @@ private:
|
|||
void start_request(AsyncBlockDeviceRequest&, bool, bool, u16);
|
||||
void complete_current_request(AsyncDeviceRequest::RequestResult);
|
||||
|
||||
void clear_pending_interrupts() const;
|
||||
|
||||
void ata_access(Direction, bool, u32, u8, u16, bool);
|
||||
void ata_read_sectors_with_dma(bool, u16);
|
||||
void ata_read_sectors(bool, u16);
|
||||
|
|
Loading…
Reference in a new issue