All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/selftests: Add compiler paranoia for checking HWSP values
From: Patchwork @ 2020-07-16 20:40 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx
In-Reply-To: <20200716203201.11977-1-chris@chris-wilson.co.uk>

== Series Details ==

Series: series starting with [1/2] drm/i915/selftests: Add compiler paranoia for checking HWSP values
URL   : https://patchwork.freedesktop.org/series/79565/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
31bcd6fa4b2a drm/i915/selftests: Add compiler paranoia for checking HWSP values
-:35: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#35: FILE: drivers/gpu/drm/i915/gt/selftest_timeline.c:566:
+			GEM_TRACE_ERR("Invalid seqno:%lu stored in timeline %llu @ %x, found 0x%x\n",
+			       n, tl->fence_context, tl->hwsp_offset, *tl->hwsp_seqno);

-:48: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#48: FILE: drivers/gpu/drm/i915/gt/selftest_timeline.c:638:
+			GEM_TRACE_ERR("Invalid seqno:%lu stored in timeline %llu @ %x, found 0x%x\n",
+			       n, tl->fence_context, tl->hwsp_offset, *tl->hwsp_seqno);

-:57: WARNING:LONG_LINE: line length of 101 exceeds 100 columns
#57: FILE: drivers/gpu/drm/i915/gt/selftest_timeline.c:736:
+		if (READ_ONCE(*hwsp_seqno[0]) != seqno[0] || READ_ONCE(*hwsp_seqno[1]) != seqno[1]) {

-:70: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#70: FILE: drivers/gpu/drm/i915/gt/selftest_timeline.c:971:
+				GEM_TRACE_ERR("Invalid seqno:%lu stored in timeline %llu @ %x found 0x%x\n",
+				       count, tl->fence_context, tl->hwsp_offset, *tl->hwsp_seqno);

total: 0 errors, 1 warnings, 3 checks, 52 lines checked
58fd41068987 drm/i915/gt: Wait for aux invalidation on Tigerlake


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm/i915/selftests: Add compiler paranoia for checking HWSP values
From: Patchwork @ 2020-07-16 20:40 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx
In-Reply-To: <20200716203201.11977-1-chris@chris-wilson.co.uk>

== Series Details ==

Series: series starting with [1/2] drm/i915/selftests: Add compiler paranoia for checking HWSP values
URL   : https://patchwork.freedesktop.org/series/79565/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.0
Fast mode used, each commit won't be checked separately.


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* Re: Serial port driver usage and status
From: Austin Schuh @ 2020-07-16 20:40 UTC (permalink / raw)
  To: Michel Macena Oliveira; +Cc: Itai Handler, linux-rt-users
In-Reply-To: <CAKkbJ-wDsGO+ZHKZFkPfUL113ONc=NNNeShQkLf+ZH82iaBTEQ@mail.gmail.com>

On Thu, Jul 16, 2020 at 1:21 PM Michel Macena Oliveira
<michel@austral-dynamics.com> wrote:
>
> Em qui., 16 de jul. de 2020 às 16:26, Itai Handler
> <itai.handler@gmail.com> escreveu:
> >
> > Hi Michel,
> >
> > On 7/16/20, Michel Macena Oliveira <michel@austral-dynamics.com> wrote:
> > > Hi, sorry for my newbie question,
> > > What is the status of the serial port driver?
> > > I've written some code to use serial ports  for the generic kernel linux,
> > > And now I want to write something similar for the real time kernel, do
> > > I have to use some specific library, flags or something or is it just
> > > the same settings?
> > >
> > > I'm asking because now I need to take into account the serial access
> > > in the scheduler to ensure a real time behavior .
> > >
> > > Any help, advice, hint or tips would be appreciated.
> > >
> >
> > Do you mean that you wrote some code that works with a /dev/tty* serial port?
> >
> > In some kernel versions (e.g 4.19) we saw high latencies in the rx
> > path of serial drivers.
> > I think that this is due to rx handled in the context of a workqueue
> > which also handles other system activities.
> > We found a workaround to this problem. If I remember correctly we
> > create a dedicated thread for the port and assign it a high priority.
> >
> > Itai Handler
>
> Thanks for the answer,
> Yes I wrote a code that works with  /dev/tty* serial using termios.h.
> I thought exactly what you suggested, to use a dedicated thread, but
> how to properly implement it?
> I mean in a simple way, just need to put open and write calls inside
> the high priority (RT) thread?
>
> Current kernel: 4.4.208-rt198 #1 SMP PREEMPT RT

Itai is talking about the kernel work to handle the serial data, not
the userspace work.  We found the same thing, that the work goes
through a work queue in the kernel, which adds unbounded latency.

https://www.spinics.net/lists/linux-serial/msg07341.html looks
relevant and matches my memory of what we did to solve this.  There's
either a flag in userspace or patch to apply to the kernel (and then a
flag) to skip the work queue.

Austin

^ permalink raw reply

* Re: INFO: rcu detected stall in __sys_sendmsg
From: syzbot @ 2020-07-16 20:41 UTC (permalink / raw)
  To: davem, jhs, jiri, kuba, linux-kernel, netdev, syzkaller-bugs,
	vinicius.gomes, xiyou.wangcong
In-Reply-To: <000000000000983e0405a9c7b870@google.com>

syzbot has bisected this issue to:

commit 5a781ccbd19e4664babcbe4b4ead7aa2b9283d22
Author: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Date:   Sat Sep 29 00:59:43 2018 +0000

    tc: Add support for configuring the taprio scheduler

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=109a63cf100000
start commit:   7cc2a8ea Merge tag 'block-5.8-2020-07-01' of git://git.ker..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=149a63cf100000
kernel config:  https://syzkaller.appspot.com/x/.config?x=183dd243398ba7ec
dashboard link: https://syzkaller.appspot.com/bug?extid=f517075b510306f61903
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11f01c1f100000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16c40ba7100000

Reported-by: syzbot+f517075b510306f61903@syzkaller.appspotmail.com
Fixes: 5a781ccbd19e ("tc: Add support for configuring the taprio scheduler")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply

* Re: [RFC PATCH] overlayfs: Provide a mount option "nosync" to skip sync
From: Vivek Goyal @ 2020-07-16 20:41 UTC (permalink / raw)
  To: linux-unionfs, miklos
  Cc: amir73il, gscrivan, pmatilai, dwalsh, swhiteho, sandeen
In-Reply-To: <20200630193708.GB328891@redhat.com>

On Tue, Jun 30, 2020 at 03:37:08PM -0400, Vivek Goyal wrote:
> Container folks are complaining that dnf/yum issues too many sync while
> installing packages and this slows down the image build. Build
> requirement is such that they don't care if a node goes down while
> build was still going on. In that case, they will simply throw away
> unfinished layer and start new build. So they don't care about syncing
> intermediate state to the disk and hence don't want to pay the price
> associated with sync.
> 

Hi Miklos,

Ping for this patch. What do you think about this patch. Can this be
merged.

Thanks
Vivek

> So they are asking for an option where they can disable sync on overlay
> mount point completely and user space will do sync management on upper
> layer as needed.
> 
> They primarily seem to have two use cases.
> 
> - For building images, they will mount overlay with nosync and then sync
>   upper layer after unmounting overlay and reuse upper as lower for next
>   layer.
> 
> - For running containers, they don't seem to care about syncing upper
>   layer because if node goes down, they will simply throw away upper
>   layer and create a fresh one.
> 
> So this patch provides a mount option "nosync" which disables all forms
> of sync. Now it is caller's responsibility to manage sync of upper layer
> before it is reused again.
> 
> I am seeing roughly 20% speed up in my VM where I am just installing
> emacs in an image. Installation time drops from 31 seconds to 25 seconds
> when nosync option is used. This is for the case of building on top
> of an image where all packages are already cached. That way I take
> out the network operations latency out of the measurement.
> 
> Giuseppe is also looking to cut down on number of iops done on the
> disk. He is complaining that often in cloud their VMs are throttled
> if they cross the limit. This option can help them where they reduce
> number of iops (by cutting down on frequent sync and writebacks).
> 
> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> ---
>  Documentation/filesystems/overlayfs.rst | 20 ++++++++++++++++++++
>  fs/overlayfs/copy_up.c                  | 12 ++++++++----
>  fs/overlayfs/file.c                     | 11 ++++++++++-
>  fs/overlayfs/ovl_entry.h                |  1 +
>  fs/overlayfs/readdir.c                  |  3 +++
>  fs/overlayfs/super.c                    | 23 ++++++++++++++++++++---
>  6 files changed, 62 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/filesystems/overlayfs.rst b/Documentation/filesystems/overlayfs.rst
> index 660dbaf0b9b8..0a42f26a3f0c 100644
> --- a/Documentation/filesystems/overlayfs.rst
> +++ b/Documentation/filesystems/overlayfs.rst
> @@ -563,6 +563,26 @@ This verification may cause significant overhead in some cases.
>  Note: the mount options index=off,nfs_export=on are conflicting and will
>  result in an error.
>  
> +Disable sync
> +------------
> +By default, overlay skips sync on files residing on a lower layer.  It
> +is possible to skip sync operations for files on the upper layer as well
> +with the 'nosync' mount option. This option disables all forms of sync
> +from overlay, including the one done at umount/remount and it is
> +user's responsibility to sync upper layer on the file system it
> +is residing.
> +
> +With this option, data loss will happen if overlayfs upper layer is
> +not synced. So use this option very carefully. This is only for the
> +use cases where users discard upper layer if they could not sync it
> +successfully.
> +
> +Typically workflow will be.
> +
> +- mount overlay
> +- Do bunch of operations
> +- unmount overlay
> +- sync filesystem container upper layer
>  
>  Testsuite
>  ---------
> diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
> index 79dd052c7dbf..5431a89bbd8a 100644
> --- a/fs/overlayfs/copy_up.c
> +++ b/fs/overlayfs/copy_up.c
> @@ -128,7 +128,8 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new)
>  	return error;
>  }
>  
> -static int ovl_copy_up_data(struct path *old, struct path *new, loff_t len)
> +static int ovl_copy_up_data(struct ovl_fs *ofs, struct path *old,
> +			    struct path *new, loff_t len)
>  {
>  	struct file *old_file;
>  	struct file *new_file;
> @@ -218,7 +219,7 @@ static int ovl_copy_up_data(struct path *old, struct path *new, loff_t len)
>  		len -= bytes;
>  	}
>  out:
> -	if (!error)
> +	if (!error && !ofs->config.nosync)
>  		error = vfs_fsync(new_file, 0);
>  	fput(new_file);
>  out_fput:
> @@ -484,6 +485,7 @@ static int ovl_link_up(struct ovl_copy_up_ctx *c)
>  
>  static int ovl_copy_up_inode(struct ovl_copy_up_ctx *c, struct dentry *temp)
>  {
> +	struct ovl_fs *ofs = OVL_FS(c->dentry->d_sb);
>  	int err;
>  
>  	/*
> @@ -499,7 +501,8 @@ static int ovl_copy_up_inode(struct ovl_copy_up_ctx *c, struct dentry *temp)
>  		upperpath.dentry = temp;
>  
>  		ovl_path_lowerdata(c->dentry, &datapath);
> -		err = ovl_copy_up_data(&datapath, &upperpath, c->stat.size);
> +		err = ovl_copy_up_data(ofs, &datapath, &upperpath,
> +				       c->stat.size);
>  		if (err)
>  			return err;
>  	}
> @@ -784,6 +787,7 @@ static bool ovl_need_meta_copy_up(struct dentry *dentry, umode_t mode,
>  /* Copy up data of an inode which was copied up metadata only in the past. */
>  static int ovl_copy_up_meta_inode_data(struct ovl_copy_up_ctx *c)
>  {
> +	struct ovl_fs *ofs = OVL_FS(c->dentry->d_sb);
>  	struct path upperpath, datapath;
>  	int err;
>  	char *capability = NULL;
> @@ -804,7 +808,7 @@ static int ovl_copy_up_meta_inode_data(struct ovl_copy_up_ctx *c)
>  			goto out;
>  	}
>  
> -	err = ovl_copy_up_data(&datapath, &upperpath, c->stat.size);
> +	err = ovl_copy_up_data(ofs, &datapath, &upperpath, c->stat.size);
>  	if (err)
>  		goto out_free;
>  
> diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
> index 01820e654a21..a361890a8d05 100644
> --- a/fs/overlayfs/file.c
> +++ b/fs/overlayfs/file.c
> @@ -329,6 +329,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
>  	struct fd real;
>  	const struct cred *old_cred;
>  	ssize_t ret;
> +	int ifl = iocb->ki_flags;
>  
>  	if (!iov_iter_count(iter))
>  		return 0;
> @@ -344,11 +345,14 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
>  	if (ret)
>  		goto out_unlock;
>  
> +	if (OVL_FS(inode->i_sb)->config.nosync)
> +		ifl &= ~(IOCB_DSYNC | IOCB_SYNC);
> +
>  	old_cred = ovl_override_creds(file_inode(file)->i_sb);
>  	if (is_sync_kiocb(iocb)) {
>  		file_start_write(real.file);
>  		ret = vfs_iter_write(real.file, iter, &iocb->ki_pos,
> -				     ovl_iocb_to_rwf(iocb->ki_flags));
> +				     ovl_iocb_to_rwf(ifl));
>  		file_end_write(real.file);
>  		/* Update size */
>  		ovl_copyattr(ovl_inode_real(inode), inode);
> @@ -368,6 +372,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
>  		real.flags = 0;
>  		aio_req->orig_iocb = iocb;
>  		kiocb_clone(&aio_req->iocb, iocb, real.file);
> +		aio_req->iocb.ki_flags = ifl;
>  		aio_req->iocb.ki_complete = ovl_aio_rw_complete;
>  		ret = vfs_iocb_iter_write(real.file, &aio_req->iocb, iter);
>  		if (ret != -EIOCBQUEUED)
> @@ -430,6 +435,10 @@ static int ovl_fsync(struct file *file, loff_t start, loff_t end, int datasync)
>  	struct fd real;
>  	const struct cred *old_cred;
>  	int ret;
> +	struct ovl_fs *ofs = OVL_FS(file_inode(file)->i_sb);
> +
> +	if (ofs->config.nosync)
> +		return 0;
>  
>  	ret = ovl_real_fdget_meta(file, &real, !datasync);
>  	if (ret)
> diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h
> index b429c80879ee..034a8d9897e0 100644
> --- a/fs/overlayfs/ovl_entry.h
> +++ b/fs/overlayfs/ovl_entry.h
> @@ -17,6 +17,7 @@ struct ovl_config {
>  	bool nfs_export;
>  	int xino;
>  	bool metacopy;
> +	bool nosync;
>  };
>  
>  struct ovl_sb {
> diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
> index 6918b98faeb6..9e93db028dbf 100644
> --- a/fs/overlayfs/readdir.c
> +++ b/fs/overlayfs/readdir.c
> @@ -863,6 +863,9 @@ static int ovl_dir_fsync(struct file *file, loff_t start, loff_t end,
>  	if (!OVL_TYPE_UPPER(ovl_path_type(dentry)))
>  		return 0;
>  
> +	if (OVL_FS(dentry->d_sb)->config.nosync)
> +		return 0;
> +
>  	/*
>  	 * Need to check if we started out being a lower dir, but got copied up
>  	 */
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index 91476bc422f9..c28ab39b5c70 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -264,6 +264,8 @@ static int ovl_sync_fs(struct super_block *sb, int wait)
>  	if (!ovl_upper_mnt(ofs))
>  		return 0;
>  
> +	if (ofs->config.nosync)
> +		return 0;
>  	/*
>  	 * Not called for sync(2) call or an emergency sync (SB_I_SKIP_SYNC).
>  	 * All the super blocks will be iterated, including upper_sb.
> @@ -362,6 +364,8 @@ static int ovl_show_options(struct seq_file *m, struct dentry *dentry)
>  	if (ofs->config.metacopy != ovl_metacopy_def)
>  		seq_printf(m, ",metacopy=%s",
>  			   ofs->config.metacopy ? "on" : "off");
> +	if (ofs->config.nosync)
> +		seq_puts(m, ",nosync");
>  	return 0;
>  }
>  
> @@ -376,9 +380,11 @@ static int ovl_remount(struct super_block *sb, int *flags, char *data)
>  
>  	if (*flags & SB_RDONLY && !sb_rdonly(sb)) {
>  		upper_sb = ovl_upper_mnt(ofs)->mnt_sb;
> -		down_read(&upper_sb->s_umount);
> -		ret = sync_filesystem(upper_sb);
> -		up_read(&upper_sb->s_umount);
> +		if (!ofs->config.nosync) {
> +			down_read(&upper_sb->s_umount);
> +			ret = sync_filesystem(upper_sb);
> +			up_read(&upper_sb->s_umount);
> +		}
>  	}
>  
>  	return ret;
> @@ -411,6 +417,7 @@ enum {
>  	OPT_XINO_AUTO,
>  	OPT_METACOPY_ON,
>  	OPT_METACOPY_OFF,
> +	OPT_NOSYNC,
>  	OPT_ERR,
>  };
>  
> @@ -429,6 +436,7 @@ static const match_table_t ovl_tokens = {
>  	{OPT_XINO_AUTO,			"xino=auto"},
>  	{OPT_METACOPY_ON,		"metacopy=on"},
>  	{OPT_METACOPY_OFF,		"metacopy=off"},
> +	{OPT_NOSYNC,			"nosync"},
>  	{OPT_ERR,			NULL}
>  };
>  
> @@ -573,6 +581,10 @@ static int ovl_parse_opt(char *opt, struct ovl_config *config)
>  			metacopy_opt = true;
>  			break;
>  
> +		case OPT_NOSYNC:
> +			config->nosync = true;
> +			break;
> +
>  		default:
>  			pr_err("unrecognized mount option \"%s\" or missing value\n",
>  					p);
> @@ -588,6 +600,11 @@ static int ovl_parse_opt(char *opt, struct ovl_config *config)
>  		config->workdir = NULL;
>  	}
>  
> +	if (!config->upperdir && config->nosync) {
> +		pr_info("option nosync is meaningless in a non-upper mount, ignoring it.\n");
> +		config->nosync = false;
> +	}
> +
>  	err = ovl_parse_redirect_mode(config, config->redirect_mode);
>  	if (err)
>  		return err;
> -- 
> 2.25.4
> 


^ permalink raw reply

* Re: [PATCH RFC] bluetooth: add support for some old headsets
From: Sergey Shtylyov @ 2020-07-16 20:33 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Johan Hedberg, Bluetooth Kernel Mailing List, David S. Miller,
	Jakub Kicinski, netdev
In-Reply-To: <1834765D-52E6-45B8-9923-778C9182CFA9@holtmann.org>

Hello!

On 7/16/20 4:14 PM, Marcel Holtmann wrote:

>> The MediaTek Bluetooth platform (MT6630 etc.) has a peculiar implementation
>> for the eSCO/SCO connection via BT/EDR: the host controller returns error
>> code 0x20 (LMP feature not supported) for HCI_Setup_Synchronous_Connection
>> (0x0028) command without actually trying to setup connection with a remote
>> device in case such device (like Digma BT-14 headset) didn't advertise its
>> supported features.  Even though this doesn't break compatibility with the
>> Bluetooth standard it breaks the compatibility with the Hands-Free Profile
>> (HFP).
>>
>> This patch returns the compatibility with the HFP profile and actually
>> tries to check all available connection parameters despite of the specific
>> MediaTek implementation. Without it one was unable to establish eSCO/SCO
>> connection with some headsets.
> 
> please include the parts of btmon output that show this issue.

   Funny, I had removed that part from the original patch. Here's that log:

< HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17                                  #1 [hci0] 6.705320
        Handle: 50
        Transmit bandwidth: 8000
        Receive bandwidth: 8000
        Max latency: 10
        Setting: 0x0060
          Input Coding: Linear
          Input Data Format: 2's complement
          Input Sample Size: 16-bit
            of bits padding at MSB: 0
          Air Coding Format: CVSD
        Retransmission effort: Optimize for power consumption (0x01)
        Packet type: 0x0380
          3-EV3 may not be used
          2-EV5 may not be used
          3-EV5 may not be used
> HCI Event: Command Status (0x0f) plen 4                                                          #2 [hci0] 6.719598
      Setup Synchronous Connection (0x01|0x0028) ncmd 1
        Status: Unsupported LMP Parameter Value / Unsupported LL Parameter Value (0x20)

>> Based on the patch by Ildar Kamaletdinov <i.kamaletdinov@omprussia.ru>.
>>
>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
>>
>> ---
>> This patch is against the 'bluetooth-next.git' repo.
>>
>> net/bluetooth/hci_event.c |    8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> Index: bluetooth-next/net/bluetooth/hci_event.c
>> ===================================================================
>> --- bluetooth-next.orig/net/bluetooth/hci_event.c
>> +++ bluetooth-next/net/bluetooth/hci_event.c
>> @@ -2187,6 +2187,13 @@ static void hci_cs_setup_sync_conn(struc
>> 	if (acl) {
>> 		sco = acl->link;
>> 		if (sco) {
>> +			if (status == 0x20 && /* Unsupported LMP Parameter value */
>> +			    sco->out) {
>> +				sco->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) |
>> +						(hdev->esco_type & EDR_ESCO_MASK);
>> +				if (hci_setup_sync(sco, sco->link->handle))
>> +					goto unlock;
>> +			}
>> 			sco->state = BT_CLOSED;
> 
> since this is the command status event, I doubt that sco->out check is needed.

   Can't comment oin this, my BT fu is too weak... 

> And I would start with a switch statement right away.

   Funny, I had removed the *switch* statement from the original patch... :-)

