Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3287199pxj; Mon, 24 May 2021 03:11:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrV9bCHeOzmb1N7kHSqe/Up1iCnZwbMk2Rhgoey2KgM20yoPoZIcsSuKDI6hKu/p+CMHiJ X-Received: by 2002:a05:6402:4310:: with SMTP id m16mr24847095edc.279.1621851109526; Mon, 24 May 2021 03:11:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621851109; cv=pass; d=google.com; s=arc-20160816; b=mdRE3SCnm3uoURgUae3e9iAZiNMlcixkOHZ0/USdmZanSIBAb3cIhLiMXUqm6Ign5q NLETDwvAeGHQQCyKC0e6Ozy+2+TDi83UH502jdBSWW1rTbNCDaeV02t4wUjFWewkRahu eXLDHtZ6pikIPEii9gjMoBvnUAOHxsWTjuFzevANwZdtetabMczOy8BfJXuzfgu7Ou8V 6JppePt6a58EAHk8kQpFwfc8Hzf8P5YT7GIk4ZjmRlIsrpGzU1dPq80lRFZ1OuPScf1f Wk95FC7sSUJYOZap9yMqwamUTkP1IDYA5OY+cO0c5JxlbG/P2m9Zn/yHO5/ttNP9zh4l IL5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=bgKXfjbtHrW06do2INpix45cXQhlTD+/5X9lSQ/LKOI=; b=DcXYnn6O0gTJCzq+atJJK8NrCFIkTN0DOSnOuE7UDGlEZRa2+J5RKhPvcUs7e39VBe dNmF6fGCTHyP8S+q4nvnRIU2tTeecXmvE6gL9pzfxPgj1JMM4K7KOz285DcI54phY/RQ FSz71lZ8eyuh2kydAZSehwFIIcjajV/p9aXjgNw9QcTA0LZN4r91o3CGcAJTLqDBCSj6 S6SvoPOvcFmY7cnxX8n++P6e3CzkVRp7xCYUA6dOTnVGu/xxchXQgRoxF74PDiyBpljm eCH8Jilu0PBZiy7ArBzxQexgXBaCzcLem/kh7I3ndQSjshkoiQGMzNR1GulGQ4eIVZ29 gFRA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b=mKIABpaQ; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.com); 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si10016675eds.282.2021.05.24.03.11.26; Mon, 24 May 2021 03:11:49 -0700 (PDT) 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=@aspeedtech.com header.s=selector1 header.b=mKIABpaQ; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.com); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232607AbhEXKI0 (ORCPT + 99 others); Mon, 24 May 2021 06:08:26 -0400 Received: from mail-eopbgr1310127.outbound.protection.outlook.com ([40.107.131.127]:62932 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232621AbhEXKIS (ORCPT ); Mon, 24 May 2021 06:08:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KulFYzE+YpKeODk2HXzzBItSCA/jY02TAkNKtRCel4OZqW4zllfubuHIuStkiv8YwabWFTK/yd4Wf5JxijpOK35Fc3wi9TuR9RKVSuNb0rgZcXtzhCp+s6UxxvsoH29AL/Uc9aEXi22VI7j95EcmfxDgxRSmpXooigrJR5JE8zuHo/dFQo1q/S3Y4ILxfjk5XvF7esKRnmCd/XQYTa83iifi9PsrOhPsKJZFoaDS6m67VqglNXglQJiIBn42zbWUt31H4L+kBHgVFoKWJ3iBIq6FqbRZ5h7YPX1gkRXPwrJ+6BHCyexKccHNJ4S4XiHln/RGC72pdaG4nqmIqwnDQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bgKXfjbtHrW06do2INpix45cXQhlTD+/5X9lSQ/LKOI=; b=Qu5g9Y8L1PIfngCplOBwC+RiFC07yPO4gftzqMeSA8G3bV2c3+rZCNgDoufAgN46VsDEYhVike9BUtQgcmF608oY1k4Pur+7buHQ9YihDdzCQXtPuz07dyyuIn29Y6fMT4qdApTBCl+tBAyP0EBGKkvktpSuR12mMnsDiPx2Nnk74bOPYbaPM9el0x7v3OFER9VraD2bG6zpVwTI2vKVEHgQW3uFmd0ii0/L65gREQtmkAzLdsJAdTURyDgXCam8sEGlDwxwMMFqDsA7kec5Jbw22A/rryRNESgQnSIMURyj694ketb7XEvIjcjbhQVfBlufJXmpe/XJRH3MkXR2Zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bgKXfjbtHrW06do2INpix45cXQhlTD+/5X9lSQ/LKOI=; b=mKIABpaQJ9fha0ZxZ8kWPcrrOFHCg5+8W/kaIa4BNXL/d1RRkKEIE6OLELHQuqyDWxp60DORcCaaj+/S4QtIhXItQXaoq2fl1X6RA70HOJRxYqG80bZw/X3p/uHnRE/72ggapP0eZLmzA0MLfryYykEaRa+R3C+jPzoY7JKcrML0Zr/qnx4FtWQh2p1oLNyuMAx1Rrzh/FJTOXro/nsU2fH/haxysGdsAllSNi/yN5gq5Uz/fVoyZLUUJlsZyVtW5LN2rzSrSFSnA6n1Pg6ndG/4lvyxMVPebulWS/0jxp9uOm6OQ+8tlIGM1bBjhWV97p4h68QzAS07kpNh/FP8DA== Received: from HK0PR06MB3380.apcprd06.prod.outlook.com (2603:1096:203:82::18) by HK0PR06MB2578.apcprd06.prod.outlook.com (2603:1096:203:63::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.26; Mon, 24 May 2021 10:06:13 +0000 Received: from HK0PR06MB3380.apcprd06.prod.outlook.com ([fe80::ec25:881b:f113:93dc]) by HK0PR06MB3380.apcprd06.prod.outlook.com ([fe80::ec25:881b:f113:93dc%6]) with mapi id 15.20.4150.027; Mon, 24 May 2021 10:06:12 +0000 From: Ryan Chen To: Quan Nguyen , Corey Minyard , Rob Herring , Joel Stanley , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , Wolfram Sang , Philipp Zabel , "openipmi-developer@lists.sourceforge.net" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-aspeed@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "linux-i2c@vger.kernel.org" CC: Open Source Submission , "Thang Q . Nguyen" , Phong Vo , "openbmc@lists.ozlabs.org" Subject: RE: [PATCH v3 5/7] i2c: aspeed: Add aspeed_set_slave_busy() Thread-Topic: [PATCH v3 5/7] i2c: aspeed: Add aspeed_set_slave_busy() Thread-Index: AQHXTIQCISnhT+/XbEiDVKSu2FVXwqryb5QA Date: Mon, 24 May 2021 10:06:12 +0000 Message-ID: References: <20210519074934.20712-1-quan@os.amperecomputing.com> <20210519074934.20712-6-quan@os.amperecomputing.com> In-Reply-To: <20210519074934.20712-6-quan@os.amperecomputing.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: os.amperecomputing.com; dkim=none (message not signed) header.d=none;os.amperecomputing.com; dmarc=none action=none header.from=aspeedtech.com; x-originating-ip: [211.20.114.70] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 15891d5d-64cb-4472-997b-08d91e9b8f7a x-ms-traffictypediagnostic: HK0PR06MB2578: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xom3LaH8GLXnegelyBcJAh4PtCc2f+BAWkARviG2EF+DCzep+Qpo/TCAy9sxPAdPz4NtvVh3aFCj0S9pYi7QEGxXWD+CdEKPS1RwK2NchFrP8kfqugWrfy02RYxQNAuZKotyUJf84Hg/amK5SFeDy/FwRGKA5V4MlDQSQUPGDCqj1UdTs0ZIPOqQJYhXk521rVD4GBNnLJ248N3BCMOJRgZdzh+5CpDxcGIdiyesOUfxrNJ7CI2wXQrbTYCq1SUSny4nYM6S3nWVlHSoKedfwt7ZnOycsnC3SAIOaDp8OP9Qq5ju6P7jiPYDbAEaeECisNHpe2RthBKDS0SQrHL3Q+UlZEU4QESx7q8yWJJuUiMG234fCNunnS4lAEr/OJO2k6zc3KCr1iqa80PRrbzBMUqyejxMsm2xgv6aWQ9DJoszSO8v6t+/gr8MfwXl5RgZwVDVkl7Ij/N+7zblgTV/zdOhvIog3wNXNc4jRXbWOcZlgb95ewj80x3w91bSlu9Y4ZsCXH2RZXydKBzYSM7FLe7zBFPX9fHj1Osz2ej608fVU2cGBtRUaAQk8t0oBZxvRJSwYAfeXu+w72qIYiGPPFl12YTITLJLHotjn81rnmHQ3ujW+W8GCqAAzNFCJyFRRGnk50WFoJIjWxDjkcUbyA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HK0PR06MB3380.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(136003)(376002)(396003)(366004)(39840400004)(64756008)(66556008)(66476007)(5660300002)(66446008)(122000001)(66946007)(38100700002)(52536014)(83380400001)(6506007)(53546011)(7696005)(8676002)(54906003)(2906002)(110136005)(9686003)(55016002)(86362001)(76116006)(316002)(186003)(7416002)(71200400001)(26005)(55236004)(8936002)(33656002)(921005)(4326008)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?PPO+fGFyzZV+5lPUa5JDaIo2Ap4ueUslNsfwg6vpaPwvlwL6gLXN55rwXiT8?= =?us-ascii?Q?qtWWL67Y8wtEcaQ8ihs9cFk9oy/2en406bsm4Y3H2E37Wr51U0qac74U8jML?= =?us-ascii?Q?QhQlZXT2DerybVgTyMRHjRV8eTtiwDELkwETBp5ySRyNGgWmnpDJpS4rWcK2?= =?us-ascii?Q?gp1eBt5ujiQ6nPlL1xgTMDSB80hWAX+wa+JrfndZ0e2zYV9o1WSUF/Qy8B7D?= =?us-ascii?Q?Lp1AjKPfQRYLmxvzD6qW6J9BupjBoYNKKV/SrzbJcLf6+xKekLuYYJTaBfEd?= =?us-ascii?Q?mmgC3yq27ZmeZwQXjFgkN+IcAUXV2R3JqAUihwfAw+f245zqvl2Zn+QY2G+P?= =?us-ascii?Q?AXgRTUP762ktrfipdIIAbnI4Fa6bLzbzdx3xvoRlABcd9VzTEg+TENcvyW/4?= =?us-ascii?Q?TvLYm4g/YsDmPynntwNApcz2pnVpNecjYGDC0MNleitdWWCctGRh/WN+iThm?= =?us-ascii?Q?4FplFFncTBo7aO0jwinjyT8B5cCgWoVn1WENdzcZH+ngZuFByfV5d3GXAn5x?= =?us-ascii?Q?ONQX/8Fdl94mPmYlce8P5zoM1PKRUvka54ZbycZYhpznD0X/M87QMXxUY2Dj?= =?us-ascii?Q?oteQ8DwT2fqSjMWBi1ESiyAbMDi6ybHakBwBJPDg5WvtiDXG6O2CRGYuQkx5?= =?us-ascii?Q?J8RuhOGjR7OxoixLC/TBBUwU8NBZ/EtBzXIWJxjQsPqWt3UE+318E2odPS8i?= =?us-ascii?Q?MN4DkCecexhacRn82WGGpK1DNmxQ9eBhLYVYOcjT9LCRFvxuGVzFqmub2KEj?= =?us-ascii?Q?QDoAeYOhjz5kygkLk1CqOLMfIDToi0DdMqWFzLSUZ2co80O8FN0keQmg063T?= =?us-ascii?Q?gQThjicS0RfLauTpMCIZi/lXImcun3CkrmToxpsaIttL9U+OnMg8+3lIkUH9?= =?us-ascii?Q?yCgk0RZc7y4DaicLdCtcM6O3ZYWa3i3IUXrSQUlQd7ADp4quoI/f666xOE9m?= =?us-ascii?Q?MyFo6qEAJRCT66W+Xr/UMLFWFTQepcWVeIfBQIdooi4u1lE+TTarKSpUqDXY?= =?us-ascii?Q?Ejqg29lIPeJ/2l4uieQxFJeRzEabm2FT+spotnVmpnbcisj+BhfYtY1JwC+r?= =?us-ascii?Q?THw300np5XF/NIinqlxOXVn9nEfHmgIz+rzsiJpDeju+ftgEiwa+MuCWIT9y?= =?us-ascii?Q?76AG1obRAvG1Lc1KmjKrI3TqQdM0i0nZiTK2CJwAUUq8uSGck1BLjeIrFqyM?= =?us-ascii?Q?yJiKksOhp5uBeYHM0KA8ZCiqL32DngxhUF0Nx9ZBg847/fkEPtkb5YV6bE1v?= =?us-ascii?Q?HLnGIvWUz/pfLIJ/5nj31ldEQucTs5QXIvjYb/faMyj4yQyPjjKfWNERLRSe?= =?us-ascii?Q?IOVpFNxU7SbP3lDRQUCTbXas?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: HK0PR06MB3380.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15891d5d-64cb-4472-997b-08d91e9b8f7a X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2021 10:06:12.3787 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sbBdAaZ51nKhGZs8WzKlOktVxQiWOvGlFqgQDyi+0ESoYkIoSk2Bs5LqTojL3p+p91y6Lowk4YDx5vg+RRrLt6pnUjG2KhmX/H2opbf4/EE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK0PR06MB2578 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: openbmc > On Behalf > Of Quan Nguyen > Sent: Wednesday, May 19, 2021 3:50 PM > To: Corey Minyard ; Rob Herring ; > Joel Stanley ; Andrew Jeffery ; Brendan > Higgins ; Benjamin Herrenschmidt > ; Wolfram Sang ; Philipp Zabel > ; openipmi-developer@lists.sourceforge.net; > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > linux-aspeed@lists.ozlabs.org; linux-kernel@vger.kernel.org; > linux-i2c@vger.kernel.org > Cc: Open Source Submission ; Thang Q . > Nguyen ; Phong Vo > ; openbmc@lists.ozlabs.org > Subject: [PATCH v3 5/7] i2c: aspeed: Add aspeed_set_slave_busy() >=20 > Slave i2c device on AST2500 received a lot of slave irq while it is busy > processing the response. To handle this case, adds and exports > aspeed_set_slave_busy() for controller to temporary stop slave irq while = slave > is handling the response, and re-enable them again when the response is r= eady. >=20 > Signed-off-by: Quan Nguyen > --- > v3: > + First introduce in v3 [Quan] >=20 > drivers/i2c/busses/i2c-aspeed.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) >=20 > diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-asp= eed.c > index b2e9c8f0ddf7..9926d04831a2 100644 > --- a/drivers/i2c/busses/i2c-aspeed.c > +++ b/drivers/i2c/busses/i2c-aspeed.c > @@ -944,6 +944,26 @@ static int aspeed_i2c_init(struct aspeed_i2c_bus > *bus, > return 0; > } >=20 > +#if IS_ENABLED(CONFIG_I2C_SLAVE) > +void aspeed_set_slave_busy(struct i2c_adapter *adap, bool busy) { > + struct aspeed_i2c_bus *bus =3D i2c_get_adapdata(adap); > + unsigned long current_mask, flags; > + > + spin_lock_irqsave(&bus->lock, flags); > + > + current_mask =3D readl(bus->base + ASPEED_I2C_INTR_CTRL_REG); Hello=20 Where the bus->base to be remap? > + if (busy) > + current_mask &=3D ~(ASPEED_I2CD_INTR_RX_DONE | > ASPEED_I2CD_INTR_SLAVE_MATCH); > + else > + current_mask |=3D ASPEED_I2CD_INTR_RX_DONE | > ASPEED_I2CD_INTR_SLAVE_MATCH; > + writel(current_mask, bus->base + ASPEED_I2C_INTR_CTRL_REG); > + > + spin_unlock_irqrestore(&bus->lock, flags); } > +EXPORT_SYMBOL_GPL(aspeed_set_slave_busy); > +#endif > + > static int aspeed_i2c_reset(struct aspeed_i2c_bus *bus) { > struct platform_device *pdev =3D to_platform_device(bus->dev); > -- > 2.28.0