Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1522907pxp; Thu, 17 Mar 2022 10:47:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+eoTQGylM/7SR+NArokXG6n8btRmQzWrFgQ71Agezq0y6xl6EbUKxEbIEpDl8BeHoQrOY X-Received: by 2002:a17:902:7c89:b0:153:758e:cb with SMTP id y9-20020a1709027c8900b00153758e00cbmr6212605pll.27.1647539232530; Thu, 17 Mar 2022 10:47:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1647539232; cv=pass; d=google.com; s=arc-20160816; b=VV9d6L9ecK3B34pP/IMsqIxUhmudphArW0YucM1uGwTGkNYlejT6xtHdTnncILgLCf z8m6ah3MyG/sOzd84KBY/Dh3X0odbMfmw+YF6wMAHyLxOSnpSWAkwxYIgfIslc23iEPz QT1sJunbvBMrBsk/3ikKYyLMd/uYx2C0KXIBMfhDrT8dLxoHeDjYJPAskEmZ5EzFXMCJ 1R+9k0MVZOiCMcA93nxSpInEezypfVWzOYGhX4A9mbvdBHQL2DnCG4WAkY0TLjRnYRbH IPxQlxCpURmQZeFU9LMLzO/U0tKlCwMtvc/kq+A9VpScZ1Hu0pjmykX3NU1Qfz3Y2i1O Q0Yw== 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 :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=2mvKKCUlLwm6dvjixifPyGGrXPmDURiGSZ/YPlI2wNA=; b=wcmjeNB7KOhk8kL9IJJeAG9sAC1h9O7DTnRUqkEOR7ve2ytJeEyu0kCZq270Fi38Xu SvpYjh54KagvN/8WFillftexLkkfOrvH/WF8ENvwPy7G+A2FlR7zP1MNk2kpKLr3cG5F SLz5flGojLZODBem819L0KAKGh2jqfsXZyoRfcc2V3gx9TCYFtyxq1j7bk8xEZix+tKH H+Xkt7OT2MuuoSzELK002Hl0Ri0+vu2btHo49XhW2AxFqaq598nPeOnxgGtjbC1kXz2D y8hiorBSIgSFRPWIYVIXFaZSFlgbmX4wXQ6SASNEJKsdRgNSlz3526FR7QvhtBjwscAS F8yA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=YokT8xMi; 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 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q64-20020a634343000000b003816043f10esi2597760pga.771.2022.03.17.10.46.56; Thu, 17 Mar 2022 10:47:12 -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=@os.amperecomputing.com header.s=selector2 header.b=YokT8xMi; 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 2620:137:e000::1:20 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 S231649AbiCQJBr (ORCPT + 99 others); Thu, 17 Mar 2022 05:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231656AbiCQJBn (ORCPT ); Thu, 17 Mar 2022 05:01:43 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2137.outbound.protection.outlook.com [40.107.100.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04F6D1D08E0; Thu, 17 Mar 2022 02:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=csA7nIFDJvXbu8YU1hLJGHhD58jZJmFtPPmCAQdysy2EBZ+1u7ycEImsugx6ArgWwUjhR8Gn2YL4PS/9MCK28PBVZ4RxdRSi1nN6xDhxNdoA5+u1L57Gs3tXDSN82BWPhj87CCYXS0vzSJVYxs2MUJ3seYBCAC+KBTocfmPe8DlUDZO5ZPuY6yu8iWHv7Ljl/cmt04rsahKhOxl9ykfSOBQGhNGAS1oFVMsYARUmeVNYC90353RFDSMgGqyg1Oa8mR7DTlfIINTtK/2pzU7MBK8i1mw/jJb5b5k1DKFTAA4p3CwqpCy1EMb3Ynr43OmjZJYLtZPptpPecT46BwUKdg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2mvKKCUlLwm6dvjixifPyGGrXPmDURiGSZ/YPlI2wNA=; b=ihdHBloWd1dIEMEjmJeFoqVq6zkAfBPccabWnuat4Rrl0/l6a5Kxy8RGNR625zeQD7/py2ey55uW5XNP1agR1e6sWLSdYGUxlvq+SSg1LIrX+XOqTgVrXYO5uHhVZGvGIr8Od8lZ1do4eAaYhw/g+fRxWWwpAmK6YLiX0IkRB4thLeC4icS86c5bqGxJsoRga1OADPbU+kpJTFGscB8+kybpouqPEFhI0fyexD9L2yQ6mWK87VoA7ZN3BubXLaVF/iyymQdsgsnPwHGlnyZCVNjx1/R6UkxgqckLeGyGaEtC5I+m+SV0rpVAkwlElQK4iuZj988INUUaJilgEsweQA== 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=2mvKKCUlLwm6dvjixifPyGGrXPmDURiGSZ/YPlI2wNA=; b=YokT8xMinaih3bY9uchW6WkMCvDZEb2MK9O7n9BibwDscWMZazitLFeoqw5Xzw7/UYOudMpBUpuRTFgpvOef26c1EQGRhZCykir+x5eNxellYJHHr19QUxBUmf3dSlvto3dSmnKRRr7aka8yhiKJT7go7IMV24usjHFpKeq2PeE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) by BL0PR01MB5236.prod.exchangelabs.com (2603:10b6:208:77::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.15; Thu, 17 Mar 2022 09:00:18 +0000 Received: from SJ0PR01MB7282.prod.exchangelabs.com ([fe80::cd24:39ed:7042:46d6]) by SJ0PR01MB7282.prod.exchangelabs.com ([fe80::cd24:39ed:7042:46d6%8]) with mapi id 15.20.5081.017; Thu, 17 Mar 2022 09:00:18 +0000 Message-ID: Date: Thu, 17 Mar 2022 16:00:08 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v6 1/4] ipmi: ssif_bmc: Add SSIF BMC driver Content-Language: en-US To: Jae Hyun Yoo , Corey Minyard , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , Wolfram Sang , 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, openbmc@lists.ozlabs.org Cc: Open Source Submission , "Thang Q . Nguyen" , Phong Vo References: <20220310114119.13736-1-quan@os.amperecomputing.com> <20220310114119.13736-2-quan@os.amperecomputing.com> <7cd9301f-f417-e555-6025-74acfc53598a@quicinc.com> From: Quan Nguyen In-Reply-To: <7cd9301f-f417-e555-6025-74acfc53598a@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: HK2PR04CA0068.apcprd04.prod.outlook.com (2603:1096:202:15::12) To SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 617915d1-2e4d-4542-85a2-08da07f48f02 X-MS-TrafficTypeDiagnostic: BL0PR01MB5236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LCQULnP66SYOWsPz7UCaoVtbNml020XkNHjWg623H8BDlT1pyLkkU8s6zY2q+fh7WkOiRsyBg+EZSrIpyfzKpC4X2i2CWn9QZLAMKRO7V0OCPhzMJa3lRS0DL5hJYwEBr4slrFnu3yS/x2gjMFnDupRg2sXCjKj9Y2oS+7Do7uR3YaTzF8GMRKO5fKBY2wNi8SjBEeaEhQoR7UHwMVRCJDmUBNQ5+rNQ0WjAy0RweeZq8iAysKipNFhbmiXDieUKJPpU+uDdpCtm4OVyhFMTlvDRqoef9H4i1dYwLNd8x+mmDCRvex0JaDJ1MkrY6cgAsjX5mGw/ZPmzG+n9Vf2+tW6FSaKuo/vdKsQEmiToKVjY65vAAu81bBypf7YOAFRbfgUWoowjcLAvZMuUNxfqSzI/5av9IdV4MjQWVp1ragPuDTqon5DhFUBVoELxuFxoC/ezvrz4YvxKxFNkv7583i9K9y0R520ngYE0CgaUtJU9twYriz8hdv3KORwG+LO0KsBI/CqL3E4ASeEwS13yEKdVsORB0cQKJkjjaxyPEbREdjMrFi1GouSYXSqI8H7hfr5+2ye5gF1Iiin7fg5/dagVaNZssG7Sreq6XnBk5kz0yMdDqzqwIhh8DxyF2FysjS1MJrp8oI+FsONPh3AqNG7myd3dK1pObdVMT5m34GmTa+L8hVqvfvOGGeKjYpaGqXRvibpC+bH+MYoQrax9eG4p5zN3Ewojkd7EMCC8nDnSUB8Te9xANrq7k88GhzlYH1Y0N0Lq5DwmB/cqxJ2ijg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR01MB7282.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(7416002)(6512007)(6506007)(2906002)(921005)(6486002)(54906003)(6666004)(110136005)(508600001)(83380400001)(31686004)(66946007)(107886003)(86362001)(31696002)(8936002)(316002)(4326008)(38100700002)(8676002)(2616005)(52116002)(53546011)(55236004)(38350700002)(186003)(66556008)(26005)(66476007)(5660300002)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dGJ4M29KK3J2YWFPWW9FWEJkL25uMiswSVlBZTNKalU1a3ZPdVZ2SE5ubmh4?= =?utf-8?B?SlU3WHRDeFV2L2FreG1uY3dXc2xxSHpsS3RFSm1MaHFUTTZMaThqRlpCc3BP?= =?utf-8?B?UGJBcFJJSVNublY1dlo5NzFUaXFmdDZUdXhvM1hqSS8xRjBIVFhjNmJBTGtx?= =?utf-8?B?dTRBZHlHNnAwaHlUb0lYY3NVQzVvOFhTNjZxTEFaT28xWEo2T2thQlBob0Jp?= =?utf-8?B?Q3lBanVtV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puting.com X-MS-Exchange-CrossTenant-Network-Message-Id: 617915d1-2e4d-4542-85a2-08da07f48f02 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR01MB7282.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2022 09:00:18.6578 (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: honCA59C7zFdfmNs04QZq+tGoKoXKU2E/G5hM0OKnUjVOrKSfaDs56I0HyO/hLtnOQEAnHNsM0bYpzN4S05MV199iTWbYvSZwTE3DxLKN+M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR01MB5236 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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: X-Mailing-List: linux-kernel@vger.kernel.org On 15/03/2022 01:15, Jae Hyun Yoo wrote: > Hi Quan, > > [...] > >> +static void on_read_requested_event(struct ssif_bmc_ctx *ssif_bmc, u8 >> *val) >> +{ >> +    if (ssif_bmc->state == SSIF_READY || >> +        ssif_bmc->state == SSIF_START || >> +        ssif_bmc->state == SSIF_REQ_RECVING || >> +        ssif_bmc->state == SSIF_RES_SENDING) { >> +        ssif_bmc->state = SSIF_BAD_SMBUS; >> +        dev_warn(&ssif_bmc->client->dev, >> +             "Warn: %s unexpected READ REQUESTED in state=%s\n", >> +             __func__, state_to_string(ssif_bmc->state)); > > It will print out that the case happens in SSIF_BAD_SMBUS state always > because ssif_bmc->state is already assigned as SSIF_BAD_SMBUS above. > Move the assignment to after the dev_warn printing. > > [...] > Thanks for pointing this out. Will fix this in next version. >> +static const struct of_device_id ssif_bmc_match[] = { >> +    { .compatible = "ampere,ssif-bmc" }, > > Does this driver have any Ampere specific handling? If not, it could be > "ssif-bmc" as a generic SSIF driver. > Will change as you suggested in next version. >> +    { }, >> +}; > > Add 'MODULE_DEVICE_TABLE(of, ssif_bmc_match);' > Will do in next version >> + >> +static const struct i2c_device_id ssif_bmc_id[] = { >> +    { DEVICE_NAME, 0 }, >> +    { }, >> +}; >> + > > Remove this blank line. > Will update in next version >> +MODULE_DEVICE_TABLE(i2c, ssif_bmc_id); >> + >> +static struct i2c_driver ssif_bmc_driver = { >> +    .driver         = { >> +        .name           = DEVICE_NAME, >> +        .of_match_table = ssif_bmc_match, >> +    }, >> +    .probe          = ssif_bmc_probe, >> +    .remove         = ssif_bmc_remove, >> +    .id_table       = ssif_bmc_id, >> +}; >> + > > Remove this blank line too. > > -Jae > Thanks Jae for the review, will update in next version. - Quan >> +module_i2c_driver(ssif_bmc_driver); >> + >> +MODULE_AUTHOR("Quan Nguyen "); >> +MODULE_AUTHOR("Chuong Tran "); >> +MODULE_DESCRIPTION("Linux device driver of the BMC IPMI SSIF >> interface."); >> +MODULE_LICENSE("GPL"); > > [...]