> I also think that we need to re-structure this hci_cs_setup_sync_conn function a little to avoid the deep indentation.
> Make it look more like hci_sync_conn_complete_evt also use a switch statement even if right now we only have one 
> entry.

    Indeed, done now. :-)
 
> Regards
> 
> Marcel

MBR, Sergey

^ permalink raw reply

* Re: [PATCH RFC v2 1/3] io_uring: use an enumeration for io_uring_register(2) opcodes
From: Jens Axboe @ 2020-07-16 20:42 UTC (permalink / raw)
  To: Pavel Begunkov, Stefano Garzarella
  Cc: Alexander Viro, Kernel Hardening, Kees Cook, Aleksa Sarai,
	Stefan Hajnoczi, Christian Brauner, Sargun Dhillon, Jann Horn,
	io-uring, linux-fsdevel, Jeff Moyer, linux-kernel
In-Reply-To: <ca242a15-576d-4099-a5f8-85c08985e3ff@gmail.com>

On 7/16/20 2:16 PM, Pavel Begunkov wrote:
> On 16/07/2020 15:48, Stefano Garzarella wrote:
>> The enumeration allows us to keep track of the last
>> io_uring_register(2) opcode available.
>>
>> Behaviour and opcodes names don't change.
>>
>> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
>> ---
>>  include/uapi/linux/io_uring.h | 27 ++++++++++++++++-----------
>>  1 file changed, 16 insertions(+), 11 deletions(-)
>>
>> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
>> index 7843742b8b74..efc50bd0af34 100644
>> --- a/include/uapi/linux/io_uring.h
>> +++ b/include/uapi/linux/io_uring.h
>> @@ -253,17 +253,22 @@ struct io_uring_params {
>>  /*
>>   * io_uring_register(2) opcodes and arguments
>>   */
>> -#define IORING_REGISTER_BUFFERS		0
>> -#define IORING_UNREGISTER_BUFFERS	1
>> -#define IORING_REGISTER_FILES		2
>> -#define IORING_UNREGISTER_FILES		3
>> -#define IORING_REGISTER_EVENTFD		4
>> -#define IORING_UNREGISTER_EVENTFD	5
>> -#define IORING_REGISTER_FILES_UPDATE	6
>> -#define IORING_REGISTER_EVENTFD_ASYNC	7
>> -#define IORING_REGISTER_PROBE		8
>> -#define IORING_REGISTER_PERSONALITY	9
>> -#define IORING_UNREGISTER_PERSONALITY	10
>> +enum {
>> +	IORING_REGISTER_BUFFERS,
>> +	IORING_UNREGISTER_BUFFERS,
>> +	IORING_REGISTER_FILES,
>> +	IORING_UNREGISTER_FILES,
>> +	IORING_REGISTER_EVENTFD,
>> +	IORING_UNREGISTER_EVENTFD,
>> +	IORING_REGISTER_FILES_UPDATE,
>> +	IORING_REGISTER_EVENTFD_ASYNC,
>> +	IORING_REGISTER_PROBE,
>> +	IORING_REGISTER_PERSONALITY,
>> +	IORING_UNREGISTER_PERSONALITY,
>> +
>> +	/* this goes last */
>> +	IORING_REGISTER_LAST
>> +};
> 
> It breaks userspace API. E.g.
> 
> #ifdef IORING_REGISTER_BUFFERS

It can, yes, but we have done that in the past. In this one, for
example:

commit 9e3aa61ae3e01ce1ce6361a41ef725e1f4d1d2bf (tag: io_uring-5.5-20191212)
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed Dec 11 15:55:43 2019 -0700

    io_uring: ensure we return -EINVAL on unknown opcod

But it would be safer/saner to do this like we have the done the IOSQE_
flags.

-- 
Jens Axboe


^ permalink raw reply

* Re: [PATCH v10 0/6] Support NVIDIA Tegra-based Acer A500 and Nexus 7 devices
From: Dmitry Osipenko @ 2020-07-16 20:43 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Rob Herring, Jonathan Hunter, Michał Mirosław,
	David Heidelberg, Peter Geis, Stephen Warren, Nicolas Chauvet,
	Pedro Ângelo, Matt Merhar, Zack Pearsall,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20200716123814.GB535268@ulmo>

16.07.2020 15:38, Thierry Reding пишет:
> On Mon, Jun 29, 2020 at 05:54:50AM +0300, Dmitry Osipenko wrote:
>> Hello,
>>
>> This series introduces upstream kernel support for Acer Iconia Tab A500
>> and ASUS Google Nexus 7 tablet devices. Please review and apply, thanks
>> in advance.

> Applied, thanks.

Hello, Thierry! Thank you! :)

^ permalink raw reply

* Re: [PATCH v10 0/6] Support NVIDIA Tegra-based Acer A500 and Nexus 7 devices
From: Dmitry Osipenko @ 2020-07-16 20:43 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Rob Herring, Jonathan Hunter, Michał Mirosław,
	David Heidelberg, Peter Geis, Stephen Warren, Nicolas Chauvet,
	Pedro Ângelo, Matt Merhar, Zack Pearsall, linux-tegra,
	devicetree, linux-kernel
In-Reply-To: <20200716123814.GB535268@ulmo>

16.07.2020 15:38, Thierry Reding пишет:
> On Mon, Jun 29, 2020 at 05:54:50AM +0300, Dmitry Osipenko wrote:
>> Hello,
>>
>> This series introduces upstream kernel support for Acer Iconia Tab A500
>> and ASUS Google Nexus 7 tablet devices. Please review and apply, thanks
>> in advance.

> Applied, thanks.

Hello, Thierry! Thank you! :)

^ permalink raw reply

* [igt-dev] [PATCH i-g-t] i915/gem_exec_balancer: Race breadcrumb signaling against timeslicing
From: Chris Wilson @ 2020-07-16 20:44 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin, Chris Wilson

This is an attempt to chase down some preempt-to-busy races with
breadcrumb signaling on the virtual engines. By using more semaphore
spinners than available engines, we encourage very short timeslices, and
we make each batch of random duration to try and coincide the end of a
batch with the context being scheduled out.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_exec_balancer.c | 109 +++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)

diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index c5c0055fc..e4d9e0464 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -2240,6 +2240,112 @@ static void hog(int i915)
 	gem_quiescent_gpu(i915);
 }
 
+static uint32_t sema_create(int i915, uint64_t addr, uint32_t **x)
+{
+	uint32_t handle = gem_create(i915, 4096);
+
+	*x = gem_mmap__device_coherent(i915, handle, 0, 4096, PROT_WRITE);
+	for (int n = 1; n <= 32; n++) {
+		uint32_t *cs = *x + n * 16;
+
+		*cs++ = MI_SEMAPHORE_WAIT |
+			MI_SEMAPHORE_POLL |
+			MI_SEMAPHORE_SAD_GTE_SDD |
+			(4 - 2);
+		*cs++ = n;
+		*cs++ = addr;
+		*cs++ = addr >> 32;
+
+		*cs++ = MI_BATCH_BUFFER_END;
+	}
+
+	return handle;
+}
+
+static uint32_t *sema(int i915, uint32_t ctx)
+{
+	uint32_t *ctl;
+	struct drm_i915_gem_exec_object2 batch = {
+		.handle = sema_create(i915, 64 << 20, &ctl),
+		.offset = 64 << 20,
+		.flags = EXEC_OBJECT_PINNED
+	};
+	struct drm_i915_gem_execbuffer2 execbuf = {
+		.buffers_ptr = to_user_pointer(&batch),
+		.buffer_count = 1,
+		.rsvd1 = gem_context_clone_with_engines(i915, ctx),
+	};
+	int64_t poll = 1;
+
+	for (int n = 1; n <= 32; n++) {
+		execbuf.batch_start_offset = 64 * n,
+		gem_execbuf(i915, &execbuf);
+		/* Force a breadcrumb to be installed on each request */
+		gem_wait(i915, batch.handle, &poll);
+	}
+
+	gem_context_destroy(i915, execbuf.rsvd1);
+
+	igt_assert(gem_bo_busy(i915, batch.handle));
+	gem_close(i915, batch.handle);
+
+	return ctl;
+}
+
+static void __waits(int i915, int timeout, uint32_t ctx, unsigned int count)
+{
+	uint32_t *semaphores[count + 1];
+
+	for (int i = 0; i <= count; i++)
+		semaphores[i] = sema(i915, ctx);
+
+	igt_until_timeout(timeout) {
+		int i = rand() % (count + 1);
+
+		if ((*semaphores[i] += rand() % 32) >= 32) {
+			munmap(semaphores[i], 4096);
+			semaphores[i] = sema(i915, ctx);
+		}
+	}
+
+	for (int i = 0; i <= count; i++) {
+		*semaphores[i] = 0xffffffff;
+		munmap(semaphores[i], 4096);
+	}
+}
+
+static void waits(int i915, int timeout)
+{
+	igt_require(gem_scheduler_has_preemption(i915));
+	igt_require(gem_scheduler_has_semaphores(i915));
+
+	for (int class = 0; class < 32; class++) {
+		struct i915_engine_class_instance *ci;
+		unsigned int count;
+		uint32_t ctx;
+
+		ci = list_engines(i915, 1u << class, &count);
+		if (!ci)
+			continue;
+
+		if (count < 2) {
+			free(ci);
+			continue;
+		}
+
+		ctx = load_balancer_create(i915, ci, count);
+
+		__waits(i915, timeout, ctx, count);
+
+		gem_context_destroy(i915, ctx);
+		igt_waitchildren();
+
+		free(ci);
+	}
+
+	gem_quiescent_gpu(i915);
+}
+
 static void nop(int i915)
 {
 	struct drm_i915_gem_exec_object2 batch = {
@@ -2729,6 +2835,9 @@ igt_main
 	igt_subtest("hog")
 		hog(i915);
 
+	igt_subtest("waits")
+		waits(i915, 5);
+
 	igt_subtest("smoke")
 		smoketest(i915, 20);
 
-- 
2.28.0.rc0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related

* [Intel-gfx] [PATCH i-g-t] i915/gem_exec_balancer: Race breadcrumb signaling against timeslicing
From: Chris Wilson @ 2020-07-16 20:44 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

This is an attempt to chase down some preempt-to-busy races with
breadcrumb signaling on the virtual engines. By using more semaphore
spinners than available engines, we encourage very short timeslices, and
we make each batch of random duration to try and coincide the end of a
batch with the context being scheduled out.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_exec_balancer.c | 109 +++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)

diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index c5c0055fc..e4d9e0464 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -2240,6 +2240,112 @@ static void hog(int i915)
 	gem_quiescent_gpu(i915);
 }
 
