public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jinjian Song <jinjian.song@fibocom.com>
Cc: chandrashekar.devegowda@intel.com,
	chiranjeevi.rapolu@linux.intel.com, haijun.liu@mediatek.com,
	m.chetan.kumar@linux.intel.com, ricardo.martinez@linux.intel.com,
	loic.poulain@linaro.org, ryazanov.s.a@gmail.com,
	johannes@sipsolutions.net, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-doc@vger.kernel.org,
	angelogioacchino.delregno@collabora.com,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	corbet@lwn.net, linux-mediatek@lists.infradead.org,
	helgaas@kernel.org, danielwinkler@google.com, korneld@google.com,
	Jinjian Song <songjinjian@hotmail.com>,
	Jiri Pirko <jiri@resnulli.us>
Subject: Re: [net-next,RESEND v6 2/2] net: wwan: t7xx: Add debug port
Date: Wed, 23 Oct 2024 13:40:14 +0100	[thread overview]
Message-ID: <20241023124014.GU402847@kernel.org> (raw)
In-Reply-To: <20241021121934.16317-3-jinjian.song@fibocom.com>

+ Jiri

On Mon, Oct 21, 2024 at 08:19:34PM +0800, Jinjian Song wrote:
> From: Jinjian Song <songjinjian@hotmail.com>
> 
> Add support for userspace to switch on the debug port(ADB,MIPC).
>  - ADB port: /dev/wwan0adb0
>  - MIPC port: /dev/wwan0mipc0
> 
> Application can use ADB (Android Debg Bridge) port to implement
> functions (shell, pull, push ...) by ADB protocol commands.
> E.g., ADB commands:
>  - A_OPEN: OPEN(local-id, 0, "destination")
>  - A_WRTE: WRITE(local-id, remote-id, "data")
>  - A_OKEY: READY(local-id, remote-id, "")
>  - A_CLSE: CLOSE(local-id, remote-id, "")
> 
> Link: https://android.googlesource.com/platform/packages/modules/adb/+/refs/heads/main/README.md
> 
> Application can use MIPC (Modem Information Process Center) port
> to debug antenna tunner or noise profiling through this MTK modem
> diagnostic interface.
> 
> By default, debug ports are not exposed, so using the command
> to enable or disable debug ports.
> 
> Switch on debug port:
>  - debug: 'echo debug > /sys/bus/pci/devices/${bdf}/t7xx_mode
> 
> Switch off debug port:
>  - normal: 'echo normal > /sys/bus/pci/devices/${bdf}/t7xx_mode

Hi,

I am somewhat surprised to see vendor-specific sysfs controls being added.
And I am wondering if another mechanism was considered. It seems to
me that devlink would be appropriate. Jiri (CCed) may have an opinion on
that.

...


WARNING: multiple messages have this Message-ID (diff)
From: Jinjian Song <jinjian.song@fibocom.com>
To: horms@kernel.org
Cc: angelogioacchino.delregno@collabora.com,
	chandrashekar.devegowda@intel.com,
	chiranjeevi.rapolu@linux.intel.com, corbet@lwn.net,
	danielwinkler@google.com, davem@davemloft.net,
	edumazet@google.com, haijun.liu@mediatek.com, helgaas@kernel.org,
	jinjian.song@fibocom.com, jiri@resnulli.us,
	johannes@sipsolutions.net, korneld@google.com, kuba@kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	loic.poulain@linaro.org, m.chetan.kumar@linux.intel.com,
	matthias.bgg@gmail.com, netdev@vger.kernel.org,
	pabeni@redhat.com, ricardo.martinez@linux.intel.com,
	ryazanov.s.a@gmail.com, songjinjian@hotmail.com
Subject: Re: [net-next,RESEND v6 2/2] net: wwan: t7xx: Add debug port
Date: Thu, 24 Oct 2024 18:02:56 +0800	[thread overview]
Message-ID: <20241023124014.GU402847@kernel.org> (raw)
Message-ID: <20241024100256.lHPxLjkWIbQ7-qf91X148kDW-ztEGYcYkVvgN19QxIY@z> (raw)
In-Reply-To: <20241023124014.GU402847@kernel.org>

>+ Jiri
>
>On Mon, Oct 21, 2024 at 08:19:34PM +0800, Jinjian Song wrote:
>> From: Jinjian Song <songjinjian@hotmail.com>
>> 
>> Add support for userspace to switch on the debug port(ADB,MIPC).
>>  - ADB port: /dev/wwan0adb0
>>  - MIPC port: /dev/wwan0mipc0
>> 
>> Application can use ADB (Android Debg Bridge) port to implement
>> functions (shell, pull, push ...) by ADB protocol commands.
>> E.g., ADB commands:
>>  - A_OPEN: OPEN(local-id, 0, "destination")
>>  - A_WRTE: WRITE(local-id, remote-id, "data")
>>  - A_OKEY: READY(local-id, remote-id, "")
>>  - A_CLSE: CLOSE(local-id, remote-id, "")
>> 
>> Link: https://android.googlesource.com/platform/packages/modules/adb/+/refs/heads/main/README.md
>> 
>> Application can use MIPC (Modem Information Process Center) port
>> to debug antenna tunner or noise profiling through this MTK modem
>> diagnostic interface.
>> 
>> By default, debug ports are not exposed, so using the command
>> to enable or disable debug ports.
>> 
>> Switch on debug port:
>>  - debug: 'echo debug > /sys/bus/pci/devices/${bdf}/t7xx_mode
>> 
>> Switch off debug port:
>>  - normal: 'echo normal > /sys/bus/pci/devices/${bdf}/t7xx_mode
>
>Hi,
>
>I am somewhat surprised to see vendor-specific sysfs controls being added.
>And I am wondering if another mechanism was considered. It seems to
>me that devlink would be appropriate. Jiri (CCed) may have an opinion on
>that.
>
>...

Hi Jiri,

T7XX is MTK WWAN device platform, ADB and MIPC channel is common in all MTK
platform, the ports used to debug, and we need a way to create the channels
to usespace, so use the sysfs to trigger that.

The previous plan consider using devlink framework to set param to create 
ports inside t7xx driver, but later after communicating with Loic and Jiri
, it was replaced with the current plan.
https://lore.kernel.org/all/CAMZdPi-qZ3JjZmEAtEmJETNzKd+k6UcLnLkM0MZoSZ1hKaOXuA@mail.gmail.com/

Best Regards,
Jinjian,


  reply	other threads:[~2024-10-23 12:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21 12:19 [net-next,RESEND v6 0/2] net: wwan: t7xx: Add t7xx debug port Jinjian Song
2024-10-21 12:19 ` [net-next,RESEND v6 1/2] wwan: core: Add WWAN ADB and MIPC port type Jinjian Song
2024-10-21 12:19 ` [net-next,RESEND v6 2/2] net: wwan: t7xx: Add debug port Jinjian Song
2024-10-23 12:40   ` Simon Horman [this message]
2024-10-24 10:02     ` Jinjian Song
2024-10-23 15:15   ` Bjorn Helgaas
2024-10-24 10:07     ` Jinjian Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241023124014.GU402847@kernel.org \
    --to=horms@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chandrashekar.devegowda@intel.com \
    --cc=chiranjeevi.rapolu@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=danielwinkler@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=haijun.liu@mediatek.com \
    --cc=helgaas@kernel.org \
    --cc=jinjian.song@fibocom.com \
    --cc=jiri@resnulli.us \
    --cc=johannes@sipsolutions.net \
    --cc=korneld@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=loic.poulain@linaro.org \
    --cc=m.chetan.kumar@linux.intel.com \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ricardo.martinez@linux.intel.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=songjinjian@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox