Message ID | 20230413162440.3313036-1-eajames@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1173608vqo; Thu, 13 Apr 2023 09:45:34 -0700 (PDT) X-Google-Smtp-Source: AKy350bCmdRY85lRonlDnMa3R1eHjgov7wJ77eH93FhQh9bKXccicnIsggRK/1msGE7ALEqngetl X-Received: by 2002:a05:6a00:890:b0:63a:fae3:9890 with SMTP id q16-20020a056a00089000b0063afae39890mr4492222pfj.24.1681404334242; Thu, 13 Apr 2023 09:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681404334; cv=none; d=google.com; s=arc-20160816; b=Kc5nE6t21cYuTvJG8Gv0sfh1tZb0nmx3ZPnUX3qZQMt8oZseOfmgPPoP36J4xGJ/R1 QFhql02HJ9f3EZxGetHp7D/hz9u5niwSwMoKfrlB9aF4FM2FxU/24wMV1CpJko2BUFjS w1t4pLw+BDdiwUtTbJrNHWvw8G7t2CUTIj3c8WzRQbkwTKZWtHjtcjFjIt2rE+jJYrgE Nz7m9fU+je4yWylZeiqP3XjSvQJTiaV5jsGDfxsggPHt5Tanb31D2Aij/N8liETN/Txo fR4lmXChU92TnlYu9+athc+GVF3DywEnuLDI5pARSCw1uX+0MjxEwD0vwkW15e2yDWEg 8xFg== 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=ARLRHoHpS55qm8rtlTvlDCPA8/zgmyitwtHhAXty57Y=; b=X3Q69DWcS2KKIKQ2RffFQUlgdWBrHOzUllAc5Daa8ZbNsC99X9yJHNiHNn8C5TSC6N YFty8WEsaey2AKCIQbxZi/KfZwx9AfxT2cN1LqOO7ph/oChKAnuMYmBtkW/L39FpBF0/ q2EFzvBmWA5zqJE8GL848TJ5G3KXAuC9yt4H6s8XVgrkFMs6zxLP8l1di97YLiSpQrxx X/f+gDA4RkEioAiZ5c12YMWPLtNbb0SipMIuM6KpSuWp1AOFY9BH4c9jJEkVz+xSkosL IrrHc/p68jxfurY0izIM7lCuN+ELIhKkkV3HMpPkYokOnOvzuXC9Y62M6luvlvyEAUe5 yjWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Nw3CFdos; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w22-20020a63c116000000b005077dda0477si2493717pgf.802.2023.04.13.09.45.19; Thu, 13 Apr 2023 09:45:34 -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=@ibm.com header.s=pp1 header.b=Nw3CFdos; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbjDMQY6 (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Thu, 13 Apr 2023 12:24:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbjDMQY5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Apr 2023 12:24:57 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 978CB869E for <linux-kernel@vger.kernel.org>; Thu, 13 Apr 2023 09:24:56 -0700 (PDT) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33DFKhNB013427; Thu, 13 Apr 2023 16:24:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=ARLRHoHpS55qm8rtlTvlDCPA8/zgmyitwtHhAXty57Y=; b=Nw3CFdosSJauPwZ+kJ1fDELgGtLK+7iarPCCjCJ2tovsY25hbyhXMlRpYtVEm2/4LApT 6ZTZUn2hPZiqfT89BzdwOrCkk2IsSP45i1n3NsYpRQevmkoqPGVwfDYtY2JxcLnk95AB /CDTrRbLOaG4V6ERziRkiekxAHNJIymvM7H/p1uxRKzgodVz77WRwUCS+yCDnZpH1RK2 9ek4k31LmO/x1y2ez3Rs2RopTtAq38drCqgzPX2CD1cU5ArwNoucalL2E2AOfKm+I0z+ pqkFmzZoVKoaCHzCYbFNRG1QJacv+9eCSnphFdTqVjgWFf1T7QEY64CHXVt3Vup73oGa Ng== Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pxma1tseg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Apr 2023 16:24:45 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33DD1IW9020744; Thu, 13 Apr 2023 16:24:45 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([9.208.129.117]) by ppma04wdc.us.ibm.com (PPS) with ESMTPS id 3pu0jhccm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Apr 2023 16:24:45 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33DGOhEI20775570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Apr 2023 16:24:44 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D544258059; Thu, 13 Apr 2023 16:24:43 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DC3B58055; Thu, 13 Apr 2023 16:24:43 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.160.69.135]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 13 Apr 2023 16:24:42 +0000 (GMT) From: Eddie James <eajames@linux.ibm.com> To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, joel@jms.id.au, jk@ozlabs.org, alistair@popple.id.au, Eddie James <eajames@linux.ibm.com> Subject: [PATCH] fsi: core: Fix legacy minor numbering Date: Thu, 13 Apr 2023 11:24:40 -0500 Message-Id: <20230413162440.3313036-1-eajames@linux.ibm.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 4jQ0wmQ9Wh3-EPjZLpc_WUzFThzE6xT9 X-Proofpoint-GUID: 4jQ0wmQ9Wh3-EPjZLpc_WUzFThzE6xT9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-13_11,2023-04-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 phishscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304130143 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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?1763080231057424008?= X-GMAIL-MSGID: =?utf-8?q?1763080231057424008?= |
Series |
fsi: core: Fix legacy minor numbering
|
|
Commit Message
Eddie James
April 13, 2023, 4:24 p.m. UTC
FSI reserves the first 64 minor numbers for the legacy numbering
based on the chip id. However the legacy number shifts the chip
id too much, resulting in overlap between legacy and non-legacy
numbers. Reduce the chip id bit shift since the type field only
takes 2 bits.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
drivers/fsi/fsi-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, 13 Apr 2023 at 16:24, Eddie James <eajames@linux.ibm.com> wrote: > > FSI reserves the first 64 minor numbers for the legacy numbering > based on the chip id. However the legacy number shifts the chip > id too much, resulting in overlap between legacy and non-legacy > numbers. Reduce the chip id bit shift since the type field only > takes 2 bits. I don't know much about the legacy numbering. Was that something we used before the device tree descriptions were in place? Do we still need it if we have updated device trees? > > Signed-off-by: Eddie James <eajames@linux.ibm.com> > --- > drivers/fsi/fsi-core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c > index 0b927c9f4267..b9f410170655 100644 > --- a/drivers/fsi/fsi-core.c > +++ b/drivers/fsi/fsi-core.c > @@ -950,7 +950,7 @@ static int __fsi_get_new_minor(struct fsi_slave *slave, enum fsi_dev_type type, > /* Check if we qualify for legacy numbering */ > if (cid >= 0 && cid < 16 && type < 4) { > /* Try reserving the legacy number */ Would it help to put some of your commit message info in this comment, so we know what the magic shift is doing? > - id = (cid << 4) | type; > + id = (cid << 2) | type; > id = ida_simple_get(&fsi_minor_ida, id, id + 1, GFP_KERNEL); > if (id >= 0) { > *out_index = fsi_adjust_index(cid); > -- > 2.31.1 >
On 5/30/23 20:54, Joel Stanley wrote: > On Thu, 13 Apr 2023 at 16:24, Eddie James <eajames@linux.ibm.com> wrote: >> FSI reserves the first 64 minor numbers for the legacy numbering >> based on the chip id. However the legacy number shifts the chip >> id too much, resulting in overlap between legacy and non-legacy >> numbers. Reduce the chip id bit shift since the type field only >> takes 2 bits. > I don't know much about the legacy numbering. Was that something we > used before the device tree descriptions were in place? Do we still > need it if we have updated device trees? Its a way to number the devices based on the "chip id", which came from the device tree anyway. Now with the aliasing patch we could do away with it I believe, but we would need to update older system device trees (and scom devices on p10) to not break stuff. > >> Signed-off-by: Eddie James <eajames@linux.ibm.com> >> --- >> drivers/fsi/fsi-core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c >> index 0b927c9f4267..b9f410170655 100644 >> --- a/drivers/fsi/fsi-core.c >> +++ b/drivers/fsi/fsi-core.c >> @@ -950,7 +950,7 @@ static int __fsi_get_new_minor(struct fsi_slave *slave, enum fsi_dev_type type, >> /* Check if we qualify for legacy numbering */ >> if (cid >= 0 && cid < 16 && type < 4) { >> /* Try reserving the legacy number */ > Would it help to put some of your commit message info in this comment, > so we know what the magic shift is doing? Sure thing. Thanks, Eddie > >> - id = (cid << 4) | type; >> + id = (cid << 2) | type; >> id = ida_simple_get(&fsi_minor_ida, id, id + 1, GFP_KERNEL); >> if (id >= 0) { >> *out_index = fsi_adjust_index(cid); >> -- >> 2.31.1 >>
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 0b927c9f4267..b9f410170655 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -950,7 +950,7 @@ static int __fsi_get_new_minor(struct fsi_slave *slave, enum fsi_dev_type type, /* Check if we qualify for legacy numbering */ if (cid >= 0 && cid < 16 && type < 4) { /* Try reserving the legacy number */ - id = (cid << 4) | type; + id = (cid << 2) | type; id = ida_simple_get(&fsi_minor_ida, id, id + 1, GFP_KERNEL); if (id >= 0) { *out_index = fsi_adjust_index(cid);