From owner-freebsd-arch@freebsd.org Mon May 27 05:44:55 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D940315BA7D4 for ; Mon, 27 May 2019 05:44:54 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7524F8547F for ; Mon, 27 May 2019 05:44:53 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f46.google.com with SMTP id u27so11091617lfg.10 for ; Sun, 26 May 2019 22:44:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:openpgp:autocrypt:message-id :date:user-agent:mime-version:content-language :content-transfer-encoding; bh=IxPQ1tRrHE6SMqe16nxkI30CE/6l2Zcmo/pFbrb7Z/M=; b=aDd0JsmmCYaD7F/hSW7B47+s/FLGtW4ON0h/6iwhncYIyOqXLsnt7HhTe0L+aPpuZW Gh5Aj3lMU3/6Epgbj8lG1r0rUJhnnP8cXJxHK4mhT2Z88+rryGuxh+aWxVdqKconXNOw rYC5Kpo+ZTh0p880Zpv8e6YxykvjMh2QYqUXHSHmLhh50ulVUwFmFgxxytmM3W+ra8v/ BagnXJss98Z+iAKlj2uc8fMFcwjrI6mDcd68P7qnKOUqE06CUMzpe/QH6jMRRFJLvEXx nw0FDwqV36GMan4Jsbho+/4pZC5I85KdBzcZb2dJFotJr4DtE4Qqe4A/wjsKtmKKcTYy eszw== X-Gm-Message-State: APjAAAWNYigAdI77WSCD2f5G2B0tbEjeCjC66DFEjaYsVt3r+SzRfRwS 8OxmLm6MuCff+OO/0x22KbDqPcTx X-Google-Smtp-Source: APXvYqwrlNq9tLWreTtmzao4EALO6B99StRBRvzuSvLcn5feJTqumusrKUayOXIYBJeeZ6rJEFmAXQ== X-Received: by 2002:a05:6512:21c:: with SMTP id a28mr1555522lfo.14.1558935885728; Sun, 26 May 2019 22:44:45 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id v2sm111465lfi.52.2019.05.26.22.44.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 May 2019 22:44:44 -0700 (PDT) To: freebsd-arch@FreeBSD.ORG From: Andriy Gapon Subject: proposal: require ivar accessors to succeed Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2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xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> Date: Mon, 27 May 2019 08:44:43 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7524F8547F X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.46 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.24 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[FreeBSD.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-1.27)[ip: (-0.61), ipnet: 209.85.128.0/17(-3.41), asn: 15169(-2.29), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[46.167.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 05:44:55 -0000 __BUS_ACCESSOR() macro is used to define accessors to bus IVAR variables. Unfortunately, accessors defined in such a fashion completely ignore return values of BUS_READ_IVAR() and BUS_WRITE_IVAR() method calls. There is no way to see if a call is successful. Typically, this should not be a problem as a device driver targets a specific bus (sometimes, buses) and it should know what IVARs the bus has. So, the driver should make only those IVAR calls that are supposed to always succeed on the bus. But sometimes things can go wrong as with everything else. So, I am proposing to add some code to __BUS_ACCESSOR to verify the success. For example, we can panic when a call fails. The checks could be under INVARIANTS or under DIAGNOSTICS or under a new kernel option. A less drastic option is to print a warning message on an error. This is mostly intended to help driver writers and maintainers. Opinions, suggestions, etc are welcome. Thank you. -- Andriy Gapon From owner-freebsd-arch@freebsd.org Mon May 27 17:24:01 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C48EA15A65C9 for ; Mon, 27 May 2019 17:24:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C68A476207; Mon, 27 May 2019 17:23:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f169.google.com with SMTP id m140so241052itg.2; Mon, 27 May 2019 10:23:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=0PkoujTCZRrdJQhu0Wl1rZByHE+SKuTUTQoH+j8OgFE=; b=js/oN/w2hm9WiOm3EqEwOKIPzyRbh/CsBi4HJRZBW1cOgjZib822M29OYxCWLE3Cb3 zRIKuoMC+uB4T+Of9TkcwEIYGukLU4lL25aLMyd1FQaAFU6dcV79lkYoAWrUOg9zsTUA o1pLMnThj4MeSvNyY493UVcm8j+NNBa8xUImCeBBdmFt1cD47ZS+RiYXdJqrOtDqYSzR 2SCASsEAqy+/R+THBypLTRZ5Ro2ppzkj3ODkyNNDagE8GfZmAGtX0bLQN3Yadgi493bS 5GgsgEyJ6MCFnVAD4yaEYyJRY/vpZWbAS6qmH6oARB2FgUqryu9xfbNnIMjnlOJRLSyT RIbw== X-Gm-Message-State: APjAAAXxXalbqSppT3q+BFPm0hk2Ddy7RabAZO9w74Ywy8PXf0QtbZWv 1acuNe73N2IY/MiJ9Am5YQ/wnTsK X-Google-Smtp-Source: APXvYqw7tiQMWVu17nB+yAG0GWAlggvONyHbdEch8FMVd1Mi0CU8rG+Faj/7KfHVvGkrw5KlA2tSDQ== X-Received: by 2002:a24:fa42:: with SMTP id v63mr129755ith.20.1558977832524; Mon, 27 May 2019 10:23:52 -0700 (PDT) Received: from mail-it1-f178.google.com (mail-it1-f178.google.com. [209.85.166.178]) by smtp.gmail.com with ESMTPSA id l186sm54414itb.5.2019.05.27.10.23.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 10:23:52 -0700 (PDT) Received: by mail-it1-f178.google.com with SMTP id a186so292260itg.0; Mon, 27 May 2019 10:23:52 -0700 (PDT) X-Received: by 2002:a24:e3cb:: with SMTP id d194mr126762ith.100.1558977832076; Mon, 27 May 2019 10:23:52 -0700 (PDT) MIME-Version: 1.0 References: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> In-Reply-To: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 27 May 2019 10:23:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: proposal: require ivar accessors to succeed To: Andriy Gapon Cc: freebsd-arch@freebsd.org X-Rspamd-Queue-Id: C68A476207 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.169 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.71 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+,1:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; IP_SCORE(-2.72)[ip: (-7.83), ipnet: 209.85.128.0/17(-3.40), asn: 15169(-2.29), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[169.166.85.209.list.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 17:24:01 -0000 Seems like a good idea to me. Best, Conrad On Sun, May 26, 2019 at 10:45 PM Andriy Gapon wrote: > > __BUS_ACCESSOR() macro is used to define accessors to bus IVAR variables. > Unfortunately, accessors defined in such a fashion completely ignore return > values of BUS_READ_IVAR() and BUS_WRITE_IVAR() method calls. There is no > way to > see if a call is successful. Typically, this should not be a problem as a > device driver targets a specific bus (sometimes, buses) and it should know > what > IVARs the bus has. So, the driver should make only those IVAR calls that > are > supposed to always succeed on the bus. > But sometimes things can go wrong as with everything else. > > So, I am proposing to add some code to __BUS_ACCESSOR to verify the > success. > For example, we can panic when a call fails. The checks could be under > INVARIANTS or under DIAGNOSTICS or under a new kernel option. > A less drastic option is to print a warning message on an error. > > This is mostly intended to help driver writers and maintainers. > > Opinions, suggestions, etc are welcome. > Thank you. > -- > Andriy Gapon > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > From owner-freebsd-arch@freebsd.org Mon May 27 18:10:37 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7455115A74B7 for ; Mon, 27 May 2019 18:10:37 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DEF1E779A2; Mon, 27 May 2019 18:10:32 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 36F3D8D4A166; Mon, 27 May 2019 18:10:31 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 0463AE70890; Mon, 27 May 2019 18:10:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id neqYqdNcLIbs; Mon, 27 May 2019 18:10:28 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 6E462E7088F; Mon, 27 May 2019 18:10:28 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Andriy Gapon" Cc: freebsd-arch@FreeBSD.ORG Subject: Re: proposal: require ivar accessors to succeed Date: Mon, 27 May 2019 18:10:28 +0000 X-Mailer: MailMate (2.0BETAr6137) Message-ID: In-Reply-To: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> References: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DEF1E779A2 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 2a01:4f8:13b:39f::9f:25 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net X-Spamd-Result: default: False [-5.73 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:39f::9f:25]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[zabbadoz.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.46)[ip: (-8.55), ipnet: 2a01:4f8::/29(-2.00), asn: 24940(-1.74), country: DE(-0.00)]; MX_GOOD(-0.01)[cross.sbone.de]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 18:10:37 -0000 On 27 May 2019, at 5:44, Andriy Gapon wrote: > __BUS_ACCESSOR() macro is used to define accessors to bus IVAR > variables. > Unfortunately, accessors defined in such a fashion completely ignore > return > values of BUS_READ_IVAR() and BUS_WRITE_IVAR() method calls. There is > no way to > see if a call is successful. Typically, this should not be a problem > as a > device driver targets a specific bus (sometimes, buses) and it should > know what > IVARs the bus has. So, the driver should make only those IVAR calls > that are > supposed to always succeed on the bus. > But sometimes things can go wrong as with everything else. > > So, I am proposing to add some code to __BUS_ACCESSOR to verify the > success. > For example, we can panic when a call fails. The checks could be > under > INVARIANTS or under DIAGNOSTICS or under a new kernel option. > A less drastic option is to print a warning message on an error. > > This is mostly intended to help driver writers and maintainers. > > Opinions, suggestions, etc are welcome. What about “fixing” the KPI (possibly adding a 2nd one), deprecating the old one, and (slowly over time) migrating old stuff over? /bz From owner-freebsd-arch@freebsd.org Mon May 27 20:45:57 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1BF315AAB3A for ; Mon, 27 May 2019 20:45:56 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA00A8559B for ; Mon, 27 May 2019 20:45:55 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f42.google.com with SMTP id y13so12875613lfh.9 for ; Mon, 27 May 2019 13:45:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=bWY2Qvn0SXurgH3rXt8CZWVfbAfKJQGrSiTqTWhYHbM=; b=SwM8R7yicLJqBmdrW0ZXv+VsGqUq+ZK4xzfGhPKeZnCwAG/OK3SotAGjJS/n6yRYa/ TXPQ8uTF5UMjnLQGGjGIvSVyKYjgDWHL0f9rRRzjOsPQ/nQIs2Ck+g+9bvX31CkP65E8 2L3lUfQkT2TRK0S4QRG/jAbdg/p43KjgdL/5MorunoViJwYgAxAeFzwKJmmNozedbrEX n9UDTAhXuv5kGRTO106iRGtQHln7noCJ7uTHACtdOFmZxZR3pmvbkC1iV6A+Oa6IXNr3 9tcEm2Y7KhcjcoqSijplMGW30KRvNkl21zWbRwTMhvxb80QfGKu5smcZqYZGDtI/Qi5x Y1DA== X-Gm-Message-State: APjAAAV62/4794gwaVQbOC9bwKHqhTASA6tXZz/YCMasSUZbOCifRmAq S++3DvZVoDopv64b8ngVba5rsaQt X-Google-Smtp-Source: APXvYqzg1Ay3ymelcfn7VH/C+y++hRFpLEsIW4esiB8XMx+ixm270ecvD+q7AyruejpAOJjYi7+V9A== X-Received: by 2002:ac2:5e82:: with SMTP id b2mr5630738lfq.3.1558988512391; Mon, 27 May 2019 13:21:52 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id w27sm2495314lfn.19.2019.05.27.13.21.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 13:21:51 -0700 (PDT) Subject: Re: proposal: require ivar accessors to succeed To: "Bjoern A. Zeeb" Cc: freebsd-arch@FreeBSD.org References: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL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amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA00A8559B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.42 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.27 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; IP_SCORE(-1.27)[ip: (-0.63), ipnet: 209.85.128.0/17(-3.39), asn: 15169(-2.29), country: US(-0.06)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[42.167.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 20:45:57 -0000 On 27/05/2019 21:10, Bjoern A. Zeeb wrote: > On 27 May 2019, at 5:44, Andriy Gapon wrote: > >> __BUS_ACCESSOR() macro is used to define accessors to bus IVAR variables. >> Unfortunately, accessors defined in such a fashion completely ignore return >> values of BUS_READ_IVAR() and BUS_WRITE_IVAR() method calls.  There is no way to >> see if a call is successful.  Typically, this should not be a problem as a >> device driver targets a specific bus (sometimes, buses) and it should know what >> IVARs the bus has.  So, the driver should make only those IVAR calls that are >> supposed to always succeed on the bus. >> But sometimes things can go wrong as with everything else. >> >> So, I am proposing to add some code to __BUS_ACCESSOR to verify the success. >> For example, we can panic when a call fails.  The checks could be under >> INVARIANTS or under DIAGNOSTICS or under a new kernel option. >> A less drastic option is to print a warning message on an error. >> >> This is mostly intended to help driver writers and maintainers. >> >> Opinions, suggestions, etc are welcome. > > What about “fixing” the KPI (possibly adding a 2nd one), deprecating the old > one, and (slowly over time) migrating old stuff over? I think that the two proposals are not mutually exclusive. And I think that both make sense. However, it's hard for me to imagine a desire to replace code like this devid = pci_get_devid(dev); with this err = pci_get2_devid(dev, &devid); if (err != 0) { ... } Especially given that, modulo bugs, dev is going to be a device on the pci bus and the call is going to succeed. In other words, in my opinion, the only cases where an accessor is allowed to fail are: - a driver somehow attached to a device on an unexpected bus - uncoordinated changes in between a bus driver and a device driver So, programming errors. -- Andriy Gapon From owner-freebsd-arch@freebsd.org Mon May 27 21:04:40 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 299D515AB083 for ; Mon, 27 May 2019 21:04:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 716F28654A for ; Mon, 27 May 2019 21:04:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x734.google.com with SMTP id p18so19582454qkk.0 for ; Mon, 27 May 2019 14:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hbF59l8XGrym5wlBoLdpfL78s6P5a7836uVov9JPYw4=; b=evy+O2mAseA7+nqQUxpG8iaWcw+fYNH02K0Huy2KF4I5nL+Szty237gGJO/3OXrjdg EAIinTOvJ5zXeN7s9H7trqZOrzW2z7paxdjy20iG296J9uW1Tg+/vpQQNU+Dmjumt+/6 DDunSC58zlTnchsDr5JTFee1vbty3PEIL78NEuOg+aJhIAOCfjYh9fDimK1DL+2wOg+a vVTGcpM+Tr9nqlz6PmHP8m3fFa+IAKjgGUI4BvfK3AHbiUxMa0Q7Qz85T0TiMCSSPpMC 3KVwQpdg2L8zXllB0TfzunX8NLMmLpRBcWJoa252DvEnMBDApjUbCouzkajeyO7B701e 75vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hbF59l8XGrym5wlBoLdpfL78s6P5a7836uVov9JPYw4=; b=fTOcoZYmAbHh6j17KV/g6jrp5A5vaOt7mZSRrmyLJs31rnPHgXlYEadklyNvcmtabs kK2cHj9RneYkw5mPHSJ8aTsHjQX7Xuhs3lFbkLohr0GU/xzysIZRwtSE97oEj5wRgmS9 5WaBpzcY6L55FSsSG510K2QPu5QkkuRO4QZjGgmhBuYci9T6zgSPjdg+q3GVF2hC6h9P m4BOM+3uJj9toCOJQuerzUhwbOTJ1eI5FdKfy2FX5GNpNGthoZUvBA9yvFDkPQQNyG9N misZHBn4SGSiJP5vNNkIzDedEDVRVauKBxBronD3aoNSVu1bCy2y4d6ZFCHiQOlls+jN BVew== X-Gm-Message-State: APjAAAXJrGGopeOLeOsqKCpKzwv4k9pOjJcmqVw/1yjpjMUsfD/EXtqY OW7heniPn3ZeLDYa2TQmz2Ecb4SPx42QQU2ytDDLRA== X-Google-Smtp-Source: APXvYqxzBa0hyzpMVUaxZAMEU3WIqYr0Ptoyxps9FaY82xHNW0hkEYUYOWF6QJkTbj94LcZuVVPV/jROE+KPAijKs0E= X-Received: by 2002:aed:24ae:: with SMTP id t43mr96511230qtc.187.1558991077581; Mon, 27 May 2019 14:04:37 -0700 (PDT) MIME-Version: 1.0 References: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Mon, 27 May 2019 15:04:25 -0600 Message-ID: Subject: Re: proposal: require ivar accessors to succeed To: Andriy Gapon Cc: "Bjoern A. Zeeb" , freebsd-arch@freebsd.org X-Rspamd-Queue-Id: 716F28654A X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=evy+O2mA X-Spamd-Result: default: False [-5.88 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ALT1.aspmx.l.google.com,aspmx.l.google.com,ALT2.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[4.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.85)[-0.852,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; IP_SCORE(-3.01)[ip: (-9.44), ipnet: 2607:f8b0::/32(-3.29), asn: 15169(-2.29), country: US(-0.06)]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 21:04:40 -0000 On Mon, May 27, 2019, 2:47 PM Andriy Gapon wrote: > On 27/05/2019 21:10, Bjoern A. Zeeb wrote: > > On 27 May 2019, at 5:44, Andriy Gapon wrote: > > > >> __BUS_ACCESSOR() macro is used to define accessors to bus IVAR > variables. > >> Unfortunately, accessors defined in such a fashion completely ignore > return > >> values of BUS_READ_IVAR() and BUS_WRITE_IVAR() method calls. There is > no way to > >> see if a call is successful. Typically, this should not be a problem > as a > >> device driver targets a specific bus (sometimes, buses) and it should > know what > >> IVARs the bus has. So, the driver should make only those IVAR calls > that are > >> supposed to always succeed on the bus. > >> But sometimes things can go wrong as with everything else. > >> > >> So, I am proposing to add some code to __BUS_ACCESSOR to verify the > success. > >> For example, we can panic when a call fails. The checks could be unde= r > >> INVARIANTS or under DIAGNOSTICS or under a new kernel option. > >> A less drastic option is to print a warning message on an error. > >> > >> This is mostly intended to help driver writers and maintainers. > >> > >> Opinions, suggestions, etc are welcome. > > > > What about =E2=80=9Cfixing=E2=80=9D the KPI (possibly adding a 2nd one)= , deprecating the > old > > one, and (slowly over time) migrating old stuff over? > > I think that the two proposals are not mutually exclusive. > And I think that both make sense. > However, it's hard for me to imagine a desire to replace code like this > devid =3D pci_get_devid(dev); > with this > err =3D pci_get2_devid(dev, &devid); > if (err !=3D 0) { > ... > } > > Especially given that, modulo bugs, dev is going to be a device on the pc= i > bus > and the call is going to succeed. > In other words, in my opinion, the only cases where an accessor is allowe= d > to > fail are: > - a driver somehow attached to a device on an unexpected bus > - uncoordinated changes in between a bus driver and a device driver > So, programming errors. > I'm cool with panic. The accessor functions are all supposed to be can't fail. And creating a new set of APIs that can return failure for can't fail things will just bloat the code with cargo cult error handler's that add no value. So put me down on the NO to the new API. If you want to test if the ivar is supported, use the lower level READ_IVAR. Let's not break the API because one person had a bug... Warner > -- > Andriy Gapon > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > From owner-freebsd-arch@freebsd.org Mon May 27 23:47:37 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3676015AE581 for ; Mon, 27 May 2019 23:47:37 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id A6B588BCDC for ; Mon, 27 May 2019 23:47:36 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: by mailman.ysv.freebsd.org (Postfix) id 63AD715AE579; Mon, 27 May 2019 23:47:36 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 514A715AE575 for ; Mon, 27 May 2019 23:47:36 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail02.asahi-net.or.jp (mail02.asahi-net.or.jp [202.224.55.14]) by mx1.freebsd.org (Postfix) with ESMTP id 2675D8BCD4 for ; Mon, 27 May 2019 23:47:33 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from vmware.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail02.asahi-net.or.jp (Postfix) with ESMTPSA id 4987C3EBDF; Tue, 28 May 2019 08:47:27 +0900 (JST) Date: Mon, 27 May 2019 19:46:45 -0400 From: Yoshihiro Ota To: Warner Losh Cc: ota@j.email.ne.jp, "freebsd-arch@freebsd.org" Subject: Re: Time to retire PC Card (but not CardBus) Message-Id: <20190527194645.f1942efa17cbeb1646181dd7@j.email.ne.jp> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2675D8BCD4 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ota@j.email.ne.jp designates 202.224.55.14 as permitted sender) smtp.mailfrom=ota@j.email.ne.jp X-Spamd-Result: default: False [-0.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[14.55.224.202.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:202.224.55.0/24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[email.ne.jp]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.76)[0.762,0]; RECEIVED_SPAMHAUS_PBL(0.00)[135.119.76.72.zen.spamhaus.org : 127.0.0.10]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: sbmx.asahi-net.or.jp]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; IP_SCORE(0.07)[asn: 4685(0.42), country: JP(-0.05)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4685, ipnet:202.224.32.0/19, country:JP]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 23:47:37 -0000 Hi, I think I have a couple of PCMCIA cards and/or bus. How do I check? Thanks, Hiro On Thu, 23 May 2019 18:34:46 -0600 Warner Losh wrote: > Greetings, > > Now that a number of 16-bit drivers have been retired, I think it's time to > retire 16-bit PC Card / PCMCIA cards. The 32-bit CardBus cards are still > alive and kicking, but the need for 16-bit PC Cards has passed. It's time > to retire it. > > I've floated this idea before, and there was broad support for it. I've > held off until after FCP 101 deprecation was playing out. We've not pushed > that into the tree. This is the logical next step. FreeBSD 12.x will be the > last release with 16-bit PC Card support. > > My plan is to add deprecation notices to the remaining PC Card drivers, > merge those back to FreeBSD 11 and 12. Once that's done, I plan on removing > the 16-bit support. I have a few minor bug fixes to that which I'll push in > before I retire it, and merge those fixes. > > My plan is to give about a month for the community to discuss this plan > before I add the warnings. If there's resistance, we'll go with more formal > data collection and deprecation. If there's none, I'll go ahead. > > This affects the following drivers: an, cmx, fdc, puc, uart, wi, bt3c, ata. > > Warner > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" From owner-freebsd-arch@freebsd.org Tue May 28 02:23:00 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8EC415B2DAA for ; Tue, 28 May 2019 02:22:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 0E59091584 for ; Tue, 28 May 2019 02:22:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id C5D8515B2DA5; Tue, 28 May 2019 02:22:58 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A334015B2DA4 for ; Tue, 28 May 2019 02:22:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47D5391583 for ; Tue, 28 May 2019 02:22:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id c70so6120023qkg.7 for ; Mon, 27 May 2019 19:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x7it6p1LMs6U42kkk7xamc0A8zGOH80wwJtIYu5SZY4=; b=F4WdN76CVH+wYUe8BVH7n0zCwt3oQinmEEqZ56Kva+0msA2vruehQZ2M748iM1EORt glitcUg7mDOxZJSEZ+dif8OzppQtpCFMD4DDAtxL5QQGXSVjxtxTS79uApbzF9H1nQUP +ouEAchwc4OFWDl+qOBvtHgk78xQucRKxQKg+syfeSQWaeiwANX70XJ8HtAdyjU7wlAC tmOHMOZBkRTrI2mzUvlgIUpxGTQxjWSEJewAlTS4nuS18MkSKtqSOjB5AhhYwP0Vs5EM KDVDHSMFuoptUEyuGQXvV6rEgNqmdrYf/HRRJZ/WdQ0OCvNuMBoMabSQw5bvfXvuA0li DPyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x7it6p1LMs6U42kkk7xamc0A8zGOH80wwJtIYu5SZY4=; b=kiniyEKfuaYcpZFlQXBacfz9fwThXjd41ROCzEXv8NDKlOyKBwrL9hFVxiIZBliPsw u8kkdnLnaZKW16UC8pFgN+8C6Vf4slcl4/MgkSxUkvb0WFu3SuFfl3JjWXi6ZtUgCezB 1HjuCJZYF+hmrXV9BRwrE1GICVHSmSjrP7DydOZDOCW8LgzrlarfRRGAWOL3wts1lof4 t+nZrnFi+lwVoWvheMOE1yVTU5W51AVZSxnuhBo3VDBmnpicxEmGZxRLXoYvKMWiGUS2 KD29f2duev6MXgDhf35XQv2zN3ksODCxS3+6sOPiwsWNF1HAGuK50Wn7NY0DNvb7Hf67 48tw== X-Gm-Message-State: APjAAAUTWtWa5PlNeReUED0byQ3zPfD/cHzpaAtxvLLkT/DaAeJsdqWr xVM67FPsIudEjps+YSYc8SYrF2zlSA/uJxAXJT2jHe3s X-Google-Smtp-Source: APXvYqzzG4vLp9o2R13H2uceBCt5/nQ4qDh/S1oTs4eSDhGqsUxDeTksqpazTq1Z/MZmrYeSZGmoaKgQURjl+3wUjvU= X-Received: by 2002:ac8:6105:: with SMTP id a5mr15580627qtm.242.1559010177755; Mon, 27 May 2019 19:22:57 -0700 (PDT) MIME-Version: 1.0 References: <20190527194645.f1942efa17cbeb1646181dd7@j.email.ne.jp> In-Reply-To: <20190527194645.f1942efa17cbeb1646181dd7@j.email.ne.jp> From: Warner Losh Date: Mon, 27 May 2019 20:22:46 -0600 Message-ID: Subject: Re: Time to retire PC Card (but not CardBus) To: Yoshihiro Ota Cc: "freebsd-arch@freebsd.org" X-Rspamd-Queue-Id: 47D5391583 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 02:23:00 -0000 16 bit PC Cards have a smooth metal by the connector while 32 bit ones have a coppery bumpy grounding strip by the connector. Warner On Mon, May 27, 2019, 5:47 PM Yoshihiro Ota wrote: > Hi, > > I think I have a couple of PCMCIA cards and/or bus. > How do I check? > > Thanks, > Hiro > > On Thu, 23 May 2019 18:34:46 -0600 > Warner Losh wrote: > > > Greetings, > > > > Now that a number of 16-bit drivers have been retired, I think it's time > to > > retire 16-bit PC Card / PCMCIA cards. The 32-bit CardBus cards are still > > alive and kicking, but the need for 16-bit PC Cards has passed. It's time > > to retire it. > > > > I've floated this idea before, and there was broad support for it. I've > > held off until after FCP 101 deprecation was playing out. We've not > pushed > > that into the tree. This is the logical next step. FreeBSD 12.x will be > the > > last release with 16-bit PC Card support. > > > > My plan is to add deprecation notices to the remaining PC Card drivers, > > merge those back to FreeBSD 11 and 12. Once that's done, I plan on > removing > > the 16-bit support. I have a few minor bug fixes to that which I'll push > in > > before I retire it, and merge those fixes. > > > > My plan is to give about a month for the community to discuss this plan > > before I add the warnings. If there's resistance, we'll go with more > formal > > data collection and deprecation. If there's none, I'll go ahead. > > > > This affects the following drivers: an, cmx, fdc, puc, uart, wi, bt3c, > ata. > > > > Warner > > _______________________________________________ > > freebsd-arch@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > From owner-freebsd-arch@freebsd.org Tue May 28 07:16:22 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF82715B8D0B for ; Tue, 28 May 2019 07:16:22 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 0D0686B77F for ; Tue, 28 May 2019 07:16:22 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: by mailman.ysv.freebsd.org (Postfix) id BADDA15B8D0A; Tue, 28 May 2019 07:16:21 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A858E15B8D09 for ; Tue, 28 May 2019 07:16:21 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 343466B77D for ; Tue, 28 May 2019 07:16:21 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id F36D92025617; Tue, 28 May 2019 07:16:19 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id x4S7GJxs069760 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 May 2019 07:16:19 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id x4S7GEla069754; Tue, 28 May 2019 07:16:14 GMT (envelope-from phk) To: Warner Losh cc: Yoshihiro Ota , "freebsd-arch@freebsd.org" Subject: Re: Time to retire PC Card (but not CardBus) In-reply-to: From: "Poul-Henning Kamp" References: <20190527194645.f1942efa17cbeb1646181dd7@j.email.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <69752.1559027774.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 May 2019 07:16:14 +0000 Message-ID: <69753.1559027774@critter.freebsd.dk> X-Rspamd-Queue-Id: 343466B77D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.985,0] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 07:16:23 -0000 -------- In message , Warner Losh writes: usually v >16 bit PC Cards have a smooth metal by the connector while 32 bit ones ha= ve >a coppery bumpy grounding strip by the connector. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-freebsd-arch@freebsd.org Tue May 28 08:45:26 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB44715BAEA4 for ; Tue, 28 May 2019 08:45:26 +0000 (UTC) (envelope-from andyf@andyit.com.au) Received: from alpine.spintel.net.au (alpine-smtp.spintel.net.au [203.29.125.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 578816E3F3 for ; Tue, 28 May 2019 08:45:25 +0000 (UTC) (envelope-from andyf@andyit.com.au) Received: from drunkfish.andyit.com.au (210-1-210-40-cpe.spintel.net.au [210.1.210.40]) by alpine.spintel.net.au (Postfix) with ESMTPS id 9A8744C2664 for ; Tue, 28 May 2019 18:45:14 +1000 (AEST) Received: from snuggles.andyit.com.au (snuggles.andyit.com.au [172.22.2.2]) by drunkfish.andyit.com.au (8.15.2/8.15.2) with ESMTP id x4S8jCLu041579 for ; Tue, 28 May 2019 18:45:12 +1000 (AEST) (envelope-from andyf@andyit.com.au) Message-ID: <5CECF518.8040905@andyit.com.au> Date: Tue, 28 May 2019 18:45:12 +1000 From: Andy Farkas User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120614 Thunderbird/13.0 MIME-Version: 1.0 To: freebsd-arch@freebsd.org Subject: Re: Time to retire PC Card (but not CardBus) References: <20190527194645.f1942efa17cbeb1646181dd7@j.email.ne.jp> <69753.1559027774@critter.freebsd.dk> In-Reply-To: <69753.1559027774@critter.freebsd.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 578816E3F3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 08:45:27 -0000 On 28/05/2019 17:16, Poul-Henning Kamp wrote: > -------- > In message , Warner Losh writes: > > > usually > v >> 16 bit PC Cards have a smooth metal by the connector while 32 bit ones have >> a coppery bumpy grounding strip by the connector. > PCMCIA - People Can't Memorise Computer Industry Acronyms -andyf PS. I actually have a working DLink DFE-680TXD PC Card in my IBM 770x laptop (the only way it can get ethernet access) but it was retired about 6 years ago.... From owner-freebsd-arch@freebsd.org Tue May 28 16:43:31 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2F1D15A5710 for ; Tue, 28 May 2019 16:43:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62C81888A1; Tue, 28 May 2019 16:43:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id ADF6F14083; Tue, 28 May 2019 16:43:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: proposal: require ivar accessors to succeed To: Warner Losh , Andriy Gapon Cc: "Bjoern A. Zeeb" , freebsd-arch@freebsd.org References: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <86d87d65-2eb1-d1bf-2e9f-53420b84c1a9@FreeBSD.org> Date: Tue, 28 May 2019 09:43:28 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62C81888A1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.888,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 16:43:31 -0000 On 5/27/19 2:04 PM, Warner Losh wrote: > On Mon, May 27, 2019, 2:47 PM Andriy Gapon wrote: > >> On 27/05/2019 21:10, Bjoern A. Zeeb wrote: >>> On 27 May 2019, at 5:44, Andriy Gapon wrote: >>> >>>> __BUS_ACCESSOR() macro is used to define accessors to bus IVAR >> variables. >>>> Unfortunately, accessors defined in such a fashion completely ignore >> return >>>> values of BUS_READ_IVAR() and BUS_WRITE_IVAR() method calls. There is >> no way to >>>> see if a call is successful. Typically, this should not be a problem >> as a >>>> device driver targets a specific bus (sometimes, buses) and it should >> know what >>>> IVARs the bus has. So, the driver should make only those IVAR calls >> that are >>>> supposed to always succeed on the bus. >>>> But sometimes things can go wrong as with everything else. >>>> >>>> So, I am proposing to add some code to __BUS_ACCESSOR to verify the >> success. >>>> For example, we can panic when a call fails. The checks could be under >>>> INVARIANTS or under DIAGNOSTICS or under a new kernel option. >>>> A less drastic option is to print a warning message on an error. >>>> >>>> This is mostly intended to help driver writers and maintainers. >>>> >>>> Opinions, suggestions, etc are welcome. >>> >>> What about “fixing” the KPI (possibly adding a 2nd one), deprecating the >> old >>> one, and (slowly over time) migrating old stuff over? >> >> I think that the two proposals are not mutually exclusive. >> And I think that both make sense. >> However, it's hard for me to imagine a desire to replace code like this >> devid = pci_get_devid(dev); >> with this >> err = pci_get2_devid(dev, &devid); >> if (err != 0) { >> ... >> } >> >> Especially given that, modulo bugs, dev is going to be a device on the pci >> bus >> and the call is going to succeed. >> In other words, in my opinion, the only cases where an accessor is allowed >> to >> fail are: >> - a driver somehow attached to a device on an unexpected bus >> - uncoordinated changes in between a bus driver and a device driver >> So, programming errors. >> > > I'm cool with panic. The accessor functions are all supposed to be can't > fail. And creating a new set of APIs that can return failure for can't fail > things will just bloat the code with cargo cult error handler's that add no > value. > > So put me down on the NO to the new API. If you want to test if the ivar is > supported, use the lower level READ_IVAR. Let's not break the API because > one person had a bug... Fully agree with this. -- John Baldwin From owner-freebsd-arch@freebsd.org Tue May 28 17:48:50 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8003515A6E0B for ; Tue, 28 May 2019 17:48:50 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id CF7138A7E7 for ; Tue, 28 May 2019 17:48:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 8FA6215A6E0A; Tue, 28 May 2019 17:48:49 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69C4C15A6E09 for ; Tue, 28 May 2019 17:48:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f178.google.com (mail-it1-f178.google.com [209.85.166.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 744958A7E6 for ; Tue, 28 May 2019 17:48:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f178.google.com with SMTP id g24so5787985iti.5 for ; Tue, 28 May 2019 10:48:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=c724+u1e440yriiFdzen/csI4q1rLfEQAvXzCVP4NPs=; b=lirdnYCCXCXLAX9T1YL0IanWwKwuhOMo0W4qvnh+6NIcrUKUHqISY5Pdxt8yaOydz0 8uurSC8bHWvYPCZs13hSV3X6zsAdpvrjxpFI7mWsbhMeZuDcMeDMds1zxXxB5y+Meh5o orHcJ1NSR0bDnM+h2VXFuCldCnwkxamzY2AFwinpjmYi6HZeaz4+BhBu7h44zdMGnyIF BhBNXSO86QhXMsDM9bky3bJloA1AgZteN6x7abkkyXGpX/c3oCstLehh6DKdRJ9ARZEA zCkcDLSI9bUs1ORJsc0HA7NwALfVLsnhZzYELV5LihoMlRXFnHW2IPsUJoT483mtWtlu v2/A== X-Gm-Message-State: APjAAAUTpEZce6CD3uafOANPwdkAqRlxrKtD/0s5kHjD3hdOODySyf+W qHeT50RShdgzgrnLTSjx8keiorBd X-Google-Smtp-Source: APXvYqwJwgvWIgbfh0BPAbWpHseQFMuzoO3A/LcmZUgMItCKYq2aT8QdNcdRA8E2TIgKJjojCJwUyw== X-Received: by 2002:a02:3b55:: with SMTP id i21mr82204195jaf.128.1559065215491; Tue, 28 May 2019 10:40:15 -0700 (PDT) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com. [209.85.166.179]) by smtp.gmail.com with ESMTPSA id p11sm1370477itc.2.2019.05.28.10.40.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 May 2019 10:40:15 -0700 (PDT) Received: by mail-it1-f179.google.com with SMTP id e184so5297236ite.1 for ; Tue, 28 May 2019 10:40:15 -0700 (PDT) X-Received: by 2002:a24:9ac7:: with SMTP id l190mr953965ite.100.1559065215052; Tue, 28 May 2019 10:40:15 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 28 May 2019 10:40:04 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: style.9 RFC: Permit eliding blank lines in small functions To: "freebsd-arch@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 744958A7E6 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.178 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.53 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[arch@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-2.53)[ip: (-6.93), ipnet: 209.85.128.0/17(-3.38), asn: 15169(-2.29), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[178.166.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 17:48:50 -0000 Hi, I have proposed a small change to style.9 here: https://reviews.freebsd.org/D20448 I believe this has been generally permitted in practice and the change is mostly to codify existing unwritten standards, rather than to change them. The goal of this thread is to determine if we do have general consensus for the concept. Thanks, Conrad P.S., please try to avoid the obvious bikeshed trap about the number 4. From owner-freebsd-arch@freebsd.org Tue May 28 22:13:56 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 541E415AE057 for ; Tue, 28 May 2019 22:13:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 86B376DB2A for ; Tue, 28 May 2019 22:13:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: by mailman.ysv.freebsd.org (Postfix) id 3D32915AE055; Tue, 28 May 2019 22:13:55 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B96415AE054 for ; Tue, 28 May 2019 22:13:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 979106DB27; Tue, 28 May 2019 22:13:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 20B864398CE; Wed, 29 May 2019 08:13:43 +1000 (AEST) Date: Wed, 29 May 2019 08:13:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: "freebsd-arch@freebsd.org" Subject: Re: style.9 RFC: Permit eliding blank lines in small functions In-Reply-To: Message-ID: <20190529065949.L2755@besplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=OVlJzIpLT-XgbAEhD4EA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 979106DB27 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.947,0] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 22:13:56 -0000 On Tue, 28 May 2019, Conrad Meyer wrote: > I have proposed a small change to style.9 here: > > https://reviews.freebsd.org/D20448 Why not propose it here (on this list). > I believe this has been generally permitted in practice and the change > is mostly to codify existing unwritten standards, rather than to > change them. The goal of this thread is to determine if we do have > general consensus for the concept. It is a strange not very good rule, but it is a fundamental part of KNF. The wording for the change is bad. "excluded" makes no sense. It means closer to "omitted". "may be excluded" means "the empty line required by the previous clause is not actually required [for short functions]". Another bug in this section is the use of "empty" for lines. Everywhere else in style(9) (4 instances) uses the less precise term "blank". indent(1) consistently uses "blank" (11 instances), including for its -sob option for removing evil b's. The SunOS/zol style guide also has bugs in this area. -sob is specifically documented in indent(1) as being good for removing this particular optional blank line, but the man page is out of date. indent also has options -[n]bad and -[n]badp which interact in confusing ways with -sob even if you know that they exist and what they are set to. indent of course doesn't understand "may be excluded" so with a KNF .indent.pro it fixes any exclusions. -[n]badp was added to it recently to give more control over the blank line after the first set of declarations when this set is null. This area would be even more complicated and buggier if indent understood "may be excluded". It would need something like a numeric arg for -[n]badp to allow exceptions for short functions. Bruce From owner-freebsd-arch@freebsd.org Wed May 29 05:43:02 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4FF315B7DA9 for ; Wed, 29 May 2019 05:43:02 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 156CB82B73 for ; Wed, 29 May 2019 05:43:02 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: by mailman.ysv.freebsd.org (Postfix) id C8ACB15B7DA8; Wed, 29 May 2019 05:43:01 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B727715B7DA7 for ; Wed, 29 May 2019 05:43:01 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail03.asahi-net.or.jp (mail03.asahi-net.or.jp [202.224.55.15]) by mx1.freebsd.org (Postfix) with ESMTP id 3166782B72 for ; Wed, 29 May 2019 05:43:00 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from vmware.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail03.asahi-net.or.jp (Postfix) with ESMTPSA id 1CF2D475A4; Wed, 29 May 2019 14:42:47 +0900 (JST) Date: Wed, 29 May 2019 01:42:13 -0400 From: Yoshihiro Ota To: "Poul-Henning Kamp" Cc: Warner Losh , "freebsd-arch@freebsd.org" Subject: Re: Time to retire PC Card (but not CardBus) Message-Id: <20190529014213.defa4e559388521cd6f7f83b@j.email.ne.jp> In-Reply-To: <69753.1559027774@critter.freebsd.dk> References: <20190527194645.f1942efa17cbeb1646181dd7@j.email.ne.jp> <69753.1559027774@critter.freebsd.dk> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3166782B72 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 05:43:02 -0000 Thanks. I have one PCMCIA card still in use, Compact Flash Card Adapter. In addition, I have 3 other cards but haven't used for long time: Belkin, Network Card Xircom, Ethernet 10/100 3Com, 56K Global Modem I recall I bought Belkin CardBus Network Card as well but it didn't work. I didn't find one this time but it must be sleeping somewhere. By the way, how hard is it to keep them behind kernel option? We can turn on some of very old features even today to reactivate legacy code. Hiro On Tue, 28 May 2019 07:16:14 +0000 "Poul-Henning Kamp" wrote: > -------- > In message , Warner Losh > writes: > > > usually > v > >16 bit PC Cards have a smooth metal by the connector while 32 bit ones have > >a coppery bumpy grounding strip by the connector. > > > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" From owner-freebsd-arch@freebsd.org Wed May 29 10:06:13 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3476615BDC02 for ; Wed, 29 May 2019 10:06:13 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9314F8BB5A for ; Wed, 29 May 2019 10:06:11 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f172.google.com with SMTP id a10so1825306ljf.6 for ; Wed, 29 May 2019 03:06:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=/R/coLhjL9ZBSYxDvAY1fOztdaKg+n1OX3nNJTtv+6A=; b=bw7tnh7gmma+O1M+Ys3/rH0v35H/PkMHeJq9U1IILyN3sE2nyW2jMBInTrIja6CboR 2gf4aMvROiNlr0Z/CKDthTAHhgtMA6G/0aQlqhmASsNBywKV4L8TC0ORvEJ1AE+JDwqf 9kXs2C0jWZ9iwRlil3CHjS2aT3AG1fp/ax4AUQvyWqv9BPqmPe2c0XZ4xOefJ2ZdLy0O 6uZvA3f1CvoUH1Eo8hR9loPmNfJnPUkJz9iJW2kmIFtYf7mz9GWic5ZZD+SVUDa2IW76 vUng0XmRqvVHdiGsTt3nlQBbVJI9xRQVCjb0kIfej5nanA/bW6nbzRUlVyaRhsaKZISL b7pQ== X-Gm-Message-State: APjAAAXYAAQ2dsyEVBXH6PDJtcZbjCmBOXFHeJnB2XxNtZdIjsqnr6Pq LmUFmiYjkI/odbHdFPeYKZ+dhNEK X-Google-Smtp-Source: APXvYqxPUEQkUe2VLGoBm/IGtN9K79o0i8xuYCvs1HJRll5Xp/lmP5r6CtWRJDtZbAda9WXSjAOEWg== X-Received: by 2002:a2e:884e:: with SMTP id z14mr22180291ljj.19.1559123912636; Wed, 29 May 2019 02:58:32 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id n75sm623818lfn.59.2019.05.29.02.58.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 02:58:31 -0700 (PDT) Subject: Re: proposal: require ivar accessors to succeed From: Andriy Gapon To: freebsd-arch@FreeBSD.ORG References: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3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CEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Wed, 29 May 2019 12:58:29 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <2b2ab28f-45c5-1c28-f923-170d95c20c3d@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9314F8BB5A X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.172 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.11 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.87)[-0.871,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[FreeBSD.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-1.23)[ip: (-0.44), ipnet: 209.85.128.0/17(-3.37), asn: 15169(-2.29), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[172.208.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 10:06:13 -0000 On 27/05/2019 08:44, Andriy Gapon wrote: > > __BUS_ACCESSOR() macro is used to define accessors to bus IVAR variables. > Unfortunately, accessors defined in such a fashion completely ignore return > values of BUS_READ_IVAR() and BUS_WRITE_IVAR() method calls. There is no way to > see if a call is successful. Typically, this should not be a problem as a > device driver targets a specific bus (sometimes, buses) and it should know what > IVARs the bus has. So, the driver should make only those IVAR calls that are > supposed to always succeed on the bus. > But sometimes things can go wrong as with everything else. > > So, I am proposing to add some code to __BUS_ACCESSOR to verify the success. > For example, we can panic when a call fails. The checks could be under > INVARIANTS or under DIAGNOSTICS or under a new kernel option. > A less drastic option is to print a warning message on an error. > > This is mostly intended to help driver writers and maintainers. > > Opinions, suggestions, etc are welcome. > Thank you. > I've create a review request for this suggestion: https://reviews.freebsd.org/D20458 Please join in if you are interested. -- Andriy Gapon