+static uint32_t sema_create(int i915, uint64_t addr, uint32_t **x)
+{
+	uint32_t handle = gem_create(i915, 4096);
+
+	*x = gem_mmap__device_coherent(i915, handle, 0, 4096, PROT_WRITE);
+	for (int n = 1; n <= 32; n++) {
+		uint32_t *cs = *x + n * 16;
+
+		*cs++ = MI_SEMAPHORE_WAIT |
+			MI_SEMAPHORE_POLL |
+			MI_SEMAPHORE_SAD_GTE_SDD |
+			(4 - 2);
+		*cs++ = n;
+		*cs++ = addr;
+		*cs++ = addr >> 32;
+
+		*cs++ = MI_BATCH_BUFFER_END;
+	}
+
+	return handle;
+}
+
+static uint32_t *sema(int i915, uint32_t ctx)
+{
+	uint32_t *ctl;
+	struct drm_i915_gem_exec_object2 batch = {
+		.handle = sema_create(i915, 64 << 20, &ctl),
+		.offset = 64 << 20,
+		.flags = EXEC_OBJECT_PINNED
+	};
+	struct drm_i915_gem_execbuffer2 execbuf = {
+		.buffers_ptr = to_user_pointer(&batch),
+		.buffer_count = 1,
+		.rsvd1 = gem_context_clone_with_engines(i915, ctx),
+	};
+	int64_t poll = 1;
+
+	for (int n = 1; n <= 32; n++) {
+		execbuf.batch_start_offset = 64 * n,
+		gem_execbuf(i915, &execbuf);
+		/* Force a breadcrumb to be installed on each request */
+		gem_wait(i915, batch.handle, &poll);
+	}
+
+	gem_context_destroy(i915, execbuf.rsvd1);
+
+	igt_assert(gem_bo_busy(i915, batch.handle));
+	gem_close(i915, batch.handle);
+
+	return ctl;
+}
+
+static void __waits(int i915, int timeout, uint32_t ctx, unsigned int count)
+{
+	uint32_t *semaphores[count + 1];
+
+	for (int i = 0; i <= count; i++)
+		semaphores[i] = sema(i915, ctx);
+
+	igt_until_timeout(timeout) {
+		int i = rand() % (count + 1);
+
+		if ((*semaphores[i] += rand() % 32) >= 32) {
+			munmap(semaphores[i], 4096);
+			semaphores[i] = sema(i915, ctx);
+		}
+	}
+
+	for (int i = 0; i <= count; i++) {
+		*semaphores[i] = 0xffffffff;
+		munmap(semaphores[i], 4096);
+	}
+}
+
+static void waits(int i915, int timeout)
+{
+	igt_require(gem_scheduler_has_preemption(i915));
+	igt_require(gem_scheduler_has_semaphores(i915));
+
+	for (int class = 0; class < 32; class++) {
+		struct i915_engine_class_instance *ci;
+		unsigned int count;
+		uint32_t ctx;
+
+		ci = list_engines(i915, 1u << class, &count);
+		if (!ci)
+			continue;
+
+		if (count < 2) {
+			free(ci);
+			continue;
+		}
+
+		ctx = load_balancer_create(i915, ci, count);
+
+		__waits(i915, timeout, ctx, count);
+
+		gem_context_destroy(i915, ctx);
+		igt_waitchildren();
+
+		free(ci);
+	}
+
+	gem_quiescent_gpu(i915);
+}
+
 static void nop(int i915)
 {
 	struct drm_i915_gem_exec_object2 batch = {
@@ -2729,6 +2835,9 @@ igt_main
 	igt_subtest("hog")
 		hog(i915);
 
+	igt_subtest("waits")
+		waits(i915, 5);
+
 	igt_subtest("smoke")
 		smoketest(i915, 20);
 
-- 
2.28.0.rc0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related

* Re: [PATCH v3 07/21] ASoC: atmel: merge .digital_mute() into .mute_stream()
From: Mark Brown @ 2020-07-16 20:44 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA
In-Reply-To: <877dvdxxi8.wl-kuninori.morimoto.gx@renesas.com>

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

On Thu, Jul 09, 2020 at 10:56:15AM +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> snd_soc_dai_digital_mute() is internally using both
> mute_stream() (1) or digital_mute() (2), but the difference between
> these 2 are only handling direction.

At least this patch needs a rebase against current code, possibly others.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* Re: [GIT PULL] I2C updates
From: Peter Maydell @ 2020-07-16 20:45 UTC (permalink / raw)
  To: Corey Minyard; +Cc: QEMU Developers
In-Reply-To: <20200716174900.GL3235@minyard.net>

On Thu, 16 Jul 2020 at 18:49, Corey Minyard <minyard@acm.org> wrote:
>
> The following changes since commit 45db94cc90c286a9965a285ba19450f448760a09:
>
>   Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200707' into staging (2020-07-10 16:43:40 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/cminyard/qemu.git tags/for-qemu-i2c-5
>
> for you to fetch changes up to 73d5f22ecbb76dfc785876779d47787084ff0f42:
>
>   hw/i2c: Document the I2C qdev helpers (2020-07-16 12:30:54 -0500)
>
> ----------------------------------------------------------------
> Minor changes to:
>
> Add an SMBus config entry
>
> Cleanup/simplify/document some I2C interfaces
>
> ----------------------------------------------------------------
> Philippe Mathieu-Daudé (6):
>       hw/i2c/Kconfig: Add an entry for the SMBus
>       hw/i2c/aspeed_i2c: Simplify aspeed_i2c_get_bus()
>       hw/i2c: Rename i2c_try_create_slave() as i2c_slave_new()
>       hw/i2c: Rename i2c_realize_and_unref() as i2c_slave_realize_and_unref()
>       hw/i2c: Rename i2c_create_slave() as i2c_slave_create_simple()
>       hw/i2c: Document the I2C qdev helpers

Hi; this failed to build on x86-64 Linux (incremental build):

  LINK    i386-softmmu/qemu-system-i386
../hw/i2c/smbus_eeprom.o: In function `smbus_eeprom_vmstate_needed':
/home/petmay01/linaro/qemu-for-merges/hw/i2c/smbus_eeprom.c:94:
undefined reference to `smbus_vmstate_needed'
../hw/i2c/smbus_eeprom.o:(.data.rel+0x50): undefined reference to
`vmstate_smbus_device'
../hw/i2c/pm_smbus.o: In function `smb_transaction':
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:93: undefined
reference to `smbus_quick_command'
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:97: undefined
reference to `smbus_receive_byte'
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:100: undefined
reference to `smbus_send_byte'
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:105: undefined
reference to `smbus_read_byte'
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:108: undefined
reference to `smbus_write_byte'
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:114: undefined
reference to `smbus_read_word'
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:117: undefined
reference to `smbus_write_word'
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:149: undefined
reference to `smbus_read_block'
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:174: undefined
reference to `smbus_write_block'
../hw/i2c/pm_smbus.o: In function `smb_ioport_writeb':
/home/petmay01/linaro/qemu-for-merges/hw/i2c/pm_smbus.c:290: undefined
reference to `smbus_write_block'
../hw/ipmi/smbus_ipmi.o:(.data.rel+0x50): undefined reference to
`vmstate_smbus_device'
collect2: error: ld returned 1 exit status

(similarly for other qemu-system-* binary links)

thanks
-- PMM


^ permalink raw reply

* [LTP] [PATCH V8] syscall: Add io_uring related tests
From: Petr Vorel @ 2020-07-16 20:47 UTC (permalink / raw)
  To: ltp
In-Reply-To: <20200716143352.GA11713@yuki.lan>

Hi Cyril,

> Hi!
> I've finished the test code and pushed, thanks.
Thanks for finishing this!

Kind regards,
Petr

^ permalink raw reply

* [PATCH] net: alteon: switch from 'pci_' to 'dma_' API
From: Christophe JAILLET @ 2020-07-16 20:48 UTC (permalink / raw)
  To: davem, kuba, jes
  Cc: linux-acenic, netdev, linux-kernel, kernel-janitors,
	Christophe JAILLET

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'ace_allocate_descriptors()' and
'ace_init()' GFP_KERNEL can be used because both functions are called from
the probe function and no lock is acquired.


@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
If needed, see post from Christoph Hellwig on the kernel-janitors ML:
   https://marc.info/?l=kernel-janitors&m\x158745678307186&w=4
---
 drivers/net/ethernet/alteon/acenic.c | 114 +++++++++++++--------------
 1 file changed, 56 insertions(+), 58 deletions(-)

diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index 5d192d551623..99431c9a899b 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -642,9 +642,8 @@ static void acenic_remove_one(struct pci_dev *pdev)
 
 			ringp = &ap->skb->rx_std_skbuff[i];
 			mapping = dma_unmap_addr(ringp, mapping);
-			pci_unmap_page(ap->pdev, mapping,
-				       ACE_STD_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+			dma_unmap_page(&ap->pdev->dev, mapping,
+				       ACE_STD_BUFSIZE, DMA_FROM_DEVICE);
 
 			ap->rx_std_ring[i].size = 0;
 			ap->skb->rx_std_skbuff[i].skb = NULL;
@@ -662,9 +661,9 @@ static void acenic_remove_one(struct pci_dev *pdev)
 
 				ringp = &ap->skb->rx_mini_skbuff[i];
 				mapping = dma_unmap_addr(ringp,mapping);
-				pci_unmap_page(ap->pdev, mapping,
+				dma_unmap_page(&ap->pdev->dev, mapping,
 					       ACE_MINI_BUFSIZE,
-					       PCI_DMA_FROMDEVICE);
+					       DMA_FROM_DEVICE);
 
 				ap->rx_mini_ring[i].size = 0;
 				ap->skb->rx_mini_skbuff[i].skb = NULL;
@@ -681,9 +680,8 @@ static void acenic_remove_one(struct pci_dev *pdev)
 
 			ringp = &ap->skb->rx_jumbo_skbuff[i];
 			mapping = dma_unmap_addr(ringp, mapping);
-			pci_unmap_page(ap->pdev, mapping,
-				       ACE_JUMBO_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+			dma_unmap_page(&ap->pdev->dev, mapping,
+				       ACE_JUMBO_BUFSIZE, DMA_FROM_DEVICE);
 
 			ap->rx_jumbo_ring[i].size = 0;
 			ap->skb->rx_jumbo_skbuff[i].skb = NULL;
@@ -713,8 +711,8 @@ static void ace_free_descriptors(struct net_device *dev)
 			 RX_JUMBO_RING_ENTRIES +
 			 RX_MINI_RING_ENTRIES +
 			 RX_RETURN_RING_ENTRIES));
-		pci_free_consistent(ap->pdev, size, ap->rx_std_ring,
-				    ap->rx_ring_base_dma);
+		dma_free_coherent(&ap->pdev->dev, size, ap->rx_std_ring,
+				  ap->rx_ring_base_dma);
 		ap->rx_std_ring = NULL;
 		ap->rx_jumbo_ring = NULL;
 		ap->rx_mini_ring = NULL;
@@ -722,31 +720,30 @@ static void ace_free_descriptors(struct net_device *dev)
 	}
 	if (ap->evt_ring != NULL) {
 		size = (sizeof(struct event) * EVT_RING_ENTRIES);
-		pci_free_consistent(ap->pdev, size, ap->evt_ring,
-				    ap->evt_ring_dma);
+		dma_free_coherent(&ap->pdev->dev, size, ap->evt_ring,
+				  ap->evt_ring_dma);
 		ap->evt_ring = NULL;
 	}
 	if (ap->tx_ring != NULL && !ACE_IS_TIGON_I(ap)) {
 		size = (sizeof(struct tx_desc) * MAX_TX_RING_ENTRIES);
-		pci_free_consistent(ap->pdev, size, ap->tx_ring,
-				    ap->tx_ring_dma);
+		dma_free_coherent(&ap->pdev->dev, size, ap->tx_ring,
+				  ap->tx_ring_dma);
 	}
 	ap->tx_ring = NULL;
 
 	if (ap->evt_prd != NULL) {
-		pci_free_consistent(ap->pdev, sizeof(u32),
-				    (void *)ap->evt_prd, ap->evt_prd_dma);
+		dma_free_coherent(&ap->pdev->dev, sizeof(u32),
+				  (void *)ap->evt_prd, ap->evt_prd_dma);
 		ap->evt_prd = NULL;
 	}
 	if (ap->rx_ret_prd != NULL) {
-		pci_free_consistent(ap->pdev, sizeof(u32),
-				    (void *)ap->rx_ret_prd,
-				    ap->rx_ret_prd_dma);
+		dma_free_coherent(&ap->pdev->dev, sizeof(u32),
+				  (void *)ap->rx_ret_prd, ap->rx_ret_prd_dma);
 		ap->rx_ret_prd = NULL;
 	}
 	if (ap->tx_csm != NULL) {
-		pci_free_consistent(ap->pdev, sizeof(u32),
-				    (void *)ap->tx_csm, ap->tx_csm_dma);
+		dma_free_coherent(&ap->pdev->dev, sizeof(u32),
+				  (void *)ap->tx_csm, ap->tx_csm_dma);
 		ap->tx_csm = NULL;
 	}
 }
@@ -763,8 +760,8 @@ static int ace_allocate_descriptors(struct net_device *dev)
 		 RX_MINI_RING_ENTRIES +
 		 RX_RETURN_RING_ENTRIES));
 
-	ap->rx_std_ring = pci_alloc_consistent(ap->pdev, size,
-					       &ap->rx_ring_base_dma);
+	ap->rx_std_ring = dma_alloc_coherent(&ap->pdev->dev, size,
+					     &ap->rx_ring_base_dma, GFP_KERNEL);
 	if (ap->rx_std_ring = NULL)
 		goto fail;
 
@@ -774,7 +771,8 @@ static int ace_allocate_descriptors(struct net_device *dev)
 
 	size = (sizeof(struct event) * EVT_RING_ENTRIES);
 
-	ap->evt_ring = pci_alloc_consistent(ap->pdev, size, &ap->evt_ring_dma);
+	ap->evt_ring = dma_alloc_coherent(&ap->pdev->dev, size,
+					  &ap->evt_ring_dma, GFP_KERNEL);
 
 	if (ap->evt_ring = NULL)
 		goto fail;
@@ -786,25 +784,25 @@ static int ace_allocate_descriptors(struct net_device *dev)
 	if (!ACE_IS_TIGON_I(ap)) {
 		size = (sizeof(struct tx_desc) * MAX_TX_RING_ENTRIES);
 
-		ap->tx_ring = pci_alloc_consistent(ap->pdev, size,
-						   &ap->tx_ring_dma);
+		ap->tx_ring = dma_alloc_coherent(&ap->pdev->dev, size,
+						 &ap->tx_ring_dma, GFP_KERNEL);
 
 		if (ap->tx_ring = NULL)
 			goto fail;
 	}
 
-	ap->evt_prd = pci_alloc_consistent(ap->pdev, sizeof(u32),
-					   &ap->evt_prd_dma);
+	ap->evt_prd = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
+					 &ap->evt_prd_dma, GFP_KERNEL);
 	if (ap->evt_prd = NULL)
 		goto fail;
 
-	ap->rx_ret_prd = pci_alloc_consistent(ap->pdev, sizeof(u32),
-					      &ap->rx_ret_prd_dma);
+	ap->rx_ret_prd = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
+					    &ap->rx_ret_prd_dma, GFP_KERNEL);
 	if (ap->rx_ret_prd = NULL)
 		goto fail;
 
-	ap->tx_csm = pci_alloc_consistent(ap->pdev, sizeof(u32),
-					  &ap->tx_csm_dma);
+	ap->tx_csm = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
+					&ap->tx_csm_dma, GFP_KERNEL);
 	if (ap->tx_csm = NULL)
 		goto fail;
 
@@ -830,8 +828,8 @@ static void ace_init_cleanup(struct net_device *dev)
 	ace_free_descriptors(dev);
 
 	if (ap->info)
-		pci_free_consistent(ap->pdev, sizeof(struct ace_info),
-				    ap->info, ap->info_dma);
+		dma_free_coherent(&ap->pdev->dev, sizeof(struct ace_info),
+				  ap->info, ap->info_dma);
 	kfree(ap->skb);
 	kfree(ap->trace_buf);
 
@@ -1129,9 +1127,9 @@ static int ace_init(struct net_device *dev)
 	/*
 	 * Configure DMA attributes.
 	 */
-	if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
+	if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
 		ap->pci_using_dac = 1;
-	} else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
+	} else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
 		ap->pci_using_dac = 0;
 	} else {
 		ecode = -ENODEV;
@@ -1143,8 +1141,8 @@ static int ace_init(struct net_device *dev)
 	 * and the control blocks for the transmit and receive rings
 	 * as they need to be setup once and for all.
 	 */
-	if (!(info = pci_alloc_consistent(ap->pdev, sizeof(struct ace_info),
-					  &ap->info_dma))) {
+	if (!(info = dma_alloc_coherent(&ap->pdev->dev, sizeof(struct ace_info),
+					&ap->info_dma, GFP_KERNEL))) {
 		ecode = -EAGAIN;
 		goto init_error;
 	}
@@ -1646,10 +1644,10 @@ static void ace_load_std_rx_ring(struct net_device *dev, int nr_bufs)
 		if (!skb)
 			break;
 
-		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
+		mapping = dma_map_page(&ap->pdev->dev,
+				       virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_STD_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+				       ACE_STD_BUFSIZE, DMA_FROM_DEVICE);
 		ap->skb->rx_std_skbuff[idx].skb = skb;
 		dma_unmap_addr_set(&ap->skb->rx_std_skbuff[idx],
 				   mapping, mapping);
@@ -1707,10 +1705,10 @@ static void ace_load_mini_rx_ring(struct net_device *dev, int nr_bufs)
 		if (!skb)
 			break;
 
-		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
+		mapping = dma_map_page(&ap->pdev->dev,
+				       virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_MINI_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+				       ACE_MINI_BUFSIZE, DMA_FROM_DEVICE);
 		ap->skb->rx_mini_skbuff[idx].skb = skb;
 		dma_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx],
 				   mapping, mapping);
@@ -1763,10 +1761,10 @@ static void ace_load_jumbo_rx_ring(struct net_device *dev, int nr_bufs)
 		if (!skb)
 			break;
 
-		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
+		mapping = dma_map_page(&ap->pdev->dev,
+				       virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_JUMBO_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+				       ACE_JUMBO_BUFSIZE, DMA_FROM_DEVICE);
 		ap->skb->rx_jumbo_skbuff[idx].skb = skb;
 		dma_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx],
 				   mapping, mapping);
@@ -1977,10 +1975,8 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
 
 		skb = rip->skb;
 		rip->skb = NULL;
-		pci_unmap_page(ap->pdev,
-			       dma_unmap_addr(rip, mapping),
-			       mapsize,
-			       PCI_DMA_FROMDEVICE);
+		dma_unmap_page(&ap->pdev->dev, dma_unmap_addr(rip, mapping),
+			       mapsize, DMA_FROM_DEVICE);
 		skb_put(skb, retdesc->size);
 
 		/*
@@ -2046,9 +2042,10 @@ static inline void ace_tx_int(struct net_device *dev,
 		skb = info->skb;
 
 		if (dma_unmap_len(info, maplen)) {
-			pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping),
+			dma_unmap_page(&ap->pdev->dev,
+				       dma_unmap_addr(info, mapping),
 				       dma_unmap_len(info, maplen),
-				       PCI_DMA_TODEVICE);
+				       DMA_TO_DEVICE);
 			dma_unmap_len_set(info, maplen, 0);
 		}
 
@@ -2337,9 +2334,10 @@ static int ace_close(struct net_device *dev)
 			} else
 				memset(ap->tx_ring + i, 0,
 				       sizeof(struct tx_desc));
-			pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping),
+			dma_unmap_page(&ap->pdev->dev,
+				       dma_unmap_addr(info, mapping),
 				       dma_unmap_len(info, maplen),
-				       PCI_DMA_TODEVICE);
+				       DMA_TO_DEVICE);
 			dma_unmap_len_set(info, maplen, 0);
 		}
 		if (skb) {
@@ -2369,9 +2367,9 @@ ace_map_tx_skb(struct ace_private *ap, struct sk_buff *skb,
 	dma_addr_t mapping;
 	struct tx_ring_info *info;
 
-	mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
-			       offset_in_page(skb->data),
-			       skb->len, PCI_DMA_TODEVICE);
+	mapping = dma_map_page(&ap->pdev->dev, virt_to_page(skb->data),
+			       offset_in_page(skb->data), skb->len,
+			       DMA_TO_DEVICE);
 
 	info = ap->skb->tx_skbuff + idx;
 	info->skb = tail;
-- 
2.25.1

^ permalink raw reply related

* [PATCH 0/2] dtoc: improve compatible string aliases support
From: Walter Lozano @ 2020-07-16 20:48 UTC (permalink / raw)
  To: u-boot


This series adds additional improvements to dtoc, which are focused in
compatible string aliases.

First, enhance dtoc to use not only the first but all the compatible
strings in a dtb node in order to find a valid driver name.

Second, remove compatible string aliases from dtoc which were used to
generate mappings between struct names. This is not longer needed since
now a valid driver name is used.


Walter Lozano (2):
  dtoc: look for compatible string aliases in driver list
  dtoc: remove compatible string aliases support

 tools/dtoc/dtb_platdata.py       | 58 +++++++++++++-------------------
 tools/dtoc/dtoc_test_aliases.dts |  5 +++
 tools/dtoc/test_dtoc.py          | 39 +++------------------
 3 files changed, 32 insertions(+), 70 deletions(-)

-- 
2.20.1

^ permalink raw reply

* [PATCH 1/2] dtoc: look for compatible string aliases in driver list
From: Walter Lozano @ 2020-07-16 20:48 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <20200716204813.21839-1-walter.lozano@collabora.com>

Currently dtoc checks if the first compatible string in a dtb node
matches either a driver o driver alias name, without taking into account
any other compatible string in the list. In the case that no driver matches
the first compatible string a warning is printed and the U_BOOT_DEVICE is
not being declared correctly.

This patch adds dtoc's support for try all the compatible strings in the
dtb node, in an effort to find the correct driver.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
---

 tools/dtoc/dtb_platdata.py       | 45 ++++++++++++++++----------------
 tools/dtoc/dtoc_test_aliases.dts |  5 ++++
 tools/dtoc/test_dtoc.py          | 20 +++++++++++---
 3 files changed, 44 insertions(+), 26 deletions(-)

diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index c148c49625..b1b082e508 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -111,21 +111,17 @@ def get_value(ftype, value):
         return '%#x' % value
 
 def get_compat_name(node):
-    """Get a node's first compatible string as a C identifier
+    """Get the node's list of compatible string as a C identifiers
 
     Args:
         node: Node object to check
     Return:
-        Tuple:
-            C identifier for the first compatible string
-            List of C identifiers for all the other compatible strings
-                (possibly empty)
+        List of C identifiers for all the compatible strings
     """
     compat = node.props['compatible'].value
-    aliases = []
-    if isinstance(compat, list):
-        compat, aliases = compat[0], compat[1:]
-    return conv_name_to_c(compat), [conv_name_to_c(a) for a in aliases]
+    if not isinstance(compat, list):
+        compat = [compat]
+    return [conv_name_to_c(c) for c in compat]
 
 
 class DtbPlatdata(object):
@@ -169,7 +165,7 @@ class DtbPlatdata(object):
     def get_normalized_compat_name(self, node):
         """Get a node's normalized compat name
 
-        Returns a valid driver name by retrieving node's first compatible
+        Returns a valid driver name by retrieving node's list of compatible
         string as a C identifier and performing a check against _drivers
         and a lookup in driver_aliases printing a warning in case of failure.
 
@@ -183,19 +179,24 @@ class DtbPlatdata(object):
                 In case of no match found, the return will be the same as
                 get_compat_name()
         """
-        compat_c, aliases_c = get_compat_name(node)
-        if compat_c not in self._drivers:
-            compat_c_old = compat_c
-            compat_c = self._driver_aliases.get(compat_c)
-            if not compat_c:
-                if not self._warning_disabled:
-                    print('WARNING: the driver %s was not found in the driver list'
-                          % (compat_c_old))
-                compat_c = compat_c_old
-            else:
-                aliases_c = [compat_c_old] + aliases_c
+        compat_list_c = get_compat_name(node)
+
+        for compat_c in compat_list_c:
+            if not compat_c in self._drivers:
+                compat_c = self._driver_aliases.get(compat_c)
+                if not compat_c:
+                    continue
+
+            aliases_c = compat_list_c
+            if compat_c in aliases_c:
+                aliases_c.remove(compat_c)
+            return compat_c, aliases_c
+
+        if not self._warning_disabled:
+            print('WARNING: the driver %s was not found in the driver list'
+                  % (compat_list_c[0]))
 
-        return compat_c, aliases_c
+        return compat_list_c[0], compat_list_c[1:]
 
     def setup_output(self, fname):
         """Set up the output destination
diff --git a/tools/dtoc/dtoc_test_aliases.dts b/tools/dtoc/dtoc_test_aliases.dts
index e545816f4e..ae33716863 100644
--- a/tools/dtoc/dtoc_test_aliases.dts
+++ b/tools/dtoc/dtoc_test_aliases.dts
@@ -14,4 +14,9 @@
 		intval = <1>;
 	};
 
+	spl-test2 {
+		u-boot,dm-pre-reloc;
+		compatible = "compat1", "simple_bus";
+		intval = <1>;
+	};
 };
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index 3c8e343b1f..edb3912e94 100755
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -144,18 +144,18 @@ class TestDtoc(unittest.TestCase):
 
         prop = Prop(['rockchip,rk3399-sdhci-5.1', 'arasan,sdhci-5.1'])
         node = Node({'compatible': prop})
-        self.assertEqual(('rockchip_rk3399_sdhci_5_1', ['arasan_sdhci_5_1']),
+        self.assertEqual((['rockchip_rk3399_sdhci_5_1', 'arasan_sdhci_5_1']),
                          get_compat_name(node))
 
         prop = Prop(['rockchip,rk3399-sdhci-5.1'])
         node = Node({'compatible': prop})
-        self.assertEqual(('rockchip_rk3399_sdhci_5_1', []),
+        self.assertEqual((['rockchip_rk3399_sdhci_5_1']),
                          get_compat_name(node))
 
         prop = Prop(['rockchip,rk3399-sdhci-5.1', 'arasan,sdhci-5.1', 'third'])
         node = Node({'compatible': prop})
-        self.assertEqual(('rockchip_rk3399_sdhci_5_1',
-                          ['arasan_sdhci_5_1', 'third']),
+        self.assertEqual((['rockchip_rk3399_sdhci_5_1',
+                          'arasan_sdhci_5_1', 'third']),
                          get_compat_name(node))
 
     def test_empty_file(self):
@@ -566,6 +566,9 @@ void dm_populate_phandle_data(void) {
 struct dtd_compat1 {
 \tfdt32_t\t\tintval;
 };
+struct dtd_simple_bus {
+\tfdt32_t\t\tintval;
+};
 #define dtd_compat2_1_fred dtd_compat1
 #define dtd_compat3 dtd_compat1
 ''', data)
@@ -583,6 +586,15 @@ U_BOOT_DEVICE(spl_test) = {
 \t.platdata_size\t= sizeof(dtv_spl_test),
 };
 
+static struct dtd_simple_bus dtv_spl_test2 = {
+\t.intval\t\t\t= 0x1,
+};
+U_BOOT_DEVICE(spl_test2) = {
+\t.name\t\t= "simple_bus",
+\t.platdata\t= &dtv_spl_test2,
+\t.platdata_size\t= sizeof(dtv_spl_test2),
+};
+
 ''' + C_EMPTY_POPULATE_PHANDLE_DATA, data)
 
     def test_addresses64(self):
-- 
2.20.1

^ permalink raw reply related

* [PATCH 2/2] dtoc: remove compatible string aliases support
From: Walter Lozano @ 2020-07-16 20:48 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <20200716204813.21839-1-walter.lozano@collabora.com>

After latest improvements in dtoc, compatible strings are checked
against driver and driver alias list to get a valid driver name. With
this new feature the list of compatible string  aliases seems not
useful any more.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
---

 tools/dtoc/dtb_platdata.py | 13 ------------
 tools/dtoc/test_dtoc.py    | 43 --------------------------------------
 2 files changed, 56 deletions(-)

diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index b1b082e508..c28768f4a2 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -139,9 +139,6 @@ class DtbPlatdata(object):
         _outfile: The current output file (sys.stdout or a real file)
         _warning_disabled: true to disable warnings about driver names not found
         _lines: Stashed list of output lines for outputting in the future
-        _aliases: Dict that hold aliases for compatible strings
-            key: First compatible string declared in a node
-            value: List of additional compatible strings declared in a node
         _drivers: List of valid driver names found in drivers/
         _driver_aliases: Dict that holds aliases for driver names
             key: Driver alias declared with
@@ -157,7 +154,6 @@ class DtbPlatdata(object):
         self._outfile = None
         self._warning_disabled = warning_disabled
         self._lines = []
-        self._aliases = {}
         self._drivers = []
         self._driver_aliases = {}
         self._links = []
@@ -483,10 +479,6 @@ class DtbPlatdata(object):
                     prop.Widen(struct[name])
             upto += 1
 
-            struct_name, aliases = self.get_normalized_compat_name(node)
-            for alias in aliases:
-                self._aliases[alias] = struct_name
-
         return structs
 
     def scan_phandles(self):
@@ -549,11 +541,6 @@ class DtbPlatdata(object):
                 self.out(';\n')
             self.out('};\n')
 
-        for alias, struct_name in self._aliases.items():
-            if alias not in sorted(structs):
-                self.out('#define %s%s %s%s\n'% (STRUCT_PREFIX, alias,
-                                                 STRUCT_PREFIX, struct_name))
-
     def output_node(self, node):
         """Output the C code for a node
 
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index edb3912e94..169ecd6e6e 100755
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -290,7 +290,6 @@ struct dtd_sandbox_gpio {
 \tbool\t\tgpio_controller;
 \tfdt32_t\t\tsandbox_gpio_count;
 };
-#define dtd_sandbox_gpio_alias dtd_sandbox_gpio
 ''', data)
 
         self.run_test(['platdata'], dtb_file, output)
@@ -555,48 +554,6 @@ void dm_populate_phandle_data(void) {
         self.assertIn("Node 'phandle-target' has no cells property",
                       str(e.exception))
 
-    def test_aliases(self):
-        """Test output from a node with multiple compatible strings"""
-        dtb_file = get_dtb_file('dtoc_test_aliases.dts')
-        output = tools.GetOutputFilename('output')
-        self.run_test(['struct'], dtb_file, output)
-        with open(output) as infile:
-            data = infile.read()
-        self._CheckStrings(HEADER + '''
-struct dtd_compat1 {
-\tfdt32_t\t\tintval;
-};
-struct dtd_simple_bus {
-\tfdt32_t\t\tintval;
-};
-#define dtd_compat2_1_fred dtd_compat1
-#define dtd_compat3 dtd_compat1
-''', data)
-
-        self.run_test(['platdata'], dtb_file, output)
-        with open(output) as infile:
-            data = infile.read()
-        self._CheckStrings(C_HEADER + '''
-static struct dtd_compat1 dtv_spl_test = {
-\t.intval\t\t\t= 0x1,
-};
-U_BOOT_DEVICE(spl_test) = {
-\t.name\t\t= "compat1",
-\t.platdata\t= &dtv_spl_test,
-\t.platdata_size\t= sizeof(dtv_spl_test),
-};
-
-static struct dtd_simple_bus dtv_spl_test2 = {
-\t.intval\t\t\t= 0x1,
-};
-U_BOOT_DEVICE(spl_test2) = {
-\t.name\t\t= "simple_bus",
-\t.platdata\t= &dtv_spl_test2,
-\t.platdata_size\t= sizeof(dtv_spl_test2),
-};
-
-''' + C_EMPTY_POPULATE_PHANDLE_DATA, data)
-
     def test_addresses64(self):
         """Test output from a node with a 'reg' property with na=2, ns=2"""
         dtb_file = get_dtb_file('dtoc_test_addr64.dts')
-- 
2.20.1

^ permalink raw reply related

* [PATCH] net: alteon: switch from 'pci_' to 'dma_' API
From: Christophe JAILLET @ 2020-07-16 20:48 UTC (permalink / raw)
  To: davem, kuba, jes
  Cc: linux-acenic, netdev, linux-kernel, kernel-janitors,
	Christophe JAILLET

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'ace_allocate_descriptors()' and
'ace_init()' GFP_KERNEL can be used because both functions are called from
the probe function and no lock is acquired.


@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
If needed, see post from Christoph Hellwig on the kernel-janitors ML:
   https://marc.info/?l=kernel-janitors&m=158745678307186&w=4
---
 drivers/net/ethernet/alteon/acenic.c | 114 +++++++++++++--------------
 1 file changed, 56 insertions(+), 58 deletions(-)

diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index 5d192d551623..99431c9a899b 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -642,9 +642,8 @@ static void acenic_remove_one(struct pci_dev *pdev)
 
 			ringp = &ap->skb->rx_std_skbuff[i];
 			mapping = dma_unmap_addr(ringp, mapping);
-			pci_unmap_page(ap->pdev, mapping,
-				       ACE_STD_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+			dma_unmap_page(&ap->pdev->dev, mapping,
+				       ACE_STD_BUFSIZE, DMA_FROM_DEVICE);
 
 			ap->rx_std_ring[i].size = 0;
 			ap->skb->rx_std_skbuff[i].skb = NULL;
@@ -662,9 +661,9 @@ static void acenic_remove_one(struct pci_dev *pdev)
 
 				ringp = &ap->skb->rx_mini_skbuff[i];
 				mapping = dma_unmap_addr(ringp,mapping);
-				pci_unmap_page(ap->pdev, mapping,
+				dma_unmap_page(&ap->pdev->dev, mapping,
 					       ACE_MINI_BUFSIZE,
-					       PCI_DMA_FROMDEVICE);
+					       DMA_FROM_DEVICE);
 
 				ap->rx_mini_ring[i].size = 0;
 				ap->skb->rx_mini_skbuff[i].skb = NULL;
@@ -681,9 +680,8 @@ static void acenic_remove_one(struct pci_dev *pdev)
 
 			ringp = &ap->skb->rx_jumbo_skbuff[i];
 			mapping = dma_unmap_addr(ringp, mapping);
-			pci_unmap_page(ap->pdev, mapping,
-				       ACE_JUMBO_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+			dma_unmap_page(&ap->pdev->dev, mapping,
+				       ACE_JUMBO_BUFSIZE, DMA_FROM_DEVICE);
 
 			ap->rx_jumbo_ring[i].size = 0;
 			ap->skb->rx_jumbo_skbuff[i].skb = NULL;
@@ -713,8 +711,8 @@ static void ace_free_descriptors(struct net_device *dev)
 			 RX_JUMBO_RING_ENTRIES +
 			 RX_MINI_RING_ENTRIES +
 			 RX_RETURN_RING_ENTRIES));
-		pci_free_consistent(ap->pdev, size, ap->rx_std_ring,
-				    ap->rx_ring_base_dma);
+		dma_free_coherent(&ap->pdev->dev, size, ap->rx_std_ring,
+				  ap->rx_ring_base_dma);
 		ap->rx_std_ring = NULL;
 		ap->rx_jumbo_ring = NULL;
 		ap->rx_mini_ring = NULL;
@@ -722,31 +720,30 @@ static void ace_free_descriptors(struct net_device *dev)
 	}
 	if (ap->evt_ring != NULL) {
 		size = (sizeof(struct event) * EVT_RING_ENTRIES);
-		pci_free_consistent(ap->pdev, size, ap->evt_ring,
-				    ap->evt_ring_dma);
+		dma_free_coherent(&ap->pdev->dev, size, ap->evt_ring,
+				  ap->evt_ring_dma);
 		ap->evt_ring = NULL;
 	}
 	if (ap->tx_ring != NULL && !ACE_IS_TIGON_I(ap)) {
 		size = (sizeof(struct tx_desc) * MAX_TX_RING_ENTRIES);
-		pci_free_consistent(ap->pdev, size, ap->tx_ring,
-				    ap->tx_ring_dma);
+		dma_free_coherent(&ap->pdev->dev, size, ap->tx_ring,
+				  ap->tx_ring_dma);
 	}
 	ap->tx_ring = NULL;
 
 	if (ap->evt_prd != NULL) {
-		pci_free_consistent(ap->pdev, sizeof(u32),
-				    (void *)ap->evt_prd, ap->evt_prd_dma);
+		dma_free_coherent(&ap->pdev->dev, sizeof(u32),
+				  (void *)ap->evt_prd, ap->evt_prd_dma);
 		ap->evt_prd = NULL;
 	}
 	if (ap->rx_ret_prd != NULL) {
-		pci_free_consistent(ap->pdev, sizeof(u32),
-				    (void *)ap->rx_ret_prd,
-				    ap->rx_ret_prd_dma);
+		dma_free_coherent(&ap->pdev->dev, sizeof(u32),
+				  (void *)ap->rx_ret_prd, ap->rx_ret_prd_dma);
 		ap->rx_ret_prd = NULL;
 	}
 	if (ap->tx_csm != NULL) {
-		pci_free_consistent(ap->pdev, sizeof(u32),
-				    (void *)ap->tx_csm, ap->tx_csm_dma);
+		dma_free_coherent(&ap->pdev->dev, sizeof(u32),
+				  (void *)ap->tx_csm, ap->tx_csm_dma);
 		ap->tx_csm = NULL;
 	}
 }
@@ -763,8 +760,8 @@ static int ace_allocate_descriptors(struct net_device *dev)
 		 RX_MINI_RING_ENTRIES +
 		 RX_RETURN_RING_ENTRIES));
 
-	ap->rx_std_ring = pci_alloc_consistent(ap->pdev, size,
-					       &ap->rx_ring_base_dma);
+	ap->rx_std_ring = dma_alloc_coherent(&ap->pdev->dev, size,
+					     &ap->rx_ring_base_dma, GFP_KERNEL);
 	if (ap->rx_std_ring == NULL)
 		goto fail;
 
@@ -774,7 +771,8 @@ static int ace_allocate_descriptors(struct net_device *dev)
 
 	size = (sizeof(struct event) * EVT_RING_ENTRIES);
 
-	ap->evt_ring = pci_alloc_consistent(ap->pdev, size, &ap->evt_ring_dma);
+	ap->evt_ring = dma_alloc_coherent(&ap->pdev->dev, size,
+					  &ap->evt_ring_dma, GFP_KERNEL);
 
 	if (ap->evt_ring == NULL)
 		goto fail;
@@ -786,25 +784,25 @@ static int ace_allocate_descriptors(struct net_device *dev)
 	if (!ACE_IS_TIGON_I(ap)) {
 		size = (sizeof(struct tx_desc) * MAX_TX_RING_ENTRIES);
 
-		ap->tx_ring = pci_alloc_consistent(ap->pdev, size,
-						   &ap->tx_ring_dma);
+		ap->tx_ring = dma_alloc_coherent(&ap->pdev->dev, size,
+						 &ap->tx_ring_dma, GFP_KERNEL);
 
 		if (ap->tx_ring == NULL)
 			goto fail;
 	}
 
-	ap->evt_prd = pci_alloc_consistent(ap->pdev, sizeof(u32),
-					   &ap->evt_prd_dma);
+	ap->evt_prd = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
+					 &ap->evt_prd_dma, GFP_KERNEL);
 	if (ap->evt_prd == NULL)
 		goto fail;
 
-	ap->rx_ret_prd = pci_alloc_consistent(ap->pdev, sizeof(u32),
-					      &ap->rx_ret_prd_dma);
+	ap->rx_ret_prd = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
+					    &ap->rx_ret_prd_dma, GFP_KERNEL);
 	if (ap->rx_ret_prd == NULL)
 		goto fail;
 
-	ap->tx_csm = pci_alloc_consistent(ap->pdev, sizeof(u32),
-					  &ap->tx_csm_dma);
+	ap->tx_csm = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
+					&ap->tx_csm_dma, GFP_KERNEL);
 	if (ap->tx_csm == NULL)
 		goto fail;
 
@@ -830,8 +828,8 @@ static void ace_init_cleanup(struct net_device *dev)
 	ace_free_descriptors(dev);
 
 	if (ap->info)
-		pci_free_consistent(ap->pdev, sizeof(struct ace_info),
-				    ap->info, ap->info_dma);
+		dma_free_coherent(&ap->pdev->dev, sizeof(struct ace_info),
+				  ap->info, ap->info_dma);
 	kfree(ap->skb);
 	kfree(ap->trace_buf);
 
@@ -1129,9 +1127,9 @@ static int ace_init(struct net_device *dev)
 	/*
 	 * Configure DMA attributes.
 	 */
