From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 338A1C433DB for ; Fri, 26 Feb 2021 18:08:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C532F64F17 for ; Fri, 26 Feb 2021 18:08:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C532F64F17 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S4i0Kp4hfSJ/EW256P8a9gFPMC0WXUOkit+sIoMHNA4=; b=fE/VTNe2tuL+Kzrd783ygxyfp tXAQ8TEZFAdBS+JOGMStk4phViVNzkB8xdPdBfAZnmWWpKzrAE5x/UPNd/x8CWeNnWT3hexjWVMld TRdbW6YblDpZf2qYNzudt02mc9uWeqsen7kcdPYTFV/iSv0bBCuVxFzBAVjybMkEJXxFCuA50oU2n iPOgB4Eck0KH2/HJquliO2j1zTfmPVs3xF0wVDFg5/onpdFygCKKX6us2XWeW0KIeT8D4t6W0F8HI z2b5e3KRT1f568yLLyKXRA6iEFcCXEiBhgswnu94vRQgCfv0KovmjpbmmwjQwHfs+55euC9sYUx8m fUIwyqL7A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFhW5-00028j-Jr; Fri, 26 Feb 2021 18:07:05 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFhW2-000286-SO for linux-arm-kernel@lists.infradead.org; Fri, 26 Feb 2021 18:07:03 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 578FB64F21 for ; 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-f178.google.com with SMTP id q186so10572965oig.12 for ; Fri, 26 Feb 2021 10:07:01 -0800 (PST) X-Gm-Message-State: AOAM5339lUn7sK0chqm+6r0nylwNAuqEJ3GxNBm4mnhsp5mU+cBcPtex nnEaGsuj/HQ6QhSfsBSE4BAX0KhCMAIr46SeHQw= X-Google-Smtp-Source: ABdhPJyeZg3Pwe0jqw+NGo0qyDRNND7ksKo0FA7RNXG7z9WTLUgtfxlM+JIQEpOq+Q9tvDsGtU+39X1uraynmxH6nvs= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210226_130703_045121_D234FB53 X-CRM114-Status: GOOD ( 18.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: DTML , Florian Fainelli , Arnd Bergmann , Neil Armstrong , David Woodhouse , "linux-kernel@vger.kernel.org" , Russell King - ARM Linux , Christoph Hellwig , Will Deacon , Rob Herring , Catalin Marinas , Robin Murphy , Ard Biesheuvel , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel