Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1420191pxb; Fri, 26 Feb 2021 10:11:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDoKjw7ZekWf5u6shHkFAYhkJzKEKe/uM3KB7Ct744AcVgE/7j9nskkrlyr7jreJGPhIsY X-Received: by 2002:a17:906:37db:: with SMTP id o27mr3788712ejc.60.1614363081889; Fri, 26 Feb 2021 10:11:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614363081; cv=none; d=google.com; s=arc-20160816; b=wmMp8vtl8OjA5aJlR1cl+rntrvYC/zv0s/81YVBfF4AncVBq1A1DFS3AzNUi7ly+rN 28OrIEE8PytJNmfBphcIcJHE1wAL0D+l6B9A1aBcFjNsY49Gw9WDKIqE9ejEBjkvLV+r q98LBuJniq2EK/bCD9p/4d6k0Boxm23VS1EuJ1ic3qqTWkvY6BxXnMAt1v4rnAuNsimI aJBK+lghb8GaqEOmx9Z/zEDfaztZ3AZkAhTe1EUqcBHWWIyCPsv3XQGwRHC3V7JZv6Yr h7/czAbqQF+LmaeFYsL16sxwfx3ZVHhhoQMjKkAAEUBY3buaeYErHivT8l6AcdEES7OO SNYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7e22rYCIRdWOBz1lCPHICljzopQwHbfJrOPokD3kyoM=; b=VApLSKRDiinqxD0CD/r/cBrR7gS/k5ADCP0vvxlw0XKowa4gqUz1GMnLjp7oZY0Ywk 3rurn9r8jxiuVeXxRjFgjngMFDcYBbH2CXSbCizcIi/T7Dc+OJCWKym7WMlr8RPLYYLB M8C6bqyPQQTELPVqEufj2eZ/uFgEy4tzS20uTLJWnZvu2+CgJ9At0ALMVrIU3ZOnP2ts eAF1RbvNeqYBLkkYAhwHquMl5z2pEUUt1hwkOUaQB/WqPAipfWKqyTWrFReScQmS10gp lyIL7D18elPPVAK89WsCCvyc3shYg7fNXQxRDBmoSMzOc64p6q0XaDSU9q17tMk4Yoob Qnkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rh1bns5s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si6510566edr.483.2021.02.26.10.10.57; Fri, 26 Feb 2021 10:11:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rh1bns5s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbhBZSHo (ORCPT + 99 others); Fri, 26 Feb 2021 13:07:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:52222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbhBZSHl (ORCPT ); Fri, 26 Feb 2021 13:07:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3327A64F17; Fri, 26 Feb 2021 18:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614362821; bh=MsTenNoyOnWmOLDR4TgPo35YUl2jpUyfq4i4eUjVLSY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Rh1bns5sUNNDacFR+rXol0byU633qLb3eJ3Fy/97VgbvaWXeP1X0Jbcgwdvc8LrG4 c42fkje7HR81HJlf03QcNz45JISLidxUahvGTS86gtQvmmlBU8aU000OwRtcyScAIU f9ERBN0D/HrA/S0mjKWbHgM7l3qSz7ZMIC2O2dd6nTlP64d7zilQZZ3Qu6y66KDQnU i2teBVtXx0kdoULktpCNWZfd89/LJSnroftYnGgaEfP7pKLxaY/pEpEQDr055SxYjP Iz3HRLSvnxit637oMepDvYl+p0YF+iUB42doBLa2gvjtsiA5akdt8/QohTtV53Vh9g Qk14gwmJi+D2w== Received: by mail-oi1-f177.google.com with SMTP id j1so10623639oiw.3; Fri, 26 Feb 2021 10:07:01 -0800 (PST) X-Gm-Message-State: AOAM533CEkOq1J+isYDREutBBGn2CGE7MweNJPXUB4g3aIGaLgMnNGZl 6x0D1ck0MUd5gnBZsEhTkBdB34PmXcvlF9PXmJg= X-Received: by 2002:aca:4fd3:: with SMTP id d202mr2839613oib.11.1614362820512; Fri, 26 Feb 2021 10:07:00 -0800 (PST) MIME-Version: 1.0 References: <20210226140305.26356-1-nsaenzjulienne@suse.de> <20210226140305.26356-14-nsaenzjulienne@suse.de> In-Reply-To: From: Arnd Bergmann Date: Fri, 26 Feb 2021 19:06:43 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 13/13] scsi: megaraid: Make use of dev_64bit_mmio_supported() To: Nicolas Saenz Julienne Cc: Linux ARM , DTML , "linux-kernel@vger.kernel.org" , Florian Fainelli , Rob Herring , Robin Murphy , Ard Biesheuvel , Christoph Hellwig , Neil Armstrong , David Woodhouse , Russell King - ARM Linux , Catalin Marinas , Arnd Bergmann , Will Deacon Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 26, 2021 at 3:30 PM Arnd Bergmann wrote: > > On Fri, Feb 26, 2021 at 3:03 PM Nicolas Saenz Julienne > 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). On second look, it seems your patch breaks the byteorder logic, rather than fixing it. It would seem better to leave it unchanged then, or to send a separate rework of the endianness conversion if you think it is wrong. Arnd