-	if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
+	if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
 		ap->pci_using_dac = 1;
-	} else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
+	} else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
 		ap->pci_using_dac = 0;
 	} else {
 		ecode = -ENODEV;
@@ -1143,8 +1141,8 @@ static int ace_init(struct net_device *dev)
 	 * and the control blocks for the transmit and receive rings
 	 * as they need to be setup once and for all.
 	 */
-	if (!(info = pci_alloc_consistent(ap->pdev, sizeof(struct ace_info),
-					  &ap->info_dma))) {
+	if (!(info = dma_alloc_coherent(&ap->pdev->dev, sizeof(struct ace_info),
+					&ap->info_dma, GFP_KERNEL))) {
 		ecode = -EAGAIN;
 		goto init_error;
 	}
@@ -1646,10 +1644,10 @@ static void ace_load_std_rx_ring(struct net_device *dev, int nr_bufs)
 		if (!skb)
 			break;
 
-		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
+		mapping = dma_map_page(&ap->pdev->dev,
+				       virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_STD_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+				       ACE_STD_BUFSIZE, DMA_FROM_DEVICE);
 		ap->skb->rx_std_skbuff[idx].skb = skb;
 		dma_unmap_addr_set(&ap->skb->rx_std_skbuff[idx],
 				   mapping, mapping);
@@ -1707,10 +1705,10 @@ static void ace_load_mini_rx_ring(struct net_device *dev, int nr_bufs)
 		if (!skb)
 			break;
 
-		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
+		mapping = dma_map_page(&ap->pdev->dev,
+				       virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_MINI_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+				       ACE_MINI_BUFSIZE, DMA_FROM_DEVICE);
 		ap->skb->rx_mini_skbuff[idx].skb = skb;
 		dma_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx],
 				   mapping, mapping);
@@ -1763,10 +1761,10 @@ static void ace_load_jumbo_rx_ring(struct net_device *dev, int nr_bufs)
 		if (!skb)
 			break;
 
-		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
+		mapping = dma_map_page(&ap->pdev->dev,
+				       virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_JUMBO_BUFSIZE,
-				       PCI_DMA_FROMDEVICE);
+				       ACE_JUMBO_BUFSIZE, DMA_FROM_DEVICE);
 		ap->skb->rx_jumbo_skbuff[idx].skb = skb;
 		dma_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx],
 				   mapping, mapping);
@@ -1977,10 +1975,8 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
 
 		skb = rip->skb;
 		rip->skb = NULL;
-		pci_unmap_page(ap->pdev,
-			       dma_unmap_addr(rip, mapping),
-			       mapsize,
-			       PCI_DMA_FROMDEVICE);
+		dma_unmap_page(&ap->pdev->dev, dma_unmap_addr(rip, mapping),
+			       mapsize, DMA_FROM_DEVICE);
 		skb_put(skb, retdesc->size);
 
 		/*
@@ -2046,9 +2042,10 @@ static inline void ace_tx_int(struct net_device *dev,
 		skb = info->skb;
 
 		if (dma_unmap_len(info, maplen)) {
-			pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping),
+			dma_unmap_page(&ap->pdev->dev,
+				       dma_unmap_addr(info, mapping),
 				       dma_unmap_len(info, maplen),
-				       PCI_DMA_TODEVICE);
+				       DMA_TO_DEVICE);
 			dma_unmap_len_set(info, maplen, 0);
 		}
 
@@ -2337,9 +2334,10 @@ static int ace_close(struct net_device *dev)
 			} else
 				memset(ap->tx_ring + i, 0,
 				       sizeof(struct tx_desc));
-			pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping),
+			dma_unmap_page(&ap->pdev->dev,
+				       dma_unmap_addr(info, mapping),
 				       dma_unmap_len(info, maplen),
-				       PCI_DMA_TODEVICE);
+				       DMA_TO_DEVICE);
 			dma_unmap_len_set(info, maplen, 0);
 		}
 		if (skb) {
@@ -2369,9 +2367,9 @@ ace_map_tx_skb(struct ace_private *ap, struct sk_buff *skb,
 	dma_addr_t mapping;
 	struct tx_ring_info *info;
 
-	mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
-			       offset_in_page(skb->data),
-			       skb->len, PCI_DMA_TODEVICE);
+	mapping = dma_map_page(&ap->pdev->dev, virt_to_page(skb->data),
+			       offset_in_page(skb->data), skb->len,
+			       DMA_TO_DEVICE);
 
 	info = ap->skb->tx_skbuff + idx;
 	info->skb = tail;
-- 
2.25.1


^ permalink raw reply related

* Re: [PATCH RFC net-next] net: phy: add Marvell PHY PTP support
From: Richard Cochran @ 2020-07-16 20:48 UTC (permalink / raw)
  To: Russell King
  Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S. Miller,
	Jakub Kicinski, netdev
In-Reply-To: <E1jvNlE-0001Y0-47@rmk-PC.armlinux.org.uk>

On Tue, Jul 14, 2020 at 05:26:28PM +0100, Russell King wrote:

> With this driver, there appears to be three instances of a ptp_header()
> like function in the kernel - I think that ought to become a helper in
> generic code.

Yes, and the hellcreek DSA driver will add yet another.  I'll be happy
if patches that refactor everything this magically appear!

> +/* Read the status, timestamp and PTP common header sequence from the PHY.
> + * Apparently, reading these are atomic, but there is no mention how the
> + * PHY treats this access as atomic. So, we set the DisTSOverwrite bit
> + * when configuring the PHY.
> + */
> +static int marvell_read_tstamp(struct phy_device *phydev,
> +			       struct marvell_ts *ts,
> +			       uint8_t page, uint8_t reg)
> +{
> +	int oldpage;
> +	int ret;
> +
> +	/* Read status register */
> +	oldpage = phy_select_page(phydev, page);
> +	if (oldpage >= 0) {

Suggest avoiding the IfOk anti-pattern.

> +		ret = __phy_read(phydev, reg);
> +		if (ret < 0)
> +			goto restore;
> +
> +		ts->stat = ret;
> +		if (!(ts->stat & MV_STATUS_VALID)) {
> +			ret = 0;
> +			goto restore;
> +		}
> +
> +		/* Read low timestamp */
> +		ret = __phy_read(phydev, reg + 1);
> +		if (ret < 0)
> +			goto restore;
> +
> +		ts->time = ret;
> +
> +		/* Read high timestamp */
> +		ret = __phy_read(phydev, reg + 2);
> +		if (ret < 0)
> +			goto restore;
> +
> +		ts->time |= ret << 16;
> +
> +		/* Read sequence */
> +		ret = __phy_read(phydev, reg + 3);
> +		if (ret < 0)
> +			goto restore;
> +
> +		ts->seq = ret;
> +
> +		/* Clear valid */
> +		__phy_write(phydev, reg, 0);
> +	}
> +restore:
> +	return phy_restore_page(phydev, oldpage, ret);
> +}


> +/* Check whether the packet is suitable for timestamping, and if so,
> + * try to find a pending timestamp for it. If no timestamp is found,
> + * queue the packet with a timeout.
> + */
> +static bool marvell_ptp_rxtstamp(struct mii_timestamper *mii_ts,
> +				 struct sk_buff *skb, int type)
> +{
> +	struct marvell_ptp *ptp = mii_ts_to_ptp(mii_ts);
> +	struct marvell_rxts *rxts;
> +	bool found = false;
> +	u8 *ptp_hdr;
> +	u16 seqid;
> +	u64 ns;
> +
> +	if (ptp->rx_filter == HWTSTAMP_FILTER_NONE)
> +		return false;
> +
> +	ptp_hdr = ptp_header(skb, type);
> +	if (!ptp_hdr)
> +		return false;
> +
> +	seqid = ptp_seqid(ptp_hdr);
> +
> +	mutex_lock(&ptp->rx_mutex);
> +
> +	/* Search the pending receive timestamps for a matching seqid */
> +	list_for_each_entry(rxts, &ptp->rx_pend, node) {
> +		if (rxts->seq == seqid) {
> +			found = true;
> +			ns = rxts->ns;
> +			/* Move this timestamp entry to the free list */
> +			list_move_tail(&rxts->node, &ptp->rx_free);
> +			break;
> +		}
> +	}
> +
> +	if (!found) {
> +		/* Store the seqid and queue the skb. Do this under the lock
> +		 * to ensure we don't miss any timestamps appended to the
> +		 * rx_pend list.
> +		 */
> +		MARVELL_PTP_CB(skb)->seq = seqid;
> +		MARVELL_PTP_CB(skb)->timeout = jiffies +
> +			msecs_to_jiffies(RX_TIMEOUT_MS);
> +		__skb_queue_tail(&ptp->rx_queue, skb);
> +	}
> +
> +	mutex_unlock(&ptp->rx_mutex);
> +
> +	if (found) {
> +		/* We found the corresponding timestamp. If we can add the
> +		 * timestamp, do we need to go through the netif_rx_ni()
> +		 * path, or would it be more efficient to add the timestamp
> +		 * and return "false" here?
> +		 */

The caller expects the driver to deliver the skb.  If you return the
skb with your hwtstamp value, there is no guarantee that the caller
won't clobber it.

> +		marvell_ptp_rx(skb, ns);
> +	} else {
> +		schedule_delayed_work(&ptp->ts_work, 2);

Instead of using a separate work item, consider combining this with
the counter overflow logic in caps.do_aux_work = marvell_tai_aux_work.
The advantage of do_aux_work is that you get your own kernel thread
which can be given scheduling priority via chrt on busy systems.

> +	}
> +
> +	return true;
> +}


