Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3292825pxj; Mon, 24 May 2021 03:22:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZBf2ayvsRMZ02LGUOb5KzlYUwDQaPgMr54M4vq+1CQ07puNIUrFuRtfbPXWUNR+PpLCvu X-Received: by 2002:aa7:cc97:: with SMTP id p23mr24774483edt.372.1621851732709; Mon, 24 May 2021 03:22:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621851732; cv=pass; d=google.com; s=arc-20160816; b=dmGk1pW3kk8GHAHKoWqEo00bThU7HP29W7ksk/LsYIQ/2Y41hj3aMTWZsqjfL6k2TU KK+etr6R+t5Jm3U1tf0JSYLsupdo/001OL2k45SsFOAQXnO97ViCwEaDYyvjElpHSW4j O7ZbdcRS+iNXQT5C78pM5wpcknrTcsZvacN1TGnQTB1fU+3uESvMFv4GsPUI+i0O+UG2 J6Xq9MqfI+7mNEcOqcuodXxftFTz6DyyfYsjcfMsb1PULBLhHkfpiU4MeFp1vOSVgD/T rc3/nGVDhvUb6/BQscoImf1sPkUJfIEkKtJ59zpNK3K5Zu3tIHRma22VieCL7povxAX4 VuIQ== 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:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=04EolnKMFloxx7kfhpCzsHCe0LNLSQ6q8fACLQSUCjo=; b=tGSGALUjqItjdsWNe4BOSs2Xzz894OrKp7CFxEIPQexZbsGNtDaArE2ZVEkZg5cbXz y66pxuvnHe8R7GdVWb5QFF7mnIRmxqGV7n+ErQCwOOqYkzOsVRO6jdOuzpBhJ3XibSAw iEHLNeFpw+fOyLa77yjtTTm57OQocl38MCRX5bvORFMjmHSTLfqZwtYlTKpigf7PQYky C+CR48HmThupA0zpqzC850J7vVEQc7HfRSJXmYb6HM+yOA6yEiq0gp2EUpF99yokN1Iy wQqYHupNfc9JBaL3UZBMW3zlnHexcnyMua7qwmK5uVGIEb82CkRD3Wv+5DHGa2Nw8Ar+ kzBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=aZZltRPU; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kb22si12593656ejc.522.2021.05.24.03.21.49; Mon, 24 May 2021 03:22:12 -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=@os.amperecomputing.com header.s=selector2 header.b=aZZltRPU; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbhEXKVz (ORCPT + 99 others); Mon, 24 May 2021 06:21:55 -0400 Received: from mail-bn8nam08on2139.outbound.protection.outlook.com ([40.107.100.139]:53536 "EHLO NAM04-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232426AbhEXKVy (ORCPT ); Mon, 24 May 2021 06:21:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HQrP0ldsgS3hvEv2pIw2pvqG/yCg2IFc4AF+ufrGdpMjjuPDf8Q2LO54k9hrHKzs0Hup+ReOBQCPlLuurVT/LWeH6f2+HCTIVewSRuNllkT85cg0/khElOi1qXp3WFWbz6uMx+tz+LGLMYJ+rEesaScPIQPdehWpli4wRhqo6//OPJz1zerzdNBiJYFhNbN2/IwmESofdZoKVGK0gKFNWQ6xTgCUcRIlVS7IBE95PxKhwSeEWLuLEuzXWETe53jhMRHC8QGgqJiGDzCCrDsX7JuPZ8EfS//HjVlClMpmxzdmFSZFkHllE0LxCtDpx97uPZ+qSRThP2TkEz5z9TPB7A== 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=04EolnKMFloxx7kfhpCzsHCe0LNLSQ6q8fACLQSUCjo=; b=RSfW7plvebREg2IgzUodn3R+iMljPrwH+eXQ/q/ycY7jb5bhJpxbpsAHB7iMcOkWwjRlig7DHPQRWWT3cPjZWs+aRLMgDKyMIxWRHL3yoliIF/FumPh/1xBk1H5GWyQagww63VI4BSCc1NWC3mm9WiOW3smQnwzziUJt9kYaqAdsg0T8vv8dk7XhffjnTSnA9m5oZ5274nH5j/rhFeWUKX+tVDzojyE2i6YZNsc+FMi6fTrWHEcL+Jiusp3S8DfFwdHwgcuApdr49wgzTGCeYUu0ODzS3p4h6glLzvckHR6d8zFaXmd9YTqN9V7UKj3rCQgfeHo2dkWgKh7etkRYhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=04EolnKMFloxx7kfhpCzsHCe0LNLSQ6q8fACLQSUCjo=; b=aZZltRPUAwrhDSAU+v5pnkSv/JOKZJAIgVdn2ku0+Qv/8ejingl4FsNttYhEQFWlA+6XQOKGPtpQ2Gur8s6cr/3SMGj1zbCDmeXIUxK7SQuMG3nRXk5iONLG0E8JIU6UD7CvySuVptIWZ2Zc41ThNFN+jDD7b/T0Y2GoZ55FHQQ= Authentication-Results: lists.ozlabs.org; dkim=none (message not signed) header.d=none;lists.ozlabs.org; dmarc=none action=none header.from=os.amperecomputing.com; Received: from MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) by MWHPR0101MB3070.prod.exchangelabs.com (2603:10b6:301:32::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Mon, 24 May 2021 10:20:22 +0000 Received: from MW2PR0102MB3482.prod.exchangelabs.com ([fe80::1905:a396:9968:3a5]) by MW2PR0102MB3482.prod.exchangelabs.com ([fe80::1905:a396:9968:3a5%5]) with mapi id 15.20.4150.027; Mon, 24 May 2021 10:20:22 +0000 Subject: Re: [PATCH v3 5/7] i2c: aspeed: Add aspeed_set_slave_busy() To: Ryan Chen , 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" References: <20210519074934.20712-1-quan@os.amperecomputing.com> <20210519074934.20712-6-quan@os.amperecomputing.com> From: Quan Nguyen Message-ID: <1648966e-3e45-9661-c5dc-5ac2f40e2581@os.amperecomputing.com> Date: Mon, 24 May 2021 17:20:01 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK2PR03CA0066.apcprd03.prod.outlook.com (2603:1096:202:17::36) To MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.38.33.138] (118.69.219.201) by HK2PR03CA0066.apcprd03.prod.outlook.com (2603:1096:202:17::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.12 via Frontend Transport; Mon, 24 May 2021 10:20:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 13d70335-c9c8-408b-b4fc-08d91e9d89cd X-MS-TrafficTypeDiagnostic: MWHPR0101MB3070: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cjDGj7mJAaYPnP+aajisEYx61Mr/EtGunQHgf/J6VEAPNbmY4Jz8O+mRelhuxdPVLAhdxIAQKz3EVuBuyf+W6BwEtfBuiaTxY/V6yTPzurhXjwuMSMaBbPHD8UX3cS2wrOtc1BGzOx5XRZ4IfnNd5Gp5eo8yxBbN3l3H3hbGKuYJVAmSlIcjzEmKNpD9qukUgF0rv8w1u4C/P5AfJQ9Hare4OxNXlqiEamn8igShNXoi31M1zC5nC/NGpiNSWfKMLGvnMh6+SwEX8xkW275yJVV6Lz1LTnoFBrWmU7W5cCgrKSulBYpH/KKlDfK/faPeQZimf4UaVrqLxFqNgJ4JKmkVlbySsfqxmy7V6seC+ZVuKaFWQFpQrv/quxhf4GgZuBI7ivXUk+XzWh+07FzAQfThQn0h2ZxAd9rSfD51TyeSngF7I5Vmo3qwJsHJTqw2R8cLpAx42AaN7eSRKe/z3rav04M9LC3Enm9m5R6u2loLtDLfLrL9MO2cUZtZEwkWXSRLENCV9/qiXQzSDJUYGENjsVD+Mp7soyNLCEuNQ1Nkmlpjg/Gtrv06TMQ4LHuWDs2Q+Yvc6ebuZTsk81qMws6sqO4/PkFIfuyuUD3KWZ8RkP4RY39N/ujepa1G9hObbJ1dxU2wvtcfkiCNWlLiQ5Bl9Ob4uoNdHNFJSlrAop/U3yQGZlgO89vmv6D3vlLVnshhb1eliHn+4F7KjS42q60fZLQOS8lWJl306kurylM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW2PR0102MB3482.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(396003)(136003)(366004)(39850400004)(4326008)(8676002)(110136005)(921005)(316002)(5660300002)(16576012)(31696002)(2906002)(26005)(31686004)(86362001)(54906003)(8936002)(956004)(52116002)(16526019)(186003)(6486002)(2616005)(66946007)(66476007)(38350700002)(66556008)(53546011)(83380400001)(6666004)(38100700002)(7416002)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?ZVlPdW5zWHVWTGpTU1FhY1NaNTNacTJQaG1JWVVPU0IrT3A1Z0tzTU13Snli?= =?utf-8?B?OEJxYVIrZFBIOXVOa2JaS3hwTDhqaDZ3OUNsbDVKa1lKeXFBOWJJSEQvNUNY?= =?utf-8?B?RnBuWk5ReGJFZ2oxbnF3OC96blVFYzBkV2RQeDZWQmdWVmtvTlNabkViZjJ3?= =?utf-8?B?TmlNQnlaelN2RzNGZ1VEVTRPQmFoSzVnbHpmbDd4T3RjaXh4VlFUNFNScXJJ?= =?utf-8?B?QkNSVjgrcGtNVkxVSVZIMDRmT0VoVTRBSGp2WkE4aGZKd0RIek96NkV2UDF3?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VGYm5DUVY1T3psZThacENrN2pz?= =?utf-8?B?MDkzNmpnSW1QeDZwWVFJdVZTT2JMUHFJWmcrM1plTEtrbXJ4Z3dJdmFzQi91?= =?utf-8?B?eEtJU21aaWQzUDVQWFIrZTFIUFdnaDZhQy9jUXJaOEo2U0lWWmlwZUc2WVZ6?= =?utf-8?B?Ump4THJPVG5TdWk1cUFnMVJvS1FiZHA3ZG9SK0owNDZaRDBITURoQ28vYlBG?= =?utf-8?B?SHR0NzN3UHBDTzJBZVdqVk1aVVNwV2NMcmJuVW9vc0VYeHNQUlNTT1o0RXZW?= =?utf-8?B?OEl1TnhMRG5yVGZ2RzBzTHNpVHA2RVgwZVNsQkc4N2Q0QWtkb2NEU2JlN0VC?= =?utf-8?B?amxGa3lDUllJTFFrNXgvUmVHUVdMTkE0Vy9VYzNSOWRSOXFNVjZIZmplMHdw?= =?utf-8?B?ZDVkcjNEL0pOa3BZTGk2bk1aTUZ0KzZ6cmVieG5tSUVzaDJ2bWNZTG12c2xB?= =?utf-8?B?eFlYOXo0ck91NlZDMm9SWUVlK3ZZVkttdjJWbDRIaGF0dHZmblRjdzhiMFM3?= =?utf-8?B?aXAzazZqaWVERmNzYUJpNlJKeDI1MGhrdUtWNTRXTXlFNGUyUFRWZDlCSXk4?= =?utf-8?Q?L9Xtgj67MC+ybcDy9SjdImwoAY/FDfQQgs8NgMT?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13d70335-c9c8-408b-b4fc-08d91e9d89cd X-MS-Exchange-CrossTenant-AuthSource: MW2PR0102MB3482.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2021 10:20:22.3822 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XXKY/v9q6d4HRZ8LTHDEb12j647QEWofjzMo1FUkYsP2VV10y9tE8nF6oJb7sb+ySQoGRKtWORx/Hnqi+AE1qoNcZNorhNrn3gYpfDSj4WI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0101MB3070 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/05/2021 17:06, Ryan Chen wrote: >> -----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() >> >> 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 ready. >> >> Signed-off-by: Quan Nguyen >> --- >> v3: >> + First introduce in v3 [Quan] >> >> drivers/i2c/busses/i2c-aspeed.c | 20 ++++++++++++++++++++ >> 1 file changed, 20 insertions(+) >> >> diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.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; >> } >> >> +#if IS_ENABLED(CONFIG_I2C_SLAVE) >> +void aspeed_set_slave_busy(struct i2c_adapter *adap, bool busy) { >> + struct aspeed_i2c_bus *bus = i2c_get_adapdata(adap); >> + unsigned long current_mask, flags; >> + >> + spin_lock_irqsave(&bus->lock, flags); >> + >> + current_mask = readl(bus->base + ASPEED_I2C_INTR_CTRL_REG); > Hello > Where the bus->base to be remap? > Hi Ryan, In "[PATCH v3 6/7] ipmi: ssif_bmc: Add Aspeed SSIF BMC driver", the ->priv is retrieved by calling i2c_get_adapdata(client->adapter). And in aspeed_set_ssif_bmc_status(), call the exported aspeed_set_slave_busy() using ->priv pointer as code below. +extern void aspeed_set_slave_busy(struct i2c_adapter *adap, bool busy); +static void aspeed_set_ssif_bmc_status(struct ssif_bmc_ctx *ssif_bmc, unsigned int status) +{ + if (status & SSIF_BMC_BUSY) + aspeed_set_slave_busy((struct i2c_adapter *)ssif_bmc->priv, true); + else if (status & SSIF_BMC_READY) + aspeed_set_slave_busy((struct i2c_adapter *)ssif_bmc->priv, false); +} + +static int ssif_bmc_probe(struct i2c_client *client, const struct i2c_device_id *id) +{ + struct ssif_bmc_ctx *ssif_bmc; + + ssif_bmc = ssif_bmc_alloc(client, 0); + if (IS_ERR(ssif_bmc)) + return PTR_ERR(ssif_bmc); + + ssif_bmc->priv = i2c_get_adapdata(client->adapter); + ssif_bmc->set_ssif_bmc_status = aspeed_set_ssif_bmc_status; + + return 0; +} - Quan