Message ID | 20230614064931.3263-2-orlandoch.dev@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1053525vqr; Wed, 14 Jun 2023 00:16:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4y24TjYS2tbwBdPrAnNt0DaLQS35rp2LdIUWNy7OFNneWuC0Pk0IRnv+Ifl9jDMiqC7B2O X-Received: by 2002:a17:907:a40f:b0:973:84b0:b077 with SMTP id sg15-20020a170907a40f00b0097384b0b077mr690719ejc.33.1686726986436; Wed, 14 Jun 2023 00:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686726986; cv=none; d=google.com; s=arc-20160816; b=IOPGUrY3k+Me3TwSneFj9nPEPqa51pnGQlxjLBmPPQeFjxi5iRjKLw6+SULhwliCDo zbrpxILlstl5nvRwkoUxZsLm91xa24EsBfIAx197SxiqUQOtv8Cv/bYJmknLQZI6nlDM eC5aUJba0ACIslF0DOzWJfFZ8MAo4JcsbDwGmO+Cgn7BO5Z6Wx36ns65gaM12z/aKom+ PDiaGRfnvIdS0Ucg2KxVw/1973pilJIPWvF/6hJ+z9oA9vDGdG8vHy6GJx7L0ftGAvEL k+9ANNx+Ysv9Gk0vT/3Gokr70S+URTRWXRtLAJcXZ2/FxdoSA6So+xNNoId871H6J2Se p7RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mNU2A/dUYsnfw4tdADFd8+n69e8TqzXUbv0O6opxA8E=; b=FU/TqRAedHopLNDuqIlkKz4QKKngz1SEOj6oBkjFpTG6BEOOnEDxk8f30lMg6FEQYi sBxmsEYSfSnPE/tHZgwVU5uYBcAYBCjsHgLNqquChyUekx295TYPT/MWQu3LLQZjoqws gldbzi6pNY3jccjgiGscR8JxW1pfGyMfpq4+4Z1ePHUH7HT+3lXCTn2ECm5CbwNvf1J1 Uh4qtt4HeTo9bcSlmN3qxSY9IQw/X/M3/vZll+UIdwIbYjiWyaT4unkHTtexHCQQVCKM qwXQPMfct9ylrrfVI1LthR3Blt+iINp/QRtPa7S7JUnK8rMO8VPvKYZgAJTSpeC5FTCA t/VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=V62JOONW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v4-20020a1709060b4400b0098282239139si41364ejg.174.2023.06.14.00.16.01; Wed, 14 Jun 2023 00:16:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=V62JOONW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234248AbjFNGuY (ORCPT <rfc822;jesperjuhl76@gmail.com> + 99 others); Wed, 14 Jun 2023 02:50:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242891AbjFNGuV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 14 Jun 2023 02:50:21 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB301A3; Tue, 13 Jun 2023 23:50:20 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-666520247f8so324236b3a.2; Tue, 13 Jun 2023 23:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686725420; x=1689317420; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mNU2A/dUYsnfw4tdADFd8+n69e8TqzXUbv0O6opxA8E=; b=V62JOONWlQRzNU874AKBiipNAAJPArF8i6gxpgW+5O+5WMIRvclpKTGCqpMExANoxz ROh9x2n1UvQOBt8IOr5NiJlgeyJMbYH1rZLKSc2mXjFRyaa7o+Jp/+h1QumUYB9IGRvT SW/JAJiCP4HynCBdx1AYu51vxCAzQnrkN4EzAfCe2weiJNAobq2sC9Zi5P/d8wP/dlzv SRxAl5BX+lMHOfwtfG4C0EWSD4Iko2kJeNO/NFxGmiDNunB0sWpBl0xeyP4Gve5M1/W1 Hb4UFqNVAW1lEJ4MDsHxEoGuG8dMRZEiLusAv/m918j+U1TxvIdCzvE/x7AXf8virniK cexg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686725420; x=1689317420; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mNU2A/dUYsnfw4tdADFd8+n69e8TqzXUbv0O6opxA8E=; b=UqJU6UbP52n/NczctyyjvZ9/zEAlsRNUWhLQ4KfAfPIGFktyJkZp2cxo+FAMY1PXY0 7Rx+Hcl+6qfjTrQSF4Qmw+XUKJKXx69MoPois/xQL1fP4+791qaOM98Z44qyzmqdp37K DjSU9J/HWOol9Z6R+vi9riMDAwjULpBDy1Bx3fYc61gBikWZC2w/Bvu9XZqq1J/7RAYL cSUVYkIM0p7tlLt/GWvDGI331/a+2s9pmt7+4hkUAzKVjiqFuAKXoNou6PRlejpgrX8V gKv/hJkZj3BEcNQkSQo+rsCN87GwtcU3P0jeVOMlhsAZe8hyVvSQpw9Tbc7l5DZZMx4g zNTw== X-Gm-Message-State: AC+VfDzdcdcagJh3LYr563TxvvZiJXNeOAWLeCfRP6b+f84GbBZ7pc8b ZzVV8DW36jUxF6qP0tVieVw= X-Received: by 2002:a05:6a20:7fa3:b0:112:1e0d:14ae with SMTP id d35-20020a056a207fa300b001121e0d14aemr1054131pzj.7.1686725420098; Tue, 13 Jun 2023 23:50:20 -0700 (PDT) Received: from localhost.localdomain ([61.68.230.184]) by smtp.gmail.com with ESMTPSA id a18-20020a62bd12000000b0064ff855751fsm9629371pff.4.2023.06.13.23.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 23:50:19 -0700 (PDT) From: Orlando Chamberlain <orlandoch.dev@gmail.com> To: Hans de Goede <hdegoede@redhat.com> Cc: Mark Gross <markgross@kernel.org>, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Orlando Chamberlain <orlandoch.dev@gmail.com>, kernel test robot <lkp@intel.com> Subject: [PATCH 1/1] platform/x86: apple-gmux: don't use be32_to_cpu and cpu_to_be32 Date: Wed, 14 Jun 2023 16:49:32 +1000 Message-ID: <20230614064931.3263-2-orlandoch.dev@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768661436527570206?= X-GMAIL-MSGID: =?utf-8?q?1768661436527570206?= |
Series |
[1/1] platform/x86: apple-gmux: don't use be32_to_cpu and cpu_to_be32
|
|
Commit Message
Orlando Chamberlain
June 14, 2023, 6:49 a.m. UTC
Sparce doesn't seem to like using be32_to_cpu and cpu_to_be32 to convert
values for the MMIO gmux to/from the host architecture.
Instead use iowrite32be and ioread32be to always convert, which should be
fine because apple-gmux is only used on x86 with is always little endian.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202305161712.5l3f4iI4-lkp@intel.com/
Signed-off-by: Orlando Chamberlain <orlandoch.dev@gmail.com>
---
drivers/platform/x86/apple-gmux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi, On 6/14/23 08:49, Orlando Chamberlain wrote: > Sparce doesn't seem to like using be32_to_cpu and cpu_to_be32 to convert > values for the MMIO gmux to/from the host architecture. > > Instead use iowrite32be and ioread32be to always convert, which should be > fine because apple-gmux is only used on x86 with is always little endian. > > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202305161712.5l3f4iI4-lkp@intel.com/ > Signed-off-by: Orlando Chamberlain <orlandoch.dev@gmail.com> Thank you for your patch, I've applied this patch to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while. Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window. Regards, Hans > --- > drivers/platform/x86/apple-gmux.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c > index e02b4aea4f1e..cadbb557a108 100644 > --- a/drivers/platform/x86/apple-gmux.c > +++ b/drivers/platform/x86/apple-gmux.c > @@ -278,7 +278,7 @@ static u32 gmux_mmio_read32(struct apple_gmux_data *gmux_data, int port) > iowrite8(GMUX_MMIO_READ | sizeof(val), > gmux_data->iomem_base + GMUX_MMIO_COMMAND_SEND); > gmux_mmio_wait(gmux_data); > - val = be32_to_cpu(ioread32(gmux_data->iomem_base)); > + val = ioread32be(gmux_data->iomem_base); > mutex_unlock(&gmux_data->index_lock); > > return val; > @@ -288,7 +288,7 @@ static void gmux_mmio_write32(struct apple_gmux_data *gmux_data, int port, > u32 val) > { > mutex_lock(&gmux_data->index_lock); > - iowrite32(cpu_to_be32(val), gmux_data->iomem_base); > + iowrite32be(val, gmux_data->iomem_base); > iowrite8(port & 0xff, gmux_data->iomem_base + GMUX_MMIO_PORT_SELECT); > iowrite8(GMUX_MMIO_WRITE | sizeof(val), > gmux_data->iomem_base + GMUX_MMIO_COMMAND_SEND);
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index e02b4aea4f1e..cadbb557a108 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -278,7 +278,7 @@ static u32 gmux_mmio_read32(struct apple_gmux_data *gmux_data, int port) iowrite8(GMUX_MMIO_READ | sizeof(val), gmux_data->iomem_base + GMUX_MMIO_COMMAND_SEND); gmux_mmio_wait(gmux_data); - val = be32_to_cpu(ioread32(gmux_data->iomem_base)); + val = ioread32be(gmux_data->iomem_base); mutex_unlock(&gmux_data->index_lock); return val; @@ -288,7 +288,7 @@ static void gmux_mmio_write32(struct apple_gmux_data *gmux_data, int port, u32 val) { mutex_lock(&gmux_data->index_lock); - iowrite32(cpu_to_be32(val), gmux_data->iomem_base); + iowrite32be(val, gmux_data->iomem_base); iowrite8(port & 0xff, gmux_data->iomem_base + GMUX_MMIO_PORT_SELECT); iowrite8(GMUX_MMIO_WRITE | sizeof(val), gmux_data->iomem_base + GMUX_MMIO_COMMAND_SEND);