> +/* Check whether the skb will be timestamped on transmit; we only support
> + * a single outstanding skb. Add it if the slot is available.
> + */
> +static bool marvell_ptp_do_txtstamp(struct mii_timestamper *mii_ts,
> +				    struct sk_buff *skb, int type)
> +{
> +	struct marvell_ptp *ptp = mii_ts_to_ptp(mii_ts);
> +	u8 *ptp_hdr;
> +
> +	if (ptp->tx_type != HWTSTAMP_TX_ON)
> +		return false;
> +
> +	if (!(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP))
> +		return false;
> +
> +	ptp_hdr = ptp_header(skb, type);
> +	if (!ptp_hdr)
> +		return false;
> +
> +	MARVELL_PTP_CB(skb)->seq = ptp_seqid(ptp_hdr);
> +	MARVELL_PTP_CB(skb)->timeout = jiffies +
> +		msecs_to_jiffies(TX_TIMEOUT_MS);
> +
> +	if (cmpxchg(&ptp->tx_skb, NULL, skb) != NULL)
> +		return false;
> +
> +	/* DP83640 marks the skb for hw timestamping. Since the MAC driver
> +	 * may call skb_tx_timestamp() but may not support timestamping
> +	 * itself, it may not set this flag. So, we need to do this here.
> +	 */

The purpose of this flag is to prevent a SW time stamp from being
delivered when the user dialed HW time stamps only.  The PHY driver is
expected to set this flag all by itself regardless of the MAC driver.
Unfortunately the stack doesn't support simultaneous MAC and PHY time
stamping, and so it is up to the MAC driver to avoid setting this flag
when a time stamping PHY is attached.

> +	skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
> +	schedule_delayed_work(&ptp->ts_work, 2);
> +
> +	return true;
> +}
> +
> +static void marvell_ptp_txtstamp(struct mii_timestamper *mii_ts,
> +				 struct sk_buff *skb, int type)
> +{
> +	if (!marvell_ptp_do_txtstamp(mii_ts, skb, type))
> +		kfree_skb(skb);
> +}
> +
> +static int marvell_ptp_hwtstamp(struct mii_timestamper *mii_ts,
> +				struct ifreq *ifreq)
> +{
> +	struct marvell_ptp *ptp = mii_ts_to_ptp(mii_ts);
> +	struct hwtstamp_config config;
> +	u16 cfg0 = PTP1_PORT_CONFIG_0_DISPTP;
> +	u16 cfg2 = 0;
> +	int err;
> +
> +	if (copy_from_user(&config, ifreq->ifr_data, sizeof(config)))
> +		return -EFAULT;
> +
> +	if (config.flags)
> +		return -EINVAL;
> +
> +	switch (config.tx_type) {
> +	case HWTSTAMP_TX_OFF:
> +		break;
> +
> +	case HWTSTAMP_TX_ON:
> +		cfg0 = 0;
> +		cfg2 |= PTP1_PORT_CONFIG_2_DEPINTEN;
> +		break;
> +
> +	default:
> +		return -ERANGE;
> +	}
> +
> +	switch (config.rx_filter) {
> +	case HWTSTAMP_FILTER_NONE:
> +		break;
> +
> +	case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
> +	case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
> +	case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
> +	case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
> +	case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
> +	case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
> +	case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
> +	case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
> +	case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:
> +	case HWTSTAMP_FILTER_PTP_V2_EVENT:
> +	case HWTSTAMP_FILTER_PTP_V2_SYNC:
> +	case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
> +		/* We accept 802.1AS, IEEE 1588v1 and IEEE 1588v2. We could
> +		 * filter on 802.1AS using the transportSpecific field, but
> +		 * that affects the transmit path too.
> +		 */
> +		config.rx_filter = HWTSTAMP_FILTER_SOME;

I think you want HWTSTAMP_FILTER_PTP_V2_EVENT here.

From Documentation/networking/timestamping.rst...

   Drivers are free to use a more permissive configuration than the requested
   configuration. It is expected that drivers should only implement directly the
   most generic mode that can be supported. For example if the hardware can
   support HWTSTAMP_FILTER_V2_EVENT, then it should generally always upscale
   HWTSTAMP_FILTER_V2_L2_SYNC_MESSAGE, and so forth, as HWTSTAMP_FILTER_V2_EVENT
   is more generic (and more useful to applications).

   A driver which supports hardware time stamping shall update the struct
   with the actual, possibly more permissive configuration. If the
   requested packets cannot be time stamped, then nothing should be
   changed and ERANGE shall be returned (in contrast to EINVAL, which
   indicates that SIOCSHWTSTAMP is not supported at all).

> +		Cfg0 = 0;
> +		cfg2 |= PTP1_PORT_CONFIG_2_ARRINTEN;
> +		break;
> +
> +	default:
> +		return -ERANGE;
> +	}
> +
> +	err = phy_modify_paged(ptp->phydev, MARVELL_PAGE_PTP_PORT_1,
> +			       PTP1_PORT_CONFIG_0,
> +			       PTP1_PORT_CONFIG_0_DISPTP, cfg0);
> +	if (err)
> +		return err;
> +
> +	err = phy_write_paged(ptp->phydev, MARVELL_PAGE_PTP_PORT_1,
> +			      PTP1_PORT_CONFIG_2, cfg2);
> +	if (err)
> +		return err;
> +
> +	ptp->tx_type = config.tx_type;
> +	ptp->rx_filter = config.rx_filter;
> +
> +	return copy_to_user(ifreq->ifr_data, &config, sizeof(config)) ?
> +		-EFAULT : 0;
> +}


> +int marvell_tai_get(struct marvell_tai **taip, struct phy_device *phydev)
> +{
> +	struct marvell_tai *tai;
> +	unsigned long overflow_ms;
> +	int err;
> +
> +	err = marvell_tai_global_config(phydev);
> +	if (err < 0)
> +		return err;
> +
> +	tai = kzalloc(sizeof(*tai), GFP_KERNEL);
> +	if (!tai)
> +		return -ENOMEM;
> +
> +	mutex_init(&tai->mutex);
> +
> +	tai->phydev = phydev;
> +
> +	/* This assumes a 125MHz clock */
> +	tai->cc_mult = 8 << 28;
> +	tai->cc_mult_num = 1 << 9;
> +	tai->cc_mult_den = 15625U;
> +
> +	tai->cyclecounter.read = marvell_tai_clock_read;
> +	tai->cyclecounter.mask = CYCLECOUNTER_MASK(32);
> +	tai->cyclecounter.mult = tai->cc_mult;
> +	tai->cyclecounter.shift = 28;
> +
> +	overflow_ms = (1ULL << 32 * tai->cc_mult * 1000) >>
> +			tai->cyclecounter.shift;
> +	tai->half_overflow_period = msecs_to_jiffies(overflow_ms / 2);
> +
> +	timecounter_init(&tai->timecounter, &tai->cyclecounter,
> +			 ktime_to_ns(ktime_get_real()));
> +
> +	tai->caps.owner = THIS_MODULE;
> +	snprintf(tai->caps.name, sizeof(tai->caps.name), "Marvell PHY");
> +	/* max_adj of 1000000 is what MV88E6xxx DSA uses */
> +	tai->caps.max_adj = 1000000;
> +	tai->caps.adjfine = marvell_tai_adjfine;
> +	tai->caps.adjtime = marvell_tai_adjtime;
> +	tai->caps.gettimex64 = marvell_tai_gettimex64;
> +	tai->caps.settime64 = marvell_tai_settime64;
> +	tai->caps.do_aux_work = marvell_tai_aux_work;
> +
> +	tai->ptp_clock = ptp_clock_register(&tai->caps, &phydev->mdio.dev);
> +	if (IS_ERR(tai->ptp_clock)) {
> +		kfree(tai);
> +		return PTR_ERR(tai->ptp_clock);
> +	}
> +
> +	ptp_schedule_worker(tai->ptp_clock, tai->half_overflow_period);

ptp_clock_register() can return NULL, and so you should check for that
case before passing tai->ptp_clock here.

 * ptp_clock_register() - register a PTP hardware clock driver
 *
 * @info:   Structure describing the new clock.
 * @parent: Pointer to the parent device of the new clock.
 *
 * Returns a valid pointer on success or PTR_ERR on failure.  If PHC
 * support is missing at the configuration level, this function
 * returns NULL, and drivers are expected to gracefully handle that
 * case separately.

Thanks,
Richard

^ permalink raw reply

* Re: [PATCH v2 1/3] kgdb: Honour the kprobe blocklist when setting breakpoints
From: kernel test robot @ 2020-07-16 20:48 UTC (permalink / raw)
  To: kbuild-all
In-Reply-To: <20200716151943.2167652-2-daniel.thompson@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 38187 bytes --]

