lkml.org 
[lkml]   [2021]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [RFC 13/13] scsi: megaraid: Make use of dev_64bit_mmio_supported()
    On Fri, Feb 26, 2021 at 3:03 PM Nicolas Saenz Julienne
    <nsaenzjulienne@suse.de> wrote:

    > unsigned long flags;
    > - spin_lock_irqsave(&instance->hba_lock, flags);
    > - writel(le32_to_cpu(req_desc->u.low),
    > - &instance->reg_set->inbound_low_queue_port);
    > - writel(le32_to_cpu(req_desc->u.high),
    > - &instance->reg_set->inbound_high_queue_port);
    > - spin_unlock_irqrestore(&instance->hba_lock, flags);

    > +
    > + if (dev_64bit_mmio_supported(&instance->pdev->dev)) {
    > + writeq(req_data, &instance->reg_set->inbound_low_queue_port);
    > + } else {
    > + spin_lock_irqsave(&instance->hba_lock, flags);
    > + lo_hi_writeq(req_data, &instance->reg_set->inbound_low_queue_port);
    > + spin_unlock_irqrestore(&instance->hba_lock, flags);
    > + }

    I see your patch changes the code to the lo_hi_writeq() accessor,
    and it also fixes the endianness bug (double byteswap on big-endian),
    but it does not fix the spinlock bug (writel on pci leaks out of the lock
    unless it's followed by a read).

    I'd suggest splitting the bugfix from the cleanup here, and fixing both
    of the bugs while you're at it.

    Arnd

    \
     
     \ /
      Last update: 2021-02-26 15:33    [W:3.575 / U:0.172 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site