Hi Daniel,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on kgdb/kgdb-next pmladek/for-next v5.8-rc5 next-20200716]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Daniel-Thompson/kgdb-Honour-the-kprobe-blacklist-when-setting-breakpoints/20200716-232506
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f8456690ba8eb18ea4714e68554e242a04f65cff
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/net/wireless/intel/ipw2x00/ipw2100.c:3794:16: error: conflicting types for 'show_registers'
    3794 | static ssize_t show_registers(struct device *d, struct device_attribute *attr,
         |                ^~~~~~~~~~~~~~
   In file included from include/linux/kgdb.h:19,
                    from arch/arm64/include/asm/cacheflush.h:11,
                    from include/linux/highmem.h:12,
                    from include/linux/pagemap.h:11,
                    from include/linux/blkdev.h:16,
                    from include/linux/blk-cgroup.h:23,
                    from include/linux/writeback.h:14,
                    from include/linux/memcontrol.h:22,
                    from include/net/sock.h:53,
                    from include/linux/tcp.h:19,
                    from drivers/net/wireless/intel/ipw2x00/ipw2100.c:144:
   include/linux/kprobes.h:230:13: note: previous declaration of 'show_registers' was here
     230 | extern void show_registers(struct pt_regs *regs);
         |             ^~~~~~~~~~~~~~

vim +/show_registers +3794 drivers/net/wireless/intel/ipw2x00/ipw2100.c

2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3558  
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3559  #define IPW2100_REG(x) { IPW_ ##x, #x }
c4aee8c21ff5d8d drivers/net/wireless/ipw2100.c               Jiri Benc        2005-08-25  3560  static const struct {
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3561  	u32 addr;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3562  	const char *name;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3563  } hw_data[] = {
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3564  IPW2100_REG(REG_GP_CNTRL),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3565  	    IPW2100_REG(REG_GPIO),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3566  	    IPW2100_REG(REG_INTA),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3567  	    IPW2100_REG(REG_INTA_MASK), IPW2100_REG(REG_RESET_REG),};
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3568  #define IPW2100_NIC(x, s) { x, #x, s }
c4aee8c21ff5d8d drivers/net/wireless/ipw2100.c               Jiri Benc        2005-08-25  3569  static const struct {
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3570  	u32 addr;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3571  	const char *name;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3572  	size_t size;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3573  } nic_data[] = {
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3574  IPW2100_NIC(IPW2100_CONTROL_REG, 2),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3575  	    IPW2100_NIC(0x210014, 1), IPW2100_NIC(0x210000, 1),};
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3576  #define IPW2100_ORD(x, d) { IPW_ORD_ ##x, #x, d }
c4aee8c21ff5d8d drivers/net/wireless/ipw2100.c               Jiri Benc        2005-08-25  3577  static const struct {
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3578  	u8 index;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3579  	const char *name;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3580  	const char *desc;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3581  } ord_data[] = {
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3582  IPW2100_ORD(STAT_TX_HOST_REQUESTS, "requested Host Tx's (MSDU)"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3583  	    IPW2100_ORD(STAT_TX_HOST_COMPLETE,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3584  				"successful Host Tx's (MSDU)"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3585  	    IPW2100_ORD(STAT_TX_DIR_DATA,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3586  				"successful Directed Tx's (MSDU)"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3587  	    IPW2100_ORD(STAT_TX_DIR_DATA1,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3588  				"successful Directed Tx's (MSDU) @ 1MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3589  	    IPW2100_ORD(STAT_TX_DIR_DATA2,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3590  				"successful Directed Tx's (MSDU) @ 2MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3591  	    IPW2100_ORD(STAT_TX_DIR_DATA5_5,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3592  				"successful Directed Tx's (MSDU) @ 5_5MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3593  	    IPW2100_ORD(STAT_TX_DIR_DATA11,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3594  				"successful Directed Tx's (MSDU) @ 11MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3595  	    IPW2100_ORD(STAT_TX_NODIR_DATA1,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3596  				"successful Non_Directed Tx's (MSDU) @ 1MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3597  	    IPW2100_ORD(STAT_TX_NODIR_DATA2,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3598  				"successful Non_Directed Tx's (MSDU) @ 2MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3599  	    IPW2100_ORD(STAT_TX_NODIR_DATA5_5,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3600  				"successful Non_Directed Tx's (MSDU) @ 5.5MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3601  	    IPW2100_ORD(STAT_TX_NODIR_DATA11,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3602  				"successful Non_Directed Tx's (MSDU) @ 11MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3603  	    IPW2100_ORD(STAT_NULL_DATA, "successful NULL data Tx's"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3604  	    IPW2100_ORD(STAT_TX_RTS, "successful Tx RTS"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3605  	    IPW2100_ORD(STAT_TX_CTS, "successful Tx CTS"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3606  	    IPW2100_ORD(STAT_TX_ACK, "successful Tx ACK"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3607  	    IPW2100_ORD(STAT_TX_ASSN, "successful Association Tx's"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3608  	    IPW2100_ORD(STAT_TX_ASSN_RESP,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3609  				"successful Association response Tx's"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3610  	    IPW2100_ORD(STAT_TX_REASSN,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3611  				"successful Reassociation Tx's"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3612  	    IPW2100_ORD(STAT_TX_REASSN_RESP,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3613  				"successful Reassociation response Tx's"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3614  	    IPW2100_ORD(STAT_TX_PROBE,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3615  				"probes successfully transmitted"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3616  	    IPW2100_ORD(STAT_TX_PROBE_RESP,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3617  				"probe responses successfully transmitted"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3618  	    IPW2100_ORD(STAT_TX_BEACON, "tx beacon"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3619  	    IPW2100_ORD(STAT_TX_ATIM, "Tx ATIM"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3620  	    IPW2100_ORD(STAT_TX_DISASSN,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3621  				"successful Disassociation TX"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3622  	    IPW2100_ORD(STAT_TX_AUTH, "successful Authentication Tx"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3623  	    IPW2100_ORD(STAT_TX_DEAUTH,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3624  				"successful Deauthentication TX"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3625  	    IPW2100_ORD(STAT_TX_TOTAL_BYTES,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3626  				"Total successful Tx data bytes"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3627  	    IPW2100_ORD(STAT_TX_RETRIES, "Tx retries"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3628  	    IPW2100_ORD(STAT_TX_RETRY1, "Tx retries at 1MBPS"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3629  	    IPW2100_ORD(STAT_TX_RETRY2, "Tx retries at 2MBPS"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3630  	    IPW2100_ORD(STAT_TX_RETRY5_5, "Tx retries at 5.5MBPS"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3631  	    IPW2100_ORD(STAT_TX_RETRY11, "Tx retries at 11MBPS"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3632  	    IPW2100_ORD(STAT_TX_FAILURES, "Tx Failures"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3633  	    IPW2100_ORD(STAT_TX_MAX_TRIES_IN_HOP,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3634  				"times max tries in a hop failed"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3635  	    IPW2100_ORD(STAT_TX_DISASSN_FAIL,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3636  				"times disassociation failed"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3637  	    IPW2100_ORD(STAT_TX_ERR_CTS, "missed/bad CTS frames"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3638  	    IPW2100_ORD(STAT_TX_ERR_ACK, "tx err due to acks"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3639  	    IPW2100_ORD(STAT_RX_HOST, "packets passed to host"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3640  	    IPW2100_ORD(STAT_RX_DIR_DATA, "directed packets"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3641  	    IPW2100_ORD(STAT_RX_DIR_DATA1, "directed packets at 1MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3642  	    IPW2100_ORD(STAT_RX_DIR_DATA2, "directed packets at 2MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3643  	    IPW2100_ORD(STAT_RX_DIR_DATA5_5,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3644  				"directed packets at 5.5MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3645  	    IPW2100_ORD(STAT_RX_DIR_DATA11, "directed packets at 11MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3646  	    IPW2100_ORD(STAT_RX_NODIR_DATA, "nondirected packets"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3647  	    IPW2100_ORD(STAT_RX_NODIR_DATA1,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3648  				"nondirected packets at 1MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3649  	    IPW2100_ORD(STAT_RX_NODIR_DATA2,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3650  				"nondirected packets at 2MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3651  	    IPW2100_ORD(STAT_RX_NODIR_DATA5_5,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3652  				"nondirected packets at 5.5MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3653  	    IPW2100_ORD(STAT_RX_NODIR_DATA11,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3654  				"nondirected packets at 11MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3655  	    IPW2100_ORD(STAT_RX_NULL_DATA, "null data rx's"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3656  	    IPW2100_ORD(STAT_RX_RTS, "Rx RTS"), IPW2100_ORD(STAT_RX_CTS,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3657  								    "Rx CTS"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3658  	    IPW2100_ORD(STAT_RX_ACK, "Rx ACK"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3659  	    IPW2100_ORD(STAT_RX_CFEND, "Rx CF End"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3660  	    IPW2100_ORD(STAT_RX_CFEND_ACK, "Rx CF End + CF Ack"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3661  	    IPW2100_ORD(STAT_RX_ASSN, "Association Rx's"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3662  	    IPW2100_ORD(STAT_RX_ASSN_RESP, "Association response Rx's"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3663  	    IPW2100_ORD(STAT_RX_REASSN, "Reassociation Rx's"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3664  	    IPW2100_ORD(STAT_RX_REASSN_RESP,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3665  				"Reassociation response Rx's"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3666  	    IPW2100_ORD(STAT_RX_PROBE, "probe Rx's"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3667  	    IPW2100_ORD(STAT_RX_PROBE_RESP, "probe response Rx's"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3668  	    IPW2100_ORD(STAT_RX_BEACON, "Rx beacon"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3669  	    IPW2100_ORD(STAT_RX_ATIM, "Rx ATIM"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3670  	    IPW2100_ORD(STAT_RX_DISASSN, "disassociation Rx"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3671  	    IPW2100_ORD(STAT_RX_AUTH, "authentication Rx"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3672  	    IPW2100_ORD(STAT_RX_DEAUTH, "deauthentication Rx"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3673  	    IPW2100_ORD(STAT_RX_TOTAL_BYTES,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3674  				"Total rx data bytes received"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3675  	    IPW2100_ORD(STAT_RX_ERR_CRC, "packets with Rx CRC error"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3676  	    IPW2100_ORD(STAT_RX_ERR_CRC1, "Rx CRC errors at 1MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3677  	    IPW2100_ORD(STAT_RX_ERR_CRC2, "Rx CRC errors at 2MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3678  	    IPW2100_ORD(STAT_RX_ERR_CRC5_5, "Rx CRC errors at 5.5MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3679  	    IPW2100_ORD(STAT_RX_ERR_CRC11, "Rx CRC errors at 11MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3680  	    IPW2100_ORD(STAT_RX_DUPLICATE1,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3681  				"duplicate rx packets at 1MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3682  	    IPW2100_ORD(STAT_RX_DUPLICATE2,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3683  				"duplicate rx packets at 2MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3684  	    IPW2100_ORD(STAT_RX_DUPLICATE5_5,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3685  				"duplicate rx packets at 5.5MB"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3686  	    IPW2100_ORD(STAT_RX_DUPLICATE11,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3687  				"duplicate rx packets at 11MB"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3688  	    IPW2100_ORD(STAT_RX_DUPLICATE, "duplicate rx packets"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3689  	    IPW2100_ORD(PERS_DB_LOCK, "locking fw permanent  db"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3690  	    IPW2100_ORD(PERS_DB_SIZE, "size of fw permanent  db"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3691  	    IPW2100_ORD(PERS_DB_ADDR, "address of fw permanent  db"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3692  	    IPW2100_ORD(STAT_RX_INVALID_PROTOCOL,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3693  				"rx frames with invalid protocol"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3694  	    IPW2100_ORD(SYS_BOOT_TIME, "Boot time"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3695  	    IPW2100_ORD(STAT_RX_NO_BUFFER,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3696  				"rx frames rejected due to no buffer"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3697  	    IPW2100_ORD(STAT_RX_MISSING_FRAG,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3698  				"rx frames dropped due to missing fragment"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3699  	    IPW2100_ORD(STAT_RX_ORPHAN_FRAG,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3700  				"rx frames dropped due to non-sequential fragment"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3701  	    IPW2100_ORD(STAT_RX_ORPHAN_FRAME,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3702  				"rx frames dropped due to unmatched 1st frame"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3703  	    IPW2100_ORD(STAT_RX_FRAG_AGEOUT,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3704  				"rx frames dropped due to uncompleted frame"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3705  	    IPW2100_ORD(STAT_RX_ICV_ERRORS,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3706  				"ICV errors during decryption"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3707  	    IPW2100_ORD(STAT_PSP_SUSPENSION, "times adapter suspended"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3708  	    IPW2100_ORD(STAT_PSP_BCN_TIMEOUT, "beacon timeout"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3709  	    IPW2100_ORD(STAT_PSP_POLL_TIMEOUT,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3710  				"poll response timeouts"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3711  	    IPW2100_ORD(STAT_PSP_NONDIR_TIMEOUT,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3712  				"timeouts waiting for last {broad,multi}cast pkt"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3713  	    IPW2100_ORD(STAT_PSP_RX_DTIMS, "PSP DTIMs received"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3714  	    IPW2100_ORD(STAT_PSP_RX_TIMS, "PSP TIMs received"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3715  	    IPW2100_ORD(STAT_PSP_STATION_ID, "PSP Station ID"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3716  	    IPW2100_ORD(LAST_ASSN_TIME, "RTC time of last association"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3717  	    IPW2100_ORD(STAT_PERCENT_MISSED_BCNS,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3718  				"current calculation of % missed beacons"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3719  	    IPW2100_ORD(STAT_PERCENT_RETRIES,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3720  				"current calculation of % missed tx retries"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3721  	    IPW2100_ORD(ASSOCIATED_AP_PTR,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3722  				"0 if not associated, else pointer to AP table entry"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3723  	    IPW2100_ORD(AVAILABLE_AP_CNT,
3ea0a58cf9cf66e drivers/net/wireless/intel/ipw2x00/ipw2100.c Colin Ian King   2018-04-28  3724  				"AP's described in the AP table"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3725  	    IPW2100_ORD(AP_LIST_PTR, "Ptr to list of available APs"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3726  	    IPW2100_ORD(STAT_AP_ASSNS, "associations"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3727  	    IPW2100_ORD(STAT_ASSN_FAIL, "association failures"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3728  	    IPW2100_ORD(STAT_ASSN_RESP_FAIL,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3729  				"failures due to response fail"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3730  	    IPW2100_ORD(STAT_FULL_SCANS, "full scans"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3731  	    IPW2100_ORD(CARD_DISABLED, "Card Disabled"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3732  	    IPW2100_ORD(STAT_ROAM_INHIBIT,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3733  				"times roaming was inhibited due to activity"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3734  	    IPW2100_ORD(RSSI_AT_ASSN,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3735  				"RSSI of associated AP at time of association"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3736  	    IPW2100_ORD(STAT_ASSN_CAUSE1,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3737  				"reassociation: no probe response or TX on hop"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3738  	    IPW2100_ORD(STAT_ASSN_CAUSE2,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3739  				"reassociation: poor tx/rx quality"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3740  	    IPW2100_ORD(STAT_ASSN_CAUSE3,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3741  				"reassociation: tx/rx quality (excessive AP load"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3742  	    IPW2100_ORD(STAT_ASSN_CAUSE4,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3743  				"reassociation: AP RSSI level"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3744  	    IPW2100_ORD(STAT_ASSN_CAUSE5,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3745  				"reassociations due to load leveling"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3746  	    IPW2100_ORD(STAT_AUTH_FAIL, "times authentication failed"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3747  	    IPW2100_ORD(STAT_AUTH_RESP_FAIL,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3748  				"times authentication response failed"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3749  	    IPW2100_ORD(STATION_TABLE_CNT,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3750  				"entries in association table"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3751  	    IPW2100_ORD(RSSI_AVG_CURR, "Current avg RSSI"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3752  	    IPW2100_ORD(POWER_MGMT_MODE, "Power mode - 0=CAM, 1=PSP"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3753  	    IPW2100_ORD(COUNTRY_CODE,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3754  				"IEEE country code as recv'd from beacon"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3755  	    IPW2100_ORD(COUNTRY_CHANNELS,
fd9071ec61db420 drivers/net/wireless/ipw2x00/ipw2100.c       Masanari Iida    2012-04-13  3756  				"channels supported by country"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3757  	    IPW2100_ORD(RESET_CNT, "adapter resets (warm)"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3758  	    IPW2100_ORD(BEACON_INTERVAL, "Beacon interval"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3759  	    IPW2100_ORD(ANTENNA_DIVERSITY,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3760  				"TRUE if antenna diversity is disabled"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3761  	    IPW2100_ORD(DTIM_PERIOD, "beacon intervals between DTIMs"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3762  	    IPW2100_ORD(OUR_FREQ,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3763  				"current radio freq lower digits - channel ID"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3764  	    IPW2100_ORD(RTC_TIME, "current RTC time"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3765  	    IPW2100_ORD(PORT_TYPE, "operating mode"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3766  	    IPW2100_ORD(CURRENT_TX_RATE, "current tx rate"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3767  	    IPW2100_ORD(SUPPORTED_RATES, "supported tx rates"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3768  	    IPW2100_ORD(ATIM_WINDOW, "current ATIM Window"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3769  	    IPW2100_ORD(BASIC_RATES, "basic tx rates"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3770  	    IPW2100_ORD(NIC_HIGHEST_RATE, "NIC highest tx rate"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3771  	    IPW2100_ORD(AP_HIGHEST_RATE, "AP highest tx rate"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3772  	    IPW2100_ORD(CAPABILITIES,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3773  				"Management frame capability field"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3774  	    IPW2100_ORD(AUTH_TYPE, "Type of authentication"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3775  	    IPW2100_ORD(RADIO_TYPE, "Adapter card platform type"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3776  	    IPW2100_ORD(RTS_THRESHOLD,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3777  				"Min packet length for RTS handshaking"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3778  	    IPW2100_ORD(INT_MODE, "International mode"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3779  	    IPW2100_ORD(FRAGMENTATION_THRESHOLD,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3780  				"protocol frag threshold"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3781  	    IPW2100_ORD(EEPROM_SRAM_DB_BLOCK_START_ADDRESS,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3782  				"EEPROM offset in SRAM"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3783  	    IPW2100_ORD(EEPROM_SRAM_DB_BLOCK_SIZE,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3784  				"EEPROM size in SRAM"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3785  	    IPW2100_ORD(EEPROM_SKU_CAPABILITY, "EEPROM SKU Capability"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3786  	    IPW2100_ORD(EEPROM_IBSS_11B_CHANNELS,
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3787  				"EEPROM IBSS 11b channel set"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3788  	    IPW2100_ORD(MAC_VERSION, "MAC Version"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3789  	    IPW2100_ORD(MAC_REVISION, "MAC Revision"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3790  	    IPW2100_ORD(RADIO_VERSION, "Radio Version"),
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3791  	    IPW2100_ORD(NIC_MANF_DATE_TIME, "MANF Date/Time STAMP"),
ee8e365aa6395e7 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-09-14  3792  	    IPW2100_ORD(UCODE_VERSION, "Ucode Version"),};
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3793  
edfc43f2ec542c1 drivers/net/wireless/ipw2100.c               Andrew Morton    2005-06-20 @3794  static ssize_t show_registers(struct device *d, struct device_attribute *attr,
edfc43f2ec542c1 drivers/net/wireless/ipw2100.c               Andrew Morton    2005-06-20  3795  			      char *buf)
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3796  {
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3797  	int i;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3798  	struct ipw2100_priv *priv = dev_get_drvdata(d);
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3799  	struct net_device *dev = priv->net_dev;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3800  	char *out = buf;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3801  	u32 val = 0;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3802  
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3803  	out += sprintf(out, "%30s [Address ] : Hex\n", "Register");
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3804  
22d574324939d62 drivers/net/wireless/ipw2100.c               Ahmed S. Darwish 2007-02-05  3805  	for (i = 0; i < ARRAY_SIZE(hw_data); i++) {
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3806  		read_register(dev, hw_data[i].addr, &val);
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3807  		out += sprintf(out, "%30s [%08X] : %08X\n",
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3808  			       hw_data[i].name, hw_data[i].addr, val);
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3809  	}
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3810  
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3811  	return out - buf;
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3812  }
2c86c275015c880 drivers/net/wireless/ipw2100.c               James Ketrenos   2005-03-23  3813  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 73539 bytes --]

^ permalink raw reply

* Re: [PATCH RFC v2 1/3] io_uring: use an enumeration for io_uring_register(2) opcodes
From: Pavel Begunkov @ 2020-07-16 20:47 UTC (permalink / raw)
  To: Jens Axboe, Stefano Garzarella
  Cc: Alexander Viro, Kernel Hardening, Kees Cook, Aleksa Sarai,
	Stefan Hajnoczi, Christian Brauner, Sargun Dhillon, Jann Horn,
	io-uring, linux-fsdevel, Jeff Moyer, linux-kernel
In-Reply-To: <a2f109b2-adbf-147d-9423-7a1a4bf99967@kernel.dk>

On 16/07/2020 23:42, Jens Axboe wrote:
> On 7/16/20 2:16 PM, Pavel Begunkov wrote:
>> On 16/07/2020 15:48, Stefano Garzarella wrote:
>>> The enumeration allows us to keep track of the last
>>> io_uring_register(2) opcode available.
>>>
>>> Behaviour and opcodes names don't change.
>>>
>>> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
>>> ---
>>>  include/uapi/linux/io_uring.h | 27 ++++++++++++++++-----------
>>>  1 file changed, 16 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
>>> index 7843742b8b74..efc50bd0af34 100644
>>> --- a/include/uapi/linux/io_uring.h
>>> +++ b/include/uapi/linux/io_uring.h
>>> @@ -253,17 +253,22 @@ struct io_uring_params {
>>>  /*
>>>   * io_uring_register(2) opcodes and arguments
>>>   */
>>> -#define IORING_REGISTER_BUFFERS		0
>>> -#define IORING_UNREGISTER_BUFFERS	1
>>> -#define IORING_REGISTER_FILES		2
>>> -#define IORING_UNREGISTER_FILES		3
>>> -#define IORING_REGISTER_EVENTFD		4
>>> -#define IORING_UNREGISTER_EVENTFD	5
>>> -#define IORING_REGISTER_FILES_UPDATE	6
>>> -#define IORING_REGISTER_EVENTFD_ASYNC	7
>>> -#define IORING_REGISTER_PROBE		8
>>> -#define IORING_REGISTER_PERSONALITY	9
>>> -#define IORING_UNREGISTER_PERSONALITY	10
>>> +enum {
>>> +	IORING_REGISTER_BUFFERS,
>>> +	IORING_UNREGISTER_BUFFERS,
>>> +	IORING_REGISTER_FILES,
>>> +	IORING_UNREGISTER_FILES,
>>> +	IORING_REGISTER_EVENTFD,
>>> +	IORING_UNREGISTER_EVENTFD,
>>> +	IORING_REGISTER_FILES_UPDATE,
>>> +	IORING_REGISTER_EVENTFD_ASYNC,
>>> +	IORING_REGISTER_PROBE,
>>> +	IORING_REGISTER_PERSONALITY,
>>> +	IORING_UNREGISTER_PERSONALITY,
>>> +
>>> +	/* this goes last */
>>> +	IORING_REGISTER_LAST
>>> +};
>>
>> It breaks userspace API. E.g.
>>
>> #ifdef IORING_REGISTER_BUFFERS
> 
> It can, yes, but we have done that in the past. In this one, for

Ok, if nobody on the userspace side cares, then better to do that
sooner than later.


> example:
> 
> commit 9e3aa61ae3e01ce1ce6361a41ef725e1f4d1d2bf (tag: io_uring-5.5-20191212)
> Author: Jens Axboe <axboe@kernel.dk>
> Date:   Wed Dec 11 15:55:43 2019 -0700
> 
>     io_uring: ensure we return -EINVAL on unknown opcod
> 
> But it would be safer/saner to do this like we have the done the IOSQE_
> flags.

IOSQE_ are a bitmask, but this would look peculiar

enum {
	__IORING_REGISTER_BUFFERS,
	...
};
define IORING_REGISTER_BUFFERS __IORING_REGISTER_BUFFERS

-- 
Pavel Begunkov

^ permalink raw reply

* Re: [dpdk-dev] [EXT] Re: [PATCH v2 1/7] lib/librte_pci: add rte_pci_regs.h
From: Manish Chopra @ 2020-07-16 20:49 UTC (permalink / raw)
  To: Gaëtan Rivet, Thomas Monjalon
  Cc: Jerin Jacob, Ferruh Yigit, Igor Russkikh, dpdk-dev
In-Reply-To: <20200716175600.no5svwut34lb2wyr@u256.net>

> -----Original Message-----
> From: Gaëtan Rivet <grive@u256.net>
> Sent: Thursday, July 16, 2020 11:26 PM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: Jerin Jacob <jerinjacobk@gmail.com>; Manish Chopra
> <manishc@marvell.com>; Ferruh Yigit <ferruh.yigit@intel.com>; Igor
> Russkikh <irusskikh@marvell.com>; dpdk-dev <dev@dpdk.org>
> Subject: [EXT] Re: [dpdk-dev] [PATCH v2 1/7] lib/librte_pci: add
> rte_pci_regs.h
> 
> External Email
> 
> ----------------------------------------------------------------------
> On 16/07/20 18:57 +0200, Thomas Monjalon wrote:
> > 16/07/2020 18:43, Jerin Jacob:
> > > On Thu, Jul 16, 2020 at 9:25 PM Thomas Monjalon
> <thomas@monjalon.net> wrote:
> > > >
> > > > 16/07/2020 15:02, Jerin Jacob:
> > > > > On Thu, Jul 16, 2020 at 6:20 PM Thomas Monjalon
> <thomas@monjalon.net> wrote:
> > > > > >
> > > > > > 16/07/2020 13:55, Jerin Jacob:
> > > > > > > On Thu, Jul 16, 2020 at 4:57 PM Thomas Monjalon
> <thomas@monjalon.net> wrote:
> > > > > > > >
> > > > > > > > 16/07/2020 12:27, Jerin Jacob:
> > > > > > > > > On Thu, Jul 16, 2020 at 3:48 PM Gaëtan Rivet
> <grive@u256.net> wrote:
> > > > > > > > > >
> > > > > > > > > > On 16/07/20 12:08 +0200, Gaëtan Rivet wrote:
> > > > > > > > > > > Re-CCing dev@dpdk.org as it was removed from the reply.
> > > > > > > > > > >
> > > > > > > > > > > On 13/07/20 08:13 -0700, Manish Chopra wrote:
> > > > > > > > > > > > This is merely copy of latest linux/pci_regs.h in
> > > > > > > > > > > > order to avoid dependency of dpdk on user headers.
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > I guess this dependency is an issue on non-linux
> > > > > > > > > > > systems, when you must use those defines in a
> > > > > > > > > > > generic implementation. Can you confirm this is the
> motivation here?
> > > > > > > > > > >
> > > > > > > > > > > If so, I think it would be clearer to state "in
> > > > > > > > > > > order to avoid dependency of DPDK on linux headers".
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > To add to it, if this is actually the motivation to
> > > > > > > > > > add this header, I don't think it is sufficient.
> > > > > > > > > >
> > > > > > > > > > You can restrict the function definition to the linux
> > > > > > > > > > part of the PCI bus driver instead, using stubs for other
> systems.
> > > > > > > > > >
> > > > > > > > > > > > Signed-off-by: Manish Chopra <manishc@marvell.com>
> > > > > > > > > > > > Signed-off-by: Igor Russkikh
> > > > > > > > > > > > <irusskikh@marvell.com>
> > > > > > > > > > > > ---
> > > > > > > > > > > >  drivers/bus/pci/linux/pci_uio.c     |    2 +-
> > > > > > > > > > > >  drivers/bus/pci/linux/pci_vfio.c    |    2 +-
> > > > > > > > > > > >  drivers/net/bnx2x/bnx2x.h           |    2 +-
> > > > > > > > > > > >  drivers/net/hns3/hns3_ethdev_vf.c   |    2 +-
> > > > > > > > > > > >  drivers/vdpa/ifc/base/ifcvf_osdep.h |    2 +-
> > > > > > > > > > > >  lib/librte_pci/Makefile             |    1 +
> > > > > > > > > > > >  lib/librte_pci/meson.build          |    2 +-
> > > > > > > > > > > >  lib/librte_pci/rte_pci_regs.h       | 1075
> +++++++++++++++++++++++++++
> > > > > > > > > > > >  8 files changed, 1082 insertions(+), 6
> > > > > > > > > > > > deletions(-)  create mode 100644
> > > > > > > > > > > > lib/librte_pci/rte_pci_regs.h
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > [...]
> > > > > > > > > > >
> > > > > > > > > > > > diff --git a/lib/librte_pci/rte_pci_regs.h
> > > > > > > > > > > > b/lib/librte_pci/rte_pci_regs.h new file mode
> > > > > > > > > > > > 100644 index 000000000..1d11f4de5
> > > > > > > > > > > > --- /dev/null
> > > > > > > > > > > > +++ b/lib/librte_pci/rte_pci_regs.h
> > > > > > > > > > > > @@ -0,0 +1,1075 @@
> > > > > > > > > > > > +/* SPDX-License-Identifier: GPL-2.0 WITH
> > > > > > > > > > > > +Linux-syscall-note */
> > > > > > > > > > > > +/*
> > > > > > > > > > >
> > > > > > > > > > > This file is delivered alongside the PCI lib, targeting
> userspace.
> > > > > > > > > > > This seems to be an exception to the license policy
> > > > > > > > > > > described in license/README. Code shared between
> > > > > > > > > > > kernel and userspace is expected to be dual-licensed BSD-3
> and GPL-2.0.
> > > > > > > > > > >
> > > > > > > > > > > As it is a copy of Linux user includes, re-licensing
> > > > > > > > > > > it as BSD-3 as well is not possible.
> > > > > > > > > > >
> > > > > > > > > > > So I think it might require a techboard + governing
> > > > > > > > > > > board exception approval. Ferruh or Thomas, what do you
> think?
> > > > > > > > >
> > > > > > > > > I think, instead of importing GPL-2.0 file, We can add
> > > > > > > > > the constants as need by the DPDK as symbols start from
> > > > > > > > > RTE_PCI_*(It will fix up the namespace as well).
> > > > > > > >
> > > > > > > > If symbols can be found in /usr/include/, don't add anything.
> > > > > > >
> > > > > > > Not by default on all the distros. It is part of pciutils library.
> > > > > > > Moreover, we need these symbols for Windows OS as well.
> > > > > > > IMO, We should add absolute minimum constants that needed
> > > > > > > for DPDK as RTE_PCI_*
> > > > > >
> > > > > > I am for mandating the dependency instead of copying it.
> > > > >
> > > > > You mean _pciutils_ package as a mandatory dependency to  DPDK.
> > > >
> > > > There is already this dependency:
> > > >         #include <linux/pci_regs.h>
> > >
> > > I just checked in archlinux, PCI headers can be provided by
> > >
> > > # pacman -F /usr/include/pci/header.h usr/include/pci/header.h is
> > > owned by core/pciutils 3.7.0-
> > >
> > > # pacman -F /usr/include/linux/pci.h usr/include/linux/pci.h is
> > > owned by core/linux-api-headers 5.4.17-1
> > >
> > >
> > > > I'm missing the real justification for this patch.
> > >
> > > See below.
> > >
> > > > Is there some missing definitions?
> > > > Is there some environments where this file is missing?
> > > >
> > > > > > pciutils cannot be installed on Windows?
> > > > > > Why do you care about Windows?
> > > > > > I don't see any contribution for qede on Windows.
> > > > >
> > > > > You closely review the patch, it not about qede. The proposed
> > > > > file comes at lib/librte_pci/rte_pci_regs.h which is common to
> Windows.
> > > >
> > > > The series is for qede. I'm trying to understand the motivation.
> > >
> > > First version of qede driver sent with defined generic PCI symbols
> > > and generic PCI function like pci_find_next_ext_capability() in qede
> driver.
> >
> > That's a pity the v2 is not threaded with v1, I would have found these
> > explanations easily myself.
> >
> > > In the review, I suggested using generic rte_ function as
> > > a) It is not specific to qede.
> > > b) Other drivers also doing the same thing in their own driver space
> > > as there is no dpdk API for the same.
> > > This patches create generic API for pci_find_next_ext_capability()
> > > and remove duplicate implementation from the drivers.
> > > https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.org
> > >
> _patch_73959_&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=bMTgx2X48QVX
> yXOEL8
> > > ALyI4dsWoR-m74c5n3d-
> ruJI8&m=eNuzGYhB7u2Wzru3VeBTY7QDZSSb9VQ9eQXW56D4
> > > 64Y&s=eatY5xyw-474yS0cBJXyG7gLyPXFo243P2LmBDDsXd8&e=
> >
> > I agree it's good to have an API for such thing.
> >
> > So far such feature is supported in drivers on Linux, requiring only
> > Linux headers to be installed.
> > Do we need more?
> >
> >
> 
> +1 to make it generic, no question here.
> 
> On linux, the dependency is already there (either from linux headers or
> pciutils) to have the original. So including this header in DPDK is only useful
> for other OSes.
> 
> I think right now we should only add pci_find_next_ext_capability() full
> implementation within linux part of PCI bus, other systems being stubs.
> 
> We can go with your suggestion Jerin about adding only the specific symbols
> needed, prefixed with RTE_, once we decide to have windows support.
> Question is whether we need it right now. Is there a driver that would make
> use of it support more than linux currently?
> 
> --

I don't know if there are any drivers which will require this other than linux as of today - 

My only motivation of adding these symbols in dpdk via rte_pci_regs.h (new file in lib/librte_pci/) was to avoid any dependency of dpdk on /usr/include/../pci_regs.h,
since I was little unsure whether in all distributions (linux/windows) supported will have the required PCI defines available in /usr/include/../pci_regs.h file or not in order
to implement rte_pci_find_next_ext_capability().  (unless user to bound for updating headers by mean of installing any latest _pciutils_/packages). Moreover, for not just
this API, but if going forward if we have to add any new APIs which could rely/depend on PCI defines availability under /usr/include.

From the discussion so far - 

1. Define the function under drivers/bus/pci/linux/pci.c only and add empty/stub implementation for windows/pci.c and bsd/pci.c ?
2.  Just relying on /usr/include/ is perfectly okay without adding any defines anywhere for now ?, it will just require <linux/pci_regs.h> inclusion in
     drivers/bus/pci/linux/pci.c. OR Shall I add (may be in lib/librte_pci/rte_pci.h ?) only required PCI defines with RTE_ prefixed and use them instead ?

Thanks,
Manish

^ permalink raw reply

* [Buildroot] audit2allow BR support
From: Tomas V. Arredondo @ 2020-07-16 20:49 UTC (permalink / raw)
  To: buildroot
In-Reply-To: <20200716094540.27274cf4@windsurf.home>

 Hi Thomas,
Quick question inline marked with [TA]... Thanks a lot, Tomas
    On Thursday, July 16, 2020, 03:45:45 AM EDT, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:  
 
 Hello,

I am adding a few folks with SELinux/Buildroot knowledge in Cc. See
below some comments as well.

On Thu, 16 Jul 2020 05:56:33 +0000 (UTC)
"Tomas V. Arredondo" <surf_fanatico@yahoo.com> wrote:

> +BR2_PACKAGE_REFPOLICY=y+BR2_PACKAGE_SETOOLS=y+BR2_PACKAGE_POLICYCOREUTILS=y+BR2_PACKAGE_SELINUX_PYTHON=y+BR2_PACKAGE_SELINUX_PYTHON_AUDIT2ALLOW=y?
> The build completes with the kernel, rootfs and dtb.? SELinux support is seen in that the Z option works with ps, ls and labels etc are seen.But some errors are observed:
> 
> 1- selinux module not found in audit2allow
> $ audit2allow -aTraceback (most recent call last):File "/usr/bin/audit2allow", line 25, in <module>import sepolgen.audit as auditFile "usr/lib/python3.7/sepolgen/audit.py", line 23, in <module>File "usr/lib/python3.7/sepolgen/refpolicy.py", line 21, in <module>ModuleNotFoundError: No module named 'selinux'
> buildroot/package/selinux-python$ cat selinux-python.hash# https://github.com/SELinuxProject/selinux/wiki/Releasessha256 3650b5393b0d1790cac66db00e34f059aa91c23cfe3c2559676594e295d75fde selinux-python-2.9.tar.gz
> # ls__init__.pyc? ? ? interfaces.pyc? ? output.pyc? ? ? ? util.pycaccess.pyc? ? ? ? lex.pyc? ? ? ? ? ?policygen.pyc? ? ?yacc.pycaudit.pyc? ? ? ? ?matching.pyc? ? ? refparser.pycclassperms.pyc? ? module.pyc? ? ? ? refpolicy.pycdefaults.pyc? ? ? objectmodel.pyc? ?sepolgeni18n.pyc# pwd/usr/lib/python3.7/sepolgen
> ==> I do see selinux.py in the build directory but not in the target rootfs as a pyc or otherwise:? 
> buildroot/output/build/host-libselinux-2.9/src/selinux.pybuildroot/output/build/libselinux-2.9/src/selinux.py

This file is from host-libselinux, which is not relevant here.
[TA] Correct, would this be the one?: ./buildroot/output/build/libselinux-2.9/src/selinux.py??As a temp workaround do you think that just adding this selinux.py might work?? Just thinking about what a temporary workaround might look like in the mean time.? Thanks!
Which Python version have you chosen ? Python 3.x or Python 2.x, i.e
BR2_PACKAGE_PYTHON=y or BR2_PACKAGE_PYTHON3=y ?

> 2- /var/lib/selinux directory missing
> $ semodule -llibsemanage.semanage_create_store: Could not create module store at /var/lib/selinux/targeted. (No such file or directory).libsemanage.semanage_direct_connect: could not establish direct connection (No such file or directory).semodule: Could not connect to policy handler
> ls /var/lib/selinuxls: /var/lib/selinux: No such file or directory
> ==> looks like the directory can just be added? 

On this one, I'm not sure, would need testing. I don't immediately see
anything creating /var/lib/selinux in Buildroot, so if it's not done by
the build system of one the SELinux packages, indeed /var/lib/selinux
will be missing.

Antoine: you are working on building systems with SELinux supports, did
you face the /var/lib/selinux missing problem ? Or perhaps because
you're testing with systemd, the situation is different ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200716/f7e4fd88/attachment.html>

^ permalink raw reply

* Re: [PATCH RFC v2 1/3] io_uring: use an enumeration for io_uring_register(2) opcodes
From: Jens Axboe @ 2020-07-16 20:51 UTC (permalink / raw)
  To: Pavel Begunkov, Stefano Garzarella
  Cc: Alexander Viro, Kernel Hardening, Kees Cook, Aleksa Sarai,
	Stefan Hajnoczi, Christian Brauner, Sargun Dhillon, Jann Horn,
	io-uring, linux-fsdevel, Jeff Moyer, linux-kernel
In-Reply-To: <20326d79-fb5a-2480-e52a-e154e056171f@gmail.com>

On 7/16/20 2:47 PM, Pavel Begunkov wrote:
> On 16/07/2020 23:42, Jens Axboe wrote:
>> On 7/16/20 2:16 PM, Pavel Begunkov wrote:
>>> On 16/07/2020 15:48, Stefano Garzarella wrote:
>>>> The enumeration allows us to keep track of the last
>>>> io_uring_register(2) opcode available.
>>>>
>>>> Behaviour and opcodes names don't change.
>>>>
>>>> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
>>>> ---
>>>>  include/uapi/linux/io_uring.h | 27 ++++++++++++++++-----------
>>>>  1 file changed, 16 insertions(+), 11 deletions(-)
>>>>
>>>> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
>>>> index 7843742b8b74..efc50bd0af34 100644
>>>> --- a/include/uapi/linux/io_uring.h
>>>> +++ b/include/uapi/linux/io_uring.h
>>>> @@ -253,17 +253,22 @@ struct io_uring_params {
>>>>  /*
>>>>   * io_uring_register(2) opcodes and arguments
>>>>   */
>>>> -#define IORING_REGISTER_BUFFERS		0
>>>> -#define IORING_UNREGISTER_BUFFERS	1
>>>> -#define IORING_REGISTER_FILES		2
>>>> -#define IORING_UNREGISTER_FILES		3
>>>> -#define IORING_REGISTER_EVENTFD		4
>>>> -#define IORING_UNREGISTER_EVENTFD	5
>>>> -#define IORING_REGISTER_FILES_UPDATE	6
>>>> -#define IORING_REGISTER_EVENTFD_ASYNC	7
>>>> -#define IORING_REGISTER_PROBE		8
>>>> -#define IORING_REGISTER_PERSONALITY	9
>>>> -#define IORING_UNREGISTER_PERSONALITY	10
>>>> +enum {
>>>> +	IORING_REGISTER_BUFFERS,
>>>> +	IORING_UNREGISTER_BUFFERS,
>>>> +	IORING_REGISTER_FILES,
>>>> +	IORING_UNREGISTER_FILES,
>>>> +	IORING_REGISTER_EVENTFD,
>>>> +	IORING_UNREGISTER_EVENTFD,
>>>> +	IORING_REGISTER_FILES_UPDATE,
>>>> +	IORING_REGISTER_EVENTFD_ASYNC,
>>>> +	IORING_REGISTER_PROBE,
>>>> +	IORING_REGISTER_PERSONALITY,
>>>> +	IORING_UNREGISTER_PERSONALITY,
>>>> +
>>>> +	/* this goes last */
>>>> +	IORING_REGISTER_LAST
>>>> +};
>>>
>>> It breaks userspace API. E.g.
>>>
>>> #ifdef IORING_REGISTER_BUFFERS
>>
>> It can, yes, but we have done that in the past. In this one, for
> 
> Ok, if nobody on the userspace side cares, then better to do that
> sooner than later.
> 
> 
>> example:
>>
>> commit 9e3aa61ae3e01ce1ce6361a41ef725e1f4d1d2bf (tag: io_uring-5.5-20191212)
>> Author: Jens Axboe <axboe@kernel.dk>
>> Date:   Wed Dec 11 15:55:43 2019 -0700
>>
>>     io_uring: ensure we return -EINVAL on unknown opcod
>>
>> But it would be safer/saner to do this like we have the done the IOSQE_
>> flags.
> 
> IOSQE_ are a bitmask, but this would look peculiar
> 
> enum {
> 	__IORING_REGISTER_BUFFERS,
> 	...
> };
> define IORING_REGISTER_BUFFERS __IORING_REGISTER_BUFFERS

Yeah true of course, that won't really work for this case at all.

That said, I don't think it's a huge deal to turn it into an enum.


-- 
Jens Axboe


^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.